mbox series

[v4,00/11] backlight, lcd, led: Remove fbdev dependencies

Message ID 20250321095517.313713-1-tzimmermann@suse.de
Headers show
Series backlight, lcd, led: Remove fbdev dependencies | expand

Message

Thomas Zimmermann March 21, 2025, 9:53 a.m. UTC
This series removes the remaining dependencies on fbdev from the
backlight, lcd and led subsystems. Each depends on fbdev events to
track display state. Make fbdev inform each subsystem via a dedicated
interface instead.

Patches 1 to 3 make fbdev track blank state for each display, so that
backlight code doesn't have to.

Patches 4 to 6 remove fbdev event handling from backlight code. Patches
7 and 8 remove fbdev event handling from lcd code and patches 9 and 10
do the same for led's backlight trigger.

The final patch removes the event constants from fbdev.

With the series applied, the three subsystems do no longer depend on
fbdev. It's also a clean up for fbdev. Fbdev used to send out a large
number of events. That mechanism has been deprecated for some time and
converted call to dedicated functions instead.

Testing is very welcome, as I don't have the hardware to test this
series.

v4:
- protect backlight declarations with IS_REACHABLE()
v3:
- export several symbols
- static-inline declare empty placeholders
v2:
- avoid IS_REACHABLE() in source file (Lee)
- simplify several interfaces and helpers
- use lock guards
- initialize global lists and mutices

Thomas Zimmermann (11):
  fbdev: Rework fb_blank()
  fbdev: Track display blanking state
  fbdev: Send old blank state in FB_EVENT_BLANK
  backlight: Implement fbdev tracking with blank state from event
  backlight: Move blank-state handling into helper
  backlight: Replace fb events with a dedicated function call
  backlight: lcd: Move event handling into helpers
  backlight: lcd: Replace fb events with a dedicated function call
  leds: backlight trigger: Move blank-state handling into helper
  leds: backlight trigger: Replace fb events with a dedicated function
    call
  fbdev: Remove constants of unused events

 drivers/leds/trigger/ledtrig-backlight.c |  48 +++++-----
 drivers/video/backlight/backlight.c      |  93 +++++--------------
 drivers/video/backlight/lcd.c            | 108 +++++++++--------------
 drivers/video/fbdev/core/fb_backlight.c  |  12 +++
 drivers/video/fbdev/core/fb_info.c       |   1 +
 drivers/video/fbdev/core/fbmem.c         |  82 ++++++++++++++---
 drivers/video/fbdev/core/fbsysfs.c       |   8 +-
 include/linux/backlight.h                |  32 +++----
 include/linux/fb.h                       |  12 +--
 include/linux/lcd.h                      |  21 ++++-
 include/linux/leds.h                     |   6 ++
 11 files changed, 215 insertions(+), 208 deletions(-)

Comments

Lee Jones April 10, 2025, 9:39 a.m. UTC | #1
On Fri, 21 Mar 2025 10:53:53 +0100, Thomas Zimmermann wrote:
> This series removes the remaining dependencies on fbdev from the
> backlight, lcd and led subsystems. Each depends on fbdev events to
> track display state. Make fbdev inform each subsystem via a dedicated
> interface instead.
> 
> Patches 1 to 3 make fbdev track blank state for each display, so that
> backlight code doesn't have to.
> 
> [...]

Applied, thanks!

[01/11] fbdev: Rework fb_blank()
        commit: 93e41f968d7c6ea1cedc6b365917cbb787ef08f6
[02/11] fbdev: Track display blanking state
        commit: 7e3711eb87c584ed224a7ad7000eba36e6fa3a51
[03/11] fbdev: Send old blank state in FB_EVENT_BLANK
        commit: dfb4bf1ac40162ff5ea3715a10f6af2dcf3030c5
[04/11] backlight: Implement fbdev tracking with blank state from event
        commit: 726491f2038ec71122d45700f3abf36fdb277aaa
[05/11] backlight: Move blank-state handling into helper
        commit: 4bfb77f3381627640e97e0e423c93a2ea93e7de7
[06/11] backlight: Replace fb events with a dedicated function call
        commit: b01beb2f1f6bcda17634a5b529865ffc5a9b795f
[07/11] backlight: lcd: Move event handling into helpers
        commit: e98696cea7e289447a5d2328546b947629301616
[08/11] backlight: lcd: Replace fb events with a dedicated function call
        commit: bc70cc84f5a2ebfd7e7112e9b8837e0c7954fc65
[09/11] leds: backlight trigger: Move blank-state handling into helper
        commit: 28f8bab711c0984005a6dd4cc980b4ba8409b817
[10/11] leds: backlight trigger: Replace fb events with a dedicated function call
        commit: dc2139c0aa3283e5749109641af1878ed7bf7371
[11/11] fbdev: Remove constants of unused events
        commit: d32a0b567a8a8b6e677d35c4f8eb8bd32b7029a0

--
Lee Jones [李琼斯]
Lee Jones April 10, 2025, 9:41 a.m. UTC | #2
On Thu, 10 Apr 2025, Lee Jones wrote:

> On Fri, 21 Mar 2025 10:53:53 +0100, Thomas Zimmermann wrote:
> > This series removes the remaining dependencies on fbdev from the
> > backlight, lcd and led subsystems. Each depends on fbdev events to
> > track display state. Make fbdev inform each subsystem via a dedicated
> > interface instead.
> > 
> > Patches 1 to 3 make fbdev track blank state for each display, so that
> > backlight code doesn't have to.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [01/11] fbdev: Rework fb_blank()
>         commit: 93e41f968d7c6ea1cedc6b365917cbb787ef08f6
> [02/11] fbdev: Track display blanking state
>         commit: 7e3711eb87c584ed224a7ad7000eba36e6fa3a51
> [03/11] fbdev: Send old blank state in FB_EVENT_BLANK
>         commit: dfb4bf1ac40162ff5ea3715a10f6af2dcf3030c5
> [04/11] backlight: Implement fbdev tracking with blank state from event
>         commit: 726491f2038ec71122d45700f3abf36fdb277aaa
> [05/11] backlight: Move blank-state handling into helper
>         commit: 4bfb77f3381627640e97e0e423c93a2ea93e7de7
> [06/11] backlight: Replace fb events with a dedicated function call
>         commit: b01beb2f1f6bcda17634a5b529865ffc5a9b795f
> [07/11] backlight: lcd: Move event handling into helpers
>         commit: e98696cea7e289447a5d2328546b947629301616
> [08/11] backlight: lcd: Replace fb events with a dedicated function call
>         commit: bc70cc84f5a2ebfd7e7112e9b8837e0c7954fc65
> [09/11] leds: backlight trigger: Move blank-state handling into helper
>         commit: 28f8bab711c0984005a6dd4cc980b4ba8409b817
> [10/11] leds: backlight trigger: Replace fb events with a dedicated function call
>         commit: dc2139c0aa3283e5749109641af1878ed7bf7371
> [11/11] fbdev: Remove constants of unused events
>         commit: d32a0b567a8a8b6e677d35c4f8eb8bd32b7029a0

Okay, these have been submitted for build testing.

Once complete, I'll send out a PR.

Note to self: ib-backlight-leds-fbdev-6.16