OSDN Git Service

minigbm: i915: Add support for buffers required by new camera subsystem
authorTomasz Figa <tfiga@chromium.org>
Wed, 5 Jul 2017 08:50:18 +0000 (17:50 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 11 Jul 2017 07:38:59 +0000 (00:38 -0700)
commitd30c0a508a15eb6c61ec1657f4b4a27f21f01fc5
tree5f032f397b76d29decb0ad6384d0d45b6c5877e9
parent7ec0788f7ec6305a893afad71a337c3c62be9d3b
minigbm: i915: Add support for buffers required by new camera subsystem

The new camera subsystem on ChromeOS (introduced with selected KBL
boards) requires following Android pixel formats to be supported:
 - HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
 - HAL_PIXEL_FORMAT_YCbCr_420_888,
 - HAL_PIXEL_FORMAT_BLOB (JPEG binary data).

The first two need to map to DRM_FORMAT_NV12, if used with camera, so
adjust .resolve_format() callback to choose this format when camera
usage bits are specified. Also add respective combinations.

The last one is used specifically for JPEG binary data and the
cros_gralloc layer maps it into DRM_FORMAT_R8, so we need to add it to
the list of combinations for camera usage.

Note that the new usage flags are used only be the new camera subsystem
and do not affect existing boards. They will be migrated later, with the
initial objective to support NV12, so the combinations should remain
valid.

BUG=b:37615277
TEST=Camera preview renders correctly on Poppy.

Change-Id: Ib1081374ed82df9ae1cf543d85a2f5c50ff23371
Reviewed-on: https://chromium-review.googlesource.com/559315
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
i915.c