linux_dsm_epyc7002/drivers/gpu/drm
Daniel Vetter 6449b088dd drm: Add fake controlD* symlinks for backwards compat
We thought that no userspace is using them, but oops libdrm is using
them to figure out whether a driver supports modesetting. Check out
drmCheckModesettingSupported but maybe don't because it's horrible and
totally runs counter to where we want to go with libdrm device
handling. The function looks in the device hierarchy for whether
controlD* exist using the following format string:

/sys/bus/pci/devices/%04x:%02x:%02x.%d/drm/controlD%d

The "/drm" subdirectory is the glue directory from the sysfs class
stuff, and the only way to get at it seems to through
kdev->kobj.parent (when kdev is represents e.g. the card0 chardev
instance in sysfs). Git grep says we're not the only ones touching
that, so I hope it's ok we dig into such internals - I couldn't find a
proper interface for getting at the glue directory.

Quick git grep shows that at least -amdgpu, -ati are using this.
-modesetting do not, and on -intel it's only about the 4th fallback
path for device lookup, which is why this didn't blow up earlier.

Oh well, we need to keep it working, and the simplest way is to add a
symlink at the right place in sysfs from controlD* to card*.

v2:
- Fix error path handling by adding if (!minor) return checks (David)
- Fix the controlD* numbers to match what's been there (David)
- Add a comment what exactly userspace minimally needs.
- Correct the analysis for -intel (Chris).

