linux_dsm_epyc7002/drivers/gpu/drm/nouveau
Lukas Wunner b00e5334ab vga_switcheroo: Add helper for deferred probing
So far we've got one condition when DRM drivers need to defer probing
on a dual GPU system and it's coded separately into each of the relevant
drivers. As suggested by Daniel Vetter, deduplicate that code in the
drivers and move it to a new vga_switcheroo helper. This yields better
encapsulation of concepts and lets us add further checks in a central
place. (The existing check pertains to pre-retina MacBook Pros and an
additional check is expected to be needed for retinas.)

One might be tempted to check deferred probing conditions in
vga_switcheroo_register_client(), but this is usually called fairly late
during driver load. The GPU is fully brought up and ready for switching
at that point. On boot the ->probe hook is potentially called dozens of
times until it finally succeeds, and each time we'd repeat bringup and
teardown of the GPU, lengthening boot time considerably and cluttering
logfiles. A separate helper is therefore needed which can be called
right at the beginning of the ->probe hook.

Note that amdgpu currently does not call this helper as the AMD GPUs
built into MacBook Pros are only supported by radeon so far.

v2: This helper could eventually be used by audio clients as well,
    so rephrase kerneldoc to refer to "client" instead of "GPU"
    and move the single existing check in an if block specific
    to PCI_CLASS_DISPLAY_VGA devices. Move documentation on
    that check from kerneldoc to a comment. (Daniel Vetter)

v3: Mandate in kerneldoc that registration of client shall only
    happen after calling this helper. (Daniel Vetter)

v4: Rebase on 412c8f7de0 ("drm/radeon: Return -EPROBE_DEFER when
    amdkfd not loaded")

v5: Some Optimus GPUs use PCI_CLASS_DISPLAY_3D, make sure those are
    matched as well. (Emil Velikov)

v6: The if-condition referring to PCI_BASE_CLASS_DISPLAY may be
    considered a functional change. Move to a separate commit to
    keep this a pure refactoring change. (Emil Velikov, Jani Nikula)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/575885fd440c2b13c3f19ddf44360cfbbff35f50.1464685538.git.lukas@wunner.de
2016-05-31 13:15:57 +02:00
..
dispnv04 Merge branch 'linux-4.7' of git://github.com/skeggsb/linux into drm-next 2016-05-21 06:12:13 +10:00
include drm/nouveau/fb/gm200: setup mmu debug buffer registers at init() 2016-05-20 14:43:04 +10:00
nvif drm/nouveau/nvif: device time mthd 2015-08-28 12:40:33 +10:00
nvkm drm/nouveau/gr/gf100-: fix race condition in fecs/gpccs ucode 2016-05-20 14:43:04 +10:00
Kbuild drm/nouveau/sysfs: remove pstate interface 2016-01-11 11:28:26 +10:00
Kconfig drm/nouveau: merge nouveau_platform.ko into nouveau.ko 2015-01-22 12:15:09 +10:00
nouveau_abi16.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_abi16.h drm/nouveau/abi16: implement limited interoperability with usif/nvif 2015-11-03 15:02:18 +10:00
nouveau_acpi.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_acpi.h drm/nouveau/device: remove pci/platform_device from common struct 2015-08-28 12:40:49 +10:00
nouveau_backlight.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_bios.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_bios.h
nouveau_bo.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_bo.h drm/nouveau: finalise nvkm namespace switch (no binary change) 2015-01-22 12:18:07 +10:00
nouveau_chan.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_chan.h drm/nouveau: remove unnecessary usage of object handles 2015-11-03 15:02:18 +10:00
nouveau_connector.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_connector.h drm/nouveau: finalise nvkm namespace switch (no binary change) 2015-01-22 12:18:07 +10:00
nouveau_crtc.h drm/nouveau: Use private save/restore hooks for CRTCs 2015-12-08 16:13:49 +01:00
nouveau_debugfs.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_debugfs.h drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_display.c drm: Remove unused drm_device from drm_gem_object_lookup() 2016-05-17 08:47:30 +02:00
nouveau_display.h drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_dma.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_dma.h drm/nouveau/nvif: simplify and tidy library interfaces 2015-08-28 12:40:32 +10:00
nouveau_dp.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_drm.c vga_switcheroo: Add helper for deferred probing 2016-05-31 13:15:57 +02:00
nouveau_drv.h drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_encoder.h drm: Constify drm_encoder_slave_funcs 2015-12-15 13:41:17 +01:00
nouveau_fbcon.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_fbcon.h drm: Remove unused fbdev_list members 2015-11-24 11:41:52 +01:00
nouveau_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_fence.h drm/nouveau/sw: turn flip completion into an event 2015-08-28 12:40:38 +10:00
nouveau_gem.c Merge branch 'linux-4.7' of git://github.com/skeggsb/linux into drm-next 2016-05-21 06:12:13 +10:00
nouveau_gem.h drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_hwmon.c drm/nouveau/iccsense: convert to linked list 2016-05-20 14:43:04 +10:00
nouveau_hwmon.h
nouveau_ioc32.c drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
nouveau_ioctl.h
nouveau_nvif.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_platform.c drm/nouveau/tegra: acquire and enable reference clock if needed 2016-04-06 16:06:51 +10:00
nouveau_platform.h drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_prime.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_reg.h drm/nouveau/sw: rename from software (no binary change) 2015-01-22 12:17:47 +10:00
nouveau_sgdma.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_ttm.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_ttm.h
nouveau_usif.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_usif.h drm/nouveau: expose the full object/event interfaces to userspace 2014-08-10 05:28:18 +10:00
nouveau_vga.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nouveau_vga.h
nv04_fbcon.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv04_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv10_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv10_fence.h drm/nouveau: remove as much direct use of core headers as possible 2014-08-10 05:13:16 +10:00
nv17_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv50_display.c Merge branch 'linux-4.7' of git://github.com/skeggsb/linux into drm-next 2016-05-21 06:12:13 +10:00
nv50_display.h
nv50_fbcon.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv50_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nv84_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nvc0_fbcon.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00
nvc0_fence.c drm/nouveau: rename nouveau_drm.h to nouveau_drv.h 2016-05-20 14:43:04 +10:00