OSDN Git Service

minigbm: i915: Add necessary padding to Android YV12 buffers
authorTomasz Figa <tfiga@chromium.org>
Sat, 29 Jul 2017 06:47:54 +0000 (15:47 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 3 Aug 2017 08:11:02 +0000 (01:11 -0700)
commitd846de667cba72121ec579912d0854729f013731
tree0837d6dc1ed27bb9dad01eee317265bdff51c949
parent33615a569956de6dc060db423e0a4ddf033432c8
minigbm: i915: Add necessary padding to Android YV12 buffers

All the regular formats are already aligned by current code, except
Android YV12, which requires height of planes to be unchanged. However
Mesa requires each plane to have at least certain required padding
between planes. Work around this by calculating total BO size with
aligned height to allow padding space to overlap with further planes
and making sure that padding of last plane fits in the buffer. This is
okay, since Mesa requirement seems to indicate that data of the padding
area should not be affected and padding is only needed to satisfy GPU
cache requests.

Fixes following CTS tests on Intel platforms:
android.media.cts.VideoEncoderTest#testGoogH264FlexArbitraryH
android.media.cts.VideoEncoderTest#testGoogH264FlexNearMaxMin
android.media.cts.VideoEncoderTest#testGoogH264SurfArbitraryH
android.media.cts.VideoEncoderTest#testGoogH264SurfNearMaxMin

BUG=b:63957026
TEST=./cts-tradefed run cts -m CtsMediaTestCases -t
 android.media.cts.VideoEncoderTest

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