drm/i915: Turn off pipe gamma when it's not needed
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 7 Feb 2019 20:21:43 +0000 (22:21 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 8 Feb 2019 12:30:14 +0000 (14:30 +0200)
commit0fc3f8e7540f59e0e059b20d5a138e5f81bcf352
treeffe15caf00aa63d2680a44959298367105370236
parent8271b2ef71aaabac452dc03a6cbe8960cbea4247
drm/i915: Turn off pipe gamma when it's not needed

The pipe internal precision is higher than what we currently program to
the degamma/gamma LUTs. We can get a higher quality image by bypassing
the LUTs when they're not needed. Let's do that.

Each plane has its own control bit for this, so we have to update
all active planes. The way we've done this we don't actually have
to run through the whole .check_plane() thing. And we actually
do the .color_check() after .check_plane() so we couldn't even do
that without shuffling the code around.

Additionally on pre-skl we have to update the primary plane regardless
of whether it's active or not on account of the primary plane gamma
enable bit also affecting the pipe bottom color.

v2: Drop the '.' from patch title (Uma)
    Fix 'primayr' typo (Uma,Matt)
    Rebase

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