All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: eDP display control registers in Linux kernel
       [not found] <CABfYTXSYiObPFoLJ2h-W-o0u-t_=_4YmM52Ma50fqofnWo8VTg@mail.gmail.com>
@ 2015-02-23  7:59 ` Jani Nikula
  2015-02-23 10:26   ` Stéphane Marchesin
  2015-02-23 12:33   ` Michael Leuchtenburg
  0 siblings, 2 replies; 9+ messages in thread
From: Jani Nikula @ 2015-02-23  7:59 UTC (permalink / raw)
  To: Michael Leuchtenburg; +Cc: intel-gfx, dri-devel


Hi Michael -

Please always cc: the relevant mailing lists; done now.

On Sun, 22 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> Hi Jani,
>
> I've been trying to figure out how to control the dynamic backlight control
> on my new Dell XPS 13 since the defaults are atrocious - huge swings in
> brightness from a black background to a white one, over a few seconds
> period so it's very obvious. I eventually tracked down a patch from the
> Chromium folks that adds a sysfs interface (
> https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db5eacd6ac7a0cbda4ea1010fabbd3ff6b30e0bc%5E%21/),
> but it seems to depend on your patch that adds eDP display control
> registers (
> http://lists.freedesktop.org/archives/dri-devel/2013-November/049098.html),
> which was never merged into mainline as far as I can tell.
>
> Do you know what the status of that is? Is it still wending its way through
> the process (now, over a year later) or did it die somewhere along the way?
> The patch doesn't apply to mainline today, though it's simple enough that I
> suspect it'd be easy to adapt. I'd rather see where it went, though.
>
> I'd appreciate any help you can offer.

The Chrome OS patches wouldn't be acceptable upstream, and indeed
they've never been posted upstream. A more driver agnostic approach
would be required.

My patches were simple, adding some macros etc. They were reviewed but
apparently forgotten, also by me. I'll repost them, but they won't do
you much good in this case.

I'm also not convinced yet that your problem would be solved by the
patches; are you sure Dell XPS 13 does have dynamic backlight control in
the panel, adjustable via DPCD?

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: eDP display control registers in Linux kernel
  2015-02-23  7:59 ` eDP display control registers in Linux kernel Jani Nikula
@ 2015-02-23 10:26   ` Stéphane Marchesin
  2015-02-23 12:33   ` Michael Leuchtenburg
  1 sibling, 0 replies; 9+ messages in thread
From: Stéphane Marchesin @ 2015-02-23 10:26 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, Michael Leuchtenburg, dri-devel

On Sun, Feb 22, 2015 at 11:59 PM, Jani Nikula <jani.nikula@intel.com> wrote:
>
> Hi Michael -
>
> Please always cc: the relevant mailing lists; done now.
>
> On Sun, 22 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
>> Hi Jani,
>>
>> I've been trying to figure out how to control the dynamic backlight control
>> on my new Dell XPS 13 since the defaults are atrocious - huge swings in
>> brightness from a black background to a white one, over a few seconds
>> period so it's very obvious. I eventually tracked down a patch from the
>> Chromium folks that adds a sysfs interface (
>> https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db5eacd6ac7a0cbda4ea1010fabbd3ff6b30e0bc%5E%21/),
>> but it seems to depend on your patch that adds eDP display control
>> registers (
>> http://lists.freedesktop.org/archives/dri-devel/2013-November/049098.html),
>> which was never merged into mainline as far as I can tell.
>>
>> Do you know what the status of that is? Is it still wending its way through
>> the process (now, over a year later) or did it die somewhere along the way?
>> The patch doesn't apply to mainline today, though it's simple enough that I
>> suspect it'd be easy to adapt. I'd rather see where it went, though.
>>
>> I'd appreciate any help you can offer.
>
> The Chrome OS patches wouldn't be acceptable upstream, and indeed
> they've never been posted upstream. A more driver agnostic approach
> would be required.

I actually asked Eric to make a property version of this:
https://chromium-review.googlesource.com/#/c/244165/

Once this lands in Chrome OS, we should upstream it.

Stéphane

>
> My patches were simple, adding some macros etc. They were reviewed but
> apparently forgotten, also by me. I'll repost them, but they won't do
> you much good in this case.
>
> I'm also not convinced yet that your problem would be solved by the
> patches; are you sure Dell XPS 13 does have dynamic backlight control in
> the panel, adjustable via DPCD?
>
> BR,
> Jani.
>
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: eDP display control registers in Linux kernel
  2015-02-23  7:59 ` eDP display control registers in Linux kernel Jani Nikula
  2015-02-23 10:26   ` Stéphane Marchesin
@ 2015-02-23 12:33   ` Michael Leuchtenburg
  2015-02-25 12:41     ` Jani Nikula
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Leuchtenburg @ 2015-02-23 12:33 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2221 bytes --]

