All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] Developing a new backlight driver for specific OLED screen
@ 2022-09-09  9:35 Aurélien
  2022-09-09  9:50 ` Rodrigo Vivi
  0 siblings, 1 reply; 8+ messages in thread
From: Aurélien @ 2022-09-09  9:35 UTC (permalink / raw)
  To: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

Hi,
I hope this mailing-mist is the right place for this question.
I would like to develop a new driver in order to manage backlight for a 
specific OLED display (Samsung one). For that propose I need to use the 
dpcd aux read and write functions.
Since this driver is independent film the i915 driver I would like to 
develop an indémependant driver.
So my question is: how can I use the i915 API (dpcd aux communications) 
outside from the driver and register the backlight sys entries like the 
i915 does (in order to have all the softwares which plays with the 
backlight working without modifying them) ?

Many thanks for your answers

--
Aurélien

[-- Attachment #2: Type: text/html, Size: 1836 bytes --]

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09  9:35 [Intel-gfx] Developing a new backlight driver for specific OLED screen Aurélien
@ 2022-09-09  9:50 ` Rodrigo Vivi
  2022-09-09 15:26   ` Jani Nikula
  2022-09-09 15:49   ` Aurélien
  0 siblings, 2 replies; 8+ messages in thread
From: Rodrigo Vivi @ 2022-09-09  9:50 UTC (permalink / raw)
  To: Aurélien, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

On Fri, Sep 09, 2022 at 11:35:28AM +0200, Aurélien wrote:
>    Hi,
>    I hope this mailing-mist is the right place for this question.

+ dri-devel mailing list that looks more appropriated.
+ Hans and Lyude who were recently working to standardize some of the
backlight stuff.

>    I would like to develop a new driver in order to manage backlight for a
>    specific OLED display (Samsung one). For that propose I need to use the
>    dpcd aux read and write functions.
>    Since this driver is independent film the i915 driver I would like to
>    develop an indémependant driver.
>    So my question is: how can I use the i915 API (dpcd aux communications)
>    outside from the driver and register the backlight sys entries like the
>    i915 does (in order to have all the softwares which plays with the
>    backlight working without modifying them) ?

I don't believe you want to use the i915 API, but move the common functions
to the drm subsystem itself and then reuse as a drm device.