Fixes: 8a357d1004 ("drm: Nerf DRM_CONTROL nodes")
Cc: Dave Airlie <airlied@gmail.com>
Reported-and-tested-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161209135656.14881-1-daniel.vetter@ffwll.ch
2016-12-10 22:46:19 +01:00
..
amd Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
arc Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
arm Linux 4.9-rc8 2016-12-05 17:11:48 +10:00
armada Merge branch 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next 2016-11-25 09:03:27 +10:00
ast drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
atmel-hlcdc drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
bochs drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
bridge drm/bridge: analogix: Don't return -EINVAL when panel doesn't support PSR 2016-12-07 08:27:36 +05:30
cirrus drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
etnaviv Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux into drm-next 2016-12-06 11:00:16 +10:00
exynos drm/exynos: Use VIDEO_SAMSUNG_EXYNOS_GSC=n as GSC Kconfig dependency 2016-12-05 22:08:59 +09:00
fsl-dcu Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
gma500 drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
hisilicon drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
i2c drm/i2c: tda998x: fix spelling mistake 2016-11-18 00:00:40 +00:00
i810 drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
i915 Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
imx Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
mediatek Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
mga
mgag200 drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
msm Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next 2016-12-01 09:25:58 +10:00
nouveau Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next 2016-12-06 09:34:43 +10:00
omapdrm drm/omapdrm: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:58:15 +01:00
panel
qxl Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
r128
radeon Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
rcar-du drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
rockchip drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
savage drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
shmobile drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
sis drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
sti drm: Make the connector .detect() callback optional 2016-12-01 10:05:53 -05:00
sun4i Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
tdfx drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
tegra drm/tegra: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops 2016-11-14 07:56:58 +01:00
tilcdc Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next 2016-12-06 10:26:48 +01:00
ttm drm/ttm: fix ttm_bo_wait 2016-11-09 00:46:04 +05:30
udl drm/virtio: fix busid in a different way, allocate more vbufs. 2016-11-30 14:18:51 +10:00
vc4 This pull request brings in fragment shader threading and ETC1 support 2016-11-17 09:43:56 +10:00
vgem drm: Take ownership of the dmabuf->obj when exporting 2016-12-08 10:29:22 +01:00
via drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
virtio drm/virtio: fix busid in a different way, allocate more vbufs. 2016-11-30 14:18:51 +10:00
vmwgfx drm/vmwgfx: Switch to mode_cmd2 2016-12-02 17:15:20 +01:00
zte drm: zte: checking for NULL instead of IS_ERR() 2016-11-15 11:00:42 +01:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: doc: remove old comment about nonblocking commits 2016-12-06 16:28:30 -02:00
drm_atomic.c drm/fence: add drm_crtc_create_fence() 2016-12-07 11:16:55 -02:00
drm_auth.c
drm_blend.c
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_color_mgmt.c drm/color: document NULL values and default settings better 2016-11-15 22:39:48 +01:00
drm_connector.c drm: document standard connector properties 2016-11-18 09:45:07 +01:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h drm/fence: add drm_crtc_create_fence() 2016-12-07 11:16:55 -02:00
drm_crtc.c drm/fence: add drm_crtc_create_fence() 2016-12-07 11:16:55 -02:00
drm_debugfs_crc.c
drm_debugfs.c drm/atomic: cleanup debugfs entries on un-registering the driver. 2016-11-21 13:22:08 -05:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_dual_mode_helper.c drm: Print some debug/error info during DP dual mode detect 2016-10-26 15:57:11 -04:00
drm_dp_helper.c
drm_dp_mst_topology.c drm/dp/mst: Check peer device type before attempting EDID read 2016-10-26 18:53:44 +02:00
drm_drv.c drm: Add fake controlD* symlinks for backwards compat 2016-12-10 22:46:19 +01:00
drm_dumb_buffers.c drm: Consolidate dumb buffer docs 2016-11-15 12:51:49 +01:00
drm_edid_load.c
drm_edid.c Merge tag 'drm-misc-next-2016-11-29' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2016-11-30 14:28:20 +10:00
drm_encoder_slave.c
drm_encoder.c drm: Fix locking cargo-cult in encoder/plane init/cleanup 2016-11-29 23:34:36 +01:00
drm_fb_cma_helper.c drm/fb_cma_helper: Add drm_fb_cma_prepare_fb() helper 2016-11-14 12:43:58 +01:00
drm_fb_helper.c drm: Protect fb_helper list manipulation with a mutex 2016-11-29 15:52:32 -05:00
drm_flip_work.c
drm_fops.c drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs 2016-11-02 11:33:47 -04:00
drm_fourcc.c drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_framebuffer.c drm: Nuke modifier[1-3] 2016-11-17 11:58:09 +01:00
drm_gem_cma_helper.c
drm_gem.c
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h drm: drm_irq.h header cleanup 2016-11-15 23:33:48 +01:00
drm_ioc32.c
drm_ioctl.c drm: Allow CAP_PRIME on !MODESET 2016-12-08 10:00:15 +01:00
drm_irq.c drm/irq: Unexport drm_vblank_on/off 2016-11-15 23:33:48 +01:00
drm_kms_helper_common.c
drm_legacy.h
drm_lock.c drm: Avoid NULL dereference for DRM_LEGACY debug message 2016-11-28 08:39:41 +01:00
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm: Initialise drm_mm.head_node.allocated 2016-12-01 10:35:45 +01:00
drm_mode_config.c drm/fence: add out-fences support 2016-11-16 14:36:27 +01:00
drm_mode_object.c
drm_modes.c Revert "drm: Add aspect ratio parsing in DRM layer" 2016-11-15 15:01:42 +01:00
drm_modeset_helper.c drm: also move DSI panels to the front of the connector list 2016-11-17 11:59:26 +01:00
drm_modeset_lock.c drm/doc: Fix indenting in drm_modeset_lock.c comment 2016-11-29 23:34:36 +01:00
drm_of.c
drm_panel.c
drm_pci.c
drm_plane_helper.c drm: add helpers to go from plane state to drm_rect 2016-11-08 16:38:03 -05:00
drm_plane.c drm: Fix locking cargo-cult in encoder/plane init/cleanup 2016-11-29 23:34:36 +01:00
drm_platform.c
drm_prime.c drm: Take ownership of the dmabuf->obj when exporting 2016-12-08 10:29:22 +01:00
drm_print.c drm/print: Move kerneldoc next to definition 2016-11-15 12:55:24 +01:00
drm_probe_helper.c drm: Don't block the kworker waiting for mode_config.mutex in output_poll() 2016-12-06 13:41:15 +01:00
drm_property.c drm: Use u64_to_user_ptr() helper for blob ioctls 2016-11-28 08:12:18 +01:00
drm_rect.c drm: helper macros to print composite types 2016-11-08 16:38:03 -05:00
drm_scatter.c
drm_simple_kms_helper.c
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c
Kconfig drm/fence: add in-fences support 2016-11-16 09:55:27 +01:00
Makefile drm: Extract drm_mode_config.[hc] 2016-11-15 15:23:29 +01:00