minigbm: i915: Align chroma planes of planar formats properly

Mesa handles planar formats with separate surface for each plane. Each
linear surface has certain width and height alignment restrictions.
However minigbm's i915 backend currently does not account for chroma plane
subsampling when calculating the alignments, so that only the luma plane
gets enough alignment. Fix this by multiplying luma plane alignment by
chroma subsampling factor, both horizonal and vertical for 3-plane
formats and only the latter for 2-plane formats.

Fixes following CTS tests on Intel platforms:
android.media.cts.VideoEncoderTest#testGoogVP8FlexArbitraryH
android.media.cts.VideoEncoderTest#testGoogVP8FlexArbitraryW
android.media.cts.VideoEncoderTest#testGoogVP8FlexNearMaxMin
android.media.cts.VideoEncoderTest#testGoogVP8SurfArbitraryH
android.media.cts.VideoEncoderTest#testGoogVP8SurfArbitraryW
android.media.cts.VideoEncoderTest#testGoogVP8SurfNearMaxMin

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

Change-Id: I8459b0f5f22ba9f9936fa987a13dd99d6b245560
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/592989
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
1 file changed