On Sat, Sep 17, 2022 at 10:59 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > > Hi All, > > Here is a patch-series changing gma500's backlight handling to match > the changes done to the other major x86 GPU drivers in the just landed > backlight detection refactor patch series: > https://lore.kernel.org/dri-devel/261afe3d-7790-e945-adf6-a2c96c9b1eff@xxxxxxxxxx/ > > The main goal is here is to only register one backlight class device instead > of registering both "acpi_video0" and "psb-bl" backlight class devices; > in preparation for implementing the new backlight userspace-API from: > https://lore.kernel.org/dri-devel/b61d3eeb-6213-afac-2e70-7b9791c86d2e@xxxxxxxxxx/ Hi Hans, Quite some time ago I wrote a backlight driver [1] for a MacBook to work around an issue in the i915 driver. My driver spoke directly to an external backlight driver chip. By doing so I could turn off the signal coming from the GPU and instead program my own PWM value directly. I remember it being a bit tricky to make my driver get priority over the i915 driver. Not sure what the actual issue was but I did get it to work properly in the end (perhaps with an xorg.conf change). I understand that this is a corner case but I'm just curious how/if this can be handled with the new API. Is it possible to kick out an existing non-acpi backlight driver if you know yours is better? [1] https://github.com/patjak/mba6x_bl > > Changes in v2: > - Add "Use backlight_get_brightness() to get the brightness" patch > > Changes in v3: > - Fix unused variable warnings when CONFIG_BACKLIGHT is not selected by > marking the 2 variables as __maybe_unused. This looks good to me. I don't have access to my DIM setup in a couple of days so please push these yourself if possible. For the entire series: Acked-by: Patrik Jakobsson <patrik.r.jakobsson@xxxxxxxxx> > > Regards, > > Hans > > > Hans de Goede (5): > drm/gma500: Refactor backlight support (v2) > drm/gma500: Change registered backlight device type to raw/native > drm/gma500: Use backlight_get_brightness() to get the brightness > drm/gma500: Don't register backlight when another backlight should be > used > drm/gma500: Call acpi_video_register_backlight() > > drivers/gpu/drm/gma500/backlight.c | 102 +++++++++++++++-------- > drivers/gpu/drm/gma500/cdv_device.c | 50 ++--------- > drivers/gpu/drm/gma500/oaktrail_device.c | 65 ++------------- > drivers/gpu/drm/gma500/opregion.c | 6 +- > drivers/gpu/drm/gma500/psb_device.c | 73 +--------------- > drivers/gpu/drm/gma500/psb_drv.c | 15 +--- > drivers/gpu/drm/gma500/psb_drv.h | 13 +-- > 7 files changed, 97 insertions(+), 227 deletions(-) > > -- > 2.37.3 >