diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2017-02-08 15:21:14 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-20 19:30:09 -0700 |
commit | 03f13569eca3ce0acdec5865454f345d53a80fb9 (patch) | |
tree | 1bbc4b25eea3a59973a73f9bb1aadb005c34071b /rockchip.c | |
parent | 80fc2b9ed9ca858ab8d1c85e5ddf27946e8574fc (diff) |
minigbm: add DRM_FORMAT_YVU420_ANDROID
YV12 in <system/graphics.h> in the Android tree defines the
HAL_PIXEL_FORMAT_YV12 as:
* y_size = stride * height
* c_stride = ALIGN(stride/2, 16)
* c_size = c_stride * height/2
* size = y_size + c_size * 2
* cr_offset = y_size
* cb_offset = y_size + c_size
Let's add a special format DRM_FORMAT_YVU420_ANDROID that adheres to these
requirements.
Previously, our y_size on Intel not adhere to the spec. We should
change drv_bo_from_format to calculate the size of plane not based on the
aligned height, but the height that outside world sees.
BUG=chromium:616275
TEST=
ImageReaderDecoderTest#testGoogH264ImageReader
passes on cyan. Run YT app.
Change-Id: I4906300a0775cf561c4b05bf6d973cf4e82470bc
Reviewed-on: https://chromium-review.googlesource.com/441913
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'rockchip.c')
-rw-r--r-- | rockchip.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -20,7 +20,8 @@ static const uint32_t supported_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, DRM_FORMAT_RGB565, - DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888, DRM_FORMAT_YVU420 + DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888, DRM_FORMAT_YVU420, + DRM_FORMAT_YVU420_ANDROID }; static int afbc_bo_from_format(struct bo *bo, uint32_t width, uint32_t height, |