From: Ray Wu <ray.wu@amd.com>
To: Hugo Sales <hugo@hsal.es>,
alexander.deucher@amd.com, sunpeng.li@amd.com,
harry.wentland@amd.com, siqueira@igalia.com,
amd-gfx@lists.freedesktop.org
Cc: simona@ffwll.ch, alex.hung@amd.com, mario.limonciello@amd.com,
linux-kernel@vger.kernel.org, lohita.mudimela@amd.com,
bhawanpreet.lakha@amd.com, dri-devel@lists.freedesktop.org,
roman.li@amd.com, airlied@gmail.com, christian.koenig@amd.com
Subject: Re: [PATCH RFC RFT 0/8] drm/amd/display: Stop rounding backlight levels to whole percents
Date: Wed, 11 Nov 2026 17:22:56 +0800 [thread overview]
Message-ID: <7099a8ba-6508-4771-a97f-c681d0a8ceae@amd.com> (raw)
In-Reply-To: <20261103-backlight-curve-rfc-v1-0-6e4813a8f2eb@hsal.es>
[-- Attachment #1: Type: text/plain, Size: 6636 bytes --]
Hi Hugo,
Thanks for the series and for digging into this.
I have been working on a similar backlight update that takes a different
approach: instead of fixing the conversion in amdgpu_dm, it removes it.
DM passes a linear brightness percentage for every panel type, and the
power module does all of the conversion:
- VESA AUX: nits, mapped linearly over the panel luminance range
from EDID.
- AMD AUX: nits on OLED, PWM otherwise.
- PWM: through the power module LUT built from the ATIF curve.
With that, most of this series no longer applies, since the DM code it
touches is gone.
Patches 2/8 and 3/8 (LUT interpolation in the power module) are still
useful on top of it, and I have already given my Reviewed-by on those.
Could you test it on your machine?
drm/amd/display: Use panel luminance range for AUX backlight in power
module
drm/amd/display: Add power module API to set brightness percent
drm/amd/display: Pass linear brightness percent to power module
drm/amd/display: Read PWM back linearly with the linear backlight curve
Thanks,
Ray
On 11/4/2026 5:55 PM, Hugo Sales wrote:
> Both backlight paths in amdgpu_dm_backlight.c map the 16-bit user level
> through the ATIF custom brightness curve, whose points pair an 8-bit
> signal with a whole-percent luminance. Both round the level to one of
> those signals and the luminance to a whole percent first. That hurts
> most at the dim end, where one percent is a large share of the light.
> With the curve of an ASUS ROG Flow X13 GV301QH, minimum 12 and 49
> points:
>
> - On PWM, the lowest level asks for 2% of full brightness, and the
> first 2% of the scale steps from there to 3%, 4% and 5%. Each step is
> 50%, 33% and 25% brighter than the one before. The bottom 10% of the
> scale has 18 different brightness values
> - On AUX, with amdgpu.backlight=1 to force the unsupported AUX path,
> the 1..512 nits fallback range stays at 1 nit for the bottom 6.1% of
> the scale, and the next steps go to 3, 5 and 7 nits. The bottom 10%
> of the scale has 4 different values, and the top stops at 496 nits
>
> This series interpolates on the unrounded level and rounds once at the
> end. On PWM, the power module also interpolates between its LUT entries
> now, from millipercent to PWM and back. The bottom 10% of the scale then
> has 6018 different values on PWM instead of 18, and 33311 on AUX instead
> of 4. Level 0 still gives the panel's minimum and the top level gives
> its maximum. On AUX only levels 0 and 1 now sit at the minimum, instead
> of the bottom 6.1% of the scale
>
> - Patch 1 renames the min and max of the user range to user_min and
> user_max, to avoid confusion with the curve's signal_max and the
> output_max that patch 4 adds. No functional change
> - Patches 2 and 3 interpolate between the power module's LUT entries,
> from millipercent to PWM and back
> - Patch 4 stops rounding the PWM path
> - Patches 5 and 6 test the PWM path and the LUT with the GV301QH curve
> - Patch 7 maps AUX through the same curve code as PWM, which reaches
> max at the top, and removes convert_custom_brightness()
> - Patch 8 tests the AUX path
>
> Patch 7 changes what an AUX panel gets. Until now an AUX level asked for
> the curve's luminance percentage times the level, so the level went in
> twice. Now it asks for min plus that percentage of the range above min,
> the same luminance the PWM path asks the power module for. On the
> fallback range, half the scale goes from 159 nits to 315 nits. I found
> no reason for the old product, but I may be missing the intent. I also
> can't test it meaningfully, as I don't have a panel with an AUX
> backlight
>
> The series applies on top of "drm/amd/display: Fix the doubled AUX
> backlight minimum on the custom curve" [1]. That series fixes the
> minimum going in twice on AUX, and asks whether the ATIF curve is meant
> for AUX at all. Patch 7 keeps applying the curve on AUX, as the code
> always has. Since it changes what AUX panels get, it has no Fixes: tags
>
> One question for you: on PWM, above the last point the curve still runs
> to 100% at max_input_signal, as backlight_signal_to_luminance() did,
> while the level maps to the 0..255 signal scale over the whole user
> range. With max_input_signal below 255 the top of the PWM scale is flat
> at full brightness. AUX keeps ending the curve at 255, as it did
> before. Should PWM end at 255 too?
>
> This is also a request for testing. My laptop drives its panel over PWM,
> and the panel ignores AMD's AUX brightness, so I tested the AUX path
> only with KUnit and with the amdgpu_dm_brightness trace on a forced AUX
> path. If you have a panel with an AUX backlight and an ATIF custom
> curve, a Tested-by on patches 7 and 8 would help. The middle of the
> scale should get brighter, the bottom should no longer sit at the
> minimum and the top should reach full brightness. Patches 1 to 6 don't
> depend on them, so they can go in without the AUX half
>
> [1] https://lore.kernel.org/r/20261103-amdgpu-aux-curve-min-v1-0-62119efdcc6d@hsal.es
>
> Signed-off-by: Hugo Sales <hugo@hsal.es>
> ---
> Hugo Sales (8):
> drm/amd/display: Rename the user brightness range to user_min and user_max
> drm/amd/display: Interpolate between backlight LUT entries
> drm/amd/display: Interpolate when reading PWM back as a percentage
> drm/amd/display: Stop rounding PWM brightness to whole percents
> drm/amd/display: Add KUnit tests for the custom brightness curve
> drm/amd/display: Add KUnit tests for backlight LUT interpolation
> drm/amd/display: Map AUX brightness through the custom curve like PWM
> drm/amd/display: Add KUnit tests for the AUX custom brightness curve
>
> .../amd/display/amdgpu_dm/amdgpu_dm_backlight.c | 218 ++---
> .../amd/display/amdgpu_dm/amdgpu_dm_backlight.h | 6 +-
> .../amdgpu_dm/tests/amdgpu_dm_backlight_test.c | 923 +++++++++++++++------
> .../gpu/drm/amd/display/modules/power/power_abm.c | 72 +-
> .../drm/amd/display/modules/power/power_helpers.h | 4 +
> 5 files changed, 784 insertions(+), 439 deletions(-)
> ---
> base-commit: ba496bb837882eb1af58f41572fc289e46c77b8c
> change-id: 20261102-backlight-curve-rfc-1bb4b6dee24c
> prerequisite-message-id: <20261103-amdgpu-aux-curve-min-v1-0-62119efdcc6d@hsal.es>
> prerequisite-patch-id: 0eefd25bf4ad8f6d779c7a0b0a63f84969b67fca
> prerequisite-patch-id: 016515673f79f623de1e50dd513e5440587329b6
> prerequisite-patch-id: ba453baf376b5410d66feacb1956eea933042ae8
>
> Best regards,
> --
> Hugo Sales <hugo@hsal.es>
[-- Attachment #2: dm-bl-pm-curve-patches.tar.gz --]
[-- Type: application/x-gzip, Size: 11037 bytes --]
prev parent reply other threads:[~2026-11-11 9:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 9:55 Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 1/8] drm/amd/display: Rename the user brightness range to user_min and user_max Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 2/8] drm/amd/display: Interpolate between backlight LUT entries Hugo Sales
2026-11-11 7:49 ` Ray Wu
2026-11-04 9:55 ` [PATCH RFC RFT 3/8] drm/amd/display: Interpolate when reading PWM back as a percentage Hugo Sales
2026-11-11 7:50 ` Ray Wu
2026-11-04 9:55 ` [PATCH RFC RFT 4/8] drm/amd/display: Stop rounding PWM brightness to whole percents Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 5/8] drm/amd/display: Add KUnit tests for the custom brightness curve Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 6/8] drm/amd/display: Add KUnit tests for backlight LUT interpolation Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 7/8] drm/amd/display: Map AUX brightness through the custom curve like PWM Hugo Sales
2026-11-04 9:55 ` [PATCH RFC RFT 8/8] drm/amd/display: Add KUnit tests for the AUX custom brightness curve Hugo Sales
2026-11-11 9:22 ` Ray Wu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7099a8ba-6508-4771-a97f-c681d0a8ceae@amd.com \
--to=ray.wu@amd.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bhawanpreet.lakha@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hugo@hsal.es \
--cc=linux-kernel@vger.kernel.org \
--cc=lohita.mudimela@amd.com \
--cc=mario.limonciello@amd.com \
--cc=roman.li@amd.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®