mbox series

[00/10] backlight: Replace struct fb_info in interfaces

Message ID 20240212162645.5661-1-tzimmermann@suse.de
Headers show
Series backlight: Replace struct fb_info in interfaces | expand

Message

Thomas Zimmermann Feb. 12, 2024, 4:16 p.m. UTC
Backlight drivers implement struct backlight_ops.check_fb, which
uses struct fb_info in its interface. Replace the callback with one
the does not use fb_info.

In DRM, we have several drivers that implement backlight support. By
including <linux/backlight.h> these drivers depend on <linux/fb.h>.
At the same time, fbdev is deprecated for new drivers and likely to
be replaced on many systems.

This patchset is part of a larger effort to implement the backlight
code without depending on fbdev.

Patch 1 makes the backlight core match backlight and framebuffer
devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
drivers and remove unnecessary implementations of check_fb. Finally,
patch 10 replaces the check_fb hook with controls_device, which
uses the framebuffer's Linux device instead of the framebuffer.

Thomas Zimmermann (10):
  backlight: Match backlight device against struct fb_info.bl_dev
  auxdisplay/ht16k33: Remove struct backlight_ops.check_fb
  hid/hid-picolcd: Fix initialization order
  hid/hid-picolcd: Remove struct backlight_ops.check_fb
  backlight/aat2870-backlight: Remove struct backlight.check_fb
  backlight/pwm-backlight: Remove struct backlight_ops.check_fb
  fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb
  fbdev/ssd1307fb: Init backlight before registering framebuffer
  fbdev/ssd1307fb: Remove struct backlight_ops.check_fb
  backlight: Add controls_device callback to struct backlight_ops

 drivers/auxdisplay/ht16k33.c             |  8 ------
 drivers/hid/hid-picolcd_backlight.c      |  7 ------
 drivers/hid/hid-picolcd_core.c           | 14 +++++------
 drivers/hid/hid-picolcd_fb.c             |  4 +++
 drivers/video/backlight/aat2870_bl.c     |  7 ------
 drivers/video/backlight/backlight.c      |  9 +++++--
 drivers/video/backlight/bd6107.c         | 12 ++++-----
 drivers/video/backlight/gpio_backlight.c | 12 ++++-----
 drivers/video/backlight/lv5207lp.c       | 12 ++++-----
 drivers/video/backlight/pwm_bl.c         | 12 ---------
 drivers/video/fbdev/sh_mobile_lcdcfb.c   |  7 ------
 drivers/video/fbdev/ssd1307fb.c          | 31 +++++++++---------------
 include/linux/backlight.h                | 16 ++++++------
 include/linux/pwm_backlight.h            |  1 -
 14 files changed, 55 insertions(+), 97 deletions(-)

Comments

Daniel Thompson Feb. 15, 2024, 12:13 p.m. UTC | #1
On Mon, Feb 12, 2024 at 05:16:33PM +0100, Thomas Zimmermann wrote:
> Backlight drivers implement struct backlight_ops.check_fb, which
> uses struct fb_info in its interface. Replace the callback with one
> the does not use fb_info.
>
> In DRM, we have several drivers that implement backlight support. By
> including <linux/backlight.h> these drivers depend on <linux/fb.h>.
> At the same time, fbdev is deprecated for new drivers and likely to
> be replaced on many systems.
>
> This patchset is part of a larger effort to implement the backlight
> code without depending on fbdev.
>
> Patch 1 makes the backlight core match backlight and framebuffer
> devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
> drivers and remove unnecessary implementations of check_fb. Finally,
> patch 10 replaces the check_fb hook with controls_device, which
> uses the framebuffer's Linux device instead of the framebuffer.

I won't reply individually but I also took a look at the patches for
the combo devices and it all looked good to me from a backlight
point of view.

However I don't want to drop Reviewed-by: on them since it risks those
bit being mistaken for an ack and merged ahead of the patch 1...


Daniel.
Thomas Zimmermann Feb. 15, 2024, 12:23 p.m. UTC | #2
Hi

Am 15.02.24 um 13:13 schrieb Daniel Thompson:
> On Mon, Feb 12, 2024 at 05:16:33PM +0100, Thomas Zimmermann wrote:
>> Backlight drivers implement struct backlight_ops.check_fb, which
>> uses struct fb_info in its interface. Replace the callback with one
>> the does not use fb_info.
>>
>> In DRM, we have several drivers that implement backlight support. By
>> including <linux/backlight.h> these drivers depend on <linux/fb.h>.
>> At the same time, fbdev is deprecated for new drivers and likely to
>> be replaced on many systems.
>>
>> This patchset is part of a larger effort to implement the backlight
>> code without depending on fbdev.
>>
>> Patch 1 makes the backlight core match backlight and framebuffer
>> devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
>> drivers and remove unnecessary implementations of check_fb. Finally,
>> patch 10 replaces the check_fb hook with controls_device, which
>> uses the framebuffer's Linux device instead of the framebuffer.
> I won't reply individually but I also took a look at the patches for
> the combo devices and it all looked good to me from a backlight
> point of view.
>
> However I don't want to drop Reviewed-by: on them since it risks those
> bit being mistaken for an ack and merged ahead of the patch 1...