On Mon, Feb 23, 2015 at 2:59 AM, Jani Nikula <jani.nikula@intel.com> wrote:

>
> Hi Michael -
>
> Please always cc: the relevant mailing lists; done now.
>

Sorry, will do; thanks.


>
> On Sun, 22 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> > Hi Jani,
> >
> > I've been trying to figure out how to control the dynamic backlight
> control
> > on my new Dell XPS 13 since the defaults are atrocious - huge swings in
> > brightness from a black background to a white one, over a few seconds
> > period so it's very obvious. I eventually tracked down a patch from the
> > Chromium folks that adds a sysfs interface (
> >
> https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db5eacd6ac7a0cbda4ea1010fabbd3ff6b30e0bc%5E%21/
> ),
> > but it seems to depend on your patch that adds eDP display control
> > registers (
> >
> http://lists.freedesktop.org/archives/dri-devel/2013-November/049098.html
> ),
> > which was never merged into mainline as far as I can tell.
> >
> > Do you know what the status of that is? Is it still wending its way
> through
> > the process (now, over a year later) or did it die somewhere along the
> way?
> > The patch doesn't apply to mainline today, though it's simple enough
> that I
> > suspect it'd be easy to adapt. I'd rather see where it went, though.
> >
> > I'd appreciate any help you can offer.
>
> The Chrome OS patches wouldn't be acceptable upstream, and indeed
> they've never been posted upstream. A more driver agnostic approach
> would be required.
>
> My patches were simple, adding some macros etc. They were reviewed but
> apparently forgotten, also by me. I'll repost them, but they won't do
> you much good in this case.
>
> I'm also not convinced yet that your problem would be solved by the
> patches; are you sure Dell XPS 13 does have dynamic backlight control in
> the panel, adjustable via DPCD?
>

I'm certain that it has dynamic backlight control of some sort, as the
brightness varies based on content. I'm also sure it has an eDP panel, and
an Intel graphics adapter. I'm not certain that DPCD will let me adjust it,
or how to check, though the ChromeOS patch seems to assume that intel + edp
-> DBC adjustable via DPCD.

Michael

[-- Attachment #1.2: Type: text/html, Size: 3260 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: eDP display control registers in Linux kernel
  2015-02-23 12:33   ` Michael Leuchtenburg
@ 2015-02-25 12:41     ` Jani Nikula
  2015-02-25 19:51       ` Michael Leuchtenburg
  0 siblings, 1 reply; 9+ messages in thread
From: Jani Nikula @ 2015-02-25 12:41 UTC (permalink / raw)
  To: Michael Leuchtenburg; +Cc: intel-gfx, dri-devel

On Mon, 23 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> I'm certain that it has dynamic backlight control of some sort, as the
> brightness varies based on content. I'm also sure it has an eDP panel, and
> an Intel graphics adapter. I'm not certain that DPCD will let me adjust it,
> or how to check, though the ChromeOS patch seems to assume that intel + edp
> -> DBC adjustable via DPCD.

I just sent a patch to dump the DPCD in debugfs [1]. Please apply that
on top of v4.0-rc1 or drm-intel-nightly, *and* add the following patch
on top. Please share the contents of
/sys/kernel/debug/dri/0/eDP-1/i915_dpcd running that (I assume the name
will be eDP-1).

BR,
Jani.


[1] http://patchwork.freedesktop.org/patch/43332


diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 451ef456c25f..c66b0679d6e2 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4672,6 +4672,9 @@ static const struct dpcd_block i915_dpcd_debug[] = {
 	{ .offset = DP_SINK_COUNT, .end = DP_ADJUST_REQUEST_LANE2_3 },
 	{ .offset = DP_SET_POWER },
 	{ .offset = DP_EDP_DPCD_REV },
+	{ .offset = 0x701, .end = 0x704 },
+	{ .offset = 0x720, .end = 0x72f },
+	{ .offset = 0x732, .end = 0x733 },
 };
 
 static int i915_dpcd_show(struct seq_file *m, void *data)

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: eDP display control registers in Linux kernel
  2015-02-25 12:41     ` Jani Nikula
@ 2015-02-25 19:51       ` Michael Leuchtenburg
  2015-02-25 22:56         ` Michael Leuchtenburg
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Leuchtenburg @ 2015-02-25 19:51 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1054 bytes --]

Note to anyone else who might try this (I sent someone this way from IRC
who was also wondering the same thing about the XPS 13), these patches
don't apply to 4.0-rc1 since they're missing DP_EDP_DPCD_REV (and maybe
some other things, haven't dug in thoroughly yet). Also that patch doesn't
quite apply on top - just the line number is off, though.

Going to try on drm-intel-nightly 2015y-02m-25d-15h-57m-20s
(04996479ce17b980351d69de817e4432134121cd).

- Michael

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
b/drivers/gpu/drm/i915/i915_debugfs.c
index 81d40a3..0af59d0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4673,6 +4673,9 @@ static const struct dpcd_block i915_dpcd_debug[] = {
  { .offset = DP_SINK_COUNT, .end = DP_ADJUST_REQUEST_LANE2_3 },
  { .offset = DP_SET_POWER },
  { .offset = DP_EDP_DPCD_REV },
+    { .offset = 0x701, .end = 0x704 },
+    { .offset = 0x720, .end = 0x72f },
+    { .offset = 0x732, .end = 0x733 },
 };

 static int i915_dpcd_show(struct seq_file *m, void *data)

[-- Attachment #1.2: Type: text/html, Size: 1458 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: eDP display control registers in Linux kernel
  2015-02-25 19:51       ` Michael Leuchtenburg
@ 2015-02-25 22:56         ` Michael Leuchtenburg
  2015-02-26  8:54           ` Jani Nikula
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Leuchtenburg @ 2015-02-25 22:56 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 585 bytes --]

Okay, here's the results:
0000: 12 0a 02 41 00 00 00 00 00 00 00 00 00 0b 00
0070: 01 00
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0100: 0a 02 00 09 09 00 00 00 01 00 00
0200: 01 00 77 00 01 01 55 00
0600: 01
0700: 02
0701: 88 40 00 00
0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0732: 00 00

If I read that right, it looks like it is dynamic backlight capable - 0x702
| (1 << 6).

Let me know if you need anything else, like if you have control code to
test. I don't have much time to work on it myself at the moment but am
happy to test kernels.

-- Michael

>

[-- Attachment #1.2: Type: text/html, Size: 1071 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: eDP display control registers in Linux kernel
  2015-02-25 22:56         ` Michael Leuchtenburg
@ 2015-02-26  8:54           ` Jani Nikula
  2015-02-28  9:44             ` Michael Leuchtenburg
  0 siblings, 1 reply; 9+ messages in thread
From: Jani Nikula @ 2015-02-26  8:54 UTC (permalink / raw)
  To: Michael Leuchtenburg; +Cc: intel-gfx, dri-devel

On Thu, 26 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> Okay, here's the results:
> 0000: 12 0a 02 41 00 00 00 00 00 00 00 00 00 0b 00
> 0070: 01 00
> 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 0100: 0a 02 00 09 09 00 00 00 01 00 00
> 0200: 01 00 77 00 01 01 55 00
> 0600: 01
> 0700: 02
> 0701: 88 40 00 00
> 0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 0732: 00 00
>
> If I read that right, it looks like it is dynamic backlight capable - 0x702
> | (1 << 6).

That's correct, your panel is dynamic backlight *capable*, but the
dynamic backlight *enable* (bit 4 in 0x721) is not set. The power-on
default value is also disabled, and the i915 driver does not touch it
for sure.

It is of course (I wish it wasn't "of course") possible the BIOS enables
that in some circumstances; please try the dump again when you've
observed the brightness swings for sure, and check for the DBC enable
bit.

Also, are you sure the swings are content adaptive, and not ambient
light adaptive? Have you tried locating the ambient light sensor on the
laptop (possibly somewhere in the bezel around the display or keyboard)
and covering or ensuring constant lighting of it?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: eDP display control registers in Linux kernel
  2015-02-26  8:54           ` Jani Nikula
@ 2015-02-28  9:44             ` Michael Leuchtenburg
  2015-03-03 13:36               ` Jani Nikula
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Leuchtenburg @ 2015-02-28  9:44 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 3338 bytes --]

On Thu, Feb 26, 2015 at 3:54 AM, Jani Nikula <jani.nikula@intel.com> wrote:
>
> On Thu, 26 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> > Okay, here's the results:
> > 0000: 12 0a 02 41 00 00 00 00 00 00 00 00 00 0b 00
> > 0070: 01 00
> > 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 0100: 0a 02 00 09 09 00 00 00 01 00 00
> > 0200: 01 00 77 00 01 01 55 00
> > 0600: 01
> > 0700: 02
> > 0701: 88 40 00 00
> > 0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > 0732: 00 00
> >
> > If I read that right, it looks like it is dynamic backlight capable -
0x702
> > | (1 << 6).
>
> That's correct, your panel is dynamic backlight *capable*, but the
> dynamic backlight *enable* (bit 4 in 0x721) is not set. The power-on
> default value is also disabled, and the i915 driver does not touch it
> for sure.
>
> It is of course (I wish it wasn't "of course") possible the BIOS enables
> that in some circumstances; please try the dump again when you've
> observed the brightness swings for sure, and check for the DBC enable
> bit.

No changes, even while the brightness is in the process of changing. Is it
possible there's some other bit used on this hardware? The Broadwell chips
are pretty new. I haven't had a chance to look for specs yet.

>
> Also, are you sure the swings are content adaptive, and not ambient
> light adaptive? Have you tried locating the ambient light sensor on the
> laptop (possibly somewhere in the bezel around the display or keyboard)
> and covering or ensuring constant lighting of it?

There's no ambient light adaptation advertised for this laptop and people
have complained of its lack in Windows. That said, there's two points on
the bezel which could potentially contain a sensor. I think one is a camera
and the other is a microphone, but I tried covering them with a finger and
observed no change in the behavior. If there is such a sensor hidden in the
keyboard, it is *very* well hidden. Covering the entire keyboard doesn't
cause a change in brightness so I suspect it's not an ambient sensor.

Michael
On Thu, 26 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> Okay, here's the results:
> 0000: 12 0a 02 41 00 00 00 00 00 00 00 00 00 0b 00
> 0070: 01 00
> 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 0100: 0a 02 00 09 09 00 00 00 01 00 00
> 0200: 01 00 77 00 01 01 55 00
> 0600: 01
> 0700: 02
> 0701: 88 40 00 00
> 0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 0732: 00 00
>
> If I read that right, it looks like it is dynamic backlight capable -
0x702
> | (1 << 6).

That's correct, your panel is dynamic backlight *capable*, but the
dynamic backlight *enable* (bit 4 in 0x721) is not set. The power-on
default value is also disabled, and the i915 driver does not touch it
for sure.

It is of course (I wish it wasn't "of course") possible the BIOS enables
that in some circumstances; please try the dump again when you've
observed the brightness swings for sure, and check for the DBC enable
bit.

Also, are you sure the swings are content adaptive, and not ambient
light adaptive? Have you tried locating the ambient light sensor on the
laptop (possibly somewhere in the bezel around the display or keyboard)
and covering or ensuring constant lighting of it?


BR,
Jani.


--
Jani Nikula, Intel Open Source Technology Center

[-- Attachment #1.2: Type: text/html, Size: 4302 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: eDP display control registers in Linux kernel
  2015-02-28  9:44             ` Michael Leuchtenburg
@ 2015-03-03 13:36               ` Jani Nikula
  0 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2015-03-03 13:36 UTC (permalink / raw)
  To: Michael Leuchtenburg; +Cc: intel-gfx, dri-devel

On Sat, 28 Feb 2015, Michael Leuchtenburg <michael@slashhome.org> wrote:
> No changes, even while the brightness is in the process of changing. Is it
> possible there's some other bit used on this hardware? The Broadwell chips
> are pretty new. I haven't had a chance to look for specs yet.

The DPCD info is specific to your panel, not the platform.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-03-03 13:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABfYTXSYiObPFoLJ2h-W-o0u-t_=_4YmM52Ma50fqofnWo8VTg@mail.gmail.com>
2015-02-23  7:59 ` eDP display control registers in Linux kernel Jani Nikula
2015-02-23 10:26   ` Stéphane Marchesin
2015-02-23 12:33   ` Michael Leuchtenburg
2015-02-25 12:41     ` Jani Nikula
2015-02-25 19:51       ` Michael Leuchtenburg
2015-02-25 22:56         ` Michael Leuchtenburg
2015-02-26  8:54           ` Jani Nikula
2015-02-28  9:44             ` Michael Leuchtenburg
2015-03-03 13:36               ` 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.