[igt-dev] [PATCH i-g-t 3/3] lib/igt_fb: Fix creating FBs on platforms w/o HW detiling

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Jan 21 16:21:56 UTC 2020


On 21.1.2020 0.03, Imre Deak wrote:
> On platforms w/o HW detiling don't fail creating the FB due to the
> expected error from the set_tiling IOCTL.
> 
> Most of the tests use a cairo surface to draw, which don't depend on HW
> detiling. Other tests (using lib/igt_draw.c or drawing to the FB
> directly, like kms_draw_crc, kms_frontbuffer) are failing atm and will
> need to be fixed separately.
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
>   lib/igt_fb.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index b5b1750e..ccb76455 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -944,9 +944,10 @@ static int create_bo_for_fb(struct igt_fb *fb)
>   
>   		if (is_i915_device(fd)) {
>   			fb->gem_handle = gem_create(fd, fb->size);
> -			gem_set_tiling(fd, fb->gem_handle,
> -				       igt_fb_mod_to_tiling(fb->modifier),
> -				       fb->strides[0]);
> +			if (gem_has_legacy_hw_tiling(fd))
> +				gem_set_tiling(fd, fb->gem_handle,
> +					       igt_fb_mod_to_tiling(fb->modifier),
> +					       fb->strides[0]);

I don't have good ideas to offer but silently ignoring gem_set_tiling at 
this place sound bit so-so to me. Maybe put igt_debug(..) message if 
this happen? Now fb->modifier will have misleading value.

>   		} else if (is_vc4_device(fd)) {
>   			fb->gem_handle = igt_vc4_create_bo(fd, fb->size);
>   
> 



More information about the igt-dev mailing list