[igt-dev] [i-g-t] tests/kms_big_fb: Use igt_assert on bufmgr

Petri Latvala petri.latvala at intel.com
Wed Jul 22 07:41:04 UTC 2020


On Wed, Jul 15, 2020 at 05:33:39PM +0530, Pankaj Bharadiya wrote:
> NULL bufmgr pointer leads to SIGSEGV. Assert on NULL bufmgr so that
> correct failure reason will get dumped in the stack trace.
> 
> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
> ---
>  tests/kms_big_fb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
> index a754b2997..b19b56f90 100644
> --- a/tests/kms_big_fb.c
> +++ b/tests/kms_big_fb.c
> @@ -649,6 +649,7 @@ igt_main
>  			data.render_copy = igt_get_render_copyfunc(data.devid);
>  
>  		data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
> +		igt_assert(data.bufmgr);
>  		data.batch = intel_batchbuffer_alloc(data.bufmgr, data.devid);

Make the error message more helpful, as suggested by Chris last time
this patch was independently written by Swati:

const struct intel_device_info *info;
info = intel_get_device_info(data.devid);
igt_assert_f(data.bufmgr, "Update libdrm for %s support\n",
             info->gen ? info->codename : "<unknown chipset>");


-- 
Petri Latvala


More information about the igt-dev mailing list