On 2023-11-28 12:52, Melissa Wen wrote:
> This series updates the color state section of the AMD DTN log to match
> color resource differences between DCN versions.
>
> Currently, the DTN log considers the DCN10 color pipeline, which is
> useless for newer DCN versions due to all the color capability
> differences. In addition to the new color blocks and features, some
> semantic differences meant that the DCN10 output was no longer suitable
> for newer families.
>
> This version addresses comments from Siqueira and Harry [1]. It also
> contains some improvements: DPP and MPC gamut remap matrix data in 31.32
> fixed point format and coverage of DCN2+ and DCN3+.
>
> - The first patch decouple DCN10 color state from HW log in a
> preparation for color logs specific to each DCN family.
> - Harry kindly provided the second patch with a way to read Gamut Remap
> Matrix data in 31.32 fixed point format instead of HW values.
> - With this, I replaced the DCN10 gamut remap output to display values
> in the new format (third patch).
> - Patches 4 and 6 fill up the color state of DPP and MPC blocks for DCN3
> from the right registers.
> - As DCN3+ has a new MPC color block for post-blending Gamut Remap
> matrix, in the patch 5 I reuse Harry's approach for reading DPP gamut
> remap matrix and create a helper to read data of MPC gamut remap
> matrix.
> - Patch 7 and 9 create the new color state log specific for DCN2+ and
> DCN3+. I didn't extend to DCN32 (and also DCN35) because I observed
> some differences in the shaper and 3D LUT registers of this version.
> - Patch 8 adds description of DPP and MPC color blocks for for better
> interpretation of data.
>
> This new approach works well with the driver-specific color
> properties[2] and steamdeck/gamescope[3] together, where we can see
> color state changing from default values. I also tested with
> steamdeck/KDE and DCN21/GNOME.
>
> Please find some `before vs after` results below:
>
> ===
>
> DCN301 - Before:
> ---
>
> DPP:IGAM format IGAM modeDGAM modeRGAM mode GAMUT mode C11 C12
> C13 C14 C21 C22 C23 C24 C31 C32 C33 C34
> [ 0]:0h BypassFixed Bypass Bypass0
> h h h h h h
> [ 1]:0h BypassFixed Bypass Bypass0
> h h h h h h
> [ 2]:0h BypassFixed Bypass Bypass0
> h h h h h h
> [ 3]:0h BypassFixed Bypass Bypass0
> h h h h h h
>
> MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE
> [ 0]: 0h 0h 2h 3 01 0 0
> [ 1]: 0h 1h fh 2 20 0 0
> [ 2]: 0h 2h 3h 3 01 0 0
> [ 3]: 0h 3h 1h 3 20 0 0
>
>
> DCN301 - After (Gamescope):
> ---
>
> DPP: DGAM ROM DGAM ROM type DGAM LUT SHAPER mode 3DLUT mode 3DLUT bit
> depth 3DLUT size RGAM mode GAMUT adjust C11C12C13
> C14C21C22C23C24C31C32
> C33C34
> [ 0]:1 sRGBBypassRAM B RAM A
> 12-bit17x17x17 RAM ABypass 00 00 00
> 00 00 00 00 00 00 00
> 00 00
> [ 1]:1 sRGBBypassRAM B RAM A
> 12-bit17x17x17 RAM ABypass 00 00 00
> 00 00 00 00 00 00 00
> 00 00
> [ 2]:1 sRGBBypassRAM B RAM A
> 12-bit17x17x17 RAM ABypass 00 00 00
> 00 00 00 00 00 00 00
> 00 00
> [ 3]:1 sRGBBypassRAM B RAM A
> 12-bit17x17x17 RAM ABypass 00 00 00
> 00 00 00 00 00 00 00
> 00 00
>
> DPP Color Caps: input_lut_shared:0 icsc:1 dgam_ram:0 dgam_rom:
> srgb:1,bt2020:1,gamma2_2:1,pq:1,hlg:1 post_csc:1 gamcor:1
> dgam_rom_for_yuv:0 3d_lut:1 blnd_lut:1 oscs:0
>
> MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE
> SHAPER mode 3DLUT mode 3DLUT bit-depth 3DLUT size OGAM mode OGAM LUT
> GAMUT adjust C11C12C13C14C21C22
> C23C24C31C32C33C34
> [ 0]: 0h 0h 2h 3