[igt-dev] [V2 4/5] tests/kms_dither: Adopt to use updated debugfs functions

Sharma, Swati2 swati2.sharma at intel.com
Tue May 10 10:49:51 UTC 2022


LGTM
Reviewed-by:
Swati Sharma <swati2.sharma at intel.com>

On 11-Apr-22 3:11 PM, Bhanuprakash Modem wrote:
> Instead of writing our own wrappers of debugfs read,
> use updated functions from lib.
> 
> Cc: Uma Shankar <uma.shankar at intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>   tests/kms_dither.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/kms_dither.c b/tests/kms_dither.c
> index 8e18dc83..21c1618a 100644
> --- a/tests/kms_dither.c
> +++ b/tests/kms_dither.c
> @@ -99,14 +99,12 @@ static dither_status_t get_dither_state(data_t *data)
>   	igt_require(res > 0);
>   	close(dir);
>   
> -	igt_assert(start_loc = strstr(buf, ", bpp="));
> -	igt_assert_eq(sscanf(start_loc, ", bpp=%u", &status.bpc), 1);
> -	status.bpc /= 3;
> -
>   	igt_assert(start_loc = strstr(buf, ", dither="));
>   	igt_assert_eq(sscanf(start_loc, ", dither=%s", tmp), 1);
>   	status.dither = !strcmp(tmp, "yes,");
>   
> +	status.bpc = igt_get_pipe_current_bpc(data->drm_fd, data->pipe_id);
> +
>   	return status;
>   }
>   
> @@ -145,6 +143,11 @@ static void test_dithering(data_t *data, enum pipe pipe,
>   
>   	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>   
> +	if (!igt_check_output_bpc_equal(data->drm_fd, pipe, output->name, output_bpc)) {
> +		igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc);
> +		igt_fail_on_f(true, "Failed to set max_bpc as: %d\n", output_bpc);
> +	}
> +
>   	/*
>   	 * Check the status of Dithering block:
>   	 *

-- 
~Swati Sharma


More information about the igt-dev mailing list