OSDN Git Service

minigbm: align multi-planar formats to 16
authorAlexandre Courbot <acourbot@chromium.org>
Wed, 30 Aug 2017 05:37:36 +0000 (14:37 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Wed, 30 Aug 2017 20:04:22 +0000 (13:04 -0700)
libva 1.8.3 makes it a hard requirement that multi-planar surfaces are
vertically aligned to 16. Enforce this rule at allocation time.

BUG=b:65084476
TEST=checked that b:65084476 was not reproducible with this patch and
that all multi-planar surfaces are aligned to 16.

Change-Id: Id31055df81ba43130f3f45282db104753fb6e700
Reviewed-on: https://chromium-review.googlesource.com/642429
Commit-Ready: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
i915.c

diff --git a/i915.c b/i915.c
index fe162f1..cbd6c6b 100644 (file)
--- a/i915.c
+++ b/i915.c
@@ -224,6 +224,12 @@ static int i915_align_dimensions(struct bo *bo, uint32_t tiling, uint32_t *strid
                break;
        }
 
+       /*
+        * For multi-planar formats we must be aligned to 16
+        */
+       if (bo->num_planes > 1)
+               vertical_alignment = MAX(vertical_alignment, 16);
+
        *aligned_height = ALIGN(bo->height, vertical_alignment);
        if (i915->gen > 3) {
                *stride = ALIGN(*stride, horizontal_alignment);