[PATCH i-g-t 8/8] lib/igt_fb: assert fb->size blt_fb_init()

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Feb 12 15:07:41 UTC 2024


On Fri, Feb 09, 2024 at 06:34:33PM +0000, Matthew Auld wrote:
> 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
>

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew


More information about the igt-dev mailing list