drm/i915: Track pipe gamma enable/disable in crtc state
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 7 Feb 2019 20:39:13 +0000 (22:39 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 8 Feb 2019 12:28:55 +0000 (14:28 +0200)
commit5f29ab23046a4bb08a850e41bdb579b2cb59421d
tree6a29eb48744c7177c17be1722509cd83b713d61e
parent9d5441de28e2b1e5087ce63c4fe9e0b1c5b3fcaa
drm/i915: Track pipe gamma enable/disable in crtc state

Track whether pipe gamma is enabled or disabled. For now we
stick to the current behaviour of always enabling gamma. But
we do get working state readout for this now. On SKL+ we use
the pipe bottom color as our hardware state. On pre-SKL we
read the state back from the primary plane control register.
That only really correct for g4x+, as older platforms never
gamma correct pipe bottom color. But doing the readout the
same way on all platforms is fine, and there is no other way
to do it really.

v2: Initialize val at declaration (Uma)
    Drop the bogus skl scaler comment change (Uma)
    Rebase
v3: Allow fastboot with gamma_enable changes (Maarten)
v4: Drop the PIPE_BOTTOM_COLOR write from
    intel_update_pipe_config() again. It snuck back in
    during the rebase

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190207203913.5529-1-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/intel_color.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sprite.c