1. 11 Apr, 2023 1 commit
    • Ville Syrjälä's avatar
      drm/i915: Fix limited range csc matrix · 404c3acd
      Ville Syrjälä authored
      Our current limited range matrix is a bit off. I think it
      was originally calculated with rounding, as if we wanted
      the normal pixel replication type of behaviour.
      That is, since the 8bpc max value is 0xeb we assumed the
      16bpc max value should be 0xebeb, but what the HDMI spec
      actually says it should be is 0xeb00.
      
      So to get what we want we make the formula
       out = in * (235-16) << (12-8) / in_max + 16 << (12-8),
      with 12 being precision of the csc, 8 being the precision
      of the constants we used.
      
      The hardware takes its coefficients as floating point
      values, but the (235−16)/255 = ~.86, so exponent 0
      is what we want anyway, so it works out perfectly without
      having to hardcode it in hex or start playing with floats.
      
      In terms of raw numbers we are feeding the hardware the
      post offset changes from 0x101 to 0x100, and the coefficient
      changes from 0xdc0 to 0xdb0 (~.860->~.855). So this should
      make everything come out just a tad darker.
      
      I already used better constants in lut_limited_range() earlier
      so the output of the two paths should be closer now.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230329135002.3096-2-ville.syrjala@linux.intel.comReviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
      404c3acd
  2. 06 Apr, 2023 2 commits
  3. 05 Apr, 2023 5 commits
  4. 04 Apr, 2023 3 commits
  5. 03 Apr, 2023 29 commits