drm/i915: Apply LUT validation checks to platforms more accurately (v3)
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 30 Jan 2019 18:10:22 +0000 (10:10 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 31 Jan 2019 01:09:45 +0000 (17:09 -0800)
commite4c0d5314dede34ac48257cbdd4b3a046b2415df
treefaba29a4ad5b8a3c4a4bae85a2322831b40903a6
parentc0550305fcbd82c0b0d094e385551d9c63fc8852
drm/i915: Apply LUT validation checks to platforms more accurately (v3)

Use of the new DRM_COLOR_LUT_NON_DECREASING test was a bit over-zealous;
it doesn't actually need to be applied to the degamma on "bdw-style"
platforms.  Likewise, we overlooked the fact that CHV should have that
test applied to the gamma LUT as well as the degamma LUT.

Rather than adding more complicated platform checking to
intel_color_check(), let's just store the appropriate set of LUT
validation flags for each platform in the intel_device_info structure.

v2:
 - Shuffle around LUT size tests so that the hardware-specific tests
   won't be applied to legacy gamma tables.  (Ville)
 - Add a debug message so that it will be easier to understand why an
   atomic transaction involving incorrectly-sized LUT's got rejected
   by the driver.

v3:
 - Switch size_t's to int's.  (Ville)

Fixes: 85e2d61e4976 ("drm/i915: Validate userspace-provided color management LUT's (v4)")
References: https://lists.freedesktop.org/archives/intel-gfx/2019-January/187634.html
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190130181022.4291-1-matthew.d.roper@intel.com
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/intel_color.c
drivers/gpu/drm/i915/intel_device_info.h