Log in

No account? Create an account

July 2017
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

airlied [userpic]
hybrid graphics on Linux (Part 2)

Okay v4 of the patch is available at


First thing I added was power up/down methods. This calls the DRM suspend/resume methods + along with the cut power for discrete GPU. I'm not sure dynamic Windows ever does this as it seems to take a bit of work, I suspect they just run the second GPU in really low power modes. This is slow because we have to repost the ATI card after turning it back on.

I then talked to mjg59 and worked over the ATPX detection. I removed all the DMI code and it should detect *any* laptop that uses ATPX (i.e. ATI/ATI and Intel/ATI) from what I can see. I've tested on Lenovo W500 and T500 now and it appears to work on both. Would be nice if someone on a ATI/ATI and/or ASUS ATI/ATI or ATI/Intel machines could give it a whirl. I think the main problem with ATI/ATI is the poweroff methods have a hardcoded Intel PCI ID. I've no idea yet how to tell on an ATI/ATI which device is the IGD and which is discrete. Its probably more than likely the IGD is the one with the ATPX method on it.

It doesn't switch off at boot yet but I've added commands to let you do it.

echo "OFF" > switch - turns off the not in use card, so if Intel and ATI are on at boot, it will turn off ATI
echo "ON" > switch - turns back on not in use card
echo "PCIID" > switch - causes a switch with full off/on cycles.

nvidia combos appear to use a DSM method and in theory nouveau_acpi.c should be detecting that, so it might be possible for someone to hook that up.

I've also started looking at some desktop integration via gdm or logout - but its not my usual place to code so going is a bit slower ;-)


Aww, sounds good! As an owner of the W500 I'd love to see this feature working in Fedora in the future :) Hope you keep making good progress :) If you need someone to test, feel free to get back to me (not with patches tho but with binary rpms...maybe source rpms too).

Keep up your good work!

(uhm, my openif provider is down -_- use red@fp.o if you need me)

Eager to test!!

Hello David,
This is greeeaaaat!!! Thanks a lot for your work. I have an ASUS M51Ta with this hybrid graphic card configuration ATI/ATI:
01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]
02:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3650
I would love to test your patch, I just don't know how to... Please give me some instructions and I will test it.
I have Fedora 12.
Thanks a lot!!

Re: Eager to test!!

I can 'git apply' this patch on top of this tree:


It _doesn't_ apply as is on top of nouveau (~2.6.32) or Linus's master (2.6.33-rc6+) trees


I just wanted to post a note to say thanks for the great work!


Jon Pritchard:

That's some great progress already. I would love to test it out but my technical competency is still pretty low.

I really appreciate your work though.

target for patch?

Heya, I am eager to try this out on my T400 so I took the 2.6.33-rc6 kernel from opensuse, did some small modifications to your patch so it would apply and tried it out.

Kernel reported this:
[ 14.343249] VGA switcheroo: detect ATPX method on 0000:00:02.0 device \_SB_.PCI0.VID_.ATPX handle
[ 14.343343] VERN is 1
[ 14.343345] registered 1 client 0000:00:02.0 ffff8800793ffef0

So I guess 2.6.33-rc6 isn't really ready =/

Diff from your to my patch

--- 0001-vga_switcheroo-initial-implementation-v4.patch.org 2010-02-02 23:16:22.000000000 +0100
+++ 0001-vga_switcheroo-initial-implementation-v4.patch 2010-02-02 20:27:47.000000000 +0100
@@ -82,6 +82,8 @@
+ if (ret)
+ goto destroy_ringbuffer;
+ intel_modeset_init(dev);
ret = drm_irq_install(dev);
if (ret)
goto destroy_ringbuffer;
@@ -111,9 +113,9 @@
index fbecac7..ddfaffd 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -704,6 +704,8 @@ extern int i915_max_ioctl;
- extern unsigned int i915_fbpercrtc;
+@@ -725,6 +725,8 @@
extern unsigned int i915_powersave;
+ extern unsigned int i915_lvds_downclock;

+extern int i915_suspend(struct drm_device *dev, pm_message_t state);
+extern int i915_resume(struct drm_device *dev);

Re: target for patch?

you need kms drivers for the second card loaded also, so radeon needs to be running in KMS mode.

Use both chips at the same time

It would be really cool if one could use both graphic cards at the same time (for example when it was plugged in and you were playing a 3d heavy game). Isn't there a dual card feature that is being worked on somewhere?

Re: Use both chips at the same time

well they both can't scanout at once, since there is only one laptop panel, and mostly the second one fairly beats the first so its isn't helping but hindering.

There is already dual-card features like cross-fire and SLI for cards from the same manufacturer.