Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Aurélien <aurelien.intel@ap2c.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Hans de Goede" <hdegoede@redhat.com>, Lyude <lyude@redhat.com>,
	dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] Developing a new backlight driver for specific OLED screen
Date: Mon, 31 Oct 2022 10:40:00 +0200	[thread overview]
Message-ID: <87wn8g8jz3.fsf@intel.com> (raw)
In-Reply-To: <e168e993071e55404dfa91387cf4db97@ap2c.com>

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

      reply	other threads:[~2022-10-31  8:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn8g8jz3.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=aurelien.intel@ap2c.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox