From 7df3eeb4f3360cd2b511c31acc1c52bd7ce6587f Mon Sep 17 00:00:00 2001 From: Nicholas Kazlauskas Date: Fri, 15 Mar 2019 11:04:42 -0400 Subject: lib/igt_fb: Align min_stride to 256 bytes for YUV buffers on amdgpu The chroma address needs to be 256 byte aligned on amdgpu and the easiest way to do so is to align the minimum stride for the luma. v2: added this patch Cc: Leo Li Cc: Harry Wentland Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland --- lib/igt_fb.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/igt_fb.c b/lib/igt_fb.c index bad1d1fb..fcd7c4c5 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -467,6 +467,12 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane) stride = roundup_power_of_two(stride); return stride; + } else if (igt_format_is_yuv(fb->drm_format) && is_amdgpu_device(fb->fd)) { + /* + * Chroma address needs to be aligned to 256 bytes on AMDGPU + * so the easiest way is to align the luma stride to 256. + */ + return ALIGN(min_stride, 256); } else { unsigned int tile_width, tile_height; -- cgit v1.2.3