Skip to contentSkip to conversation

New: Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

Bug 105051 [email protected] 1 participant 18 messages Sep 26, 2015 – Oct 22, 2015

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Bug ID: 105051
Summary: Radeon sets max_brightness to -1, breaking GNOME
backlight control on Macbook Pro mid-2015 11,5
Product: Drivers
Version: 2.5
Kernel Version: 4.2.1
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Video(DRI - non Intel)
Assignee: [email protected]
Reporter: [email protected]
Regression: No

Created attachment 188601
--> https://bugzilla.kernel.org/attachment.cgi?id=188601&action=edit
dmesg output

The radeon driver appears to be setting an incorrect value of -1 for max_brightness in /sys/devices/pnp0/00:03/backlight/gmux_backlight/max_brightness. This computer is a Macbook Pro Retina mid-2015 model 11,5 without any video or acpi related kernel command line options.

This prevents GNOME from correctly managing the backlight. You can see this using the following commands:

$ cat /sys/devices/pnp0/00:03/backlight/gmux_backlight/max_brightness
-1
$ /usr/libexec/gsd-backlight-helper --get-max-brightness
Could not get the maximum value of the backlight: got invalid backlight value
from /sys/devices/pnp0/00:03/backlight/gmux_backlight/max_brightness
$ sudo /usr/libexec/gsd-backlight-helper --set-brightness 500
Could not get the maximum value of the backlight: got invalid backlight value
from /sys/devices/pnp0/00:03/backlight/gmux_backlight/max_brightness

This looks to be the same issue reported into the RedHat bugzilla at:

https://bugzilla.redhat.com/show_bug.cgi?id=1263387

I've attached the dmesg from my machine.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Alex Deucher <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Alex Deucher <[email protected]> --- Radeon hardware supports 256 levels of brightness (0-255). The backlight integer property max_brightness is thus set to RADEON_MAX_BL_LEVEL (0xff). It sounds like GNOME is misinterpreting the value.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Robert Abraham <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |robert.abraham86@googlemail
                   |                            |.com

--- Comment #2 from Robert Abraham <[email protected]> --- I have a similar problem. gmux_backlight/max_brightness is set to -1. But i also have a radeon_bl entry in /sys/class/backlight which has the correct values.
But no matter which value i echo into /sys/class/backlight/radeon_bl/brightness i am on max brightness, except i echo 0. in this case the backlight turns off.

so i can only choose between backlight off or on max brightness. it works perfectly fine on 4.0.x kernel though.

i will happily provide any information you need.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #3 from Alex Deucher <[email protected]> --- (In reply to Robert Abraham from comment #2)

Quoted 2 lines

it works perfectly fine on 4.0.x kernel though.

The radeon backlight code hasn't really changed since it was added so presumably something else did. Can you bisect? Since this is a mac, it's possible the GPU driver does not actually control the backlight. Everything is a one off on macs.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #4 from Tim Sammut <[email protected]> --- (In reply to Alex Deucher from comment #1)

Quoted 3 lines

Radeon hardware supports 256 levels of brightness (0-255). The backlight integer property max_brightness is thus set to RADEON_MAX_BL_LEVEL (0xff). It sounds like GNOME is misinterpreting the value.

Hi Alex, thanks. I don't think is a GNOME issue. This is via /sys and you can see the max_brightness = -1 here:

