diff options
author | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2022-04-11 15:11:46 +0530 |
---|---|---|
committer | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2022-05-17 11:59:01 +0530 |
commit | 0a71a676180910b556e99f7702e9e3b4e24fa355 (patch) | |
tree | 720adac72cf22d1b7ea24ca7139e60274f7d69a6 /tests/kms_dither.c | |
parent | 5be520f6f02fe0f6cb6470596e6c72983e318528 (diff) |
tests/kms_dither: Adopt to use updated debugfs functions
Instead of writing our own wrappers of debugfs read,
use updated functions from lib.
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
Diffstat (limited to 'tests/kms_dither.c')
-rw-r--r-- | tests/kms_dither.c | 11 |
1 files 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: * |