OSDN Git Service

minigbm: add encoder/decoder blob combination
authorDavid Stevens <stevensd@chromium.org>
Mon, 15 Jun 2020 04:48:48 +0000 (13:48 +0900)
committerCommit Bot <commit-bot@chromium.org>
Tue, 16 Jun 2020 07:27:24 +0000 (07:27 +0000)
ARCVM sets encoder/decoder usage on the blob output/input buffers, so
that virtio_gpu knows to perform transfers from/to the host where
appropriate. Recently, virtio_gpu started passing all bind flags to the
host, instead of reducing them in the guest. These factors combined
means that the host backends now need to support encoder/decoder usage
with R8 format.

Test: manually verify ARCVM YouTube
Bug: b:158957350
Change-Id: I58bf657496647f8002c693d17a1186f4cf527b01
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2245540
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>

amdgpu.c
i915.c
mediatek.c
msm.c
rockchip.c

index 795d137..c3d8ffa 100644 (file)
--- a/amdgpu.c
+++ b/amdgpu.c
@@ -102,10 +102,11 @@ static int amdgpu_init(struct driver *drv)
 
        /*
         * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots
-        * from camera.
+        * from camera and input/output from hardware decoder/encoder.
         */
        drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
-                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE);
+                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_HW_VIDEO_DECODER |
+                                  BO_USE_HW_VIDEO_ENCODER);
 
        /*
         * The following formats will be allocated by the DRI backend and may be potentially tiled.
diff --git a/i915.c b/i915.c
index b9a825a..08487ff 100644 (file)
--- a/i915.c
+++ b/i915.c
@@ -96,10 +96,11 @@ static int i915_add_combinations(struct driver *drv)
 
        /*
         * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots
-        * from camera.
+        * from camera and input/output from hardware decoder/encoder.
         */
        drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
-                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE);
+                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_HW_VIDEO_DECODER |
+                                  BO_USE_HW_VIDEO_ENCODER);
 
        render = unset_flags(render, linear_mask);
        scanout_and_render = unset_flags(scanout_and_render, linear_mask);
index cdfc9ab..91691bf 100644 (file)
@@ -74,6 +74,13 @@ static int mediatek_init(struct driver *drv)
        drv_modify_combination(drv, DRM_FORMAT_YVU420_ANDROID, &metadata, BO_USE_HW_VIDEO_DECODER);
        drv_modify_combination(drv, DRM_FORMAT_NV12, &metadata, BO_USE_HW_VIDEO_DECODER);
 
+       /*
+        * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB for input/output from
+        * hardware decoder/encoder.
+        */
+       drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
+                              BO_USE_HW_VIDEO_DECODER | BO_USE_HW_VIDEO_ENCODER);
+
 #ifdef MTK_MT8183
        /* Only for MT8183 Camera subsystem */
        drv_modify_combination(drv, DRM_FORMAT_NV12, &metadata,
diff --git a/msm.c b/msm.c
index e212251..6e7df2b 100644 (file)
--- a/msm.c
+++ b/msm.c
@@ -183,10 +183,11 @@ static int msm_init(struct driver *drv)
                               BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_SCANOUT);
        /*
         * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots
-        * from camera.
+        * from camera and input/output from hardware decoder/encoder.
         */
-       drv_modify_combination(drv, DRM_FORMAT_R8, &LINEAR_METADATA,
-                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE);
+       drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
+                              BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_HW_VIDEO_DECODER |
+                                  BO_USE_HW_VIDEO_ENCODER);
 
        /* Android CTS tests require this. */
        drv_add_combination(drv, DRM_FORMAT_BGR888, &LINEAR_METADATA, BO_USE_SW_MASK);
index 25f16ab..0076528 100644 (file)
@@ -101,11 +101,12 @@ static int rockchip_init(struct driver *drv)
        drv_modify_linear_combinations(drv);
        /*
         * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots
-        * from camera.
+        * from camera and input/output from hardware decoder/encoder.
         */
        drv_add_combination(drv, DRM_FORMAT_R8, &metadata,
                            BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_SW_MASK |
-                               BO_USE_LINEAR | BO_USE_PROTECTED);
+                               BO_USE_LINEAR | BO_USE_PROTECTED | BO_USE_HW_VIDEO_DECODER |
+                               BO_USE_HW_VIDEO_ENCODER);
 
        return 0;
 }