diff options
Diffstat (limited to 'src/loader')
-rw-r--r-- | src/loader/Android.mk | 2 | ||||
-rw-r--r-- | src/loader/Makefile.am | 10 | ||||
-rw-r--r-- | src/loader/loader.c | 6 | ||||
-rw-r--r-- | src/loader/loader.h | 12 |
4 files changed, 20 insertions, 10 deletions
diff --git a/src/loader/Android.mk b/src/loader/Android.mk index 8e215de3cda..92d9fd20d3c 100644 --- a/src/loader/Android.mk +++ b/src/loader/Android.mk @@ -40,6 +40,8 @@ else LOCAL_SHARED_LIBRARIES := libdrm endif +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) + LOCAL_MODULE := libmesa_loader include $(MESA_COMMON_MK) diff --git a/src/loader/Makefile.am b/src/loader/Makefile.am index 36ddba82bd3..aef1bd61bea 100644 --- a/src/loader/Makefile.am +++ b/src/loader/Makefile.am @@ -41,15 +41,11 @@ libloader_la_CPPFLAGS += \ -I$(top_builddir)/src/mesa/drivers/dri/common/ \ -I$(top_srcdir)/src/mesa/ \ -I$(top_srcdir)/src/mapi/ \ - -DUSE_DRICONF \ - $(EXPAT_CFLAGS) + -DUSE_DRICONF -libloader_la_SOURCES += \ - $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c + libloader_la_LIBADD += \ + $(top_builddir)/src/mesa/drivers/dri/common/libxmlconfig.la -libloader_la_LIBADD += \ - -lm \ - $(EXPAT_LIBS) endif if !HAVE_LIBDRM diff --git a/src/loader/loader.c b/src/loader/loader.c index 17bf1336005..fc468153425 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -314,8 +314,8 @@ get_id_path_tag_from_fd(struct udev *udev, int fd) return id_path_tag; } -static int -drm_open_device(const char *device_name) +int +loader_open_device(const char *device_name) { int fd; #ifdef O_CLOEXEC @@ -404,7 +404,7 @@ int loader_get_user_preferred_fd(int default_fd, int *different_device) goto default_device_clean; } - fd = drm_open_device(device_name); + fd = loader_open_device(device_name); if (fd >= 0) { close(default_fd); } else { diff --git a/src/loader/loader.h b/src/loader/loader.h index 810e7da7f9f..055dc786892 100644 --- a/src/loader/loader.h +++ b/src/loader/loader.h @@ -27,12 +27,19 @@ #ifndef LOADER_H #define LOADER_H +#ifdef __cplusplus +extern "C" { +#endif + /* Helpers to figure out driver and device name, eg. from pci-id, etc. */ #define _LOADER_DRI (1 << 0) #define _LOADER_GALLIUM (1 << 1) int +loader_open_device(const char *); + +int loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id); char * @@ -61,4 +68,9 @@ loader_get_user_preferred_fd(int default_fd, int *different_device); void loader_set_logger(void (*logger)(int level, const char *fmt, ...)); + +#ifdef __cplusplus +} +#endif + #endif /* LOADER_H */ |