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>
2 files changed