Re: [PATCH v2 1/4] drm/amd/display: keep custom brightness curve in userspace domain

From: Andrei Rusu de Castro

Date: Fri Oct 23 2026 - 21:34:10 EST


On 10/12/26 22:06, Mario Limonciello wrote:
> There has already been some competing changes for how the power module
> integration handling works in amd-staging-drm-next.
>
> I wanted to see how your series was on top of it, but it doesn't apply
> anymore. [1] Can you please rebase your series and re-evaluate?
>
> If it still makes sense (in your view); please send out a v3.

Thanks for trying it. I rebased onto amd-staging-drm-next (77f548b12).

Patch 1 is still needed: convert_custom_brightness() still adds the
firmware minimum before convert_brightness_from_user() adds it again.
Since Ray's "drm/amd/display: map PWM brightness through custom
backlight curve" that only reaches AUX panels with a custom curve on
staging, plus PWM panels on stable kernels before the power module.
v3 has patches 1 and 2 only:
https://lore.kernel.org/r/cover.1792805565.git.arc@empyreal.works

Patches 3 and 4 overlap with Ray's change, so I'm dropping them. Two
things in the new PWM path look unintended, though. Numbers below are
from a ROG Flow Z13 (GZ302EA, Strix Halo) on 7.3.0, writing amdgpu_bl1
and reading amdgpu_target_backlight_pwm. ATIF reports min 12, max 255
and a 49-point curve (50% luminance at signal 98, 62% at 129).

- convert_brightness_to_millipercent() clamps the request to
[min..max] before scaling it as [0..max]. Every request from 0 to
3598, the bottom 5.5% of the range, gives PWM 3598, and the panel
minimum of 3084 is never used.

- The request is mapped through the ATIF curve to a luminance
percentage, and the power module maps that back to PWM through its
LUT, built from the same points. The two steps cancel, so PWM follows
the request one to one: 25% gives 16576, 50% gives 33153, 80% gives
52428. By the panel's own curve that is 35%, 62% and 86% luminance.
Passing the request straight through as millipercent would give 25%,
50% and 80%. If sysfs values are meant to stay signal levels this is
fine, but then the custom curve no longer shapes the response on
these panels.

On AUX, brightness_mask is still ORed into the millinit value before
mod_power_set_backlight_nits(), which is an intermediate unit (the
Sashiko finding from v2).

If these aren't intended I can send a follow-up on top of Ray's patch,
or leave it to him if he prefers.

Thanks,
Andrei