OSDN Git Service

xf86drm: parse the separate sysfs files for vendor... info
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 1 Nov 2016 18:04:06 +0000 (18:04 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 5 Dec 2016 17:21:23 +0000 (17:21 +0000)
commitaae3f318d5aca81b87a14360116bb766a51e82ef
tree4f656c0f082c7589a3cdea96815b4030db1c24c3
parent138d23117c6b96f57aaa0072992e0480153cfebd
xf86drm: parse the separate sysfs files for vendor... info

Up-to recently (patch should land in 4.10) the kernel did not expose the
PCI device revision field as a separate sysfs file.

Thus one needed too parse the config file to retrieve it. This in
itself wakes up the device, which in some cases can be quite slow.

To avoid that, just check for the separate files and fall-back to the
original if kernel is not new enough.

v3: rework alongside drmGetDevice[s]2

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nicolai Hähnle <nhaehnle@gmail.com>
Cc: Mauro Santos <registo.mailling@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
xf86drm.c