From 507f5ddba23c76e4b4150b488c542b75fcf4d648 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 16 Mar 2017 13:14:30 -0700 Subject: [PATCH] minigbm: i915: align YV12 to HW requirements MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As per drm_gralloc we need to: (1) align the Y plane to 128 bytes so the chroma planes would be aligned to 64 bytes boundaries. (2) Have no tiling with YV12. BUG=chromium:616275 TEST=DecodeEditEncodeTest#testVideoEdit720p passes on cyan. Run YT app. Change-Id: I339163c94d4481991702b8bfd232a70f3a275506 Reviewed-on: https://chromium-review.googlesource.com/456403 Commit-Ready: Gurchetan Singh Tested-by: Gurchetan Singh Reviewed-by: Stéphane Marchesin --- i915.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/i915.c b/i915.c index 4acceb4..915a4ce 100644 --- a/i915.c +++ b/i915.c @@ -260,6 +260,16 @@ static int i915_bo_create(struct bo *bo, uint32_t width, uint32_t height, else tiling_mode = I915_TILING_Y; + /* + * Align the Y plane to 128 bytes so the chroma planes would be aligned + * to 64 byte boundaries. This is an Intel HW requirement. + */ + if (format == DRM_FORMAT_YVU420 || + format == DRM_FORMAT_YVU420_ANDROID) { + width = ALIGN(width, 128); + tiling_mode = I915_TILING_NONE; + } + i915_align_dimensions(bo->drv, tiling_mode, &width, &height, bpp); drv_bo_from_format(bo, width, height, format); -- 2.11.0