mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Avoid using zero AC/DC brightness levels
@ 2026-05-26 21:00 Edson Juliano Drosdeck
  2026-05-28 21:17 ` Mario Limonciello
  0 siblings, 1 reply; 6+ messages in thread
From: Edson Juliano Drosdeck @ 2026-05-26 21:00 UTC (permalink / raw)
  To: harry.wentland
  Cc: sunpeng.li, siqueira, alexander.deucher, christian.koenig,
	airlied, simona, mario.limonciello, alex.hung, Wayne.Lin,
	timur.kristof, superm1, aurabindo.pillai, ivan.lipski,
	chen-yu.chen, amd-gfx, dri-devel, linux-kernel, edson.drosdeck

Some systems report zero AC/DC brightness levels during
backlight initialization, causing the panel brightness to
start at the minimum level on boot.

Only use the firmware brightness levels when both AC and DC
values are non-zero

Signed-off-by: Edson Juliano Drosdeck <edson.drosdeck@gmail.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 5fc5d5608506..f947ce2a8625 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5380,7 +5380,9 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
 	}
 
 	caps = &dm->backlight_caps[aconnector->bl_idx];
-	if (get_brightness_range(caps, &min, &max)) {
+	if (get_brightness_range(caps, &min, &max) &&
+	    caps->ac_level > 0 &&
+	    caps->dc_level > 0) {
 		if (power_supply_is_system_supplied() > 0)
 			props.brightness = DIV_ROUND_CLOSEST((max - min) * caps->ac_level, 100);
 		else
-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-08 18:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-26 21:00 [PATCH] drm/amd/display: Avoid using zero AC/DC brightness levels Edson Juliano Drosdeck
2026-05-28 21:17 ` Mario Limonciello
2026-05-29 19:13   ` edson drosdeck
2026-06-03 19:23     ` Mario Limonciello
2026-06-08 18:25       ` edson drosdeck
2026-06-08 18:34         ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®