summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>2019-03-15 11:04:42 -0400
committerHarry Wentland <harry.wentland@amd.com>2019-03-27 11:18:03 -0400
commit7df3eeb4f3360cd2b511c31acc1c52bd7ce6587f (patch)
tree79bb625f1211c2fc22c70c01004ad25bc3d89db4 /lib
parent66abe6748004ff7a6e46e08d96c36be31889d063 (diff)
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 <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_fb.c6
1 files changed, 6 insertions, 0 deletions
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;