Bug 100446 - Backlight control not working on Pascal / GP106 using nouveau drivers
Summary: Backlight control not working on Pascal / GP106 using nouveau drivers
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 106305 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-29 10:42 UTC by Carlo Caione
Modified: 2019-02-04 14:28 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
vbios + mmiotrace (7.77 MB, application/x-xz)
2017-04-10 17:10 UTC, Carlo Caione
no flags Details
Proposed fix, relative to 4.16.0 (582 bytes, patch)
2018-04-06 00:20 UTC, Bernhard Rosenkraenzer
no flags Details | Splinter Review
nouveau_backlight.c working on msi gt73vr 6rf titan pro (8.94 KB, text/plain)
2018-05-01 02:12 UTC, Geroge T
no flags Details

Description Carlo Caione 2017-03-29 10:42:53 UTC
I'm currently working on an ASUS GL702VMK. This machine is shipping a GeForce GTX 1060 GP106 (136000a1) connected to an internal DisplayPort on DFP-5 (usual AU Optronics Corporation).

Using the unmodified latest nouveau drivers I have no backlight control. Modifying nouveau_backlight.c adding a case for NV_DEVICE_INFO_V0_PASCAL I finally get /sys/class/backlight/nv_backlight/ but changing the backlight value in there is not working anyway.

Trying to manually poke NV50_PDISP_SOR_PWM_CTL(1) with `nvapoke` has no effect whatsoever on the brightness (on or==1)

Backlight control is not working using the proprietary 375 / 378 drivers either. Also in this case the value of NV50_PDISP_SOR_PWM_CTL is actually changed by `xbacklight` but with no visible effect.

Any hint?
Comment 1 Carlo Caione 2017-04-10 17:10:49 UTC
Created attachment 130784 [details]
vbios + mmiotrace
Comment 2 Carlo Caione 2017-04-10 17:12:34 UTC
In attachment (tar + xz -9):
- vbios
- mmiotrace
- demmio'd mmiotrace

The trace was taken in pure Xorg with only xterm running and:

echo "XSET50IN" > /sys/kernel/debug/tracing/trace_marker
    && xbacklight -set 50 -steps 1
    && echo "XSET50OUT" > /sys/kernel/debug/tracing/trace_marker
sleep 2
echo "XSET100IN" > /sys/kernel/debug/tracing/trace_marker
    && xbacklight -set 100 -steps 1
    && echo "XSET100OUT" > /sys/kernel/debug/tracing/trace_marker
Comment 3 Carlo Caione 2017-04-10 17:14:45 UTC
I forgot: the mmiotrace was taken using the proprietary NVIDIA drivers 381.09 (beta). With this version I'm able to change the brightness using xbacklight.
Comment 4 Carlo Caione 2017-05-16 11:20:26 UTC
For the sake of completeness some more info on this.

The two settings differ only for couple of accesses:

< MMIO32 W 0x00d980 0x000000ff PGPIO+0x980 <= 0xff
---
> MMIO32 W 0x00d980 0x0000007f PGPIO+0x980 <= 0x7f

< MMIO32 W 0x619484 0x0000ff00 PDISPLAY.VGA.CR+0x84 <= 0xff00
---
> MMIO32 W 0x619484 0x00007000 PDISPLAY.VGA.CR+0x84 <= 0x7000

The problem is that poking at those registers using nvapeek / nvapoke doesn't change the brightness.

Also trying to use nvammiotracereplay to reply step-by-step the mmio trace has no effect on the brightness.
Comment 5 caguduzexi 2018-01-29 14:10:54 UTC
I wont recommend using/keeping the GP106 (GTX 1060). It cant ever run with free software: https://www.theregister.co.uk/2015/04/15/nvidia_gtx_900_linux_driver_roadbloack/
https://www.phoronix.com/scan.php?page=news_item&px=Nouveau-XDC2017
https://www.phoronix.com/scan.php?page=news_item&px=Nouveau-XDC2016-NVIDIA

