summaryrefslogtreecommitdiff
path: root/cros_gralloc
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@chromium.org>2020-12-14 10:43:32 +0900
committerCommit Bot <commit-bot@chromium.org>2020-12-16 06:07:58 +0000
commit150b4968810447d72714a7c88afb97d4e59fe23a (patch)
tree5800367123ce70fa6c1390104f476ba01a4dedcb /cros_gralloc
parent519978f239b58bf60e50f10368238fb7e27515be (diff)
downloadminigbm-150b4968810447d72714a7c88afb97d4e59fe23a.tar.gz
gralloc0: drop encoder use flag for YV12 buffersupstream-master
The ARC encoder components do not submit YV12 buffers to the hardware, instead converting and copying the content to NV12 buffers. Because of this, we can clear the HW_VIDEO_ENCODER flag from any YV12 buffers. BUG=b:162796596 TEST=revert ag/12467634 and arc.VideoEncodeAccel.h264_192p_i420_vm Change-Id: I170f7c51d7ff18e75f720db2c2af8c79f29a0423 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2589173 Tested-by: David Stevens <stevensd@chromium.org> Reviewed-by: David Staessens <dstaessens@chromium.org> Commit-Queue: David Stevens <stevensd@chromium.org>
Diffstat (limited to 'cros_gralloc')
-rw-r--r--cros_gralloc/gralloc0/gralloc0.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/cros_gralloc/gralloc0/gralloc0.cc b/cros_gralloc/gralloc0/gralloc0.cc
index f67ddff..3a08724 100644
--- a/cros_gralloc/gralloc0/gralloc0.cc
+++ b/cros_gralloc/gralloc0/gralloc0.cc
@@ -141,11 +141,13 @@ static int gralloc0_alloc(alloc_device_t *dev, int w, int h, int format, int usa
supported = mod->driver->is_supported(&descriptor);
}
if (!supported && (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) &&
- !gralloc0_droid_yuv_format(format)) {
- // Unmask BO_USE_HW_VIDEO_ENCODER in the case of non-yuv formats
- // because they are not input to a hw encoder but used as an
- // intermediate format (e.g. camera).
+ format != HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ // Unmask BO_USE_HW_VIDEO_ENCODER for other formats. They are mostly
+ // intermediate formats not passed directly to the encoder (e.g.
+ // camera). YV12 is passed to the encoder component, but it is converted
+ // to YCbCr_420_888 before being passed to the hw encoder.
descriptor.use_flags &= ~BO_USE_HW_VIDEO_ENCODER;
+ drv_log("Retrying format %u allocation without encoder flag", format);
supported = mod->driver->is_supported(&descriptor);
}