kernel_optimize_test/drivers/video
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
..
aty tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
backlight omap1: Fix compile for omap1_bl.c 2010-01-08 10:29:06 -08:00
console vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
display tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
geode lxfb: add copyright/license info 2009-12-16 07:20:02 -08:00
i810 i810fb: fix stack exploding 2009-12-16 07:20:02 -08:00
intelfb intelfb: fix setting of active pipe with LVDS displays 2009-12-16 07:20:05 -08:00
kyro
logo
matrox matroxfb: fix problems with display stability 2009-12-16 07:20:05 -08:00
mb862xx mb862xxfb: add acceleration support for Coral-P/Coral-PA. * imageblt * copyarea * fillrect 2009-12-16 07:20:01 -08:00
mbx
msm drivers/video/msm: update to new kernel 2009-11-12 07:26:00 -08:00
nvidia
omap video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c 2010-01-11 14:45:25 +02:00
omap2 OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded 2010-01-12 12:10:55 +02:00
pnx4008
riva
savage savagefb: fix blanking mode on CRT display 2009-11-12 07:25:56 -08:00
sis fbdev: TV_PALN bit set twice in sisfb_detect_VB_connect() 2009-12-16 07:20:01 -08:00
vermilion
via viafb: fix acceleration for some chips 2010-01-16 12:15:37 -08:00
68328fb.c
acornfb.c
acornfb.h
amba-clcd.c
amifb.c
arcfb.c
arkfb.c
asiliantfb.c
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h
atafb.c Revert "fbdev: atafb - add palette register check" 2009-12-17 07:20:30 -08:00
atafb.h
atmel_lcdfb.c Merge branch 'for-next' into for-linus 2009-12-07 18:36:35 +01:00
au1100fb.c drivers/video: add kmalloc NULL tests 2009-09-23 07:39:56 -07:00
au1100fb.h
au1200fb.c
au1200fb.h
bf54x-lq043fb.c
bfin-lq035q1-fb.c fbdev: bfin-lq035q1-fb: new Blackfin Landscape LCD EZ-Extender driver 2009-12-16 07:20:01 -08:00
bfin-t350mcqb-fb.c fbdev: bfin-t350mcqb-fb: fix LCD dimensions 2009-12-16 07:20:01 -08:00
broadsheetfb.c fb-defio: Inhibit VM_IO flag to be set on vmalloc-ed framebuffers. 2009-12-03 17:30:42 -08:00
bt431.h
bt455.h
bw2.c
c2p_core.h
c2p_iplan2.c
c2p_planar.c
c2p.h
carminefb_regs.h
carminefb.c
carminefb.h
cfbcopyarea.c trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
cfbfillrect.c
cfbimgblt.c
cg3.c
cg6.c
cg14.c
chipsfb.c
cirrusfb.c
clps711xfb.c clps711xfb: convert to proc_fops 2009-12-16 07:20:04 -08:00
cobalt_lcdfb.c
controlfb.c
controlfb.h
cyber2000fb.c VIDEO: cyberpro: pci_request_regions needs a persistent name 2009-12-24 18:34:09 +00:00
cyber2000fb.h
da8xx-fb.c davinci: fb: add framebuffer blank operation 2009-12-16 07:20:05 -08:00
dnfb.c
edid.h
efifb.c efifb: fix framebuffer handoff 2010-02-22 19:50:34 -08:00
ep93xx-fb.c fbdev: add palette register check to several drivers 2009-12-16 07:20:01 -08:00
epson1355fb.c
fb_ddc.c
fb_defio.c Merge branch 'xen/fbdev' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen 2009-12-10 09:34:40 -08:00
fb_draw.h
fb_notify.c
fb_sys_fops.c
fbcmap.c
fbcvt.c
fbmem.c fb: for framebuffer handover don't exit the loop early. 2010-02-25 14:15:12 +10:00
fbmon.c
fbsysfs.c
ffb.c
fm2fb.c
fsl-diu-fb.c
fsl-diu-fb.h
g364fb.c
gbefb.c Merge branch 'for-next' into for-linus 2009-12-07 18:36:35 +01:00
gxt4500.c
hecubafb.c fb-defio: Inhibit VM_IO flag to be set on vmalloc-ed framebuffers. 2009-12-03 17:30:42 -08:00
hgafb.c
hitfb.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
hpfb.c
igafb.c
imsttfb.c
imxfb.c imxfb: correct location of callbacks in suspend and resume 2010-02-02 18:11:22 -08:00
Kconfig fbdev: bfin-lq035q1-fb: new Blackfin Landscape LCD EZ-Extender driver 2009-12-16 07:20:01 -08:00
leo.c
macfb.c
macmodes.c
macmodes.h
Makefile fbdev: bfin-lq035q1-fb: new Blackfin Landscape LCD EZ-Extender driver 2009-12-16 07:20:01 -08:00
maxinefb.c fbdev: add palette register check to several drivers 2009-12-16 07:20:01 -08:00
metronomefb.c fb-defio: Inhibit VM_IO flag to be set on vmalloc-ed framebuffers. 2009-12-03 17:30:42 -08:00
modedb.c fbdev: drop custom atoi from drivers/video/modedb.c 2009-12-16 07:20:01 -08:00
mx3fb.c mx3fb: some debug and initialisation fixes 2010-02-02 18:11:21 -08:00
n411.c
neofb.c
offb.c offb: Add support for framebuffer handoff to offb. 2009-12-09 17:09:29 +11:00
output.c tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
p9100.c
platinumfb.c platinumfb: fix misplaced parenthesis 2009-09-23 07:39:50 -07:00
platinumfb.h
pm2fb.c
pm3fb.c
pmag-aa-fb.c
pmag-ba-fb.c fbdev: add palette register check to several drivers 2009-12-16 07:20:01 -08:00
pmagb-b-fb.c fbdev: add palette register check to several drivers 2009-12-16 07:20:01 -08:00
ps3fb.c
pvr2fb.c
pxa168fb.c pxa168fb: fix offset setting at initialization 2009-12-01 09:02:31 +08:00
pxa168fb.h
pxafb.c [ARM] pxafb: fix building issue of incorrect reference 2009-12-29 14:11:27 +08:00
pxafb.h
q40fb.c
s1d13xxxfb.c
s3c2410fb.c s3c2410fb: fix clockrate calculation 2009-09-23 07:39:56 -07:00
s3c2410fb.h
s3c-fb.c revert "drivers/video/s3c-fb.c: fix clock setting for Samsung SoC Framebuffer" 2010-01-16 12:15:40 -08:00
s3fb.c
sa1100fb.c Nicolas Pitre has a new email address 2009-09-15 09:37:12 -07:00
sa1100fb.h
sbuslib.c
sbuslib.h
sgivwfb.c sgivwfb: Make use of ARRAY_SIZE. 2009-12-04 15:39:52 +01:00
sh7760fb.c
sh_mobile_lcdcfb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2009-12-16 10:29:52 -08:00
skeletonfb.c
sm501fb.c sm501: implement acceleration features 2009-12-16 07:20:04 -08:00
sstfb.c
sticore.h
stifb.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
sunxvr500.c
sunxvr2500.c
svgalib.c
syscopyarea.c
sysfillrect.c
sysimgblt.c
tcx.c
tdfxfb.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
tgafb.c
tmiofb.c drivers/video/tmiofb.c: fix uninitialised return value 2009-09-23 07:39:57 -07:00
tridentfb.c
uvesafb.c fb: remove fb_save_state() and fb_restore_state operations 2009-11-12 07:25:56 -08:00
valkyriefb.c
valkyriefb.h
vesafb.c
vfb.c
vga16fb.c
vgastate.c
vt8623fb.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
w100fb.c
w100fb.h
xen-fbfront.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-12-11 12:18:16 -08:00
xilinxfb.c