]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Jul 2025 09:25:08 +0000 (11:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Jul 2025 09:25:08 +0000 (11:25 +0200)
added patches:
drm-amd-display-add-debugging-message-for-brightness-caps.patch
drm-amd-display-fix-default-dc-and-ac-levels.patch

queue-6.15/drm-amd-display-add-debugging-message-for-brightness-caps.patch [new file with mode: 0644]
queue-6.15/drm-amd-display-fix-default-dc-and-ac-levels.patch [new file with mode: 0644]
queue-6.15/series

diff --git a/queue-6.15/drm-amd-display-add-debugging-message-for-brightness-caps.patch b/queue-6.15/drm-amd-display-add-debugging-message-for-brightness-caps.patch
new file mode 100644 (file)
index 0000000..e95ca8a
--- /dev/null
@@ -0,0 +1,52 @@
+From 4b61b8a390511a1864f26cc42bab72881e93468d Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 14 May 2025 16:00:43 -0500
+Subject: drm/amd/display: Add debugging message for brightness caps
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 4b61b8a390511a1864f26cc42bab72881e93468d upstream.
+
+[Why]
+Default BIOS brightness caps are buried in ACPI.
+
+[How]
+Add extra dynamic debug that can show default brightness caps.
+
+Reviewed-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Wayne Lin <wayne.lin@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/amdgpu_dm/amdgpu_dm.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -4834,6 +4834,7 @@ amdgpu_dm_register_backlight_device(stru
+       struct backlight_properties props = { 0 };
+       struct amdgpu_dm_backlight_caps caps = { 0 };
+       char bl_name[16];
++      int min, max;
+       if (aconnector->bl_idx == -1)
+               return;
+@@ -4846,11 +4847,15 @@ amdgpu_dm_register_backlight_device(stru
+       }
+       amdgpu_acpi_get_backlight_caps(&caps);
+-      if (caps.caps_valid) {
++      if (caps.caps_valid && get_brightness_range(&caps, &min, &max)) {
+               if (power_supply_is_system_supplied() > 0)
+                       props.brightness = caps.ac_level;
+               else
+                       props.brightness = caps.dc_level;
++              /* min is zero, so max needs to be adjusted */
++              props.max_brightness = max - min;
++              drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,
++                      caps.ac_level, caps.dc_level);
+       } else
+               props.brightness = AMDGPU_MAX_BL_LEVEL;
diff --git a/queue-6.15/drm-amd-display-fix-default-dc-and-ac-levels.patch b/queue-6.15/drm-amd-display-fix-default-dc-and-ac-levels.patch
new file mode 100644 (file)
index 0000000..db60fb0
--- /dev/null
@@ -0,0 +1,40 @@
+From 8b5f3a229a70d242322b78c8e13744ca00212def Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 14 May 2025 16:06:40 -0500
+Subject: drm/amd/display: Fix default DC and AC levels
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 8b5f3a229a70d242322b78c8e13744ca00212def upstream.
+
+[Why]
+DC and AC levels are advertised in a percentage, not a luminance.
+
+[How]
+Scale DC and AC levels to supported values.
+
+Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4221
+Reviewed-by: Alex Hung <alex.hung@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Wayne Lin <wayne.lin@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/amdgpu_dm/amdgpu_dm.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -4849,9 +4849,9 @@ amdgpu_dm_register_backlight_device(stru
+       amdgpu_acpi_get_backlight_caps(&caps);
+       if (caps.caps_valid && get_brightness_range(&caps, &min, &max)) {
+               if (power_supply_is_system_supplied() > 0)
+-                      props.brightness = caps.ac_level;
++                      props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps.ac_level, 100);
+               else
+-                      props.brightness = caps.dc_level;
++                      props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps.dc_level, 100);
+               /* min is zero, so max needs to be adjusted */
+               props.max_brightness = max - min;
+               drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,
index 243f3b004ee433dfd605d053896daf19008d21c4..c6970d09e1616a2904c19ec5af3ee732c3550977 100644 (file)
@@ -256,3 +256,5 @@ s390-ptrace-fix-pointer-dereferencing-in-regs_get_kernel_stack_nth.patch
 io_uring-kbuf-flag-partial-buffer-mappings.patch
 io_uring-gate-req_f_isreg-on-s_anon_inode-as-well.patch
 riscv-uaccess-only-restore-the-csr_status-sum-bit.patch
+drm-amd-display-add-debugging-message-for-brightness-caps.patch
+drm-amd-display-fix-default-dc-and-ac-levels.patch