dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	anthony.wong@canonical.com, dri-devel@lists.freedesktop.org,
	Mario.Limonciello@dell.com
Subject: Re: OLED panel brightness support
Date: Thu, 25 Jul 2019 15:12:39 +0200	[thread overview]
Message-ID: <20190725131239.GA8684@ravnborg.org> (raw)
In-Reply-To: <20190725115909.GA15868@phenom.ffwll.local>

Hi Daniel.
 
> 
> > The next question is, how do we change the brightness level for OLED
> > displays? Is changing gamma value a good way to do it?
> 
> There's no overall amplifier knob to set general brightness on these?

I just looked up two random OLED controllers.
They have a "Contrast" - which is wired to set_gamma.
See for example:

fb_sh1106.c:
/* Gamma is used to control Contrast */
static int set_gamma(struct fbtft_par *par, u32 *curves)
{
        /* apply mask */
        curves[0] &= 0xFF;

        /* Set Contrast Control for BANK0 */
        write_reg(par, 0x81, curves[0]);

        return 0;
}


And fb_ssd1306.c:
/* Gamma is used to control Contrast */
static int set_gamma(struct fbtft_par *par, u32 *curves)
{
        /* apply mask */
        curves[0] &= 0xFF;

        /* Set Contrast Control for BANK0 */
        write_reg(par, 0x81);
        write_reg(par, curves[0]);

        return 0;
}

I have a few ssd1306 panels in the mail, so when I get some spare time I
will try to make a tiny DRM driver for them.
But starting on the backlight stuff seems to a bit more complicated.

Hmm... browsing backlight code I see that FB_EARLY_EVENT_BLANK and FB_R_EARLY_EVENT_BLANK
are not used - time to delete some code...

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-07-25 13:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 10:46 OLED panel brightness support Kai-Heng Feng
2019-07-24 11:48 ` Daniel Vetter
     [not found]   ` <30f693a33f5a45ce84673fd8d7cecc7a@AUSX13MPC105.AMER.DELL.COM>
2019-07-25  7:35     ` Kai-Heng Feng
2019-07-25 11:59       ` Daniel Vetter
2019-07-25 13:12         ` Sam Ravnborg [this message]
2019-07-25 14:02           ` Daniel Vetter
2019-07-25 14:24             ` Sam Ravnborg
2019-07-29  8:34         ` Jani Nikula
2019-07-29  8:26 ` Jani Nikula
2019-07-29  8:43   ` Kai-Heng Feng
2019-07-29  9:19     ` Jani Nikula

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=20190725131239.GA8684@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=Mario.Limonciello@dell.com \
    --cc=anthony.wong@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kai.heng.feng@canonical.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