[PATCH i-g-t v5 6/8] benchmarks/kms_fb_stress: Don't paint the FB's if the format is not supported by Pixman

Louis Chauvet louis.chauvet at bootlin.com
Wed May 22 08:39:17 UTC 2024


Le 22/04/24 - 19:18, Arthur Grillo a écrit :
> Pixman requires strides to be divisible by sizeof(uint32_t).
> So, don't paint the FB's if the stride is not.
> 
> Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
> ---
>  benchmarks/kms_fb_stress.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/benchmarks/kms_fb_stress.c b/benchmarks/kms_fb_stress.c
> index e028424bb3e4..8775fabdd164 100644
> --- a/benchmarks/kms_fb_stress.c
> +++ b/benchmarks/kms_fb_stress.c
> @@ -48,10 +48,24 @@ static void plane_setup(struct plane_t *plane, int index)
>  
>  static void create_fb(int fd, struct plane_t *plane, int fb_index, double r, double g, double b)
>  {
> -	igt_create_color_fb(fd, plane->rect.width, plane->rect.height,
> -			    plane->format, DRM_FORMAT_MOD_LINEAR,
> -			    r, g, b,
> -			    &plane->fbs[fb_index]);
> +	unsigned int stride;
> +
> +	igt_calc_fb_size(fd, plane->rect.width, plane->rect.height,
> +			 plane->format, DRM_FORMAT_MOD_LINEAR,
> +			 NULL, &stride);
> +
> +	if (stride % sizeof(uint32_t) == 0) {
> +		igt_create_color_fb(fd,
> +				    plane->rect.width, plane->rect.height,
> +				    plane->format, DRM_FORMAT_MOD_LINEAR,
> +				    r, g, b,
> +				    &plane->fbs[fb_index]);
> +	} else {
> +		igt_create_fb(fd,
> +			      plane->rect.width, plane->rect.height,
> +			      plane->format, DRM_FORMAT_MOD_LINEAR,
> +			      &plane->fbs[fb_index]);
> +	}
>  }

Can you also add a check for YUV formats with subsampling? The DRM core 
expects a YUV format with subsampling to have an odd number of pixels, so 
the benchmark was failing on vkms.

Sorry for the late review,
Louis Chauvet
  
>  static void gen_fbs(struct data_t *data)
> 
> -- 
> 2.44.0
> 

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the igt-dev mailing list