[PATCH i-g-t 8/8] lib/igt_fb: assert fb->size blt_fb_init()
Matthew Auld
matthew.auld at intel.com
Fri Feb 9 18:34:33 UTC 2024
If fb->size is zero here, the mmap failure is pretty obscure from the
logs. Make it more obvious if we hit this.
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
lib/igt_fb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 71c220a08..65e0638c2 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2780,6 +2780,8 @@ static struct blt_copy_object *blt_fb_init(const struct igt_fb *fb,
blt->plane_offset = fb->offsets[plane];
+ igt_assert(fb->size);
+
if (is_xe_device(fb->fd))
blt->ptr = xe_bo_mmap_ext(fb->fd, handle, fb->size,
PROT_READ | PROT_WRITE);
--
2.43.0
More information about the igt-dev
mailing list