camera: intel: ipu6: Choose stream by usage for YCbCr_420_888 format

If GRALLOC_USAGE_PRIVATE_1 usage is set, the stream
should be treated as a STILL stream.

BUG=b:238165401
TEST=Full tested pass for camera functions.

Change-Id: I0317cbfe178d6a0e77c84e0a8aaf6836279323fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/camera/+/3754543
Tested-by: Qingwu Zhang <qingwu.zhang@intel.corp-partner.google.com>
Reviewed-by: Ren-Pei Zeng <kamesan@chromium.org>
Commit-Queue: Ren-Pei Zeng <kamesan@chromium.org>
(cherry picked from commit 15f7014652625b29c5b7adb4ca9322ac0080968f)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/camera/+/3761682
Tested-by: Qingwu Zhang <qingwu.zhang@intel.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
diff --git a/hal/intel/ipu6/aal/HALv3Utils.cpp b/hal/intel/ipu6/aal/HALv3Utils.cpp
index 55d6c6a..25ebcf6 100644
--- a/hal/intel/ipu6/aal/HALv3Utils.cpp
+++ b/hal/intel/ipu6/aal/HALv3Utils.cpp
@@ -169,8 +169,11 @@
             } else {
                 stream->usage = icamera::CAMERA_STREAM_STILL_CAPTURE;
             }
+        } else if (camera3Stream.format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+            // Check if it is STILL capture
+            stream->usage = IS_STILL_USAGE(camera3Stream.usage) ?
+                icamera::CAMERA_STREAM_STILL_CAPTURE : icamera::CAMERA_STREAM_VIDEO_CAPTURE;
         } else {
-            // Always bind other format(IMPLEMENTATION_DEFINED and YCbCr_420_888) to video pipe
             stream->usage = icamera::CAMERA_STREAM_VIDEO_CAPTURE;
         }
     }
diff --git a/hal/intel/ipu6/aal/HALv3Utils.h b/hal/intel/ipu6/aal/HALv3Utils.h
index f124d00..cc23494 100644
--- a/hal/intel/ipu6/aal/HALv3Utils.h
+++ b/hal/intel/ipu6/aal/HALv3Utils.h
@@ -27,6 +27,8 @@
 
 #define IS_ZSL_USAGE(usage) (((usage)&GRALLOC_USAGE_HW_CAMERA_ZSL) == GRALLOC_USAGE_HW_CAMERA_ZSL)
 
+#define IS_STILL_USAGE(usage) (((usage)&GRALLOC_USAGE_PRIVATE_1) == GRALLOC_USAGE_PRIVATE_1)
+
 namespace HalV3Utils {
 
 struct CrosCameraInfo {