diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-11-07 18:17:15 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-03-03 20:26:23 +0300 |
commit | 3faf8b8532d750be669af0d27049914cff90acd8 (patch) | |
tree | 95949fda37eb04119f545807829a003b723f9dbb /drivers/gpu/drm/i915/display/intel_color.c | |
parent | 6e482b96b387d717302b6d281120121bf93b1936 (diff) | |
download | linux-3faf8b8532d750be669af0d27049914cff90acd8.tar.xz |
drm/i915: Polish CHV .load_luts() a bit
It irks me to use crtc_state_is_legacy_gamma() inside the guts
of the CHV color management code. Let's get rid of it and instead
just consult cgm_mode to figure out if we want to enable the pipe
gamma or the CGM gamma.
Also CHV display engine is based on i965/g4x so we should fall back
to the i965 path when the CGM gamma is not used.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191107151725.10507-3-ville.syrjala@linux.intel.com
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_color.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_color.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 36dd52d2a9ee..98aefeebda28 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1025,16 +1025,13 @@ static void chv_load_luts(const struct intel_crtc_state *crtc_state) cherryview_load_csc_matrix(crtc_state); - if (crtc_state_is_legacy_gamma(crtc_state)) { - i9xx_load_luts(crtc_state); - return; - } - - if (degamma_lut) + if (crtc_state->cgm_mode & CGM_PIPE_MODE_DEGAMMA) chv_load_cgm_degamma(crtc, degamma_lut); - if (gamma_lut) + if (crtc_state->cgm_mode & CGM_PIPE_MODE_GAMMA) chv_load_cgm_gamma(crtc, gamma_lut); + else + i965_load_luts(crtc_state); } void intel_color_load_luts(const struct intel_crtc_state *crtc_state) |