]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd/display: force use sRGB for video TF is sRGB or BT709
authorJing Zhou <Jing.Zhou@amd.com>
Wed, 28 Oct 2020 07:50:53 +0000 (15:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Nov 2020 19:25:27 +0000 (14:25 -0500)
[Why]
When mpo enabled, video comes is 709. Desktop use sRGB.
So color change easily noticeable especially when switch between
mpo/non-mpo.

[How]
Force use sRGB for video TF is sRGB or BT709.
DCN1/DCN2 use predefined type with YUV.
DCN3 use distributed points type with YUV.

Signed-off-by: Jing Zhou <Jing.Zhou@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c

index 65aabf25cdecc08be8ca9536eda050d9b180043b..27bcbe5fa7b04e84d3a0a5c4d0780b7830ed37b5 100644 (file)
@@ -125,6 +125,7 @@ struct dpp_color_caps {
        uint16_t hw_3d_lut : 1;
        uint16_t ogam_ram : 1; // blnd gam
        uint16_t ocsc : 1;
+       uint16_t dgam_rom_for_yuv : 1;
        struct rom_curve_caps dgam_rom_caps;
        struct rom_curve_caps ogam_rom_caps;
 };
index e74bb273588531f23d3ced6f6e0c23144d1c1da8..bdc37831535e43a7fdff48a7f635e925635bba63 100644 (file)
@@ -1439,6 +1439,7 @@ static bool dcn10_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 0;
        dc->caps.color.dpp.post_csc = 0;
        dc->caps.color.dpp.gamma_corr = 0;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 1;
 
        dc->caps.color.dpp.hw_3d_lut = 0;
        dc->caps.color.dpp.ogam_ram = 1; // RGAM on DCN1
index 728212cca7aa59725b7fffd86e989e0a0646c0c6..ff36db5edf6c51aac9f3de6cc9603e66e6d33101 100644 (file)
@@ -3820,6 +3820,7 @@ static bool dcn20_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 0;
        dc->caps.color.dpp.post_csc = 0;
        dc->caps.color.dpp.gamma_corr = 0;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 1;
 
        dc->caps.color.dpp.hw_3d_lut = 1;
        dc->caps.color.dpp.ogam_ram = 1;
index 5eedc19662a3db98f6dadece0ceecb9e99040533..abc8af0ef1413223df56039c6ec11fdf3a9398f8 100644 (file)
@@ -1978,6 +1978,7 @@ static bool dcn21_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 0;
        dc->caps.color.dpp.post_csc = 0;
        dc->caps.color.dpp.gamma_corr = 0;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 1;
 
        dc->caps.color.dpp.hw_3d_lut = 1;
        dc->caps.color.dpp.ogam_ram = 1;
index c8851853843acc893deb51f09a13d9b8ce31f6cb..b379057e669c04a8ae1e03f076908428edc21bd6 100644 (file)
@@ -2681,6 +2681,7 @@ static bool dcn30_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 1;
        dc->caps.color.dpp.post_csc = 1;
        dc->caps.color.dpp.gamma_corr = 1;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 0;
 
        dc->caps.color.dpp.hw_3d_lut = 1;
        dc->caps.color.dpp.ogam_ram = 1;
index 5a47b4106b7b534f2a7bde30174631178adfc112..8824dbce6f4a7361ce8e95930d69f219e3dd0952 100644 (file)
@@ -1748,6 +1748,7 @@ static bool dcn301_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 1;
        dc->caps.color.dpp.post_csc = 1;
        dc->caps.color.dpp.gamma_corr = 1;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 0;
 
        dc->caps.color.dpp.hw_3d_lut = 1;
        dc->caps.color.dpp.ogam_ram = 1;
index e2e792d239239fd5a8903f83623c9a44b9224440..765002e0ff9308fac1af7cacfb827920710db4af 100644 (file)
@@ -1327,6 +1327,7 @@ static bool dcn302_resource_construct(
        dc->caps.color.dpp.dgam_rom_caps.hlg = 1;
        dc->caps.color.dpp.post_csc = 1;
        dc->caps.color.dpp.gamma_corr = 1;
+       dc->caps.color.dpp.dgam_rom_for_yuv = 0;
 
        dc->caps.color.dpp.hw_3d_lut = 1;
        dc->caps.color.dpp.ogam_ram = 1;