Bug 292873 - intel_backlight on "switchable" graphics
Summary: intel_backlight on "switchable" graphics
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 15:13 UTC by Aaron Bauman
Modified: 2013-06-06 00:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Bauman 2012-01-30 15:13:48 UTC
Version:           unspecified (using KDE 4.8.0) 
OS:                Linux

My system has the "HP Switchable graphics" setup which consists of 1 Intel integrated graphics card and 1 Dedicated Radeon GPU.

I have found KDE is referencing the incorrect file when making adjustments to the backlight of my system.  I have the following files for backlights.

/sys/class/backlight/acpi_video0
/sys/class/backlight/acpi_video1
/sys/class/backlight/intel_backlight

The brightness slider under power management and FN keys do work however the changes are being reflected in the acpi_video1 file (confirmed with simple 'cat' on the command line).  Manual editing of intel_backlight confirms this is the correct card to adjust brightness levels.  I have also found the following bug which addresses the priority of different GPU's but does not include the switchable graphics dilemma.  

https://bugs.kde.org/show_bug.cgi?id=288180


Reproducible: Always

Steps to Reproduce:
Attempt to adjust brightness.

Actual Results:  
The incorrect file reflected the brightness adjustments.

Expected Results:  
backlight adjusted.
Comment 1 Alex Fiestas 2012-02-02 18:40:49 UTC
Can you cat

/sys/class/backlight/acpi_video1/type
/sys/class/backlight/acpi_video0/type
/sys/class/backlight/intel_backlight/type

Thanks.
Comment 2 Aaron Bauman 2012-02-02 19:08:44 UTC
video1 = firmware
video0 = firmware
intel_backlight = raw
Comment 3 Alex Fiestas 2012-02-02 22:07:46 UTC
Ok so, do you have any idea of how to deal with swicheable GPU ?any idea of knowing which video_acpi is the correct one?
Comment 4 Aaron Bauman 2012-02-02 22:14:06 UTC
Alex, I am able to adjust the brightness by modifying the intel_backlight/brightness file.  As far as dealing with the dual GPU's I have been unsuccessful in the switcheroo (kernel) or even starting X with the radeon.  If I were booted and running off of the radeon I am unsure which video1 or video0 would become relevant at that point.

Other reports say the radeon GPU does the rendering but everything is sent back through the intel card so that would change things.  I hope this helps.  Please feel free to ask any further questions.  I am more than happy to assist!
Comment 5 Alex Fiestas 2012-02-02 23:00:17 UTC
intel_backlight is now the "last resource interface" since it is "raw" instead we will prioritize the ones with interface "firmware".

I'm going to push a commit in a few minutes that will close this bug (since it is against 4.8) which will put intel_backlight after acpi_video1/0.

Not related to this bug, can you give me the output of everything within acpi_video1/0 folders?

Thanks !
Comment 6 Aaron Bauman 2012-02-02 23:15:34 UTC
So why is it not currently working?  I am unsure how it is determined that an interface, while available, is not the correct one?  Working on getting you the data you requested as well.
Comment 7 Aaron Bauman 2012-02-02 23:24:21 UTC
Do you need just the main files in the acpi_video1/0 or all the subdirectories as well?
Comment 8 Alex Fiestas 2012-02-03 01:06:48 UTC
Git commit 018679ecdd07a2fd8dfb27df79355465252e8bc2 by Alex Fiestas.
Committed on 02/02/2012 at 23:59.
Pushed by afiestas into branch 'KDE/4.8'.

Put acpi_video1/0 before intel_backlight

Now we know that firmware interface should be put BEFORE the raw ones
so in this case, acpi_video1/0 are firmware and intel_backlight is RAW.
Related: bug 288180

M  +4    -3    powerdevil/daemon/backends/upower/backlighthelper.cpp

http://commits.kde.org/kde-workspace/018679ecdd07a2fd8dfb27df79355465252e8bc2
Comment 9 Alex Fiestas 2012-02-03 01:29:46 UTC
Git commit 5257ff19aa3e779a9e07cc49ee82cca7a051b558 by Alex Fiestas.
Committed on 03/02/2012 at 02:12.
Pushed by afiestas into branch 'master'.

If kernel newer than 2.6.36 use the backlight type instead of whitelist

If the kernel is newer than 2.6.36 it indicates the type of the
backlight wether it is a firmware/platform or raw. We should
attempt to connect to these interfaces in this order.

This should fix any compatibility issue we have right now and make this
code comaptible with drivers that may appear in the future.
Related: bug 288180
CCMAIL: lukas@kde.org
FIXED-IN: 4.9

M  +97   -5    powerdevil/daemon/backends/upower/backlighthelper.cpp
M  +19   -0    powerdevil/daemon/backends/upower/backlighthelper.h

http://commits.kde.org/kde-workspace/5257ff19aa3e779a9e07cc49ee82cca7a051b558
Comment 10 Alex Fiestas 2012-02-03 08:45:59 UTC
WEll not is not determinated by any logic but a whitelist, the last change shown in the report (5257ff1) changes that by prefering the ones with type firmware.

In your case, acpi_video1 will be loaded which is working for you.

Once switcheable graphics is working perfect we will have to adapt the code to pic the "active one".
Comment 11 Aaron Bauman 2012-02-03 13:25:43 UTC
Understood,  I applied the patch with no luck of controlling it.  intel_backlight is my active one.
Comment 12 Alex Fiestas 2012-02-05 15:27:34 UTC
What do you mean with
Comment 13 Aaron Bauman 2012-02-05 15:43:46 UTC
Alex, I applied your patch to powerdevil in hopes of controlling the backlight with power management (battery applet, fn keys etc).  I am not able to though.  intel_backlight is what I am able to manually (echo foo > /sys/class/backlight/intel_backlight/brightness) control to change brightness settings.
Comment 14 Alex Fiestas 2012-02-06 23:28:29 UTC
I see, then I'm afraid it is some kind of error in the stack below KDE, what we have been told from Kernel developer is:

-Firmware drivers first
-Then platform
-finally Raw

intel_backlight is a raw driver and since you have some others (acpi_video0-1) which are firmware we are selecting them.

can you give me some more information about your hardware? maybe

lshw output?
Comment 15 Aaron Bauman 2012-02-06 23:33:24 UTC
Alex, first and foremost thank you for your patience on this bug and the awesome feedback.  Here is a link to my lshw output.

http://pastebin.com/kk3TztYE
Comment 16 Aaron Bauman 2012-02-10 02:47:44 UTC
Alex, I have been able to get my discrete graphics card working and the issue still remains.  So the system is not using the acpi_video0/1 at all it seems.
Comment 17 Alex Fiestas 2012-02-10 11:08:12 UTC
Are you able to change your brightness by echoing to them as you do with intel_brightness ?
Comment 18 Aaron Bauman 2012-02-10 12:05:06 UTC
No I am not able to.  intel is the only one that works even while utilizing the discrete card.  Others are saying the acpi kernel driver is just ignorant so this may be out of the KDE realm as you mentioned.
Comment 19 Bernd Paysan 2013-06-06 00:54:14 UTC
I've the same problem with an Asus UX32VD, with Intel HD4000+NVidia 620M.  The thing the kernel developer propose does not work - you have to use the raw file.  I don't even see any reaction from the acpi files, regardless if setting acpi_backlight=vendor or =video (which creates two different firmware backlights).