New: amdgpu: brightness 100% blacks out screen
https://bugzilla.kernel.org/show_bug.cgi?id=221865
Bug ID: 221865
Summary: amdgpu: brightness 100% blacks out screen
Product: Drivers
Version: 2.5
Hardware: AMD
OS: Linux
Status: NEW
Severity: normal
Priority: P3
Component: Video(DRI - non Intel)
Assignee: [email protected]
Reporter: [email protected]
Regression: No
Hardware:
- ASUS ROG laptop, AMD Phoenix1 APU (DCN 3.1.4), eDP panel BOE NE134WUM-N82 (EISA BOE0B4A)
- Kernel 7.1.6 (regression: 7.1.5 works fine)
Symptom: Setting backlight above ~98.4% makes the internal display go black. Setting it back down recovers instantly.
Diagnosis via amdgpu_dm_brightness tracepoint (/sys/kernel/tracing):
requested=64200 converted=65302 (works) requested=64300 converted=65535 (true max, works) requested=64500 converted=65535 (true max, works) requested=64540 converted=65768 (> 65535, BLACK) requested=65535 converted=66702 (> 65535, BLACK)
Root cause: convert_custom_brightness() in drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:*user_brightness = scale_fw_to_input(min, max, DIV_ROUND_CLOSEST(lum * brightness, 101));
The panel's ATIF QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS (from ASUS BIOS) returns luminance data points >100 (~103). So lum * brightness / 101 exceeds 65535, and the result is passed as backlight_pwm_u16_16 (u16) to dc_link_set_backlight_level(), truncating to ~232 → black screen.
Regression: 7.1.6 changed amdgpu_dm_register_backlight_device() from props.max_brightness = max - min / (max-min)*level/100 to max / max*level/100, exposing the overflow zone to userspace. 7.1.5's 100% mapped below the overflow threshold.
Suggested fix: clamp the converted level to max (this is what the hardware accepts — 65535 is valid full brightness, the plateau at requested 64300–64500 proves it):
static u32 convert_brightness_from_user(const struct amdgpu_dm_backlight_caps *caps, uint32_t brightness)
{
unsigned int min, max;
if (!get_brightness_range(caps, &min, &max))
return brightness;
convert_custom_brightness(caps, min, max, &brightness);
return min_t(u32, min + DIV_ROUND_CLOSEST_ULL((u64)(max - min) *brightness, max), max);
}
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 221865] amdgpu: brightness 100% blacks out screen
https://bugzilla.kernel.org/show_bug.cgi?id=221865
[email protected] changed:
What |Removed |Added
----------------------------------------------------------------------------
Kernel Version| |7.1.6
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 221865] amdgpu: brightness 100% blacks out screen
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=221865
[email protected] changed:
What |Removed |Added
----------------------------------------------------------------------------
Regression|No |Yes
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 221865] amdgpu: brightness 100% blacks out screen
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=221865
Artem S. Tashkinov ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |ANSWERED--- Comment #1 from Artem S. Tashkinov ([email protected]) --- Already marked as a dupe of
https://gitlab.freedesktop.org/drm/amd/-/work_items/5562
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.