Thanks for reviewing. Unless someone objects, my intention is to merge 
everything via the drm-misc, so all patches should go in at once. I do 
have a lot more patches that untangle backlight and fbdev almost 
completely, but most of these changes are in the actual graphics drivers 
rather than the backlight core code. So hopefully everything can go 
through the DRM tree; or maybe the fbdev tree.

Best regards
Thomas

>
>
> Daniel.
Lee Jones Feb. 19, 2024, 3:02 p.m. UTC | #3
On Thu, 15 Feb 2024, Thomas Zimmermann wrote:

> Hi
> 
> Am 15.02.24 um 13:13 schrieb Daniel Thompson:
> > On Mon, Feb 12, 2024 at 05:16:33PM +0100, Thomas Zimmermann wrote:
> > > Backlight drivers implement struct backlight_ops.check_fb, which
> > > uses struct fb_info in its interface. Replace the callback with one
> > > the does not use fb_info.
> > > 
> > > In DRM, we have several drivers that implement backlight support. By
> > > including <linux/backlight.h> these drivers depend on <linux/fb.h>.
> > > At the same time, fbdev is deprecated for new drivers and likely to
> > > be replaced on many systems.
> > > 
> > > This patchset is part of a larger effort to implement the backlight
> > > code without depending on fbdev.
> > > 
> > > Patch 1 makes the backlight core match backlight and framebuffer
> > > devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
> > > drivers and remove unnecessary implementations of check_fb. Finally,
> > > patch 10 replaces the check_fb hook with controls_device, which
> > > uses the framebuffer's Linux device instead of the framebuffer.
> > I won't reply individually but I also took a look at the patches for
> > the combo devices and it all looked good to me from a backlight
> > point of view.
> > 
> > However I don't want to drop Reviewed-by: on them since it risks those
> > bit being mistaken for an ack and merged ahead of the patch 1...
> 
> Thanks for reviewing. Unless someone objects, my intention is to merge
> everything via the drm-misc, so all patches should go in at once. I do have
> a lot more patches that untangle backlight and fbdev almost completely, but
> most of these changes are in the actual graphics drivers rather than the
> backlight core code. So hopefully everything can go through the DRM tree; or
> maybe the fbdev tree.

This is only acceptable if the maintainers of those trees can provide me
with a pull-request to a succinct (_only_ these patches) immutable
branch.  If this is not possible, then I should like to merge the set
through the Backlight tree and I can provide everyone else with said PR.
Thomas Zimmermann Feb. 21, 2024, 9:23 a.m. UTC | #4
Hi

Am 19.02.24 um 16:02 schrieb Lee Jones:
> On Thu, 15 Feb 2024, Thomas Zimmermann wrote:
>
>> Hi
>>
>> Am 15.02.24 um 13:13 schrieb Daniel Thompson:
>>> On Mon, Feb 12, 2024 at 05:16:33PM +0100, Thomas Zimmermann wrote:
>>>> Backlight drivers implement struct backlight_ops.check_fb, which
>>>> uses struct fb_info in its interface. Replace the callback with one
>>>> the does not use fb_info.
>>>>
>>>> In DRM, we have several drivers that implement backlight support. By
>>>> including <linux/backlight.h> these drivers depend on <linux/fb.h>.
>>>> At the same time, fbdev is deprecated for new drivers and likely to
>>>> be replaced on many systems.
>>>>
>>>> This patchset is part of a larger effort to implement the backlight
>>>> code without depending on fbdev.
>>>>
>>>> Patch 1 makes the backlight core match backlight and framebuffer
>>>> devices via struct fb_info.bl_dev. Patches 2 to 9 then go through
>>>> drivers and remove unnecessary implementations of check_fb. Finally,
>>>> patch 10 replaces the check_fb hook with controls_device, which
>>>> uses the framebuffer's Linux device instead of the framebuffer.
>>> I won't reply individually but I also took a look at the patches for
>>> the combo devices and it all looked good to me from a backlight
>>> point of view.
>>>
>>> However I don't want to drop Reviewed-by: on them since it risks those
>>> bit being mistaken for an ack and merged ahead of the patch 1...
>> Thanks for reviewing. Unless someone objects, my intention is to merge
>> everything via the drm-misc, so all patches should go in at once. I do have
>> a lot more patches that untangle backlight and fbdev almost completely, but
>> most of these changes are in the actual graphics drivers rather than the
>> backlight core code. So hopefully everything can go through the DRM tree; or
>> maybe the fbdev tree.
> This is only acceptable if the maintainers of those trees can provide me
> with a pull-request to a succinct (_only_ these patches) immutable
> branch.  If this is not possible, then I should like to merge the set
> through the Backlight tree and I can provide everyone else with said PR.

I see, there's a separate backlight tree.

I'm going to send another revision of this patchset. You either merge 
all of the patches via the backlight tree, or you could just merge 
patches 1, 5 and 6 for now. I'll take care to get the rest merged via 
other trees and I'll re-submoit patch 10 for a final clean up. Your choice.

Best regards
Thomas

>