At Display Next Hackfest 2026 we reviewed progress moving brightness
control into the DRM connector properties.

There is a range LUMINANCE property that will default to 0->0.
Once a driver attaches a backlight it will be updated to 1->max.
If the panel supports the minimum backlight turning off the display
the range can later be updated to 0->max instead of 1->max.

The legacy sysfs interface is synchronized with the DRM connector.
When a compositor using this feature is loaded, sysfs writes are disabled
to prevent legacy tools from going out of sync with the compositor.

This has an implementation initially for amdgpu, i915, and Xe with eDP
connectors.  It can be extended to other connectors like DP for displays
that can be controlled via DDC as well later.

The following compositors have implemented matching support:
 * Kwin: https://invent.kde.org/plasma/kwin/-/merge_requests/9298
 * Mutter: 
https://gitlab.gnome.org/swick/mutter/-/commits/wip/kms-luminance-prop
 * Wlroots: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5384

v7->v8:
  - Rebase on v7.3-rc2
  - backlight: add kernel-internal backlight API: 
    - Inhibit legacy "bl_power" sysfs writes during a DRM takeover, not 
      just "brightness", so the takeover is fully exclusive. 
    - backlight_set_brightness() now returns -ENXIO (and skips the uevent) 
      instead of reporting a false success when the device has no ops. 
    - Release ops_lock before emitting the change uevent. 
  - drm: add connector backlight (LUMINANCE) infrastructure: 
    - Take a reference in drm_backlight_get_device() and drop it in the 
      sysfs-link callers to close a use-after-free. 
    - Unlink any still-linked backend in drm_backlight_connector_cleanup() 
      instead of only WARN()ing, so a connector torn down on a probe-error 
      path no longer leaks a global-list entry / pending work item (also 
      removes an unconditional lockdep assertion). 
    - Guard the backend pointer against a concurrent re-link while 
      unlinking. 
    - Drop the redundant luminance restore in the bridge-enable path that 
      dereferenced the live connector state; the commit tail already 
      applies it from the new state. 
  - drm: add DRM_CLIENT_CAP_LUMINANCE: 
    - Serialize the capability change so concurrent ioctls on a shared fd 
      cannot unbalance the inhibit count. 
    - Track the legacy-inhibit device-wide so connectors hotplugged (e.g. 
      DP MST) while the capability is active inherit it, and no longer 
      trigger warnings when the client exits. 
  - drm/amd/display: Pass up errors reading actual brightness: 
    - Also return -EINVAL from the legacy PWM read error path (previously 
      returned the cached value), matching the KUnit test. 
  - drm/amd/display: use drm backlight: 
    - Apply the LUMINANCE property on modeset commits too, and avoid a NULL 
      CRTC-state dereference on brightness-only commits. 
  - drm/xe: Indicate support for luminance on the connector: 
    - Drop an unrelated DRIVER_GEM_GPUVA change squashed in by mistake. 
  - drm/i915/display: use drm backlight: 
    - Remove an unused <drm/drm_backlight.h> include from intel_dp.c. 

Mario Limonciello (12):
  Revert "backlight: Remove notifier"
  backlight: add kernel-internal backlight API
  drm/property: add a per-connector luminance flag
  drm: add connector backlight (LUMINANCE) infrastructure
  drm: add DRM_CLIENT_CAP_LUMINANCE
  drm/amd/display: Pass up errors reading actual brightness
  drm/amd: Indicate driver supports luminance
  drm/amd/display: use drm backlight
  drm/bridge: auto-link panel backlight in bridge connector
  drm/xe: Indicate support for luminance on the connector
  drm/i915: Indicate support for luminance on the connector
  drm/i915/display: use drm backlight

Mario Limonciello (AMD) (2):
  drm/amdgpu: Check bios_scratch_reg_offset in backlight level helper
  drm/amd/display: Update KUnit backlight tests for luminance property
    and fixtures

 drivers/gpu/drm/Kconfig                       |  18 +
 drivers/gpu/drm/Makefile                      |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c  |   7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  15 +-
 .../display/amdgpu_dm/amdgpu_dm_backlight.c   |  36 +-
 .../display/amdgpu_dm/amdgpu_dm_backlight.h   |   2 +-
 .../display/amdgpu_dm/amdgpu_dm_connector.c   |   2 +
 .../tests/amdgpu_dm_backlight_test.c          |  18 +-
 .../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c |   8 +-
 drivers/gpu/drm/bridge/panel.c                |  15 +
 .../gpu/drm/display/drm_bridge_connector.c    |  11 +-
 drivers/gpu/drm/drm_atomic_helper.c           |  35 ++
 drivers/gpu/drm/drm_atomic_uapi.c             |  49 +-
 drivers/gpu/drm/drm_backlight.c               | 550 ++++++++++++++++++
 drivers/gpu/drm/drm_connector.c               |  56 ++
 drivers/gpu/drm/drm_drv.c                     |   8 +
 drivers/gpu/drm/drm_file.c                    |   5 +
 drivers/gpu/drm/drm_ioctl.c                   |  24 +
 drivers/gpu/drm/drm_mode_config.c             |   1 +
 drivers/gpu/drm/drm_property.c                |   6 +
 drivers/gpu/drm/drm_sysfs.c                   |  32 +-
 .../gpu/drm/i915/display/intel_backlight.c    |   6 +
 drivers/gpu/drm/i915/display/intel_display.c  |   7 +-
 drivers/gpu/drm/i915/i915_driver.c            |   1 +
 drivers/gpu/drm/xe/xe_device.c                |   1 +
 drivers/video/backlight/backlight.c           | 108 ++++
 include/drm/drm_atomic_helper.h               |   2 +
 include/drm/drm_backlight.h                   | 166 ++++++
 include/drm/drm_bridge.h                      |   1 +
 include/drm/drm_connector.h                   |  20 +
 include/drm/drm_drv.h                         |   7 +
 include/drm/drm_file.h                        |   8 +
 include/drm/drm_mode_config.h                 |  11 +
 include/drm/drm_property.h                    |  10 +
 include/linux/backlight.h                     |  67 +++
 include/uapi/drm/drm.h                        |  22 +
 37 files changed, 1313 insertions(+), 25 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_backlight.c
 create mode 100644 include/drm/drm_backlight.h

-- 
2.43.0

Reply via email to