diff --git a/Makefile.am b/Makefile.am index 8380277..615f6ec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,8 @@ -bin_PROGRAMS = steamcompmgr loadargb_cursor +bin_PROGRAMS = steamcompmgr loadargb_cursor udev_is_boot_vga steamcompmgr_SOURCES = src/steamcompmgr.c src/glext.h loadargb_cursor_SOURCES = src/loadargbcursor.c +udev_is_boot_vga_SOURCES = src/udev_is_boot_vga.c AM_CFLAGS = $(DEPS_CFLAGS) AM_LIBS = $(DEPS_LIBS) @@ -12,4 +13,7 @@ steamcompmgr_LDADD = $(DEPS_LIBS) loadargb_cursor_CFLAGS = $(DEPS_CFLAGS) loadargb_cursor_LDADD = $(DEPS_LIBS) +udev_is_boot_vga_CFLAGS = $(DEPS_CFLAGS) +udev_is_boot_vga_LDADD = $(DEPS_LIBS) + dist_doc_DATA = README diff --git a/configure.ac b/configure.ac index 2687e04..50924ce 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT([SteamOS Compostitor], [1.0], [linux@steampowered.com], [steamos-compositor], [http://support.steampowered.com]) AM_INIT_AUTOMAKE([foreign tar-ustar]) -PKG_CHECK_MODULES([DEPS],xxf86vm gl x11 xrender xcomposite SDL_image) +PKG_CHECK_MODULES([DEPS],xxf86vm gl x11 xrender xcomposite SDL_image libudev) AC_PROG_CC AC_PROG_CC_STDC diff --git a/debian/changelog b/debian/changelog index bd4f7b1..2a47022 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +steamos-compositor (1.17.3) alchemist; urgency=low + + * Add udev_is_boot_vga, little tool to check which GPU drives the console. + + -- Pierre-Loup A. Griffais Fri, 28 Feb 2014 18:39:57 -0800 + steamos-compositor (1.16) alchemist; urgency=low * Only consider InputOutput windows for focus; this fixes "CID The Dummy" diff --git a/debian/control b/debian/control index f4815a7..25d3521 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,10 @@ Maintainer: Pierre-Loup Griffais Section: misc Priority: optional Standards-Version: 3.9.3 -Build-Depends: debhelper (>= 8), pkg-config, libxxf86vm-dev, libgl1-mesa-dev, libx11-dev, libxrender-dev, libxcomposite-dev, libxdamage-dev, libsdl-image1.2-dev, automake, autoconf +Build-Depends: debhelper (>= 8), pkg-config, libxxf86vm-dev, libgl1-mesa-dev, libx11-dev, libxrender-dev, libxcomposite-dev, libxdamage-dev, libsdl-image1.2-dev, automake, autoconf, libudev-dev Package: steamos-compositor Architecture: any -Depends: libsdl-image1.2, ${shlibs:Depends}, ${misc:Depends} +Depends: libsdl-image1.2, libudev0, ${shlibs:Depends}, ${misc:Depends} Description: SteamOS Compositor Provides graphics compositor services for the full-screen environment of SteamOS diff --git a/src/udev_is_boot_vga.c b/src/udev_is_boot_vga.c new file mode 100644 index 0000000..2c15c65 --- /dev/null +++ b/src/udev_is_boot_vga.c @@ -0,0 +1,32 @@ +// Thanks to Aaron Plattner for that snippet +// Public domain + +#include +#include "libudev.h" + +int main (int argc, char **argv) +{ + int ret = 1; + struct udev *udev = udev_new(); + struct udev_enumerate *enumerate = udev_enumerate_new(udev); + struct udev_list_entry *entry; + + if (argc != 2) + { + printf("usage: udev_is_boot_vga DRIVER\n"); + return 1; + } + + udev_enumerate_add_match_sysattr(enumerate, "boot_vga", "1"); + udev_enumerate_add_match_sysattr(enumerate, "driver", argv[1]); + udev_enumerate_scan_devices(enumerate); + + udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(enumerate)) { + ret = 0; + } + + udev_enumerate_unref(enumerate); + udev_unref(udev); + + return ret; +}