]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Change default size for dummy plane in DML2
authorSwapnil Patel <swapnil.patel@amd.com>
Tue, 13 Feb 2024 13:09:48 +0000 (08:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:31 +0000 (15:11 +0200)
[ Upstream commit 75eb8f7df65c5e6eb22a5aff8deb60ce0b65de1a ]

[WHY & HOW]
Currently, to map dc states into dml_display_cfg,
We create a dummy plane if the stream doesn't have any planes
attached to it. This dummy plane uses max addersable width height.
This results in certain mode validations failing when they shouldn't.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Swapnil Patel <swapnil.patel@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

index 16452dae4acac4565c064f4da4f2901245b33eb1..5ef8c2e255808f162b239173e5f29234801a6bef 100644 (file)
@@ -824,13 +824,25 @@ static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state
 
 static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_stream_state *in)
 {
+       dml_uint_t width, height;
+
+       if (in->timing.h_addressable > 3840)
+               width = 3840;
+       else
+               width = in->timing.h_addressable;       // 4K max
+
+       if (in->timing.v_addressable > 2160)
+               height = 2160;
+       else
+               height = in->timing.v_addressable;      // 4K max
+
        out->CursorBPP[location] = dml_cur_32bit;
        out->CursorWidth[location] = 256;
 
        out->GPUVMMinPageSizeKBytes[location] = 256;
 
-       out->ViewportWidth[location] = in->timing.h_addressable;
-       out->ViewportHeight[location] = in->timing.v_addressable;
+       out->ViewportWidth[location] = width;
+       out->ViewportHeight[location] = height;
        out->ViewportStationary[location] = false;
        out->ViewportWidthChroma[location] = 0;
        out->ViewportHeightChroma[location] = 0;
@@ -849,7 +861,7 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned
        out->HTapsChroma[location] = 0;
        out->VTapsChroma[location] = 0;
        out->SourceScan[location] = dml_rotation_0;
-       out->ScalerRecoutWidth[location] = in->timing.h_addressable;
+       out->ScalerRecoutWidth[location] = width;
 
        out->LBBitPerPixel[location] = 57;