Commit 8658f5d9 authored by Daniel Stone's avatar Daniel Stone

Hotplug: Add HAL support

Add support for HAL-based hotplugging, in which we just get the list of
input devices and properties from HAL.  Requires an FDI which is not yet
in mainline HAL.
parent aa75b348
......@@ -16,4 +16,8 @@ noinst_LIBRARIES = libconfig.a
libconfig_a_SOURCES += dbus.c
endif
EXTRA_DIST = xorg-server.conf
if CONFIG_HAL
libconfig_a_SOURCES += hal.c
endif
EXTRA_DIST = xorg-server.conf x11-input.fdi
......@@ -50,3 +50,8 @@ void config_dbus_core_remove_hook(struct config_dbus_core_hook *hook);
int config_dbus_init(void);
void config_dbus_fini(void);
#endif
#ifdef CONFIG_HAL
int config_hal_init(void);
void config_hal_fini(void);
#endif
......@@ -31,10 +31,16 @@
void
config_init()
{
#if defined(CONFIG_DBUS_API)
#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
if (config_dbus_core_init()) {
# ifdef CONFIG_DBUS_API
if (!config_dbus_init())
ErrorF("[config] failed to initialise D-Bus API\n");
# endif
# ifdef CONFIG_HAL
if (!config_hal_init())
ErrorF("[config] failed to initialise HAL\n");
# endif
}
else {
ErrorF("[config] failed to initialise D-Bus core\n");
......@@ -45,8 +51,13 @@ config_init()
void
config_fini()
{
#if defined(CONFIG_DBUS_API)
#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
# ifdef CONFIG_HAL
config_hal_fini();
# endif
# ifdef CONFIG_DBUS_API
config_dbus_fini();
# endif
config_dbus_core_fini();
#endif
}
This diff is collapsed.
......@@ -520,6 +520,7 @@ AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extensi
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--disable-config-dbus], [Build D-BUS support (default: auto)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=auto])
AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
dnl DDXes.
......@@ -637,14 +638,29 @@ if test "x$CONFIG_DBUS_API" = xyes; then
fi
AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
CONFIG_LIB='$(top_builddir)/config/libconfig.a'
NEED_DBUS="yes"
fi
AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
if test "x$CONFIG_HAL" = xauto; then
CONFIG_HAL="$HAVE_HAL"
fi
if test "x$CONFIG_HAL" = xyes; then
if ! test "x$HAVE_HAL" = xyes; then
AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
fi
AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
REQUIRED_LIBS="$REQUIRED_LIBS hal"
NEED_DBUS="yes"
fi
AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
if test "x$NEED_DBUS" = xyes; then
REQUIRED_LIBS="$REQUIRED_LIBS dbus-1"
fi
CONFIG_LIB='$(top_builddir)/config/libconfig.a'
AM_CONDITIONAL(XV, [test "x$XV" = xyes])
if test "x$XV" = xyes; then
......
......@@ -149,6 +149,7 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
#ifdef XKB
dev->xkb_interest = NULL;
#endif
dev->config_info = NULL;
dev->nPrivates = 0;
dev->devPrivates = NULL;
dev->unwrapProc = NULL;
......
......@@ -471,6 +471,9 @@
/* Support the D-Bus hotplug API */
#undef CONFIG_DBUS_API
/* Support HAL for hotplug */
#undef CONFIG_HAL
/* Use only built-in fonts */
#undef BUILTIN_FONTS
......
......@@ -326,6 +326,7 @@ typedef struct _DeviceIntRec {
#else
void *pad0;
#endif
char *config_info; /* used by the hotplug layer */
DevUnion *devPrivates;
int nPrivates;
DeviceUnwrapProc unwrapProc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment