]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: CS_TFM_1D only applied post EOTF
authorKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Thu, 16 May 2019 15:14:55 +0000 (11:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:35 +0000 (07:24 +0200)
[ Upstream commit 6ad34adeaec5b56a5ba90e90099cabf1c1fe9dd2 ]

[Why]
There's some unnecessary mem allocation for CS_TFM_ID. What's worse, it
depends on LUT size and since it's 4K for CS_TFM_1D, it is 16x bigger
than in regular case when it's actually needed. This leads to some
crashes in stress conditions.

[How]
Skip ramp combining designed for RGB256 and DXGI gamma with CS_TFM_1D.

Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/modules/color/color_gamma.c

index a1055413bade66242a6637389deece2c9aba1695..31f867bb5afe8e3afb697b1daa22dffe76face07 100644 (file)
@@ -1564,7 +1564,8 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
 
        output_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
 
-       if (ramp && (mapUserRamp || ramp->type != GAMMA_RGB_256)) {
+       if (ramp && ramp->type != GAMMA_CS_TFM_1D &&
+                       (mapUserRamp || ramp->type != GAMMA_RGB_256)) {
                rgb_user = kvcalloc(ramp->num_entries + _EXTRA_POINTS,
                            sizeof(*rgb_user),
                            GFP_KERNEL);