Sell this crappy GP102 card (in your case the notebook that contains this crap) away and go away from nvidia. Nvidia died with the 780ti card. Its the last end-user card that can be used normaly. Everything else is in some countries even a legal problem. Because the manufacturer (nvidia) blocks the users from beeing able to boot the software they want on THEIR hardware - happyly illegal in some countries. Hopefully some layer would sue the heck out of nvidia so that they would have to release the private signing key or close their doors.
Blocking the freedom of the users on such way should not be accepted by anyone.
Comment 6 Martin Peres 2018-01-29 17:34:27 UTC
(In reply to caguduzexi from comment #5)
> I wont recommend using/keeping the GP106 (GTX 1060). It cant ever run with
> free software:
> https://www.theregister.co.uk/2015/04/15/
> nvidia_gtx_900_linux_driver_roadbloack/
> https://www.phoronix.com/scan.php?page=news_item&px=Nouveau-XDC2017
> https://www.phoronix.com/scan.php?page=news_item&px=Nouveau-XDC2016-NVIDIA
> 
> Sell this crappy GP102 card (in your case the notebook that contains this
> crap) away and go away from nvidia. Nvidia died with the 780ti card. Its the
> last end-user card that can be used normaly. Everything else is in some
> countries even a legal problem. Because the manufacturer (nvidia) blocks the
> users from beeing able to boot the software they want on THEIR hardware -
> happyly illegal in some countries. Hopefully some layer would sue the heck
> out of nvidia so that they would have to release the private signing key or
> close their doors.
> Blocking the freedom of the users on such way should not be accepted by
> anyone.

User banned
Comment 7 Karol Herbst 2018-03-22 14:26:52 UTC
(In reply to Carlo Caione from comment #4)
> For the sake of completeness some more info on this.
> 
> The two settings differ only for couple of accesses:
> 
> < MMIO32 W 0x00d980 0x000000ff PGPIO+0x980 <= 0xff
> ---
> > MMIO32 W 0x00d980 0x0000007f PGPIO+0x980 <= 0x7f
> 
> < MMIO32 W 0x619484 0x0000ff00 PDISPLAY.VGA.CR+0x84 <= 0xff00
> ---
> > MMIO32 W 0x619484 0x00007000 PDISPLAY.VGA.CR+0x84 <= 0x7000
> 
> The problem is that poking at those registers using nvapeek / nvapoke
> doesn't change the brightness.
> 
> Also trying to use nvammiotracereplay to reply step-by-step the mmio trace
> has no effect on the brightness.

Can you check that this is fixed in 4.16-rc6? A fix landed to address backlight problems and it might be the same you had: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.16-rc6&id=9e75dc61eaa9acd1bff83c3b814ac2af6dc1f64c
Comment 8 Pedro Albuquerque Santos 2018-04-03 00:01:50 UTC
I have the same problem on an ASUS GL502VM with a GTX 1060 6GB. UNFORTUNATELY this laptop shipped with G-SYNC enabled, which means that the Intel GPU is completely disabled and everything goes through/is controlled by the NVIDIA GPU. I would rather have no G-SYNC but having the Intel GPU driving the display output and backlight. I'm sure that it would be a much less painful experience.

Well... Enough with ranting! Since you suggested that this may have been fixed by a recent kernel update, I have tested a Fedora 28 Workstation Live Image that comes with the 4.16rc6 kernel. But the problem persists.

From what I could understand, even if the 4.16 corrects the underlying issue, the nouveau driver still needs to be changed and manually recompiled as suggested by the OP because backlight support for Pascal-based cards is not enabled by that switch statement. The "NV_DEVICE_INFO_V0_PASCAL" clause is missing in the "nvidia_backlight.c" file. Is this assessment correct?

Also, feel free to ask me for any further information that may help you to fully support backlight control for Pascal GPUs. I may need some instructions on how to gather some lower level information, but I'll gladly do it if you think that it may help.
Comment 9 Bernhard Rosenkraenzer 2018-04-05 22:59:54 UTC
Still happens with 4.16.0 final on an hp omen 17-an0xx laptop.

GPU details from lspci:
01:00.0 0300: 10de:1be1 (rev a1) (prog-if 00 [VGA controller])
        Subsystem: 103c:8393
        Flags: bus master, fast devsel, latency 0, IRQ 132
        Memory at db000000 (32-bit, non-prefetchable) [size=16M]
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        Memory at c0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at e000 [size=128]
        Expansion ROM at dc000000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [250] Latency Tolerance Reporting
        Capabilities: [258] L1 PM Substates
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] #19
        Kernel driver in use: nouveau
        Kernel modules: nvidiafb, nouveau

Additionally, the display doesn't turn on again after an "xset dpms force off" (bug #103383); this may well be related.
Comment 10 Bernhard Rosenkraenzer 2018-04-06 00:20:27 UTC
Created attachment 138646 [details] [review]
Proposed fix, relative to 4.16.0

The combination of the fix in 4.16-rc and the hint from the first comment on the bug did it -- backlight control works (at least on my hp Omen) with this patch on top of 4.16.0.
Comment 11 Geroge T 2018-05-01 02:06:41 UTC
*** Bug 106305 has been marked as a duplicate of this bug. ***
Comment 12 Geroge T 2018-05-01 02:10:26 UTC
I confirm that adding the line "case NV_DEVICE_INFO_V0_PASCAL:" over latest kernel git makes it work on my MSI GT73VR 6RF Titan Pro. Will attach the file for testing purposes.
Comment 13 Geroge T 2018-05-01 02:12:14 UTC
Created attachment 139241 [details]
nouveau_backlight.c working on msi gt73vr 6rf titan pro
Comment 14 Geroge T 2018-05-05 13:34:42 UTC
Related?

https://bugzilla.gnome.org/show_bug.cgi?id=688052
Comment 15 Pedro Albuquerque Santos 2019-01-31 10:29:07 UTC
Any reason why this hasn't been fixed yet given that it seems to be an easy fix?
Comment 16 Ilia Mirkin 2019-02-04 06:24:19 UTC
(In reply to Pedro Albuquerque Santos from comment #15)
> Any reason why this hasn't been fixed yet given that it seems to be an easy
> fix?

This is in Ben's tree now:

https://github.com/skeggsb/nouveau/commit/a9133adc009eb3b982fb27d073e5087e63187b23

And should make its way to kernel 5.1.
Comment 17 Ilia Mirkin 2019-02-04 06:25:45 UTC
Er, make that 5.0. It's in 5.0-rc2.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.