]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2024 10:03:40 +0000 (12:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2024 10:03:40 +0000 (12:03 +0200)
added patches:
drm-amd-display-round-calculated-vtotal.patch
drm-amd-display-validate-backlight-caps-are-sane.patch

queue-6.6/drm-amd-display-round-calculated-vtotal.patch [new file with mode: 0644]
queue-6.6/drm-amd-display-validate-backlight-caps-are-sane.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/drm-amd-display-round-calculated-vtotal.patch b/queue-6.6/drm-amd-display-round-calculated-vtotal.patch
new file mode 100644 (file)
index 0000000..c74ac7a
--- /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
+@@ -133,7 +133,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.6/drm-amd-display-validate-backlight-caps-are-sane.patch b/queue-6.6/drm-amd-display-validate-backlight-caps-are-sane.patch
new file mode 100644 (file)
index 0000000..e1574d5
--- /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
+@@ -4037,6 +4037,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,
+@@ -4051,6 +4052,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 780c0618e76f8e32f37bb2c7cdd3f5129d265371..db2d6322ff74d18a6584c240028f9e8f1a8eef04 100644 (file)
@@ -421,3 +421,5 @@ kvm-x86-move-x2apic-icr-helper-above-kvm_apic_write_nodecode.patch
 kvm-use-dedicated-mutex-to-protect-kvm_usage_count-to-avoid-deadlock.patch
 drm-amd-display-skip-recompute-dsc-params-if-no-stream-on-link.patch
 drm-amd-display-add-hdmi-dsc-native-ycbcr422-support.patch
+drm-amd-display-round-calculated-vtotal.patch
+drm-amd-display-validate-backlight-caps-are-sane.patch