Something somewhere is assuming the UV pitch can be half of the Y pitch,
leading to failures with CtsMediaTestCases#android.media.cts.DecodeAccuracyTest
To componsate, double the pitch alignment requirement for YUV formats.
BUG=b:
159504968, b:
165333514
TEST=run CtsMediaTestCases#android.media.cts.DecodeAccuracyTest
Change-Id: I0118d813576654c72ed55500d741cf07a1977b20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/
2568395
Commit-Queue: Rob Clark <robdclark@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
return ALIGN(macrotile_width * macrotile_height, PLANE_SIZE_ALIGN);
}
return ALIGN(macrotile_width * macrotile_height, PLANE_SIZE_ALIGN);
}
+static unsigned get_pitch_alignment(struct bo *bo)
+{
+ switch (bo->meta.format) {
+ case DRM_FORMAT_NV12:
+ return VENUS_STRIDE_ALIGN;
+ case DRM_FORMAT_YVU420:
+ case DRM_FORMAT_YVU420_ANDROID:
+ /* TODO other YUV formats? */
+ /* Something (in the video stack?) assumes the U/V planes can use
+ * half the pitch as the Y plane.. to componsate, double the
+ * alignment:
+ */
+ return 2 * DEFAULT_ALIGNMENT;
+ default:
+ return DEFAULT_ALIGNMENT;
+ }
+}
+
static void msm_calculate_layout(struct bo *bo)
{
uint32_t width, height;
static void msm_calculate_layout(struct bo *bo)
{
uint32_t width, height;
} else {
uint32_t stride, alignw, alignh;
} else {
uint32_t stride, alignw, alignh;
- alignw = ALIGN(width, DEFAULT_ALIGNMENT);
+ alignw = ALIGN(width, get_pitch_alignment(bo));
/* HAL_PIXEL_FORMAT_YV12 requires that the buffer's height not be aligned.
DRM_FORMAT_R8 of height one is used for JPEG camera output, so don't
height align that. */
/* HAL_PIXEL_FORMAT_YV12 requires that the buffer's height not be aligned.
DRM_FORMAT_R8 of height one is used for JPEG camera output, so don't
height align that. */