Skip to content
  1. Dec 09, 2022
  2. Dec 08, 2022
  3. Dec 01, 2022
  4. Nov 30, 2022
  5. Nov 29, 2022
  6. Nov 23, 2022
  7. Nov 22, 2022
    • Ville Syrjälä's avatar
      drm/i915: Add 10bit gamma mode for gen2/3 · 67630bac
      Ville Syrjälä authored
      
      
      Some gen2/gen3 parts have a 10bit gamma mode, on some pipes.
      Expose it.
      
      The format is different to the later i965+ style in that we
      store a 10bit value and a 6 bit floating point slope for each
      entry. Ie. the hardware extrapolates the intermediate steps
      from the current LUT entry, instead of interpolating between
      the current and next LUT entries. This also means we don't store
      the last LUT entry in any register as it is defined by the previous
      LUT entry's value+slope.
      
      The slope has limited precision though (2 bit exponent + 4 bit
      mantissa), so we'd have to allow for more error in the state checker
      for the last entry and we have to make sure userspace doesn't
      pass in something where the slope is simply to steep. In theory
      we should perhaps check the slope for every interval, but we don't
      do that for any other interpolated gamma mode and I suspect they
      may also have some internal limit on the slope. I haven't confirmed
      that theory though. Anyways, for ease of implementation we shall
      just ignore the last entry in the state checker. If all the other
      entries match anyway then that seems like a good indication that
      the hardware was programmed as expected.
      
      v2: Redo the state checker logic a bit
          Rebase due to other changes
      v3: Fix C8 readout
      v4: Use REG_FIELD_PREP()
      
      Acked-by: default avatarUma Shankar <uma.shankar@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221114153732.11773-20-ville.syrjala@linux.intel.com
      67630bac
    • Ville Syrjälä's avatar
      drm/i915: Use gamma LUT for RGB limited range compression · 07fc6a7b
      Ville Syrjälä authored
      
      
      On hsw+ and glk class hardware we current make a mess of
      things when we have to both generate limited range output
      and use the hw gamma LUT. Since we do the range compression
      using the pipe CSC unit (which is situated before the gamma
      LUT in the pipe) we are in fact applying the gamma to the
      limited range data instead of the full range data as the
      user intended.
      
      We can work around this by applying the range compression
      via the gamma LUT instead of using the pipe CSC for it.
      Fairly easy to do now that we have the internal post_csc_lut
      attachment point where we can stick our new cooked LUT.
      
      On hsw+ this only needs to be done when using the split
      gamma mode or when the ctm is enabled since otherwise we can
      simply reorder the LUT vs. CSC. On glk we need to do this any
      time a gamma LUT is used since no reordering is possible.
      We do lose a bit of coverage in intel_color_assert_luts(),
      but so be it.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221114153732.11773-19-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      07fc6a7b