[PATCH 2/2] tests/kms_plane_scaling: msm get_num_scalars() support

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Aug 19 18:24:51 UTC 2024


Hi Rob,
On 2024-08-14 at 11:53:39 -0700, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>
> 

Could you improve subject? Was:

[PATCH 2/2] tests/kms_plane_scaling: msm get_num_scalars() support

imho better:

[PATCH 2/2] tests/kms_plane_scaling: Improve msm support

or some other re-wording, no need here for mentioning
'get_num_scalars()' function

> This may undercount # of scalars on hw with rgb pipes, but the scaling
--------------------- ^

Please use word here, 'number'.

With these nits addressed
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

Regards,
Kamil

> on yuv and rgb pipes is functionally equivalent, so for test coverage
> this is a good enough approximation.
> 
> Signed-off-by: Rob Clark <robdclark at chromium.org>
> ---
>  lib/igt_kms.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 99cdeeb76033..dd530dbabf89 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6682,6 +6682,25 @@ int get_num_scalers(igt_display_t *display, enum pipe pipe)
>  			igt_assert(start_loc2 = strstr(start_loc1, "num_scalers="));
>  			igt_assert_eq(sscanf(start_loc2, "num_scalers=%d", &num_scalers), 1);
>  		}
> +	} else if (is_msm_device(drm_fd)) {
> +		igt_plane_t *plane;
> +
> +		/*
> +		 * msm devices have dma pipes (no csc, no scaling), rgb
> +		 * pipes (no csc, has scaling), and vid pipes (has csc,
> +		 * has scaling), but not all devices have rgb pipes.
> +		 * We can use the # of pipes that support YUV formats
> +		 * as a rough approximation of the # of scalars.. it may
> +		 * undercount on some hw, but it will not overcount
> +		 */
> +		for_each_plane_on_pipe(display, pipe, plane) {
> +			for (unsigned i = 0; i < plane->format_mod_count; i++) {
> +				if (igt_format_is_yuv(plane->formats[i])) {
> +					num_scalers++;
> +					break;
> +				}
> +			}
> +		}
>  	}
>  
>  	return num_scalers;
> -- 
> 2.46.0
> 


More information about the igt-dev mailing list