linux/drivers/video/console
Dave Airlie 6a9ee8af34 vga_switcheroo: initial implementation (v15)
Many new laptops now come with 2 gpus, one to be used for low power
modes and one for gaming/on-ac applications. These GPUs are typically
wired to the laptop panel and VGA ports via a multiplexer unit which
is controlled via ACPI methods.

4 combinations of systems typically exist - with 2 ACPI methods.
Intel/ATI - Lenovo W500/T500 - use ATPX ACPI method
ATI/ATI - some ASUS - use ATPX ACPI Method
Intel/Nvidia - - use _DSM ACPI method
Nvidia/Nvidia -  - use _DSM ACPI method.

TODO:
This patch adds support for the ATPX method and initial bits
for the _DSM methods that need to written by someone with
access to the hardware.
Add a proper non-debugfs interface - need to get some proper
testing first.

v2: add power up/down support for both devices
on W500 puts i915/radeon into D3 and cuts power to radeon.

v3: redo probing methods, no DMI list, drm devices call to
register with switcheroo, it tries to find an ATPX method on
any device and once there is two devices + ATPX it inits the
switcher.

v4: ATPX msg handling using buffers - should work on more machines

v5: rearchitect after more mjg59 discussion - move ATPX handling to
    radeon driver.

v6: add file headers + initial nouveau bits (to be filled out).

v7: merge delayed switcher code.

v8: avoid suspend/resume of gpu that is off

v9: rearchitect - mjg59 is always right. - move all ATPX code to
radeon, should allow simpler DSM also proper ATRM handling

v10: add ATRM support for radeon BIOS, add mutex to lock vgasr_priv

v11: fix bug in resuming Intel for 2nd time.

v12: start fixing up nvidia code blindly.

v13: blindly guess at finishing nvidia code

v14: remove radeon audio hacks - fix up intel resume more like upstream

v15: clean up printks + remove unnecessary igd/dis pointers

mount debugfs

/sys/kernel/debug/vgaswitcheroo/switch - should exist if ATPX detected
 + 2 cards.

DIS - immediate change to discrete
IGD - immediate change to IGD
DDIS - delayed change to discrete
DIGD - delayed change to IGD
ON - turn on not in use
OFF - turn off not in use

Tested on W500 (Intel/ATI) and T500 (Intel/ATI)

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-01 16:20:37 +10:00
..
bitblit.c video: console, use DIV_ROUND_UP 2009-09-23 07:39:56 -07:00
dummycon.c Remove magic macros for screen_info structure members 2007-10-16 22:57:17 -07:00
fbcon_ccw.c fbcon: fix color generation for monochrome framebuffer 2008-02-06 10:41:18 -08:00
fbcon_cw.c fbcon: fix color generation for monochrome framebuffer 2008-02-06 10:41:18 -08:00
fbcon_rotate.c
fbcon_rotate.h fbcon: fix rotate upside down crash 2009-08-07 10:39:55 -07:00
fbcon_ud.c fbcon: fix color generation for monochrome framebuffer 2008-02-06 10:41:18 -08:00
fbcon.c vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
fbcon.h fbcon: fix monochrome color value calculation 2008-10-02 15:53:13 -07:00
font_6x11.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_7x14.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_8x8.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_8x16.c export font_vga_8x16 2007-10-16 09:43:19 -07:00
font_10x18.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_acorn_8x8.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_mini_4x6.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_pearl_8x8.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_sun8x16.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
font_sun12x22.c fbcon: Convert struct font_desc to use ISO C initializers 2007-10-16 09:43:17 -07:00
fonts.c cleanup after APUS removal 2008-02-06 10:41:01 -08:00
Kconfig sparc: Kill PROM console driver. 2009-09-15 17:04:38 -07:00
Makefile sparc: Kill PROM console driver. 2009-09-15 17:04:38 -07:00
mdacon.c Revert "vt: fix background color on line feed" 2008-10-14 12:12:02 -07:00
newport_con.c drivers/video/console/newport_con.c: fix read outside array bounds 2009-09-23 07:39:56 -07:00
softcursor.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
sticon.c Revert "vt: fix background color on line feed" 2008-10-14 12:12:02 -07:00
sticore.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
tileblit.c fbcon: fix color generation for monochrome framebuffer 2008-02-06 10:41:18 -08:00
vgacon.c vgacon: Add support for setting the default cursor state 2009-11-13 15:55:02 -08:00