All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 00/21] Add support for a DRM backlight capability
@ 2026-10-02 19:00 Mario Limonciello
  2026-10-02 19:00 ` [PATCH v9 01/21] drm: add connector LUMINANCE property Mario Limonciello
                   ` (21 more replies)
  0 siblings, 22 replies; 29+ messages in thread
From: Mario Limonciello @ 2026-10-02 19:00 UTC (permalink / raw)
  To: dri-devel, harry.wentland, Simona Vetter, Alex Deucher,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie
  Cc: Xaver Hugl, amd-gfx,
	open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS,
	open list:INTEL DRM DISPLAY FOR XE AND I915 DRIVERS,
	Mario Limonciello

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.

Version 8 had a lot of review feedback, and the biggest change is that
this no longer has the legacy sysfs interface for brightness control.

There is a Kconfig knob introduced that turns on the new API, and when
the new API is available all drivers will conflict with the old backlight
control API.

This will allow us to land the new brightness control API and the transition
to the new API separately.  *This series only tracks the new API itself.*

Here's the main review items that I tried to cover in v8->v9.

- [x] Javier Martinez Canillas: separate generic DRM luminance infrastructure
      from the backlight-subsystem adapter; let drivers own the hardware path;
      avoid a leaky `drm_backlight_link()` mid-layer.
- [x] Thomas Zimmermann: invoke a connector helper callback from atomic helper
      sequencing; keep backlight-specific state in driver-owned structures and
      helper code rather than embedding it in DRM core objects.
- [x] Thomas Zimmermann, Leo Li, Harry Wentland: make luminance and display
      power/DPMS independent. Preserve requested luminance while a display is
      disabled and apply it when the display is enabled.
- [x] Jani Nikula: remove `IS_REACHABLE()` linkage workarounds and express any
      remaining dependencies through Kconfig.
- [x] Thomas Zimmermann: remove the driver capability flag if userspace can
      discover support by the connector property itself.
- [x] Thomas Zimmermann: remove redundant brightness-change notification and
      DRM readback loops when the committed property already contains the
      authoritative requested value.
- [x] Maxime Ripard: split the new DRM UAPI from legacy sysfs compatibility so
      the property can be reviewed and merged independently.
- [x] Javier Martinez Canillas / Maxime Ripard / Thomas Zimmermann / Xaver Hugl:
      preserve legacy sysfs behavior for legacy userspace; avoid silently
      breaking the de-facto backlight UAPI while DRM-master ownership is
      introduced.
- [x] Harry Wentland / Jani Nikula / Xaver Hugl: terminology reviewed. Retain
      `LUMINANCE` as an explicit author decision, while documenting that the
      property contains relative, driver-defined levels rather than physical
      cd/m^2 values.

As the series changed significantly from all this feedback I did not see value
in a per-patch changelog.  Instead here is the changelog from the whole series:

- Reworked the interface around driver-owned connector helper callbacks.
  Removed the generic DRM backlight adapter, backend-linking layer, and
  backlight state embedded in DRM core objects.
- Made LUMINANCE an atomic connector property whose requested value is
  independent of display power. Disable panel emission before shutting down
  the pipeline, preserve the requested value while inactive, and apply it
  after the pipeline is enabled.
- Removed DRM_CLIENT_CAP_LUMINANCE and the associated per-client takeover,
  legacy sysfs inhibition, property visibility, notification, and hardware
  readback machinery.
- Removed the kernel-internal backlight API and the backlight notifier
  restoration from the series.
- Added the default-off CONFIG_DRM_LUMINANCE option. When disabled, drivers
  retain their existing backlight class devices and userspace ABI. When
  enabled, all DRM-owned brightness implementations migrate to the connector
  property together.
- Migrated AMDGPU, legacy AMD display, i915/Xe, Nouveau, Radeon, GMA500, GUD,
  PS8622, SSD130x, panel and bridge connectors, and the DRM MIPI DBI drivers.
- Added common panel, bridge, and MIPI DBI luminance forwarding helpers.
- Retained the LUMINANCE name, while documenting that values are relative,
  driver-defined levels rather than physical luminance in cd/m^2.
- Added connector property lifecycle coverage and updated the AMD display
  KUnit fixtures for both CONFIG_DRM_LUMINANCE configurations.
- Fixed error propagation when AMD Display Core reads the current brightness
  and guarded legacy AMDGPU backlight scratch-register access.
