Commit 87cefd57 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Pull GAMMA_MODE write out from haswell_load_luts()

For bdw+ let's move the GAMMA_MODE write for the legacy LUT
mode into the .load_luts() funciton directly, rather than
relying on haswell_load_luts(). We'll be getting rid of
haswell_load_luts() entirely soon, and it's anyway cleaner
to have the GAMMA_MODE write in a single place.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190205160848.24662-5-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent 23b03a27
...@@ -473,21 +473,20 @@ static void broadwell_load_luts(const struct intel_crtc_state *crtc_state) ...@@ -473,21 +473,20 @@ static void broadwell_load_luts(const struct intel_crtc_state *crtc_state)
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
if (crtc_state_is_legacy_gamma(crtc_state)) { if (crtc_state_is_legacy_gamma(crtc_state)) {
haswell_load_luts(crtc_state); i9xx_load_luts(crtc_state);
return; } else {
}
bdw_load_degamma_lut(crtc_state); bdw_load_degamma_lut(crtc_state);
bdw_load_gamma_lut(crtc_state, bdw_load_gamma_lut(crtc_state,
INTEL_INFO(dev_priv)->color.degamma_lut_size); INTEL_INFO(dev_priv)->color.degamma_lut_size);
I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode);
/* /*
* Reset the index, otherwise it prevents the legacy palette to be * Reset the index, otherwise it prevents the legacy palette to be
* written properly. * written properly.
*/ */
I915_WRITE(PREC_PAL_INDEX(pipe), 0); I915_WRITE(PREC_PAL_INDEX(pipe), 0);
}
I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode);
} }
static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state) static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
...@@ -530,12 +529,17 @@ static void glk_load_luts(const struct intel_crtc_state *crtc_state) ...@@ -530,12 +529,17 @@ static void glk_load_luts(const struct intel_crtc_state *crtc_state)
glk_load_degamma_lut(crtc_state); glk_load_degamma_lut(crtc_state);
if (crtc_state_is_legacy_gamma(crtc_state)) { if (crtc_state_is_legacy_gamma(crtc_state)) {
haswell_load_luts(crtc_state); i9xx_load_luts(crtc_state);
return; } else {
}
bdw_load_gamma_lut(crtc_state, 0); bdw_load_gamma_lut(crtc_state, 0);
/*
* Reset the index, otherwise it prevents the legacy palette to be
* written properly.
*/
I915_WRITE(PREC_PAL_INDEX(pipe), 0);
}
I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode); I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode);
} }
......
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