[PATCH v2 0/2] Add gamma/degamma LUT validation helper

Matt Roper matthew.d.roper at intel.com
Thu Dec 13 21:55:24 UTC 2018


Previous version of this series was here:
  https://lists.freedesktop.org/archives/dri-devel/2018-December/200178.html

Gamma and degamma LUT's uploaded by userspace need to be checked to
ensure they're valid tables and that they meet any additional
constraints of a given platform's hardware.  Let's add a DRM helper that
drivers can call to perform some common LUT sanity tests that are likely
to be useful on multiple platforms:

 - LUT entries are always increasing or flat, never decreasing
 - LUT entries have equal red, green, and blue values for each entry
 - LUT size is valid (i.e., it's a multiple of sizeof(struct
   drm_color_lut))

The size test will always be performed (since it's verifying that the
proper ABI was followed), but the other two tests are optional and will
only be applied as requested by the driver.

This revision incorporates Brian Starkey's suggestion to combine the
separate helpers into a single function that takes a bitmask of tests to
apply.  It also adds an additional LUT size test inspired by the ARM
malidp driver.


Matt Roper (2):
  drm: Add color management LUT validation helper (v2)
  drm/i915: Validate userspace-provided color management LUT's (v2)

 drivers/gpu/drm/drm_color_mgmt.c   | 64 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_color.c | 19 +++++++++++
 include/drm/drm_color_mgmt.h       |  5 +++
 3 files changed, 88 insertions(+)

-- 
2.14.4



More information about the dri-devel mailing list