[Intel-gfx] Developing a new backlight driver for specific OLED screen

Jani Nikula jani.nikula at linux.intel.com
Mon Oct 31 08:40:00 UTC 2022


On Fri, 28 Oct 2022, "Aurélien" <aurelien.intel at ap2c.com> wrote:
> Hi, 
>
> I come back on my problem regarding the development of a specific driver which controls the brightness of my OLED device.
>
>> If it's eDP and uses some proprietary DPCD brightness control mechanism,
>> I think in practice it usually is somewhat dependent on the GPU.
>> 
>> (OTOH I realize you don't mention eDP. If it's not eDP, DDC/CI is the
>> more likely way to control brightness than DPCD.)
>
> I succeed to control the brightness through the /dev/drm_dp_aux0 device.
> Since I only need access to the DP AUX channel, I would like to develop an independant (from the GPU) driver. Unfortunately I don't know how to get access to the DP AUX channel from this independant driver.. Do you have some ideas?
>
> I am totally agree with the fact that this display might only be used with an intel gfx card but I'm not sure that this code (which only use DP AUX read/write access) must be in the intel gfx driver code. 

With the information provided, I basically see two options:

1) Just make it part of i915 anyway, or

2) Make it library code in drm that i915 calls.

Observe that it's fairly easy to do 1 first, and, if necessary, turn it
into 2 later. This is actually exactly how the current DP AUX brightness
code evolved.

IMO there's no point in trying to add a framework to make this an
independent driver you could probe separately. It's an unnecessary
complication, overengineering.

>
>>> Unfortunately I guess the mechanism is not shared with many OLED
>>> displays...
>> 
>> Do you have a spec for it? How does it differ from the VESA eDP DPCD
>> brightness control?
>
> I don't have any specs but as far as I understood it configures some screen registers to scale the PWM of all OLED pixels depending on the display state. It uses its own vendor's ports and registers. And values sent on the display registers to set the desired brightness are computed with complex formulaes (and the calculation needs static tables of values and display information got from the display at startup).

What's the source of the information?

Pretty soon we're going to need something more concrete to discuss this
further. Spec or implementation or something.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list