]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2024 10:03:49 +0000 (12:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2024 10:03:49 +0000 (12:03 +0200)
added patches:
drm-amd-display-block-dynamic-ips2-on-dcn35-for-incompatible-fw-versions.patch
drm-amd-display-clean-up-dsc-blocks-in-accelerated-mode.patch
drm-amd-display-disable-symclk32_le-root-clock-gating.patch
drm-amd-display-enable-dml2-override_det_buffer_size_kbytes.patch
drm-amd-display-round-calculated-vtotal.patch
drm-amd-display-skip-to-enable-dsc-if-it-has-been-off.patch
drm-amd-display-validate-backlight-caps-are-sane.patch

queue-6.10/drm-amd-display-block-dynamic-ips2-on-dcn35-for-incompatible-fw-versions.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-clean-up-dsc-blocks-in-accelerated-mode.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-disable-symclk32_le-root-clock-gating.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-enable-dml2-override_det_buffer_size_kbytes.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-round-calculated-vtotal.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-skip-to-enable-dsc-if-it-has-been-off.patch [new file with mode: 0644]
queue-6.10/drm-amd-display-validate-backlight-caps-are-sane.patch [new file with mode: 0644]
queue-6.10/series

diff --git a/queue-6.10/drm-amd-display-block-dynamic-ips2-on-dcn35-for-incompatible-fw-versions.patch b/queue-6.10/drm-amd-display-block-dynamic-ips2-on-dcn35-for-incompatible-fw-versions.patch
new file mode 100644 (file)
index 0000000..795e8e5
--- /dev/null
@@ -0,0 +1,44 @@
+From 401c90c4d64f2227fc2f4c02d2ad23296bf5ca6f Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Tue, 27 Aug 2024 14:13:10 -0400
+Subject: drm/amd/display: Block dynamic IPS2 on DCN35 for incompatible FW versions
+
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+
+commit 401c90c4d64f2227fc2f4c02d2ad23296bf5ca6f upstream.
+
+[WHY]
+Hangs with Z8 can occur if running an older unfixed PMFW version.
+
+[HOW]
+Fallback to RCG only for dynamic IPS2 states if it's not newer than
+93.12. Limit to DCN35.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Charlene Liu <charlene.liu@amd.com>
+Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
++++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+@@ -1149,6 +1149,12 @@ void dcn35_clk_mgr_construct(
+                       ctx->dc->debug.disable_dpp_power_gate = false;
+                       ctx->dc->debug.disable_hubp_power_gate = false;
+                       ctx->dc->debug.disable_dsc_power_gate = false;
++
++                      /* Disable dynamic IPS2 in older PMFW (93.12) for Z8 interop. */
++                      if (ctx->dc->config.disable_ips == DMUB_IPS_ENABLE &&
++                          ctx->dce_version == DCN_VERSION_3_5 &&
++                          ((clk_mgr->base.smu_ver & 0x00FFFFFF) <= 0x005d0c00))
++                              ctx->dc->config.disable_ips = DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF;
+               } else {
+                       /*let's reset the config control flag*/
+                       ctx->dc->config.disable_ips = DMUB_IPS_DISABLE_ALL; /*pmfw not support it, disable it all*/
diff --git a/queue-6.10/drm-amd-display-clean-up-dsc-blocks-in-accelerated-mode.patch b/queue-6.10/drm-amd-display-clean-up-dsc-blocks-in-accelerated-mode.patch
new file mode 100644 (file)
index 0000000..23fcaa1
--- /dev/null
@@ -0,0 +1,108 @@
+From 3766a840e093d30e1a2522f650d8a6ac892a8719 Mon Sep 17 00:00:00 2001
+From: Martin Tsai <martin.tsai@amd.com>
+Date: Mon, 22 Jul 2024 14:12:25 +0800
+Subject: drm/amd/display: Clean up dsc blocks in accelerated mode
+
+From: Martin Tsai <martin.tsai@amd.com>
+
+commit 3766a840e093d30e1a2522f650d8a6ac892a8719 upstream.
+
+[WHY]
+DSC on eDP could be enabled during VBIOS post. The enabled
+DSC may not be disabled when enter to OS, once the system was
+in second screen only mode before entering to S4. In this
+case, OS will not send setTimings to reset eDP path again.
+
+The enabled DSC HW will make a new stream without DSC cannot
+output normally if it reused this pipe with enabled DSC.
+
+[HOW]
+In accelerated mode, to clean up DSC blocks if eDP is on link
+but not active when we are not in fast boot and seamless boot.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Charlene Liu <charlene.liu@amd.com>
+Signed-off-by: Martin Tsai <martin.tsai@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c |   50 ++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
++++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+@@ -57,6 +57,7 @@
+ #include "panel_cntl.h"
+ #include "dc_state_priv.h"
+ #include "dpcd_defs.h"
++#include "dsc.h"
+ /* include DCE11 register header files */
+ #include "dce/dce_11_0_d.h"
+ #include "dce/dce_11_0_sh_mask.h"
+@@ -1768,6 +1769,48 @@ static void get_edp_links_with_sink(
+       }
+ }
++static void clean_up_dsc_blocks(struct dc *dc)
++{
++      struct display_stream_compressor *dsc = NULL;
++      struct timing_generator *tg = NULL;
++      struct stream_encoder *se = NULL;
++      struct dccg *dccg = dc->res_pool->dccg;
++      struct pg_cntl *pg_cntl = dc->res_pool->pg_cntl;
++      int i;
++
++      if (dc->ctx->dce_version != DCN_VERSION_3_5 &&
++              dc->ctx->dce_version != DCN_VERSION_3_51)
++              return;
++
++      for (i = 0; i < dc->res_pool->res_cap->num_dsc; i++) {
++              struct dcn_dsc_state s  = {0};
++
++              dsc = dc->res_pool->dscs[i];
++              dsc->funcs->dsc_read_state(dsc, &s);
++              if (s.dsc_fw_en) {
++                      /* disable DSC in OPTC */
++                      if (i < dc->res_pool->timing_generator_count) {
++                              tg = dc->res_pool->timing_generators[i];
++                              tg->funcs->set_dsc_config(tg, OPTC_DSC_DISABLED, 0, 0);
++                      }
++                      /* disable DSC in stream encoder */
++                      if (i < dc->res_pool->stream_enc_count) {
++                              se = dc->res_pool->stream_enc[i];
++                              se->funcs->dp_set_dsc_config(se, OPTC_DSC_DISABLED, 0, 0);
++                              se->funcs->dp_set_dsc_pps_info_packet(se, false, NULL, true);
++                      }
++                      /* disable DSC block */
++                      if (dccg->funcs->set_ref_dscclk)
++                              dccg->funcs->set_ref_dscclk(dccg, dsc->inst);
++                      dsc->funcs->dsc_disable(dsc);
++
++                      /* power down DSC */
++                      if (pg_cntl != NULL)
++                              pg_cntl->funcs->dsc_pg_control(pg_cntl, dsc->inst, false);
++              }
++      }
++}
++
+ /*
+  * When ASIC goes from VBIOS/VGA mode to driver/accelerated mode we need:
+  *  1. Power down all DC HW blocks
+@@ -1852,6 +1895,13 @@ void dce110_enable_accelerated_mode(stru
+               clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr);
+               power_down_all_hw_blocks(dc);
++
++              /* DSC could be enabled on eDP during VBIOS post.
++               * To clean up dsc blocks if eDP is in link but not active.
++               */
++              if (edp_link_with_sink && (edp_stream_num == 0))
++                      clean_up_dsc_blocks(dc);
++
+               disable_vga_and_power_gate_all_controllers(dc);
+               if (edp_link_with_sink && !keep_edp_vdd_on)
+                       dc->hwss.edp_power_control(edp_link_with_sink, false);
diff --git a/queue-6.10/drm-amd-display-disable-symclk32_le-root-clock-gating.patch b/queue-6.10/drm-amd-display-disable-symclk32_le-root-clock-gating.patch
new file mode 100644 (file)
index 0000000..290be96
--- /dev/null
@@ -0,0 +1,37 @@
+From ae5100805f98641ea4112241e350485c97936bbe Mon Sep 17 00:00:00 2001
+From: Sung Joon Kim <Sungjoon.Kim@amd.com>
+Date: Tue, 27 Aug 2024 14:49:44 -0400
+Subject: drm/amd/display: Disable SYMCLK32_LE root clock gating
+
+From: Sung Joon Kim <Sungjoon.Kim@amd.com>
+
+commit ae5100805f98641ea4112241e350485c97936bbe upstream.
+
+[WHY & HOW]
+On display on sequence, enabling SYMCLK32_LE root clock gating
+causes issue in link training so disabling it is needed.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Signed-off-by: Sung Joon Kim <Sungjoon.Kim@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
+@@ -736,7 +736,7 @@ static const struct dc_debug_options deb
+                       .hdmichar = true,
+                       .dpstream = true,
+                       .symclk32_se = true,
+-                      .symclk32_le = true,
++                      .symclk32_le = false,
+                       .symclk_fe = true,
+                       .physymclk = true,
+                       .dpiasymclk = true,
diff --git a/queue-6.10/drm-amd-display-enable-dml2-override_det_buffer_size_kbytes.patch b/queue-6.10/drm-amd-display-enable-dml2-override_det_buffer_size_kbytes.patch
new file mode 100644 (file)
index 0000000..989bc0c
--- /dev/null
@@ -0,0 +1,51 @@
+From f57b77d667dc6bd2b114d08d04b03869539209f6 Mon Sep 17 00:00:00 2001
+From: Yihan Zhu <Yihan.Zhu@amd.com>
+Date: Mon, 26 Aug 2024 14:44:04 -0400
+Subject: drm/amd/display: Enable DML2 override_det_buffer_size_kbytes
+
+From: Yihan Zhu <Yihan.Zhu@amd.com>
+
+commit f57b77d667dc6bd2b114d08d04b03869539209f6 upstream.
+
+[WHY]
+Corrupted screen will be observed when 4k144 DP/HDMI display and
+4k144 eDP are connected, changing eDP refresh rate from 60Hz to 144Hz.
+
+[HOW]
+override_det_buffer_size_kbytes should be true for DCN35/DCN351.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Roman Li <roman.li@amd.com>
+Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Signed-off-by: Yihan Zhu <Yihan.Zhu@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c   |    1 +
+ drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c |    1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
+@@ -2150,6 +2150,7 @@ static bool dcn35_resource_construct(
+       dc->dml2_options.max_segments_per_hubp = 24;
+       dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/
++      dc->dml2_options.override_det_buffer_size_kbytes = true;
+       if (dc->config.sdpif_request_limit_words_per_umc == 0)
+               dc->config.sdpif_request_limit_words_per_umc = 16;/*todo*/
+--- a/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
+@@ -2132,6 +2132,7 @@ static bool dcn351_resource_construct(
+       dc->dml2_options.max_segments_per_hubp = 24;
+       dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/
++      dc->dml2_options.override_det_buffer_size_kbytes = true;
+       if (dc->config.sdpif_request_limit_words_per_umc == 0)
+               dc->config.sdpif_request_limit_words_per_umc = 16;/*todo*/
diff --git a/queue-6.10/drm-amd-display-round-calculated-vtotal.patch b/queue-6.10/drm-amd-display-round-calculated-vtotal.patch
new file mode 100644 (file)
index 0000000..fae4f00
--- /dev/null
@@ -0,0 +1,37 @@
+From c03fca619fc687338a3b6511fdbed94096abdf79 Mon Sep 17 00:00:00 2001
+From: Robin Chen <robin.chen@amd.com>
+Date: Fri, 23 Aug 2024 15:00:28 +0800
+Subject: drm/amd/display: Round calculated vtotal
+
+From: Robin Chen <robin.chen@amd.com>
+
+commit c03fca619fc687338a3b6511fdbed94096abdf79 upstream.
+
+[WHY]
+The calculated vtotal may has 1 line deviation. To get precisely
+vtotal number, round the vtotal result.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Anthony Koo <anthony.koo@amd.com>
+Signed-off-by: Robin Chen <robin.chen@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/modules/freesync/freesync.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
++++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+@@ -134,7 +134,7 @@ unsigned int mod_freesync_calc_v_total_f
+       v_total = div64_u64(div64_u64(((unsigned long long)(
+                       frame_duration_in_ns) * (stream->timing.pix_clk_100hz / 10)),
+-                      stream->timing.h_total), 1000000);
++                      stream->timing.h_total) + 500000, 1000000);
+       /* v_total cannot be less than nominal */
+       if (v_total < stream->timing.v_total) {
diff --git a/queue-6.10/drm-amd-display-skip-to-enable-dsc-if-it-has-been-off.patch b/queue-6.10/drm-amd-display-skip-to-enable-dsc-if-it-has-been-off.patch
new file mode 100644 (file)
index 0000000..fbed2e1
--- /dev/null
@@ -0,0 +1,81 @@
+From 4bdc5b504af7de1f649004cfdd37445d36db6703 Mon Sep 17 00:00:00 2001
+From: Zhikai Zhai <zhikai.zhai@amd.com>
+Date: Tue, 27 Aug 2024 14:06:01 +0800
+Subject: drm/amd/display: Skip to enable dsc if it has been off
+
+From: Zhikai Zhai <zhikai.zhai@amd.com>
+
+commit 4bdc5b504af7de1f649004cfdd37445d36db6703 upstream.
+
+[WHY]
+It makes DSC enable when we commit the stream which need
+keep power off, and then it will skip to disable DSC if
+pipe reset at this situation as power has been off. It may
+cause the DSC unexpected enable on the pipe with the
+next new stream which doesn't support DSC.
+
+[HOW]
+Check the DSC used on current pipe status when update stream.
+Skip to enable if it has been off. The operation enable
+DSC should happen when set power on.
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
+Signed-off-by: Zhikai Zhai <zhikai.zhai@amd.com>
+Signed-off-by: Alex Hung <alex.hung@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c |   14 ++++++++++++++
+ drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c |   13 +++++++++++++
+ 2 files changed, 27 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
++++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+@@ -991,6 +991,20 @@ static void update_dsc_on_stream(struct
+               struct dsc_config dsc_cfg;
+               struct dsc_optc_config dsc_optc_cfg = {0};
+               enum optc_dsc_mode optc_dsc_mode;
++              struct dcn_dsc_state dsc_state = {0};
++
++              if (!dsc) {
++                      DC_LOG_DSC("DSC is NULL for tg instance %d:", pipe_ctx->stream_res.tg->inst);
++                      return;
++              }
++
++              if (dsc->funcs->dsc_read_state) {
++                      dsc->funcs->dsc_read_state(dsc, &dsc_state);
++                      if (!dsc_state.dsc_fw_en) {
++                              DC_LOG_DSC("DSC has been disabled for tg instance %d:", pipe_ctx->stream_res.tg->inst);
++                              return;
++                      }
++              }
+               /* Enable DSC hw block */
+               dsc_cfg.pic_width = (stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt;
+--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
++++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
+@@ -375,7 +375,20 @@ static void update_dsc_on_stream(struct
+               struct dsc_config dsc_cfg;
+               struct dsc_optc_config dsc_optc_cfg = {0};
+               enum optc_dsc_mode optc_dsc_mode;
++              struct dcn_dsc_state dsc_state = {0};
++              if (!dsc) {
++                      DC_LOG_DSC("DSC is NULL for tg instance %d:", pipe_ctx->stream_res.tg->inst);
++                      return;
++              }
++
++              if (dsc->funcs->dsc_read_state) {
++                      dsc->funcs->dsc_read_state(dsc, &dsc_state);
++                      if (!dsc_state.dsc_fw_en) {
++                              DC_LOG_DSC("DSC has been disabled for tg instance %d:", pipe_ctx->stream_res.tg->inst);
++                              return;
++                      }
++              }
+               /* Enable DSC hw block */
+               dsc_cfg.pic_width = (stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt;
+               dsc_cfg.pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom;
diff --git a/queue-6.10/drm-amd-display-validate-backlight-caps-are-sane.patch b/queue-6.10/drm-amd-display-validate-backlight-caps-are-sane.patch
new file mode 100644 (file)
index 0000000..691d229
--- /dev/null
@@ -0,0 +1,60 @@
+From 327e62f47eb57ae5ff63de82b0815557104e439a Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Fri, 13 Sep 2024 13:00:39 -0500
+Subject: drm/amd/display: Validate backlight caps are sane
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 327e62f47eb57ae5ff63de82b0815557104e439a upstream.
+
+Currently amdgpu takes backlight caps provided by the ACPI tables
+on systems as is.  If the firmware sets maximums that are too low
+this means that users don't get a good experience.
+
+To avoid having to maintain a quirk list of such systems, do a sanity
+check on the values.  Check that the spread is at least half of the
+values that amdgpu would use if no ACPI table was found and if not
+use the amdgpu defaults.
+
+Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3020
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -4149,6 +4149,7 @@ static int amdgpu_dm_mode_config_init(st
+ #define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 12
+ #define AMDGPU_DM_DEFAULT_MAX_BACKLIGHT 255
++#define AMDGPU_DM_MIN_SPREAD ((AMDGPU_DM_DEFAULT_MAX_BACKLIGHT - AMDGPU_DM_DEFAULT_MIN_BACKLIGHT) / 2)
+ #define AUX_BL_DEFAULT_TRANSITION_TIME_MS 50
+ static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm,
+@@ -4163,6 +4164,21 @@ static void amdgpu_dm_update_backlight_c
+               return;
+       amdgpu_acpi_get_backlight_caps(&caps);
++
++      /* validate the firmware value is sane */
++      if (caps.caps_valid) {
++              int spread = caps.max_input_signal - caps.min_input_signal;
++
++              if (caps.max_input_signal > AMDGPU_DM_DEFAULT_MAX_BACKLIGHT ||
++                  caps.min_input_signal < AMDGPU_DM_DEFAULT_MIN_BACKLIGHT ||
++                  spread > AMDGPU_DM_DEFAULT_MAX_BACKLIGHT ||
++                  spread < AMDGPU_DM_MIN_SPREAD) {
++                      DRM_DEBUG_KMS("DM: Invalid backlight caps: min=%d, max=%d\n",
++                                    caps.min_input_signal, caps.max_input_signal);
++                      caps.caps_valid = false;
++              }
++      }
++
+       if (caps.caps_valid) {
+               dm->backlight_caps[bl_idx].caps_valid = true;
+               if (caps.aux_support)
index 2bd1d3f8e51a526e9e4db6b3122db39edb6bd9a4..a889a53040c39452ab59343a28f9faec58dbdcd8 100644 (file)
@@ -498,3 +498,10 @@ drm-amd-display-skip-recompute-dsc-params-if-no-stream-on-link.patch
 drm-amdgpu-mes11-reduce-timeout.patch
 drm-amdgpu-vcn-enable-av1-on-both-instances.patch
 drm-amd-display-add-hdmi-dsc-native-ycbcr422-support.patch
+drm-amd-display-round-calculated-vtotal.patch
+drm-amd-display-clean-up-dsc-blocks-in-accelerated-mode.patch
+drm-amd-display-validate-backlight-caps-are-sane.patch
+drm-amd-display-disable-symclk32_le-root-clock-gating.patch
+drm-amd-display-block-dynamic-ips2-on-dcn35-for-incompatible-fw-versions.patch
+drm-amd-display-enable-dml2-override_det_buffer_size_kbytes.patch
+drm-amd-display-skip-to-enable-dsc-if-it-has-been-off.patch