Skip to content

Commit 3faf8b8

Browse files
committed
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ä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Swati Sharma <[email protected]>
1 parent 6e482b9 commit 3faf8b8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/gpu/drm/i915/display/intel_color.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,16 +1025,13 @@ static void chv_load_luts(const struct intel_crtc_state *crtc_state)
10251025

10261026
cherryview_load_csc_matrix(crtc_state);
10271027

1028-
if (crtc_state_is_legacy_gamma(crtc_state)) {
1029-
i9xx_load_luts(crtc_state);
1030-
return;
1031-
}
1032-
1033-
if (degamma_lut)
1028+
if (crtc_state->cgm_mode & CGM_PIPE_MODE_DEGAMMA)
10341029
chv_load_cgm_degamma(crtc, degamma_lut);
10351030

1036-
if (gamma_lut)
1031+
if (crtc_state->cgm_mode & CGM_PIPE_MODE_GAMMA)
10371032
chv_load_cgm_gamma(crtc, gamma_lut);
1033+
else
1034+
i965_load_luts(crtc_state);
10381035
}
10391036

10401037
void intel_color_load_luts(const struct intel_crtc_state *crtc_state)

0 commit comments

Comments
 (0)