[i-g-t 1/2] tests/intel/kms_big_fb: Fix width calculation while creating the intel buf

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Feb 9 15:58:17 UTC 2024


Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 lib/igt_draw.c           | 2 +-
 tests/intel/kms_big_fb.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 0757e9801..0c8f92ea7 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -650,7 +650,7 @@ static struct intel_buf *create_buf(int fd, struct buf_ops *bops,
 	uint64_t region = driver == INTEL_DRIVER_XE ? vram_if_possible(fd, 0) : -1;
 	uint64_t size = from->size;
 
-	width = from->width;
+	width = from->stride / (from->bpp / 8);
 	height = from->height;
 	if (driver == INTEL_DRIVER_XE)
 		size = ALIGN(size, xe_get_default_alignment(fd));
diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
index 0bd79394b..02b07c73e 100644
--- a/tests/intel/kms_big_fb.c
+++ b/tests/intel/kms_big_fb.c
@@ -198,7 +198,7 @@ static struct intel_buf *init_buf(data_t *data,
 	tiling = igt_fb_mod_to_tiling(fb->modifier);
 	bpp = fb->plane_bpp[0];
 	size = fb->size;
-	width = fb->width;
+	width = fb->strides[0] / (bpp / 8);
 	height = fb->height;
 
 	name = gem_flink(data->drm_fd, fb->gem_handle);
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list