drm/i915: Make ilk_load_luts() deal with degamma
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 24 Oct 2022 16:15:10 +0000 (19:15 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 25 Oct 2022 22:37:39 +0000 (01:37 +0300)
Make ilk_load_luts() ready for a degamma lut. Currently we never
have one, but soon we may get one from readout, and I think we
may want to change the state computation such that we may end up
with one even when userspace has simply supplied a gamma lut.

At least the code now follows the path laid out by the ivb/bdw
counterpars.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221024161514.5340-2-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_color.c

index 123c57ceeb736335a1aef683a7c9e42d5f2ff057..ff5f462b1c499e09cec73deffd6a1a6206587e3c 100644 (file)
@@ -649,13 +649,15 @@ static void ilk_load_luts(const struct intel_crtc_state *crtc_state)
 {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
        const struct drm_property_blob *gamma_lut = crtc_state->hw.gamma_lut;
+       const struct drm_property_blob *degamma_lut = crtc_state->hw.degamma_lut;
+       const struct drm_property_blob *blob = gamma_lut ?: degamma_lut;
 
        switch (crtc_state->gamma_mode) {
        case GAMMA_MODE_MODE_8BIT:
-               ilk_load_lut_8(crtc, gamma_lut);
+               ilk_load_lut_8(crtc, blob);
                break;
        case GAMMA_MODE_MODE_10BIT:
-               ilk_load_lut_10(crtc, gamma_lut);
+               ilk_load_lut_10(crtc, blob);
                break;
        default:
                MISSING_CASE(crtc_state->gamma_mode);