• Ville Syrjälä's avatar
    drm/i915: Introduce crtc_state->{pre,post}_csc_lut · 18f1b5ae
    Ville Syrjälä authored
    Add an extra remapping step between the logical state of the LUTs
    (hw.(de)gamma_lut) as specified via uapi/bigjoiner copy vs.
    the actual state of the LUTs programmed into the hardware.
    
    With this we should be finally able finish the (de)gamma
    readout/state checker support for the remaining platforms
    (ilk-skl) where the same hardware LUT can be positioned
    either before or after the pipe CSC unit. Where we position
    it depends on factors such as presence of the logical degamma
    LUT, RGB vs. YCbCr output, full vs. limited RGB quantization
    range.
    
    Without the extra remapping step the state readout doesn't
    really know whether the LUT read from the hardware is the
    degamma or gamma LUT, and so we is unable to accurately store
    it into our crtc state. With the remapping step we know
    exactly where to put it given the order of the LUT vs. CSC
    in the hardware state.
    
    Only the initial hw->uapi state readout done during driver
    load/resume still has the problem of not really knowing
    what to do with the LUT(s). But we can just assume 1:1
    mapping there and let subsequent commits fix things up.
    
    Another benefit is that we now have a place for purely
    internal LUTs, without complicating the bigjoiner uapi->hw
    copy logic. This should prove useful for streamlining
    glk degamma LUT handling.
    Reviewed-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/20221024161514.5340-3-ville.syrjala@linux.intel.com
    18f1b5ae
intel_crtc_state_dump.c 10.4 KB