- Restructured the series from 14 to 21 patches splitting the core
  infrastructure, shared helpers, and individual driver migrations.

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

I've tested this series using Kwin on amdgpu. I've compile tested other
drivers.

The series is also available on this branch for easy testing.

https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/log/?h=superm1/backlight-property-v9

And lastly; I've used an LLM to assist with implementing this version, particularly
on all the drivers I wasn't familiar with.

Assisted-by: LLM

Mario Limonciello (19):
  drm: add connector LUMINANCE property
  drm/amd/display: Pass up errors reading actual brightness
  drm/amd: add luminance property support
  drm/i915/display: add luminance property support
  drm: add panel and bridge connector luminance forwarding
  drm/mipi-dbi: add connector luminance helpers
  drm/tiny: migrate panel-mipi-dbi to connector luminance
  drm/tiny: migrate HX8357D to connector luminance
  drm/tiny: migrate ILI9163 to connector luminance
  drm/tiny: migrate ILI9341 to connector luminance
  drm/tiny: migrate ILI9486 to connector luminance
  drm/tiny: migrate MI0283QT to connector luminance
  drm/sitronix: migrate ST7735R to connector luminance
  drm/nouveau: add connector luminance support
  drm/gud: add connector luminance support
  drm/radeon: add connector luminance support
  drm/gma500: add connector luminance support
  drm/bridge: add PS8622 connector luminance support
  drm/solomon: add SSD130x connector luminance support

Mario Limonciello (AMD) (2):
  drm/amdgpu: Check bios_scratch_reg_offset in backlight level helper
  drm/amd/display: update KUnit luminance fixtures

 drivers/gpu/drm/Kconfig                       |  14 +++
 drivers/gpu/drm/amd/amdgpu/Kconfig            |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c  |   7 +-
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  20 ++++
 .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  17 ++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  22 ++--
 .../display/amdgpu_dm/amdgpu_dm_backlight.c   |  55 +++++++--
 .../display/amdgpu_dm/amdgpu_dm_backlight.h   |   4 +-
 .../display/amdgpu_dm/amdgpu_dm_connector.c   |   7 +-
 .../tests/amdgpu_dm_backlight_test.c          |  47 ++++++--
 .../amdgpu_dm/tests/amdgpu_dm_kunit_helpers.c |   7 +-
 drivers/gpu/drm/bridge/Kconfig                |   2 +-
 drivers/gpu/drm/bridge/panel.c                |  39 +++++++
 drivers/gpu/drm/bridge/parade-ps8622.c        |  45 +++++--
 .../gpu/drm/display/drm_bridge_connector.c    |  65 +++++++++++
 drivers/gpu/drm/drm_atomic_helper.c           |  73 +++++++++++-
 drivers/gpu/drm/drm_atomic_state_helper.c     |   7 ++
 drivers/gpu/drm/drm_atomic_uapi.c             |   5 +
 drivers/gpu/drm/drm_connector.c               |  57 +++++++++
 drivers/gpu/drm/drm_mipi_dbi.c                |  36 ++++++
 drivers/gpu/drm/drm_panel.c                   |  55 +++++++++
 drivers/gpu/drm/gma500/Kconfig                |   2 +-
 drivers/gpu/drm/gma500/backlight.c            |  45 ++++---
 drivers/gpu/drm/gma500/cdv_intel_lvds.c       |   2 +
 drivers/gpu/drm/gma500/psb_drv.c              |   2 +-
 drivers/gpu/drm/gma500/psb_drv.h              |   4 +-
 drivers/gpu/drm/gma500/psb_intel_lvds.c       |   3 +-
 drivers/gpu/drm/gud/Kconfig                   |   2 +-
 drivers/gpu/drm/gud/gud_connector.c           |  48 +++++++-
 drivers/gpu/drm/i915/Kconfig                  |   2 +-
 drivers/gpu/drm/i915/display/icl_dsi.c        |   1 +
 .../gpu/drm/i915/display/intel_backlight.c    |  20 ++++
 .../gpu/drm/i915/display/intel_backlight.h    |   1 +
 drivers/gpu/drm/i915/display/intel_display.c  |   2 +
 drivers/gpu/drm/i915/display/intel_dp.c       |   1 +
 drivers/gpu/drm/i915/display/intel_lvds.c     |   1 +
 drivers/gpu/drm/i915/display/intel_panel.c    |   8 +-
 drivers/gpu/drm/i915/display/vlv_dsi.c        |   1 +
 drivers/gpu/drm/nouveau/Kconfig               |   4 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |   2 +-
 drivers/gpu/drm/nouveau/nouveau_backlight.c   | 110 ++++++++++++++----
 drivers/gpu/drm/nouveau/nouveau_connector.c   |   2 +
 drivers/gpu/drm/nouveau/nouveau_connector.h   |  14 +++
 drivers/gpu/drm/radeon/Kconfig                |   2 +-
 drivers/gpu/drm/radeon/atombios_encoders.c    |  32 ++++-
 drivers/gpu/drm/radeon/radeon_connectors.c    |  34 ++++++
 .../gpu/drm/radeon/radeon_legacy_encoders.c   |  49 ++++++--
 drivers/gpu/drm/radeon/radeon_mode.h          |   2 +
 drivers/gpu/drm/sitronix/Kconfig              |   2 +-
 drivers/gpu/drm/sitronix/st7735r.c            |   3 +
 drivers/gpu/drm/solomon/Kconfig               |   2 +-
 drivers/gpu/drm/solomon/ssd130x.c             |  79 ++++++++++---
 drivers/gpu/drm/tests/drm_connector_test.c    |  28 +++++
 drivers/gpu/drm/tiny/Kconfig                  |  12 +-
 drivers/gpu/drm/tiny/hx8357d.c                |   3 +
 drivers/gpu/drm/tiny/ili9163.c                |   3 +
 drivers/gpu/drm/tiny/ili9341.c                |   3 +
 drivers/gpu/drm/tiny/ili9486.c                |   3 +
 drivers/gpu/drm/tiny/mi0283qt.c               |   3 +
 drivers/gpu/drm/tiny/panel-mipi-dbi.c         |   3 +
 drivers/gpu/drm/xe/Kconfig                    |   2 +-
 include/drm/drm_atomic_helper.h               |   3 +
 include/drm/drm_bridge.h                      |  26 +++++
 include/drm/drm_connector.h                   |  16 +++
 include/drm/drm_mipi_dbi.h                    |   7 +-
 include/drm/drm_modeset_helper_vtables.h      |  25 ++++
 include/drm/drm_panel.h                       |   5 +
 67 files changed, 1070 insertions(+), 140 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2026-10-12  8:41 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 19:00 [PATCH v9 00/21] Add support for a DRM backlight capability Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 01/21] drm: add connector LUMINANCE property Mario Limonciello
