[igt-dev] [PATCH i-g-t 1/2] tests/kms_ccs: Add debug information on format modifier

Matt Roper matthew.d.roper at intel.com
Wed May 27 22:35:00 UTC 2020


On Tue, May 19, 2020 at 12:48:02PM +0300, Mika Kahola wrote:
> We could benefit on information on what format modifier is in use
> when running the test. This in mind, let's add informative string along
> with the list of ccs modifiers.
> 
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>
> ---
>  tests/kms_ccs.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
> index bc34aec5..c23b4e44 100644
> --- a/tests/kms_ccs.c
> +++ b/tests/kms_ccs.c
> @@ -81,12 +81,15 @@ static const uint32_t formats[] = {
>  	DRM_FORMAT_P016,
>  };
>  
> -static const uint64_t ccs_modifiers[] = {
> -	LOCAL_I915_FORMAT_MOD_Y_TILED_CCS,
> -	LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS,
> -	LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS,
> -	LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC,
> -	LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS,
> +static const struct {
> +	uint64_t modifier;
> +	const char *str;
> +} ccs_modifiers[5] = {
> +	{LOCAL_I915_FORMAT_MOD_Y_TILED_CCS, "LOCAL_I915_FORMAT_MOD_Y_TILED_CCS"},
> +	{LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS, "LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS"},
> +	{LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, "LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS"},
> +	{LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC, "LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC"},
> +	{LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS, "LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS"},
>  };

To help guard against typos or copy/paste errors, you might want to use
a macro like:

        #define CCSMOD(x)  { x, #x }
        static const struct {
                uint64_t modifier;
                const char *str;
        } ccs_modifiers[5] = {
                CCSMOD(LOCAL_I915_FORMAT_MOD_Y_TILED_CCS),
                CCSMOD(LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS),
                ...
        }
        #undef CCSMOD

But either way,

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>


>  
>  static bool check_ccs_planes;
> @@ -422,7 +425,8 @@ static int __test_output(data_t *data)
>  	for (i = 0; i < ARRAY_SIZE(ccs_modifiers); i++) {
>  		int j;
>  
> -		data->ccs_modifier = ccs_modifiers[i];
> +		data->ccs_modifier = ccs_modifiers[i].modifier;
> +		igt_debug("Modifier in use: %s\n", ccs_modifiers[i].str);
>  		for (j = 0; j < ARRAY_SIZE(formats); j++) {
>  			data->format = formats[j];
>  			valid_tests += test_ccs(data);
> -- 
> 2.20.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795


More information about the igt-dev mailing list