linux_dsm_epyc7002/drivers/gpu/drm/nouveau
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
..
Kconfig drm/i2c/ch7006: Drop build time dependency to nouveau. 2010-01-11 09:06:30 +10:00
Makefile drm/nv40: implement ctxprog/state generation 2009-12-16 17:05:39 +10:00
nouveau_acpi.c vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
nouveau_backlight.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_bios.c drm/nouveau: use mutex for vbios lock 2010-02-16 11:14:33 +10:00
nouveau_bios.h drm/nouveau: use mutex for vbios lock 2010-02-16 11:14:33 +10:00
nouveau_bo.c drm/nv50: align size of buffer object to the right boundaries. 2010-02-10 08:19:34 +10:00
nouveau_calc.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_channel.c drm/nv50: avoid unloading pgraph context when ctxprog is running 2010-02-10 08:19:36 +10:00
nouveau_connector.c drm/nouveau: move dereferences after null checks 2010-02-11 09:52:00 +10:00
nouveau_connector.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_crtc.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_debugfs.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_display.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_dma.c drm/nouveau: fix a race condition in nouveau_dma_wait() 2010-01-18 09:55:48 +10:00
nouveau_dma.h drm/nouveau: Allocate a per-channel instance of NV_SW. 2010-01-11 09:06:37 +10:00
nouveau_dp.c drm/nouveau: make dp auxch xfer len check for reads only 2010-02-09 12:50:43 +10:00
nouveau_drv.c vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
nouveau_drv.h vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
nouveau_encoder.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_fb.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_fbcon.c vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
nouveau_fbcon.h drm/nouveau: Fix fbcon on mixed pre-NV50 + NV50 multicard. 2010-02-09 12:50:14 +10:00
nouveau_fence.c drm/nouveau: Use the software object for fencing. 2010-01-11 09:06:38 +10:00
nouveau_gem.c drm/nouveau: call ttm_bo_wait with the bo lock held to prevent hang 2010-02-09 12:49:09 +10:00
nouveau_grctx.c drivers/gpu/drm/nouveau/nouveau_grctx.c: correct NULL test 2010-02-09 12:49:55 +10:00
nouveau_grctx.h drm/nv40: implement ctxprog/state generation 2009-12-16 17:05:39 +10:00
nouveau_hw.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_hw.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_i2c.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_i2c.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nouveau_ioc32.c drm: convert drm_ioctl to unlocked_ioctl 2009-12-18 11:22:31 +10:00
nouveau_irq.c drm/nv50: make the pgraph irq handler loop like the pre-nv50 version 2010-02-10 08:19:39 +10:00
nouveau_mem.c drm/nv50: fix vram ptes on IGPs to point at stolen system memory 2010-02-23 13:50:24 +10:00
nouveau_notifier.c drm/nouveau: fix non-vram notifier blocks 2010-02-09 12:47:52 +10:00
nouveau_object.c drm/nouveau: move dereferences after null checks 2010-02-11 09:52:00 +10:00
nouveau_reg.h drm/nouveau: Add getparam to get available PGRAPH units. 2010-02-09 12:48:08 +10:00
nouveau_sgdma.c drm/nouveau: move dereferences after null checks 2010-02-11 09:52:00 +10:00
nouveau_state.c vga_switcheroo: initial implementation (v15) 2010-03-01 16:20:37 +10:00
nouveau_ttm.c drm/nouveau: have ttm's fault handler called directly 2010-01-11 09:06:42 +10:00
nv04_crtc.c drm/nouveau: use drm debug levels 2009-12-16 17:04:48 +10:00
nv04_cursor.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv04_dac.c drm/nouveau: Fix up pre-nv17 analog load detection. 2010-02-23 13:41:05 +10:00
nv04_dfp.c drm/nouveau: use drm debug levels 2009-12-16 17:04:48 +10:00
nv04_display.c drm/nouveau: use drm debug levels 2009-12-16 17:04:48 +10:00
nv04_fb.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv04_fbcon.c drm/nouveau: Fix fbcon on mixed pre-NV50 + NV50 multicard. 2010-02-09 12:50:14 +10:00
nv04_fifo.c drm/nouveau: Add cache_flush/pull fifo engine functions. 2010-01-11 08:47:48 +10:00
nv04_graph.c drm/nv04: Fix set_operation software method. 2010-01-11 09:06:53 +10:00
nv04_instmem.c drm/nouveau: fix thinko in nv04_instmem.c 2010-01-18 09:55:54 +10:00
nv04_mc.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv04_timer.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv04_tv.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv10_fb.c drm/nouveau: Pre-G80 tiling support. 2010-01-11 08:47:56 +10:00
nv10_fifo.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv10_graph.c drm/nouveau: Pre-G80 tiling support. 2010-01-11 08:47:56 +10:00
nv17_gpio.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv17_tv_modes.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv17_tv.c drm/nouveau: Force TV encoder DPMS reinit after resume. 2010-02-16 11:15:07 +10:00
nv17_tv.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv20_graph.c drm/nouveau: Pre-G80 tiling support. 2010-01-11 08:47:56 +10:00
nv40_fb.c drm/nouveau: Pre-G80 tiling support. 2010-01-11 08:47:56 +10:00
nv40_fifo.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv40_graph.c drm/nouveau: Pre-G80 tiling support. 2010-01-11 08:47:56 +10:00
nv40_grctx.c drm/nv40: implement ctxprog/state generation 2009-12-16 17:05:39 +10:00
nv40_mc.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv50_crtc.c drm/nouveau: move dereferences after null checks 2010-02-11 09:52:00 +10:00
nv50_cursor.c drm/nouveau: use drm debug levels 2009-12-16 17:04:48 +10:00
nv50_dac.c drm/nouveau: use drm debug levels 2009-12-16 17:04:48 +10:00
nv50_display.c drm/nv50: ignore vbios table's claim to the contrary if EDID says >8bpc 2010-01-11 09:06:32 +10:00
nv50_display.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv50_evo.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv50_fbcon.c drm/nouveau: Fix fbcon on mixed pre-NV50 + NV50 multicard. 2010-02-09 12:50:14 +10:00
nv50_fifo.c drm/nv50: delete ramfc object after disabling fifo, not before 2010-02-10 08:19:38 +10:00
nv50_graph.c drm/nv50: avoid unloading pgraph context when ctxprog is running 2010-02-10 08:19:36 +10:00
nv50_instmem.c drm/nv50: fix instmem binding on IGPs to point at stolen system memory 2010-02-23 13:50:21 +10:00
nv50_mc.c drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00
nv50_sor.c drm/nv50: disregard dac outputs in nv50_sor_dpms() 2010-02-10 08:19:33 +10:00
nvreg.h drm/nouveau: Add DRM driver for NVIDIA GPUs 2009-12-11 21:29:34 +10:00