mesa/src/loader
Thierry Reding f9bc48d41d loader: Add support for platform and host1x busses
ARM SoCs usually have their DRM/KMS devices on the platform bus, so add
support for this bus in order to allow use of the DRI_PRIME environment
variable with those devices.

While at it, also support the host1x bus, which is effectively the same
but uses an additional layer in the bus hierarchy.

Note that it isn't enough to support the bus that has the rendering GPU
because the loader code will also try to construct an ID path tag for a
scanout-only device if it is the default that is being opened.

The ID path tag for a device can be obtained by running udevadm info on
the device node, as shown in this example on NVIDIA Tegra:

	$ udevadm info /dev/dri/card0 | grep ID_PATH_TAG
	E: ID_PATH_TAG=platform-50000000_host1x

The corresponding OF_FULLNAME property, from which the ID_PATH_TAG is
constructed, can be found in the sysfs "uevent" attribute for the card0
device's parent:

	$ grep OF_FULLNAME /sys/devices/platform/50000000.host1x/drm/uevent
	OF_FULLNAME=/host1x@50000000

Similarily, /dev/dri/card1 corresponds to the GPU:

	$ udevadm info /dev/dri/card1 | grep ID_PATH_TAG
	E: ID_PATH_TAG=platform-57000000_gpu

and:

	$ grep OF_FULLNAME /sys/devices/platform/57000000.gpu/uevent
	OF_FULLNAME=/gpu@57000000

Changes in v2:
- avoid confusing pre-increment in strdup()
- add examples of tags to commit message

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-03-02 14:40:29 +01:00
..
Android.mk Android: move libdrm settings to top-level Android.common.mk 2016-06-13 15:31:29 +01:00
loader.c loader: Add support for platform and host1x busses 2018-03-02 14:40:29 +01:00
loader.h egl: turn one more boolean int into a bool 2017-06-21 21:42:14 +01:00
loader_dri3_helper.c x11/dri3: Store raw present completion mode 2018-02-21 21:57:38 +00:00
loader_dri3_helper.h x11/dri3: Store raw present completion mode 2018-02-21 21:57:38 +00:00
Makefile.am autotools: include meson build files in tarball 2018-01-19 16:30:51 -08:00
Makefile.sources loader: Add headers to distribution. 2014-12-12 12:11:47 -08:00
meson.build x11/dri3: Don't open-code ARRAY_SIZE 2018-02-21 21:57:38 +00:00
pci_id_driver_map.c nouveau: allow NV3x's to be used with nouveau_vieux 2016-08-30 00:21:42 -04:00
pci_id_driver_map.h radeonsi: remove unused field in the PCI ID table 2017-11-07 17:26:36 +01:00
SConscript scons: remove all libudev references 2016-10-18 17:06:21 +01:00