Only try to set those values if the properties are supported.
This fixes the kms_chameium tests to run on vc4 again.

Reported-by: Maxime Ripard <[email protected]>
Cc: Paul Kocialkowski <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Boris Brezillon <[email protected]>
Signed-off-by: Maarten Lankhorst <[email protected]>
---
 tests/kms_chamelium.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 8855a8300049..2bc34d07788d 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -471,9 +471,12 @@ enable_output(data_t *data,
        igt_output_override_mode(output, mode);
 
        /* Clear any color correction values that might be enabled */
-       igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_DEGAMMA_LUT, 
NULL, 0);
-       igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_GAMMA_LUT, NULL, 
0);
-       igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_CTM, NULL, 0);
+       if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT))
+               igt_pipe_obj_replace_prop_blob(primary->pipe, 
IGT_CRTC_DEGAMMA_LUT, NULL, 0);
+       if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT))
+               igt_pipe_obj_replace_prop_blob(primary->pipe, 
IGT_CRTC_GAMMA_LUT, NULL, 0);
+       if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM))
+               igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_CTM, 
NULL, 0);
 
        igt_display_commit2(display, COMMIT_ATOMIC);
 
-- 
2.16.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to