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
This commit is contained in:
Ville Syrjälä
2019-02-07 22:39:13 +02:00
szülő 9d5441de28
commit 5f29ab2304
4 fájl változott, egészen pontosan 88 új sor hozzáadva és 25 régi sor törölve

Fájl megtekintése

@@ -741,7 +741,12 @@ vlv_update_clrc(const struct intel_plane_state *plane_state)
static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{
return SP_GAMMA_ENABLE;
u32 sprctl = 0;
if (crtc_state->gamma_enable)
sprctl |= SP_GAMMA_ENABLE;
return sprctl;
}
static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
@@ -919,7 +924,8 @@ static u32 ivb_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
u32 sprctl = 0;
sprctl |= SPRITE_GAMMA_ENABLE;
if (crtc_state->gamma_enable)
sprctl |= SPRITE_GAMMA_ENABLE;
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
sprctl |= SPRITE_PIPE_CSC_ENABLE;
@@ -1107,7 +1113,12 @@ g4x_sprite_max_stride(struct intel_plane *plane,
static u32 g4x_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{
return DVS_GAMMA_ENABLE;
u32 dvscntr = 0;
if (crtc_state->gamma_enable)
dvscntr |= DVS_GAMMA_ENABLE;
return dvscntr;
}
static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,