>    Many thanks for your answers
>    --
>    Aurélien

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09  9:50 ` Rodrigo Vivi
@ 2022-09-09 15:26   ` Jani Nikula
  2022-09-09 15:49   ` Aurélien
  1 sibling, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2022-09-09 15:26 UTC (permalink / raw)
  To: Rodrigo Vivi, Aurélien, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

On Fri, 09 Sep 2022, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> On Fri, Sep 09, 2022 at 11:35:28AM +0200, Aurélien wrote:
>>    Hi,
>>    I hope this mailing-mist is the right place for this question.
>
> + dri-devel mailing list that looks more appropriated.
> + Hans and Lyude who were recently working to standardize some of the
> backlight stuff.
>
>>    I would like to develop a new driver in order to manage backlight for a
>>    specific OLED display (Samsung one). For that propose I need to use the
>>    dpcd aux read and write functions.
>>    Since this driver is independent film the i915 driver I would like to
>>    develop an indémependant driver.
>>    So my question is: how can I use the i915 API (dpcd aux communications)
>>    outside from the driver and register the backlight sys entries like the
>>    i915 does (in order to have all the softwares which plays with the
>>    backlight working without modifying them) ?
>
> I don't believe you want to use the i915 API, but move the common functions
> to the drm subsystem itself and then reuse as a drm device.

Aurélien, are you aware of drivers/gpu/drm/display/drm_dp_helper.c and
all the functions around struct dp_aux_backlight and struct
drm_edp_backlight_info?

Also see drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c.

Does the display use some proprietary, non-VESA DPCD registers? There's
already some of that in i915 for Intel proprietary interfaces.


BR,
Jani.



>
>>    Many thanks for your answers
>>    --
>>    Aurélien

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09  9:50 ` Rodrigo Vivi
  2022-09-09 15:26   ` Jani Nikula
@ 2022-09-09 15:49   ` Aurélien
  2022-09-09 18:20     ` Lyude Paul
                       ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Aurélien @ 2022-09-09 15:49 UTC (permalink / raw)
  To: Jani Nikula, Rodrigo Vivi, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

Hi, 

> + dri-devel mailing list that looks more appropriated.
> + Hans and Lyude who were recently working to standardize some of the
> backlight stuff.

Thank you for these contacts. I'll try there if I need.

> I don't believe you want to use the i915 API, but move the common functions
> to the drm subsystem itself and then reuse as a drm device.

If there is enough generic code I'll do everything with the DRM API. Unfortunately I can't spend too much time in order to generalize the i915 common functions.

> Aurélien, are you aware of drivers/gpu/drm/display/drm_dp_helper.c and
> all the functions around struct dp_aux_backlight and struct
> drm_edp_backlight_info?

Not yet. Since I'm not familiar with GPU/display drivers I didn't know what could be a good starting point. 
Indeed I already checked the intel_dp_aux_backlight.c code. That's why I told about using the "i915 API code" at first. But since this display is independent from the GPU i didn't want to link both code. 
Then that's a really good point if there is already an independant API. I'll have a look this evening.

> Does the display use some proprietary, non-VESA DPCD registers? There's
> already some of that in i915 for Intel proprietary interfaces.

For sure. It's an OLED display. Thus there is no backlight. It uses specific registers to control the brightness of the screen.
Unfortunately I guess the mechanism is not shared with many OLED displays...

Thank you for your help.

Aurélien

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09 15:49   ` Aurélien
@ 2022-09-09 18:20     ` Lyude Paul
  2022-09-12  8:44     ` Jani Nikula
  2022-10-28 15:53     ` Aurélien
  2 siblings, 0 replies; 8+ messages in thread
From: Lyude Paul @ 2022-09-09 18:20 UTC (permalink / raw)
  To: Aurélien, Jani Nikula, Rodrigo Vivi, Hans de Goede, dri-devel
  Cc: intel-gfx

On Fri, 2022-09-09 at 15:49 +0000, Aurélien wrote:
> Hi, 
> 
> > + dri-devel mailing list that looks more appropriated.
> > + Hans and Lyude who were recently working to standardize some of the
> > backlight stuff.
> 
> Thank you for these contacts. I'll try there if I need.
> 
> > I don't believe you want to use the i915 API, but move the common functions
> > to the drm subsystem itself and then reuse as a drm device.
> 
> If there is enough generic code I'll do everything with the DRM API. Unfortunately I can't spend too much time in order to generalize the i915 common functions.
> 
> > Aurélien, are you aware of drivers/gpu/drm/display/drm_dp_helper.c and
> > all the functions around struct dp_aux_backlight and struct
> > drm_edp_backlight_info?
> 
> Not yet. Since I'm not familiar with GPU/display drivers I didn't know what could be a good starting point. 
> Indeed I already checked the intel_dp_aux_backlight.c code. That's why I told about using the "i915 API code" at first. But since this display is independent from the GPU i didn't want to link both code. 
> Then that's a really good point if there is already an independant API. I'll have a look this evening.
> 
> > Does the display use some proprietary, non-VESA DPCD registers? There's
> > already some of that in i915 for Intel proprietary interfaces.
> 
> For sure. It's an OLED display. Thus there is no backlight. It uses specific registers to control the brightness of the screen.
> Unfortunately I guess the mechanism is not shared with many OLED displays...
> 
> Thank you for your help.

Seems like we've got a pretty good argument for renaming this from backlight
to something else at some point. FWIW, the word backlight is sometimes used
around these parts simply to describe controlling the brightness of an OLED
screen.

> 
> Aurélien
> 

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09 15:49   ` Aurélien
  2022-09-09 18:20     ` Lyude Paul
@ 2022-09-12  8:44     ` Jani Nikula
  2022-10-28 15:53     ` Aurélien
  2 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2022-09-12  8:44 UTC (permalink / raw)
  To: Aurélien, Rodrigo Vivi, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

On Fri, 09 Sep 2022, "Aurélien" <aurelien.intel@ap2c.com> wrote:
> But since this display is independent from the GPU i didn't want to
> link both code.

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.)

> For sure. It's an OLED display. Thus there is no backlight. It uses
> specific registers to control the brightness of the screen.

As Lyude said, we have a bunch of "backlight" terminology for historical
reasons, but basically the DP aux, or DPCD, brightness control is mostly
agnostic to the display technology.

> 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?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-09-09 15:49   ` Aurélien
  2022-09-09 18:20     ` Lyude Paul
  2022-09-12  8:44     ` Jani Nikula
@ 2022-10-28 15:53     ` Aurélien
  2022-10-31  8:40       ` Jani Nikula
  2 siblings, 1 reply; 8+ messages in thread
From: Aurélien @ 2022-10-28 15:53 UTC (permalink / raw)
  To: Jani Nikula, Rodrigo Vivi, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

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. 

>> 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).

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

* Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
  2022-10-28 15:53     ` Aurélien
@ 2022-10-31  8:40       ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2022-10-31  8:40 UTC (permalink / raw)
  To: Aurélien, Rodrigo Vivi, Hans de Goede, Lyude, dri-devel; +Cc: intel-gfx

On Fri, 28 Oct 2022, "Aurélien" <aurelien.intel@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

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

end of thread, other threads:[~2022-10-31  8:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  9:35 [Intel-gfx] Developing a new backlight driver for specific OLED screen Aurélien
2022-09-09  9:50 ` Rodrigo Vivi
2022-09-09 15:26   ` Jani Nikula
2022-09-09 15:49   ` Aurélien
2022-09-09 18:20     ` Lyude Paul
2022-09-12  8:44     ` Jani Nikula
2022-10-28 15:53     ` Aurélien
2022-10-31  8:40       ` Jani Nikula

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.