summaryrefslogtreecommitdiff
path: root/cros_gralloc
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2017-07-05 17:50:18 +0900
committerchrome-bot <chrome-bot@chromium.org>2017-07-11 00:39:00 -0700
commitaff29fdf276d3f565ab16ba88e4386930fb6dd99 (patch)
treeaae0895238eda190e57732a88560c84f79eafd24 /cros_gralloc
parentaddd5f2136863ff1f69239266b6e31027b722b17 (diff)
minigbm: gralloc0: Allow lock_ycbcr for HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
We can use lock_ycbcr as a way to partially work around the format resolve problem - with the assumption that if lock_ycbcr succeeds, the android_ycbcr struct returned describes a YCbCr 4:2:0 image, we can query gralloc for the format instead of hardcoding one statically. BUG=b:32077885 TEST=Camera preview renders correctly on Poppy. Change-Id: Ic20f5aa89809bf89941f3b4851c0d28965da54ac Reviewed-on: https://chromium-review.googlesource.com/544487 Commit-Ready: Tomasz Figa <tfiga@chromium.org> Tested-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Diffstat (limited to 'cros_gralloc')
-rw-r--r--cros_gralloc/gralloc0/gralloc0.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/cros_gralloc/gralloc0/gralloc0.cc b/cros_gralloc/gralloc0/gralloc0.cc
index 1ef9265..abefa89 100644
--- a/cros_gralloc/gralloc0/gralloc0.cc
+++ b/cros_gralloc/gralloc0/gralloc0.cc
@@ -288,7 +288,8 @@ static int gralloc0_lock_ycbcr(struct gralloc_module_t const *module, buffer_han
}
if ((hnd->droid_format != HAL_PIXEL_FORMAT_YCbCr_420_888) &&
- (hnd->droid_format != HAL_PIXEL_FORMAT_YV12)) {
+ (hnd->droid_format != HAL_PIXEL_FORMAT_YV12) &&
+ (hnd->droid_format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED)) {
cros_gralloc_error("Non-YUV format not compatible.");
return CROS_GRALLOC_ERROR_BAD_HANDLE;
}