[igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Fix the cairo shadow buffer stride

Ville Syrjala ville.syrjala at linux.intel.com
Thu Apr 18 19:40:39 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

We're currently overallocating the shadow buffer stride by a
factor of 8. This didn't go down so well when I tried to use
a 16kx16k float framebuffer.

Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Fixes: b0033d9310c1 ("lib/color_encoding: Prepare support for HDR modes, v2.")
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/igt_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index b4d354825b10..f36096804fdd 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1911,7 +1911,7 @@ static void *igt_fb_create_cairo_shadow_buffer(int fd,
 		drm_format, LOCAL_DRM_FORMAT_MOD_NONE,
 		IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_LIMITED_RANGE);
 
-	shadow->strides[0] = ALIGN(width * shadow->plane_bpp[0], 16);
+	shadow->strides[0] = ALIGN(width * (shadow->plane_bpp[0] / 8), 16);
 	shadow->size = ALIGN(shadow->strides[0] * height,
 			     sysconf(_SC_PAGESIZE));
 	ptr = mmap(NULL, shadow->size, PROT_READ | PROT_WRITE,
-- 
2.21.0



More information about the igt-dev mailing list