Bug 73521 - Screen backlight control fails on ASUS UX51VZ
Summary: Screen backlight control fails on ASUS UX51VZ
Status: ASSIGNED
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 10:08 UTC by patrick.clara
Modified: 2014-04-23 01:29 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.14 and older
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dsdt.dls (581.81 KB, application/octet-stream)
2014-04-04 10:08 UTC, patrick.clara
Details

Description patrick.clara 2014-04-04 10:08:39 UTC
Created attachment 131421 [details]
dsdt.dls

Hello.

On the asus ux51vz laptop screen backlight is not working. It is a win8 laptop and has only one single nvidia gpu.

By default in /sys/class/backlight i have acpi_video0.
Pressing the hotkeys actually result in a change in acpi_video0/actual_brightness.
Also writing manually to acpi_video0/brightness results in a change in acpi_video0/actual_brightness.
Apparently everything works except that the actual brightness of the screen doesnt change.
Looking at the the _BCM method in the DSDT i saw that it calls STBR which does nothing it think. So the ACPI is broken in my case.

Method (_BCM, 1, NotSerialized)  // _BCM: Brightness Control Method
{
    DIAG (0x1A)
    If (LGreaterEqual (MSOS (), OSW8))
    {
         Store (Arg0, LBTN)
    }
    Else
    {
        Store (GCBL (Arg0), Local0)
        Subtract (0x0A, Local0, LBTN)
    }

    ^^^^LPCB.EC0.STBR ()
    DIAG (0x1B)
}

Method (STBR, 0, Serialized)
{
    Return (One)
}

I have tried lots of combinations of acpi_osi and acpi_os parameters, but essentially nothing changes.


acpi_backlight=legacy does not work.
acpi_backlight=vendor results in asus-nb-wmi and vn_backlight in /sys/class/backlight.
Both the GNOME slider and the hotkeys do not work. I think that GNOME prioritises the platform type over the war and so should use the asus-nb-wmi one. I think also that the asus-wmi module somehow changes the keybinding for the hotkeys in order to use WMI, I actually do not know how these things work.
asus-nb-wmi/actual_brightness stays always at 100 regardless of what i do. Writing to asus-nb-wmi/brightness does not change the brightness.
Again looking at the DSDT in the WMNB section explayns perfectly the situation and shows also WMI is broken here.

Writing manually to vn_backlight/brightness works. The problem is that asus-nb-wmi is somehow in the way.
Booting with acpi_backlight=vendor and blacklisting the asus-wmi and asus-nb-wmi results in working brightness, also hotkeys work, even if sometimes they react a little bit slowly.

I also tested video.use_native_backlight=1 but acpi_video0 still got registred, maybe becouse of the backlight_device_registered(BACKLIGHT_RAW) in this check:

if (acpi_osi_is_win8() && use_native_backlight && backlight_device_registered(BACKLIGHT_RAW))

If i understand correctly, since the only raw backlight device going to be registed is nv_backlight, and since nouveau requires the video module and therefore gets loaded afterwards, this condition will never become true.

I tried removing the backlight_device_registered(BACKLIGHT_RAW) and than video.use_native_backlight=1 do what it is supposed to do.

The problem remains in the way asus-wmi and nouveau check if they should register their own control devices. They use acpi_video_backlight_support() I think which is unaffected by the use_native_backlight parameter.

Just for testing I tried removing the check from the nouveau driver and forcing it to register the nv_backlight.
This way, booting with use_native_backlight=1 actually gives a system with working backlight, altough this solution is far from beeing optimal and also far from beeing out of the box.


I hope I could give you at least some useful information to resolve this issue. I don't mind providing you more detaied information if you need.

Thank you in advance.
Comment 1 Aaron Lu 2014-04-23 01:29:29 UTC
(In reply to patrick.clara from comment #0)
> Created attachment 131421 [details]
> dsdt.dls
> 
> Hello.
> 
> On the asus ux51vz laptop screen backlight is not working. It is a win8
> laptop and has only one single nvidia gpu.
> 
> By default in /sys/class/backlight i have acpi_video0.
> Pressing the hotkeys actually result in a change in
> acpi_video0/actual_brightness.
> Also writing manually to acpi_video0/brightness results in a change in
> acpi_video0/actual_brightness.
> Apparently everything works except that the actual brightness of the screen
> doesnt change.
> Looking at the the _BCM method in the DSDT i saw that it calls STBR which
> does nothing it think. So the ACPI is broken in my case.

agree.

> I also tested video.use_native_backlight=1 but acpi_video0 still got
> registred, maybe becouse of the backlight_device_registered(BACKLIGHT_RAW)
> in this check:
> 
> if (acpi_osi_is_win8() && use_native_backlight &&
> backlight_device_registered(BACKLIGHT_RAW))

right.

> 
> If i understand correctly, since the only raw backlight device going to be
> registed is nv_backlight, and since nouveau requires the video module and
> therefore gets loaded afterwards, this condition will never become true.
> 
> I tried removing the backlight_device_registered(BACKLIGHT_RAW) and than
> video.use_native_backlight=1 do what it is supposed to do.
> 
> The problem remains in the way asus-wmi and nouveau check if they should
> register their own control devices. They use acpi_video_backlight_support()
> I think which is unaffected by the use_native_backlight parameter.

We will need to talk to nv gpu developers on this.
I don't think the following is the correct behaviour - whether ACPI video has provided an interface doesn't matter if the gpu driver should provide a control interface, the only criteria should be: the interface is not broken.

#ifdef CONFIG_ACPI
        if (acpi_video_backlight_support()) {
                NV_INFO(drm, "ACPI backlight interface available, "
                             "not registering our own\n");
                return 0;
        }
#endif

> 
> Just for testing I tried removing the check from the nouveau driver and
> forcing it to register the nv_backlight.
> This way, booting with use_native_backlight=1 actually gives a system with
> working backlight, altough this solution is far from beeing optimal and also
> far from beeing out of the box.

We can easily add APIs in acpi video module to unregister its backlight interface without losing its event reporting capability. But we will need to talk to nv gpu developers on this first - is it the case for win8 systems, the gpu is in control of the backlight? For many intel gpu based system it is the case.

Note You need to log in before you can comment on or make changes to this bug.