1. 24 Jan, 2019 2 commits
    • Matt Roper's avatar
      drm/i915: Validate userspace-provided color management LUT's (v4) · 85e2d61e
      Matt Roper authored
      We currently program userspace-provided gamma and degamma LUT's into our
      hardware without really checking to see whether they satisfy our
      hardware's rules.  We should try to catch tables that are invalid for
      our hardware early and reject the atomic transaction.
      
      All of our platforms that accept a degamma LUT expect that the entries
      in the LUT are always flat or increasing, never decreasing.  Also, our
      GLK and ICL platforms only accept degamma tables with r=g=b entries; so
      we should also add the relevant checks for that in anticipation of
      degamma support landing for those platforms.
      
      v2:
       - Use new API (single check function with bitmask of tests to apply)
       - Call helper for our gamma table as well (with no additional tests
         specified) so that the table size will be validated.
      
      v3:
       - Don't call on the gamma table since the LUT size is already tested at
         property blob upload and we don't have any additional hardware
         constraints for that LUT.
      
      v4:
       - Apply equal color channel check on gen10 as well; the bspec has some
         strange tagging for CNL platforms, but this appears to apply there as
         well.  (Ville)
      
      Cc: Uma Shankar <uma.shankar@intel.com>
      Cc: Swati Sharma <swati2.sharma@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181218175158.5739-1-matthew.d.roper@intel.com
      85e2d61e
    • Matt Roper's avatar
      drm: Add color management LUT validation helper (v4) · 3c8861d8
      Matt Roper authored
      Some hardware may place additional restrictions on the gamma/degamma
      curves described by our LUT properties.  E.g., that a gamma curve never
      decreases or that the red/green/blue channels of a LUT's entries must be
      equal.  Let's add a helper function that drivers can use to test that a
      userspace-provided LUT is valid and doesn't violate hardware
      requirements.
      
      v2:
       - Combine into a single helper that just takes a bitmask of the tests
         to apply.  (Brian Starkey)
       - Add additional check (always performed) that LUT property blob size
         is always a multiple of the LUT entry size.  (stolen from ARM driver)
      
      v3:
       - Drop the LUT size check again since
         drm_atomic_replace_property_blob_from_id() already covers this for
         us.  (Alexandru Gheorghe)
      
      v4:
       - Use an enum to describe possible test values rather than #define's;
         this is cleaner to provide kerneldoc for.  (Daniel Vetter)
       - s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/.  (Ville)
      
      Cc: Uma Shankar <uma.shankar@intel.com>
      Cc: Swati Sharma <swati2.sharma@intel.com>
      Cc: Brian Starkey <Brian.Starkey@arm.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Reviewed-by: default avatarAlexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181217224415.12848-1-matthew.d.roper@intel.com
      3c8861d8
  2. 23 Jan, 2019 8 commits
  3. 22 Jan, 2019 8 commits
  4. 21 Jan, 2019 10 commits
  5. 18 Jan, 2019 7 commits
  6. 17 Jan, 2019 5 commits