2026-10-03 11:37   ` Javier Martinez Canillas
2026-10-02 19:00 ` [PATCH v9 02/21] drm/amd/display: Pass up errors reading actual brightness Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 03/21] drm/amd: add luminance property support Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 04/21] drm/amdgpu: Check bios_scratch_reg_offset in backlight level helper Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 05/21] drm/amd/display: update KUnit luminance fixtures Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 06/21] drm/i915/display: add luminance property support Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 07/21] drm: add panel and bridge connector luminance forwarding Mario Limonciello
2026-10-12  8:41   ` Maxime Ripard
2026-10-02 19:00 ` [PATCH v9 08/21] drm/mipi-dbi: add connector luminance helpers Mario Limonciello
2026-10-03 11:03   ` Javier Martinez Canillas
2026-10-02 19:00 ` [PATCH v9 09/21] drm/tiny: migrate panel-mipi-dbi to connector luminance Mario Limonciello
2026-10-03 11:22   ` Javier Martinez Canillas
2026-10-02 19:00 ` [PATCH v9 10/21] drm/tiny: migrate HX8357D " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 11/21] drm/tiny: migrate ILI9163 " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 12/21] drm/tiny: migrate ILI9341 " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 13/21] drm/tiny: migrate ILI9486 " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 14/21] drm/tiny: migrate MI0283QT " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 15/21] drm/sitronix: migrate ST7735R " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 16/21] drm/nouveau: add connector luminance support Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 17/21] drm/gud: " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 18/21] drm/radeon: " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 19/21] drm/gma500: " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 20/21] drm/bridge: add PS8622 " Mario Limonciello
2026-10-02 19:00 ` [PATCH v9 21/21] drm/solomon: add SSD130x " Mario Limonciello
2026-10-03 10:30   ` Javier Martinez Canillas
2026-10-03 10:39   ` Javier Martinez Canillas
2026-10-02 19:55 ` ✗ Fi.CI.BUILD: failure for Add support for a DRM backlight capability (rev4) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.