summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUma Shankar <uma.shankar@intel.com>2019-04-03 17:50:10 +0530
committerPetri Latvala <petri.latvala@intel.com>2019-04-10 16:03:02 +0300
commit64d0ff7247497ae6d726e4535fe74d4bb6ae914a (patch)
treed1ac70b84207784f6595060f6c9923b7f3df5242
parent86c207e3b8bb0d499f62c8e2a2d6ee4c990d586c (diff)
tests/kms_color: Fix CRC mismatch issues with ctm test
Due to Gamma/Degamma limitation wrt representation of intermediate values between 0 and 1.0 causing rounding issues and inaccuracies, applying linear gamma affects crc. This patch fixes the same by making ctm max test independent of gamma/degamma. v2: Disable degamma/gamma programming for ctm max test as it leads to crc mimsmatch. Limiting it to this test case alone as other tests need it to be enabled, hence not touching those scenarios. v3: Fixed a fumble with compilation. v4: Disabling degamma and gamma for ctm max tests, after the logic in kernel has been updated by Ville's series. v5: Disabled gamma/degamma for all ctm tests as suggested by Ville. v6: Restricting disabling of linear gamma luts for ctm max test. Updated the commit message and comment as suggested by Daniel. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108147 Signed-off-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/kms_color.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/kms_color.c b/tests/kms_color.c
index 1adef1da..eb85df7d 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -719,8 +719,20 @@ static bool test_pipe_ctm(data_t *data,
igt_assert(fb_modeset_id);
igt_plane_set_fb(primary, &fb_modeset);
- set_degamma(data, primary->pipe, degamma_linear);
- set_gamma(data, primary->pipe, gamma_linear);
+ /*
+ * Don't program LUT's for max CTM cases, as limitation of
+ * representing intermediate values between 0 and 1.0 causes
+ * rounding issues and inaccuracies leading to crc mismatch.
+ */
+ if (memcmp(before, after, sizeof(color_t))) {
+ set_degamma(data, primary->pipe, degamma_linear);
+ set_gamma(data, primary->pipe, gamma_linear);
+ } else {
+ /* Disable Degamma and Gamma for ctm max test */
+ disable_degamma(primary->pipe);
+ disable_gamma(primary->pipe);
+ }
+
disable_ctm(primary->pipe);
igt_display_commit(&data->display);