native: only match drm subsystem devices

Despite g_udev_client_new taking a list of subsystems, it doesn't
implicitly filter results to those subsystems.

This commit explicitly adds a subsystem match to make sure sound cards
don't end up in the resulting list of video cards.

https://bugzilla.gnome.org/show_bug.cgi?id=771442
This commit is contained in:
Ray Strode 2016-10-18 16:40:14 -04:00
parent 8a7876ded5
commit ef2000053a

View File

@ -295,6 +295,11 @@ get_primary_gpu_path (const gchar *seat_name)
g_udev_enumerator_add_match_name (enumerator, "card*"); g_udev_enumerator_add_match_name (enumerator, "card*");
g_udev_enumerator_add_match_tag (enumerator, "seat"); g_udev_enumerator_add_match_tag (enumerator, "seat");
/* We need to explicitly match the subsystem for now.
* https://bugzilla.gnome.org/show_bug.cgi?id=773224
*/
g_udev_enumerator_add_match_subsystem (enumerator, "drm");
devices = g_udev_enumerator_execute (enumerator); devices = g_udev_enumerator_execute (enumerator);
if (!devices) if (!devices)
goto out; goto out;