public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_fb: Add a check on stride alignment for pixman conversion
@ 2018-12-07  9:01 Paul Kocialkowski
  2018-12-07  9:12 ` Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Kocialkowski @ 2018-12-07  9:01 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Thomas Petazzoni

Pixman requires buffer strides the be aligned to 32-bit words in order
to create internal representations of buffers. If this condition is not
met, it will fail and IGT will not be able to report the error cause,
making it hard to debug the issue.

Add an explicit check in our code prior to calling pixman when
converting buffer so that the error can be understood if it occurs.
---
 lib/igt_fb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 2462d6ba..513a66b7 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1901,6 +1901,10 @@ static void convert_pixman(struct fb_convert *cvt)
 	igt_assert((src_pixman != PIXMAN_invalid) &&
 		   (dst_pixman != PIXMAN_invalid));
 
+	/* Pixman requires the stride to be aligned to 32 bits. */
+	igt_assert((cvt->src.fb->strides[0] % sizeof(uint32_t)) == 0);
+	igt_assert((cvt->dst.fb->strides[0] % sizeof(uint32_t)) == 0);
+
 	src_ptr = convert_src_get(cvt);
 
 	src_image = pixman_image_create_bits(src_pixman,
-- 
2.19.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-07 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07  9:01 [igt-dev] [PATCH i-g-t] lib/igt_fb: Add a check on stride alignment for pixman conversion Paul Kocialkowski
2018-12-07  9:12 ` Maxime Ripard
2018-12-07  9:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-12-07 15:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox