On Thu, May 28, 2026 at 12:49:06AM -0500, Mario Limonciello (AMD) wrote:
> The legacy backlight control interface can only be disabled when both
> the client and driver have agreed that the luminance can be set during
> a modeset. Add capability for the client to register and for the driver
> to indicate support.
> 
> When a luminance-aware client sets DRM_CLIENT_CAP_LUMINANCE, each
> DRM-connected backlight on the device is marked as taken over. Writes
> to the legacy /sys/class/backlight/<dev>/brightness attribute then
> return -EBUSY until the last luminance-aware client clears the cap or
> closes its DRM file. The takeover follows the active backlight_device
> when drm_backlight_link() retargets the link.
> 
> Signed-off-by: Mario Limonciello (AMD) <[email protected]>
> ---
> v4:
>  * Update unit for luminance
>  * Disable backlight of other connectors on same CRTC
>  * handle CRTC disconnect
>  * Make DRM_CLIENT_CAP_LUMINANCE actually inhibit legacy sysfs writes
>    with -EBUSY
> ---
>  drivers/gpu/drm/drm_atomic_helper.c |  1 +
>  drivers/gpu/drm/drm_atomic_uapi.c   | 59 ++++++++++++++++++++++++++++-
>  drivers/gpu/drm/drm_backlight.c     | 41 +++++++++++++++++++-
>  drivers/gpu/drm/drm_file.c          |  5 +++
>  drivers/gpu/drm/drm_ioctl.c         | 17 +++++++++
>  drivers/video/backlight/backlight.c |  7 ++++
>  include/drm/drm_backlight.h         |  5 +++
>  include/drm/drm_connector.h         |  5 +++
>  include/drm/drm_drv.h               |  7 ++++
>  include/drm/drm_file.h              |  8 ++++
>  include/linux/backlight.h           |  8 ++++
>  include/uapi/drm/drm.h              | 10 +++++
>  12 files changed, 170 insertions(+), 3 deletions(-)

Tested-by: Dmitry Baryshkov <[email protected]> # SM8150-HDK

I'll perform a full review later (hopefully today)

-- 
With best wishes
Dmitry

Reply via email to