[PATCH i-g-t] lib/igt_fb: fix stride calculation for igt_fb_get_fnv1a_crc()

Esha Bharadwaj quic_ebharadw at quicinc.com
Wed Sep 11 21:00:58 UTC 2024


fb->strides is assigned to the value returned by
calc_plane_stride() only if it was previously not set by the
caller. In the case of dumb buffer allocation, this is already
assigned by the driver.

Respect the stride requested by the driver in such cases by
using fb->strides[0] as this is assigned correctly in
calc_fb_size() only if it was previously not set by the driver.

Signed-off-by: Esha Bharadwaj <quic_ebharadw at quicinc.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 ab162a5b7..ed016f07d 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -4814,7 +4814,7 @@ int igt_fb_get_fnv1a_crc(struct igt_fb *fb, igt_crc_t *crc)
 	void *map;
 	char *ptr;
 	int x, y, cpp = igt_drm_format_to_bpp(fb->drm_format) / 8;
-	uint32_t stride = calc_plane_stride(fb, 0);
+	uint32_t stride = fb->strides[0];
 
 	if (fb->num_planes != 1)
 		return -EINVAL;
-- 
2.34.1



More information about the igt-dev mailing list