$ for F in /sys/class/backlight/*/{type,max_brightness}; do echo $F: $(cat $F);
done | sort
/sys/class/backlight/gmux_backlight/max_brightness: -1
/sys/class/backlight/gmux_backlight/type: platform
/sys/class/backlight/radeon_bl0/max_brightness: 255
/sys/class/backlight/radeon_bl0/type: raw

Manually adjusting the brightness via echo $level > /sys/class/backlight/gmux_backlight/brightness works, but GNOME control of brightness and the on-screen display do not.

Quoted 4 lines

The radeon backlight code hasn't really changed since it was added so presumably something else did. Can you bisect? Since this is a mac, it's possible the GPU driver does not actually control the backlight. Everything is a one off on macs.

Yeah, but probably not for 3+ weeks... sorry.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #5 from Tim Sammut <[email protected]> --- (In reply to Robert Abraham from comment #2)

Quoted 8 lines

But i also have a radeon_bl entry in /sys/class/backlight which has the correct values.
But no matter which value i echo into /sys/class/backlight/radeon_bl/brightness i am on max brightness, except i echo 0. in this case the backlight turns off.

so i can only choose between backlight off or on max brightness. it works perfectly fine on 4.0.x kernel though.

Just for the record, this is precise how my machine behaves as well.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #6 from Robert Abraham <[email protected]> --- commit
4eebd5a4e72697aac25a8a57d3f888a9d5f80370

breaks the backlight for me.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #7 from Alex Deucher <[email protected]> --- Perhaps the radeon driver should just not attempt to register a backlight interface on Macs since they seem to use the gmux for backlight control. Some one with more knowledge of mac hw should probably comment on how they should be handled.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #8 from Michel Dänzer <[email protected]> --- (In reply to Robert Abraham from comment #6)

Quoted 4 lines

commit
4eebd5a4e72697aac25a8a57d3f888a9d5f80370

breaks the backlight for me.

That's an apple-gmux change, not a radeon driver change. Please reassign the component of this bug report accordingly.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #9 from Tim Sammut <[email protected]> --- (In reply to Michel Dänzer from comment #8)

Quoted 3 lines

That's an apple-gmux change, not a radeon driver change. Please reassign the component of this bug report accordingly.

Thanks, I'd be happy to, but I don't see where to but it and looking at other apple_gmux bugs seem scattered. Help!?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #10 from Michel Dänzer <[email protected]> --- It may be easier to contact the apple-gmux developers via e-mail. The scripts/get_maintainer.pl script should be useful for that.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Tim Sammut <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Component|Video(DRI - non Intel) |Platform_x86

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #11 from Tim Sammut <[email protected]> --- (In reply to Robert Abraham from comment #6)

Quoted 4 lines

commit
4eebd5a4e72697aac25a8a57d3f888a9d5f80370

breaks the backlight for me.

Yep, me too. Reverting that change against a 4.2.1 kernel completely fixes the issues. Brightness adjusts and OSD appears.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #12 from Tim Sammut <[email protected]> --- (In reply to Michel Dänzer from comment #8)

Quoted 3 lines

That's an apple-gmux change, not a radeon driver change. Please reassign the component of this bug report accordingly.

Hi. I changed the component based on the output of scripts/get_maintainer.pl, but I do not appear to be able to reassign the bug.

Is anyone watching this bug able to reassign it?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #13 from Alex Deucher <[email protected]> --- Only the original filer or an admin can change it as far as I know.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Felipe Ortiz <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #14 from Felipe Ortiz <[email protected]> ---
I can confirm the problem with 4eebd5a4e72697aac25a8a57d3f888a9d5f80370. I have a MPB 11,5 with AMD/Intel graphics. I recompile the module (a previous version of 4eebd5a4e72697aac25a8a57d3f888a9d5f80370) and brightness adjusts is working again.

I see two problems:

1) If someone uses gpu-switch (https://github.com/0xbb/gpu-switch) with this bug screen seem not work, after severals reboots (with different kernels) I can access a terminal and execute gpu-switch -d and then screen seems work again.

2) If you use a Intel card (swiched with gpu-switch) the OSD (activated with functions keys) is so slow and chromium have the same problem (temporary fix is deactivate chromium hw acceleration) is this a intel driver bug?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#16 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

--- Comment #15 from Darren Hart <[email protected]> --- Thanks for reporting, we're following up on the platform-drivers-x86 mailing list.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#17 lore raw

[Bug 105051] Radeon sets max_brightness to -1, breaking GNOME backlight control on Macbook Pro mid-2015 11,5

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=105051

Darren Hart <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

           Assignee|drivers_video-dri@kernel-bu |drivers_platform_x86@kernel
                   |gs.osdl.org                 |-bugs.osdl.org
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel