Commit 7e764059 authored by Swati Sharma's avatar Swati Sharma Committed by Jani Nikula

drm/i915/display: Add macro to compare gamma hw/sw lut

Add macro to compare hw/sw gamma lut values. First need to
check whether hw/sw gamma mode matches or not. If not
no need to compare lut values, if matches then only compare
lut entries.

v5: -Called PIPE_CONF_CHECK_COLOR_LUT inside if (!adjust) [Jani]
    -Added #undef PIPE_CONF_CHECK_COLOR_LUT [Jani]
v8: -Added check for gamma mode before gamma lut entry comparison
     [Jani]
    -Split patch 3 into 4 patches
Signed-off-by: default avatarSwati Sharma <swati2.sharma@intel.com>
Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1567538578-4489-5-git-send-email-swati2.sharma@intel.com
parent e9c8f591
...@@ -12531,6 +12531,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12531,6 +12531,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
{ {
struct drm_i915_private *dev_priv = to_i915(current_config->base.crtc->dev); struct drm_i915_private *dev_priv = to_i915(current_config->base.crtc->dev);
bool ret = true; bool ret = true;
u32 bp_gamma = 0;
bool fixup_inherited = fastset && bool fixup_inherited = fastset &&
(current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) && (current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
!(pipe_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED); !(pipe_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED);
...@@ -12682,6 +12683,24 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12682,6 +12683,24 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
} \ } \
} while (0) } while (0)
#define PIPE_CONF_CHECK_COLOR_LUT(name1, name2, bit_precision) do { \
if (current_config->name1 != pipe_config->name1) { \
pipe_config_mismatch(fastset, __stringify(name1), \
"(expected %i, found %i, won't compare lut values)\n", \
current_config->name1, \
pipe_config->name1); \
ret = false;\
} else { \
if (!intel_color_lut_equal(current_config->name2, \
pipe_config->name2, pipe_config->name1, \
bit_precision)) { \
pipe_config_mismatch(fastset, __stringify(name2), \
"hw_state doesn't match sw_state\n"); \
ret = false; \
} \
} \
} while (0)
#define PIPE_CONF_QUIRK(quirk) \ #define PIPE_CONF_QUIRK(quirk) \
((current_config->quirks | pipe_config->quirks) & (quirk)) ((current_config->quirks | pipe_config->quirks) & (quirk))
...@@ -12777,6 +12796,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12777,6 +12796,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
PIPE_CONF_CHECK_X(csc_mode); PIPE_CONF_CHECK_X(csc_mode);
PIPE_CONF_CHECK_BOOL(gamma_enable); PIPE_CONF_CHECK_BOOL(gamma_enable);
PIPE_CONF_CHECK_BOOL(csc_enable); PIPE_CONF_CHECK_BOOL(csc_enable);
bp_gamma = intel_color_get_gamma_bit_precision(pipe_config);
if (bp_gamma)
PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, base.gamma_lut, bp_gamma);
} }
PIPE_CONF_CHECK_BOOL(double_wide); PIPE_CONF_CHECK_BOOL(double_wide);
...@@ -12839,6 +12863,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12839,6 +12863,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#undef PIPE_CONF_CHECK_P #undef PIPE_CONF_CHECK_P
#undef PIPE_CONF_CHECK_FLAGS #undef PIPE_CONF_CHECK_FLAGS
#undef PIPE_CONF_CHECK_CLOCK_FUZZY #undef PIPE_CONF_CHECK_CLOCK_FUZZY
#undef PIPE_CONF_CHECK_COLOR_LUT
#undef PIPE_CONF_QUIRK #undef PIPE_CONF_QUIRK
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment