* NV50 backlight brightness
@ 2010-10-19 9:10 Aaron Sowry
[not found] ` <20101019091030.GA28588-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Aaron Sowry @ 2010-10-19 9:10 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
[-- Attachment #1.1: Type: text/plain, Size: 1117 bytes --]
Hi,
The NV50 codepath in nouveau_backlight.c invariably sets max_brightness to 1025, regardless of the chipset in question. The maximum brightness is not 1025 for all NV50 chipsets (for example, by setting the brightness via ACPI controls and peeking the brightness register, I find that the maximum brightness level for my a8 card is 0x4001df67 although I am unsure of the significance of the MSB).
This means when anything manipulates the backlight using nouveau controls (in my case, usually g-p-m), I get very low backlight brightnesses. 2 questions:
1) Is this a known problem, and has it been looked at before? My affected laptop is a ThinkPad and I know that some Macbooks are also affected, so I would be surprised if it isn't fairly common.
2) In the absence of a reliable way to determine a card's max_brightness by peeking registers or similar, is some kind of mapping table in the code an acceptable solution for assigning max_brightness values to certain chipsets?
This has been discussed at some length on the RedHat bugzilla here:
https://bugzilla.redhat.com/show_bug.cgi?id=625171
Cheers,
Aaron
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
[-- Attachment #2: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 7+ messages in thread[parent not found: <20101019091030.GA28588-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>]
* Re: NV50 backlight brightness [not found] ` <20101019091030.GA28588-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> @ 2010-10-20 11:17 ` Ben Skeggs 2010-10-21 9:16 ` Aaron Sowry 0 siblings, 1 reply; 7+ messages in thread From: Ben Skeggs @ 2010-10-20 11:17 UTC (permalink / raw) To: Aaron Sowry; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW On Tue, 2010-10-19 at 11:10 +0200, Aaron Sowry wrote: > Hi, > > The NV50 codepath in nouveau_backlight.c invariably sets max_brightness to 1025, regardless of the chipset in question. The maximum brightness is not 1025 for all NV50 chipsets (for example, by setting the brightness via ACPI controls and peeking the brightness register, I find that the maximum brightness level for my a8 card is 0x4001df67 although I am unsure of the significance of the MSB). > > This means when anything manipulates the backlight using nouveau controls (in my case, usually g-p-m), I get very low backlight brightnesses. 2 questions: > > 1) Is this a known problem, and has it been looked at before? My affected laptop is a ThinkPad and I know that some Macbooks are also affected, so I would be surprised if it isn't fairly common. > > 2) In the absence of a reliable way to determine a card's max_brightness by peeking registers or similar, is some kind of mapping table in the code an acceptable solution for assigning max_brightness values to certain chipsets? I have a question to you that's important first: if you fix nouveau's max_brightness level, can you actually properly change the brightness? I have an eDP laptop that shows the same backlight level regardless of what's in that register. Ben. > > This has been discussed at some length on the RedHat bugzilla here: > https://bugzilla.redhat.com/show_bug.cgi?id=625171 > > Cheers, > Aaron > _______________________________________________ > Nouveau mailing list > Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: NV50 backlight brightness 2010-10-20 11:17 ` Ben Skeggs @ 2010-10-21 9:16 ` Aaron Sowry [not found] ` <20101021091621.GA29567-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Aaron Sowry @ 2010-10-21 9:16 UTC (permalink / raw) To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW [-- Attachment #1.1.1: Type: text/plain, Size: 580 bytes --] On Wed, Oct 20, 2010 at 09:17:39PM +1000, Ben Skeggs wrote: > I have a question to you that's important first: if you fix nouveau's > max_brightness level, can you actually properly change the brightness? > > I have an eDP laptop that shows the same backlight level regardless of > what's in that register. > By applying the attached patch I can properly change the brightness levels using g-p-m. The only question is what the 0x40000000 bit represents as set by BIOS/ACPI - both 0x40001fff and 0x00001fff seem to work fine as far as brightness levels are concerned. [-- Attachment #1.1.2: linux-2.6.35-20100921.patch --] [-- Type: text/x-diff, Size: 781 bytes --] diff -uNrp kernel-2.6.35.fc14.orig/drivers/gpu/drm/nouveau/nouveau_backlight.c kernel-2.6.35.fc14.new/drivers/gpu/drm/nouveau/nouveau_backlight.c --- kernel-2.6.35.fc14.orig/drivers/gpu/drm/nouveau/nouveau_backlight.c 2010-09-10 14:04:09.301972164 +0200 +++ kernel-2.6.35.fc14.new/drivers/gpu/drm/nouveau/nouveau_backlight.c 2010-10-21 10:04:03.709309995 +0200 @@ -120,7 +120,11 @@ static int nouveau_nv50_backlight_init(s return 0; memset(&props, 0, sizeof(struct backlight_properties)); - props.max_brightness = 1025; + if (dev_priv->chipset >= 0xa8) + props.max_brightness = 0x0001ffff; + else + props.max_brightness = 1025; + bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, &nv50_bl_ops, &props); if (IS_ERR(bd)) [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 489 bytes --] [-- Attachment #2: Type: text/plain, Size: 181 bytes --] _______________________________________________ Nouveau mailing list Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20101021091621.GA29567-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>]
* Re: NV50 backlight brightness [not found] ` <20101021091621.GA29567-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> @ 2010-10-21 10:45 ` Ben Skeggs 2010-10-22 9:57 ` Aaron Sowry 0 siblings, 1 reply; 7+ messages in thread From: Ben Skeggs @ 2010-10-21 10:45 UTC (permalink / raw) To: Aaron Sowry; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW On Thu, 2010-10-21 at 11:16 +0200, Aaron Sowry wrote: > On Wed, Oct 20, 2010 at 09:17:39PM +1000, Ben Skeggs wrote: > > I have a question to you that's important first: if you fix nouveau's > > max_brightness level, can you actually properly change the brightness? > > > > I have an eDP laptop that shows the same backlight level regardless of > > what's in that register. > > > > By applying the attached patch I can properly change the brightness levels using g-p-m. The only question is what the 0x40000000 bit represents as set by BIOS/ACPI - both 0x40001fff and 0x00001fff seem to work fine as far as brightness levels are concerned. Ok. I'll look at all the kmmio/vbios data I have tomorrow, and come up with some kind of "solution", it'll likely require tweaking as we see more data. What value does 0x610084 contain on boot for you? Ben. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: NV50 backlight brightness 2010-10-21 10:45 ` Ben Skeggs @ 2010-10-22 9:57 ` Aaron Sowry [not found] ` <20101022095740.GA30072-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Aaron Sowry @ 2010-10-22 9:57 UTC (permalink / raw) To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW [-- Attachment #1.1.1: Type: text/plain, Size: 376 bytes --] On Thu, Oct 21, 2010 at 08:45:20PM +1000, Ben Skeggs wrote: > What value does 0x610084 contain on boot for you? > Using the attached patch (hopefully early enough on in the initialisation): [aaron@jules ~]$ dmesg | grep NV50 [drm] nouveau 0000:01:00.0: Detected an NV50 generation card (0x0a8600a2) NV50 0x00610084: 0xa0000000 What's the relevance of this value? [-- Attachment #1.1.2: reg_peek.patch --] [-- Type: text/x-diff, Size: 572 bytes --] --- /home/aaron/rpmbuild/BUILD/kernel-2.6.35.fc14.orig/drivers/gpu/drm/nouveau/nv50_display.c 2010-09-09 23:00:38.774029000 +0200 +++ /home/aaron/rpmbuild/BUILD/kernel-2.6.35.fc14/linux-2.6.35.x86_64/drivers/gpu/drm/nouveau/nv50_display.c 2010-10-22 11:36:32.252185209 +0200 @@ -205,6 +205,8 @@ nv50_display_init(struct drm_device *dev NV_DEBUG_KMS(dev, "\n"); + printk("NV50 0x00610084: 0x%08x\n", nv_rd32(dev, 0x00610084)); + nv_wr32(dev, 0x00610184, nv_rd32(dev, 0x00614004)); /* * I think the 0x006101XX range is some kind of main control area [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 489 bytes --] [-- Attachment #2: Type: text/plain, Size: 181 bytes --] _______________________________________________ Nouveau mailing list Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20101022095740.GA30072-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>]
* Re: NV50 backlight brightness [not found] ` <20101022095740.GA30072-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> @ 2010-10-22 11:17 ` Ben Skeggs [not found] ` <FC457B53-D6EF-48DC-BB56-F2FAC3D84577-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Ben Skeggs @ 2010-10-22 11:17 UTC (permalink / raw) To: Aaron Sowry; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sent from my iPhone On 22/10/2010, at 19:57, Aaron Sowry <aaron+nv-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org> wrote: > On Thu, Oct 21, 2010 at 08:45:20PM +1000, Ben Skeggs wrote: >> What value does 0x610084 contain on boot for you? >> > Using the attached patch (hopefully early enough on in the initialisation): > > [aaron@jules ~]$ dmesg | grep NV50 > [drm] nouveau 0000:01:00.0: Detected an NV50 generation card (0x0a8600a2) > NV50 0x00610084: 0xa0000000 > > What's the relevance of this value? Oops, nothing, that was a typo. 0x61c084 is what I meant :) > <reg_peek.patch> ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <FC457B53-D6EF-48DC-BB56-F2FAC3D84577-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: NV50 backlight brightness [not found] ` <FC457B53-D6EF-48DC-BB56-F2FAC3D84577-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2010-10-22 11:51 ` Aaron Sowry 0 siblings, 0 replies; 7+ messages in thread From: Aaron Sowry @ 2010-10-22 11:51 UTC (permalink / raw) To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW [-- Attachment #1.1: Type: text/plain, Size: 214 bytes --] On Fri, Oct 22, 2010 at 09:17:37PM +1000, Ben Skeggs wrote: > > What's the relevance of this value? > Oops, nothing, that was a typo. 0x61c084 is what I meant :) > Heh. It's 0x40012ccd initially. /Aaron [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 489 bytes --] [-- Attachment #2: Type: text/plain, Size: 181 bytes --] _______________________________________________ Nouveau mailing list Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org http://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-10-22 11:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 9:10 NV50 backlight brightness Aaron Sowry
[not found] ` <20101019091030.GA28588-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
2010-10-20 11:17 ` Ben Skeggs
2010-10-21 9:16 ` Aaron Sowry
[not found] ` <20101021091621.GA29567-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
2010-10-21 10:45 ` Ben Skeggs
2010-10-22 9:57 ` Aaron Sowry
[not found] ` <20101022095740.GA30072-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
2010-10-22 11:17 ` Ben Skeggs
[not found] ` <FC457B53-D6EF-48DC-BB56-F2FAC3D84577-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-10-22 11:51 ` Aaron Sowry
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.