diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
commit | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch) | |
tree | c1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/hw/xfree86/common | |
parent | dc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff) | |
download | vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2 vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip |
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/common')
47 files changed, 2604 insertions, 3740 deletions
diff --git a/xorg-server/hw/xfree86/common/Makefile.am b/xorg-server/hw/xfree86/common/Makefile.am index 1379f457c..b38c14a7d 100644 --- a/xorg-server/hw/xfree86/common/Makefile.am +++ b/xorg-server/hw/xfree86/common/Makefile.am @@ -5,21 +5,16 @@ if XORG_BUS_SPARC SBUS_SOURCES = xf86sbusBus.c endif -if DEBUG -DEBUGSOURCES = xf86Debug.c -endif - if XV XVSOURCES = xf86xv.c xf86xvmc.c XVSDKINCS = xf86xv.h xf86xvmc.h endif -XKBSOURCES = xf86XKB.c XISOURCES = xf86Xinput.c xisb.c XISDKINCS = xf86Xinput.h xisb.h RANDRSOURCES = xf86RandR.c -BUSSOURCES = xf86isaBus.c xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) +BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes @@ -30,40 +25,38 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r -libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ +libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ xf86Cursor.c xf86DGA.c xf86DPMS.c \ - xf86DoProbe.c xf86Events.c \ - xf86Globals.c xf86AutoConfig.c \ - xf86MiscExt.c xf86Option.c \ + xf86Events.c xf86Globals.c xf86AutoConfig.c \ + xf86Option.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ - xf86Helper.c xf86PM.c \ - xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c \ - $(XVSOURCES) $(BUSSOURCES) $(XKBSOURCES) \ - $(DEBUGSOURCES) $(XISOURCES) $(RANDRSOURCES) + xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \ + xf86Mode.c xorgHelper.c \ + $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c -libinit_a_SOURCES = xf86Build.h xf86Init.c +libinit_a_SOURCES = xf86Init.c +nodist_libinit_a_SOURCES = xf86Build.h INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ - -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod + -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ + -I$(srcdir)/../modes sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \ - xf86cmap.h xf86fbman.h xf86str.h $(XISDKINCS) \ - $(XVSDKINCS) atKeynames.h xf86Version.h xorgVersion.h \ - xf86sbusBus.h xf86xv.h xf86xvmc.h xf86xvpriv.h + xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h xf86Xinput.h xisb.h \ + $(XVSDKINCS) xorgVersion.h \ + xf86sbusBus.h xf86xvpriv.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = \ - atKeynames.h \ compiler.h \ fourcc.h \ scoasm.h \ xf86.h \ - xf86Build.h \ xf86Bus.h \ xf86Config.h \ xf86InPriv.h \ @@ -82,8 +75,6 @@ EXTRA_DIST = \ xf86xvmc.h \ xf86xvpriv.h \ xisb.h \ - xf86Build.h.in \ - xf86Version.h \ xorgVersion.h \ xf86Date.h \ $(MODEDEFSOURCES) \ diff --git a/xorg-server/hw/xfree86/common/Makefile.in b/xorg-server/hw/xfree86/common/Makefile.in index 443492823..a93593a26 100644 --- a/xorg-server/hw/xfree86/common/Makefile.in +++ b/xorg-server/hw/xfree86/common/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -47,7 +47,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ @@ -58,33 +57,30 @@ ARFLAGS = cru libinit_a_AR = $(AR) $(ARFLAGS) libinit_a_LIBADD = am_libinit_a_OBJECTS = xf86Init.$(OBJEXT) -libinit_a_OBJECTS = $(am_libinit_a_OBJECTS) +nodist_libinit_a_OBJECTS = +libinit_a_OBJECTS = $(am_libinit_a_OBJECTS) \ + $(nodist_libinit_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) libcommon_la_LIBADD = -am__libcommon_la_SOURCES_DIST = xf86Configure.c xf86Bus.c xf86Config.c \ - xf86Cursor.c xf86DGA.c xf86DPMS.c xf86DoProbe.c xf86Events.c \ - xf86Globals.c xf86AutoConfig.c xf86MiscExt.c xf86Option.c \ +am__libcommon_la_SOURCES_DIST = xf86Configure.c xf86ShowOpts.c \ + xf86Bus.c xf86Config.c xf86Cursor.c xf86DGA.c xf86DPMS.c \ + xf86Events.c xf86Globals.c xf86AutoConfig.c xf86Option.c \ xf86VidMode.c xf86fbman.c xf86cmap.c xf86Helper.c xf86PM.c \ - xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c xf86xv.c \ - xf86xvmc.c xf86isaBus.c xf86pciBus.c xf86fbBus.c xf86noBus.c \ - xf86sbusBus.c xf86XKB.c xf86Debug.c xf86Xinput.c xisb.c \ + xf86RAC.c xf86Xinput.c xisb.c xf86Mode.c xorgHelper.c xf86xv.c \ + xf86xvmc.c xf86pciBus.c xf86fbBus.c xf86noBus.c xf86sbusBus.c \ xf86RandR.c @XV_TRUE@am__objects_1 = xf86xv.lo xf86xvmc.lo @XORG_BUS_SPARC_TRUE@am__objects_2 = xf86sbusBus.lo -am__objects_3 = xf86isaBus.lo xf86pciBus.lo xf86fbBus.lo xf86noBus.lo \ +am__objects_3 = xf86pciBus.lo xf86fbBus.lo xf86noBus.lo \ $(am__objects_2) -am__objects_4 = xf86XKB.lo -@DEBUG_TRUE@am__objects_5 = xf86Debug.lo -am__objects_6 = xf86Xinput.lo xisb.lo -am__objects_7 = xf86RandR.lo -am_libcommon_la_OBJECTS = xf86Configure.lo xf86Bus.lo xf86Config.lo \ - xf86Cursor.lo xf86DGA.lo xf86DPMS.lo xf86DoProbe.lo \ - xf86Events.lo xf86Globals.lo xf86AutoConfig.lo xf86MiscExt.lo \ - xf86Option.lo xf86VidMode.lo xf86fbman.lo xf86cmap.lo \ - xf86Helper.lo xf86PM.lo xf86Mode.lo xorgHelper.lo \ - xf86Versions.lo $(am__objects_1) $(am__objects_3) \ - $(am__objects_4) $(am__objects_5) $(am__objects_6) \ - $(am__objects_7) +am__objects_4 = xf86RandR.lo +am_libcommon_la_OBJECTS = xf86Configure.lo xf86ShowOpts.lo xf86Bus.lo \ + xf86Config.lo xf86Cursor.lo xf86DGA.lo xf86DPMS.lo \ + xf86Events.lo xf86Globals.lo xf86AutoConfig.lo xf86Option.lo \ + xf86VidMode.lo xf86fbman.lo xf86cmap.lo xf86Helper.lo \ + xf86PM.lo xf86RAC.lo xf86Xinput.lo xisb.lo xf86Mode.lo \ + xorgHelper.lo $(am__objects_1) $(am__objects_3) \ + $(am__objects_4) nodist_libcommon_la_OBJECTS = xf86DefModeSet.lo libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) \ $(nodist_libcommon_la_OBJECTS) @@ -93,21 +89,18 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libinit_a_SOURCES) $(libcommon_la_SOURCES) \ - $(nodist_libcommon_la_SOURCES) +SOURCES = $(libinit_a_SOURCES) $(nodist_libinit_a_SOURCES) \ + $(libcommon_la_SOURCES) $(nodist_libcommon_la_SOURCES) DIST_SOURCES = $(libinit_a_SOURCES) $(am__libcommon_la_SOURCES_DIST) am__sdk_HEADERS_DIST = compiler.h fourcc.h xf86.h xf86Module.h \ xf86Opt.h xf86PciInfo.h xf86Priv.h xf86Privstr.h \ - xf86Resources.h xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h \ - xisb.h xf86xv.h xf86xvmc.h atKeynames.h xf86Version.h \ - xorgVersion.h xf86sbusBus.h xf86xvpriv.h + xf86Resources.h xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h \ + xf86Xinput.h xisb.h xf86xv.h xf86xvmc.h xorgVersion.h \ + xf86sbusBus.h xf86xvpriv.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -125,8 +118,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -147,10 +141,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -172,6 +162,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -181,18 +172,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -211,7 +199,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -225,7 +213,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -237,8 +228,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -247,8 +237,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -281,7 +271,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -291,27 +280,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -322,10 +296,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ $(am__append_1) XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -334,13 +304,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -373,8 +338,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -394,7 +358,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -404,12 +367,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -427,55 +390,49 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ noinst_LIBRARIES = libinit.a noinst_LTLIBRARIES = libcommon.la @XORG_BUS_SPARC_TRUE@SBUS_SOURCES = xf86sbusBus.c -@DEBUG_TRUE@DEBUGSOURCES = xf86Debug.c @XV_TRUE@XVSOURCES = xf86xv.c xf86xvmc.c @XV_TRUE@XVSDKINCS = xf86xv.h xf86xvmc.h -XKBSOURCES = xf86XKB.c XISOURCES = xf86Xinput.c xisb.c XISDKINCS = xf86Xinput.h xisb.h RANDRSOURCES = xf86RandR.c -BUSSOURCES = xf86isaBus.c xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) +BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r -libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ +libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ xf86Cursor.c xf86DGA.c xf86DPMS.c \ - xf86DoProbe.c xf86Events.c \ - xf86Globals.c xf86AutoConfig.c \ - xf86MiscExt.c xf86Option.c \ + xf86Events.c xf86Globals.c xf86AutoConfig.c \ + xf86Option.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ - xf86Helper.c xf86PM.c \ - xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c \ - $(XVSOURCES) $(BUSSOURCES) $(XKBSOURCES) \ - $(DEBUGSOURCES) $(XISOURCES) $(RANDRSOURCES) + xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \ + xf86Mode.c xorgHelper.c \ + $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c -libinit_a_SOURCES = xf86Build.h xf86Init.c +libinit_a_SOURCES = xf86Init.c +nodist_libinit_a_SOURCES = xf86Build.h INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ - -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod + -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ + -I$(srcdir)/../modes sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \ - xf86cmap.h xf86fbman.h xf86str.h $(XISDKINCS) \ - $(XVSDKINCS) atKeynames.h xf86Version.h xorgVersion.h \ - xf86sbusBus.h xf86xv.h xf86xvmc.h xf86xvpriv.h + xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h xf86Xinput.h xisb.h \ + $(XVSDKINCS) xorgVersion.h \ + xf86sbusBus.h xf86xvpriv.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = \ - atKeynames.h \ compiler.h \ fourcc.h \ scoasm.h \ xf86.h \ - xf86Build.h \ xf86Bus.h \ xf86Config.h \ xf86InPriv.h \ @@ -494,8 +451,6 @@ EXTRA_DIST = \ xf86xvmc.h \ xf86xvpriv.h \ xisb.h \ - xf86Build.h.in \ - xf86Version.h \ xorgVersion.h \ xf86Date.h \ $(MODEDEFSOURCES) \ @@ -512,8 +467,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -571,26 +526,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DGA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DPMS.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DefModeSet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DoProbe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Events.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Init.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86MiscExt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Mode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Option.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86PM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RAC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RandR.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Versions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86ShowOpts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86VidMode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86XKB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Xinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86cmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86fbBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86fbman.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86isaBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86noBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86pciBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86sbusBus.Plo@am__quote@ @@ -648,7 +599,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/xorg-server/hw/xfree86/common/atKeynames.h b/xorg-server/hw/xfree86/common/atKeynames.h deleted file mode 100644 index 85f13ac32..000000000 --- a/xorg-server/hw/xfree86/common/atKeynames.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Thomas Roell not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Thomas Roell makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ -/* - * Copyright (c) 1994-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifndef _ATKEYNAMES_H -#define _ATKEYNAMES_H - -#define XK_TECHNICAL -#define XK_KATAKANA -#include <X11/keysym.h> -#include <X11/XF86keysym.h> - -#define GLYPHS_PER_KEY 4 -#define NUM_KEYCODES 248 -#define MIN_KEYCODE 8 -#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1) - -#define AltMask Mod1Mask -#define NumLockMask Mod2Mask -#define AltLangMask Mod3Mask -#define KanaMask Mod4Mask -#define ScrollLockMask Mod5Mask - -#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7))) -#define ModifierDown(k) ((keyc->state & (k)) == (k)) - -/* - * NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three) - * sets of scancodes. Set3 can only be generated by a MF keyboard. - * Set2 sends a makecode for keypress, and the same code prefixed by a - * F0 for keyrelease. This is a little bit ugly to handle. Thus we use - * here for X386 the PC/XT compatible Set1. This set uses 8bit scancodes. - * Bit 7 ist set if the key is released. The code E0 switches to a - * different meaning to add the new MF cursorkeys, while not breaking old - * applications. E1 is another special prefix. Since I assume that there - * will be further versions of PC/XT scancode compatible keyboards, we - * may be in trouble one day. - * - * IDEA: 1) Use Set2 on AT84 keyboards and translate it to MF Set3. - * 2) Use the keyboards native set and translate it to common keysyms. - */ - -/* - * definition of the AT84/MF101/MF102 Keyboard: - * ============================================================ - * Defined Key Cap Glyphs Pressed value - * Key Name Main Also (hex) (dec) - * ---------------- ---------- ------- ------ ------ - */ - -#define KEY_Escape /* Escape 0x01 */ 1 -#define KEY_1 /* 1 ! 0x02 */ 2 -#define KEY_2 /* 2 @ 0x03 */ 3 -#define KEY_3 /* 3 # 0x04 */ 4 -#define KEY_4 /* 4 $ 0x05 */ 5 -#define KEY_5 /* 5 % 0x06 */ 6 -#define KEY_6 /* 6 ^ 0x07 */ 7 -#define KEY_7 /* 7 & 0x08 */ 8 -#define KEY_8 /* 8 * 0x09 */ 9 -#define KEY_9 /* 9 ( 0x0a */ 10 -#define KEY_0 /* 0 ) 0x0b */ 11 -#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12 -#define KEY_Equal /* = (Equal) + 0x0d */ 13 -#define KEY_BackSpace /* Back Space 0x0e */ 14 -#define KEY_Tab /* Tab 0x0f */ 15 -#define KEY_Q /* Q 0x10 */ 16 -#define KEY_W /* W 0x11 */ 17 -#define KEY_E /* E 0x12 */ 18 -#define KEY_R /* R 0x13 */ 19 -#define KEY_T /* T 0x14 */ 20 -#define KEY_Y /* Y 0x15 */ 21 -#define KEY_U /* U 0x16 */ 22 -#define KEY_I /* I 0x17 */ 23 -#define KEY_O /* O 0x18 */ 24 -#define KEY_P /* P 0x19 */ 25 -#define KEY_LBrace /* [ { 0x1a */ 26 -#define KEY_RBrace /* ] } 0x1b */ 27 -#define KEY_Enter /* Enter 0x1c */ 28 -#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29 -#define KEY_A /* A 0x1e */ 30 -#define KEY_S /* S 0x1f */ 31 -#define KEY_D /* D 0x20 */ 32 -#define KEY_F /* F 0x21 */ 33 -#define KEY_G /* G 0x22 */ 34 -#define KEY_H /* H 0x23 */ 35 -#define KEY_J /* J 0x24 */ 36 -#define KEY_K /* K 0x25 */ 37 -#define KEY_L /* L 0x26 */ 38 -#define KEY_SemiColon /* ;(SemiColon) :(Colon) 0x27 */ 39 -#define KEY_Quote /* ' (Apostr) " (Quote) 0x28 */ 40 -#define KEY_Tilde /* ` (Accent) ~ (Tilde) 0x29 */ 41 -#define KEY_ShiftL /* Shift(left) 0x2a */ 42 -#define KEY_BSlash /* \(BckSlash) |(VertBar)0x2b */ 43 -#define KEY_Z /* Z 0x2c */ 44 -#define KEY_X /* X 0x2d */ 45 -#define KEY_C /* C 0x2e */ 46 -#define KEY_V /* V 0x2f */ 47 -#define KEY_B /* B 0x30 */ 48 -#define KEY_N /* N 0x31 */ 49 -#define KEY_M /* M 0x32 */ 50 -#define KEY_Comma /* , (Comma) < (Less) 0x33 */ 51 -#define KEY_Period /* . (Period) >(Greater)0x34 */ 52 -#define KEY_Slash /* / (Slash) ? 0x35 */ 53 -#define KEY_ShiftR /* Shift(right) 0x36 */ 54 -#define KEY_KP_Multiply /* * 0x37 */ 55 -#define KEY_Alt /* Alt(left) 0x38 */ 56 -#define KEY_Space /* (SpaceBar) 0x39 */ 57 -#define KEY_CapsLock /* CapsLock 0x3a */ 58 -#define KEY_F1 /* F1 0x3b */ 59 -#define KEY_F2 /* F2 0x3c */ 60 -#define KEY_F3 /* F3 0x3d */ 61 -#define KEY_F4 /* F4 0x3e */ 62 -#define KEY_F5 /* F5 0x3f */ 63 -#define KEY_F6 /* F6 0x40 */ 64 -#define KEY_F7 /* F7 0x41 */ 65 -#define KEY_F8 /* F8 0x42 */ 66 -#define KEY_F9 /* F9 0x43 */ 67 -#define KEY_F10 /* F10 0x44 */ 68 -#define KEY_NumLock /* NumLock 0x45 */ 69 -#define KEY_ScrollLock /* ScrollLock 0x46 */ 70 -#define KEY_KP_7 /* 7 Home 0x47 */ 71 -#define KEY_KP_8 /* 8 Up 0x48 */ 72 -#define KEY_KP_9 /* 9 PgUp 0x49 */ 73 -#define KEY_KP_Minus /* - (Minus) 0x4a */ 74 -#define KEY_KP_4 /* 4 Left 0x4b */ 75 -#define KEY_KP_5 /* 5 0x4c */ 76 -#define KEY_KP_6 /* 6 Right 0x4d */ 77 -#define KEY_KP_Plus /* + (Plus) 0x4e */ 78 -#define KEY_KP_1 /* 1 End 0x4f */ 79 -#define KEY_KP_2 /* 2 Down 0x50 */ 80 -#define KEY_KP_3 /* 3 PgDown 0x51 */ 81 -#define KEY_KP_0 /* 0 Insert 0x52 */ 82 -#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83 -#define KEY_SysReqest /* SysReqest 0x54 */ 84 - /* NOTUSED 0x55 */ -#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86 -#define KEY_F11 /* F11 0x57 */ 87 -#define KEY_F12 /* F12 0x58 */ 88 - -#define KEY_Prefix0 /* special 0x60 */ 96 -#define KEY_Prefix1 /* specail 0x61 */ 97 - -/* - * The 'scancodes' below are generated by the server, because the MF101/102 - * keyboard sends them as sequence of other scancodes - */ -#define KEY_Home /* Home 0x59 */ 89 -#define KEY_Up /* Up 0x5a */ 90 -#define KEY_PgUp /* PgUp 0x5b */ 91 -#define KEY_Left /* Left 0x5c */ 92 -#define KEY_Begin /* Begin 0x5d */ 93 -#define KEY_Right /* Right 0x5e */ 94 -#define KEY_End /* End 0x5f */ 95 -#define KEY_Down /* Down 0x60 */ 96 -#define KEY_PgDown /* PgDown 0x61 */ 97 -#define KEY_Insert /* Insert 0x62 */ 98 -#define KEY_Delete /* Delete 0x63 */ 99 -#define KEY_KP_Enter /* Enter 0x64 */ 100 -#define KEY_RCtrl /* Ctrl(right) 0x65 */ 101 -#define KEY_Pause /* Pause 0x66 */ 102 -#define KEY_Print /* Print 0x67 */ 103 -#define KEY_KP_Divide /* Divide 0x68 */ 104 -#define KEY_AltLang /* AtlLang(right) 0x69 */ 105 -#define KEY_Break /* Break 0x6a */ 106 -#define KEY_LMeta /* Left Meta 0x6b */ 107 -#define KEY_RMeta /* Right Meta 0x6c */ 108 -#define KEY_Menu /* Menu 0x6d */ 109 -#define KEY_F13 /* F13 0x6e */ 110 -#define KEY_F14 /* F14 0x6f */ 111 -#define KEY_F15 /* F15 0x70 */ 112 -#define KEY_HKTG /* Hirugana/Katakana tog 0x70 */ 112 -#define KEY_F16 /* F16 0x71 */ 113 -#define KEY_F17 /* F17 0x72 */ 114 -#define KEY_KP_DEC /* KP_DEC 0x73 */ 115 -#define KEY_BSlash2 /* \ _ 0x73 */ 115 -#define KEY_KP_Equal /* Equal (Keypad) 0x76 */ 118 -#define KEY_XFER /* Kanji Transfer 0x79 */ 121 -#define KEY_NFER /* No Kanji Transfer 0x7b */ 123 -#define KEY_Yen /* Yen 0x7d */ 125 - -#define KEY_Power /* Power Key 0x84 */ 132 -#define KEY_Mute /* Audio Mute 0x85 */ 133 -#define KEY_AudioLower /* Audio Lower 0x86 */ 134 -#define KEY_AudioRaise /* Audio Raise 0x87 */ 135 -#define KEY_Help /* Help 0x88 */ 136 -#define KEY_L1 /* Stop 0x89 */ 137 -#define KEY_L2 /* Again 0x8a */ 138 -#define KEY_L3 /* Props 0x8b */ 139 -#define KEY_L4 /* Undo 0x8c */ 140 -#define KEY_L5 /* Front 0x8d */ 141 -#define KEY_L6 /* Copy 0x8e */ 142 -#define KEY_L7 /* Open 0x8f */ 143 -#define KEY_L8 /* Paste 0x90 */ 144 -#define KEY_L9 /* Find 0x91 */ 145 -#define KEY_L10 /* Cut 0x92 */ 146 - -/* - * Fake 'scancodes' in the following ranges are generated for 2-byte - * codes not handled elsewhere. These correspond to most extended keys - * on so-called "Internet" keyboards: - * - * 0x79-0x93 - * 0x96-0xa1 - * 0xa3-0xac - * 0xb1-0xb4 - * 0xba-0xbd - * 0xc2 - * 0xcc-0xd2 - * 0xd6-0xf7 - */ - -/* - * Remapped 'scancodes' are generated for single-byte codes in the range - * 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards. - */ - -#define KEY_0x59 0x95 -#define KEY_0x5A 0xA2 -#define KEY_0x5B 0xAD -#define KEY_0x5C KEY_KP_EQUAL -#define KEY_0x5D 0xAE -#define KEY_0x5E 0xAF -#define KEY_0x5F 0xB0 -#define KEY_0x62 0xB5 -#define KEY_0x63 0xB6 -#define KEY_0x64 0xB7 -#define KEY_0x65 0xB8 -#define KEY_0x66 0xB9 -#define KEY_0x67 0xBE -#define KEY_0x68 0xBF -#define KEY_0x69 0xC0 -#define KEY_0x6A 0xC1 -#define KEY_0x6B 0xC3 -#define KEY_0x6C 0xC4 -#define KEY_0x6D 0xC5 -#define KEY_0x6E 0xC6 -#define KEY_0x6F 0xC7 -#define KEY_0x70 0xC8 -#define KEY_0x71 0xC9 -#define KEY_0x72 0xCA -#define KEY_0x73 0xCB -#define KEY_0x74 0xD3 -#define KEY_0x75 0xD4 -#define KEY_0x76 0xD5 - -/* These are for "notused" and "unknown" entries in translation maps. */ -#define KEY_NOTUSED 0 -#define KEY_UNKNOWN 255 - -#endif /* _ATKEYNAMES_H */ diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h index 7b65da844..285d9a3f6 100644 --- a/xorg-server/hw/xfree86/common/compiler.h +++ b/xorg-server/hw/xfree86/common/compiler.h @@ -75,43 +75,10 @@ # endif # endif /* __inline */ -# if defined(IODEBUG) && defined(__GNUC__) -# define outb RealOutb -# define outw RealOutw -# define outl RealOutl -# define inb RealInb -# define inw RealInw -# define inl RealInl -# endif - -# if defined(QNX4) /* Do this for now to keep Watcom happy */ -# define outb outp -# define outw outpw -# define outl outpd -# define inb inp -# define inw inpw -# define inl inpd - -/* Define the ffs function for inlining */ -extern int ffs(unsigned long); -# pragma aux ffs_ = \ - "bsf edx, eax" \ - "jnz bits_set" \ - "xor eax, eax" \ - "jmp exit1" \ - "bits_set:" \ - "mov eax, edx" \ - "inc eax" \ - "exit1:" \ - __parm [eax] \ - __modify [eax edx] \ - __value [eax] \ - ; -# endif - -# if defined(__SUNPRO_C) -# define DO_PROTOTYPES -# endif +/* Support gcc's __FUNCTION__ for people using other compilers */ +#if !defined(__GNUC__) && !defined(__FUNCTION__) +# define __FUNCTION__ __func__ /* C99 */ +#endif # if defined(NO_INLINE) || defined(DO_PROTOTYPES) @@ -250,7 +217,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); }; static __inline__ unsigned long ldq_u(unsigned long * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u64 *ptr = (const struct __una_u64 *) r11; return ptr->x; # else @@ -269,7 +236,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11) static __inline__ unsigned long ldl_u(unsigned int * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u32 *ptr = (const struct __una_u32 *) r11; return ptr->x; # else @@ -288,7 +255,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11) static __inline__ unsigned long ldw_u(unsigned short * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u16 *ptr = (const struct __una_u16 *) r11; return ptr->x; # else @@ -311,7 +278,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11) static __inline__ void stq_u(unsigned long r5, unsigned long * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u64 *ptr = (struct __una_u64 *) r11; ptr->x = r5; # else @@ -336,7 +303,7 @@ static __inline__ void stq_u(unsigned long r5, unsigned long * r11) static __inline__ void stl_u(unsigned long r5, unsigned int * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u32 *ptr = (struct __una_u32 *) r11; ptr->x = r5; # else @@ -361,7 +328,7 @@ static __inline__ void stl_u(unsigned long r5, unsigned int * r11) static __inline__ void stw_u(unsigned long r5, unsigned short * r11) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u16 *ptr = (struct __una_u16 *) r11; ptr->x = r5; # else @@ -498,7 +465,7 @@ extern unsigned int inb(unsigned long port); extern unsigned int inw(unsigned long port); extern unsigned int inl(unsigned long port); -# elif defined(linux) && (defined(__amd64__) || defined(__x86_64__)) +# elif defined(linux) && defined(__amd64__) # include <inttypes.h> @@ -564,9 +531,8 @@ inl(unsigned short port) return ret; } -# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) +# elif (defined(linux) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) -# if !defined(Lynx) # ifndef ASI_PL # define ASI_PL 0x88 # endif @@ -805,7 +771,6 @@ xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, : "r" (val), "r" (addr), "i" (ASI_PL)); } -# endif /* !Lynx */ /* * EGCS 1.1 knows about arbitrary unaligned loads. Define some @@ -820,7 +785,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); }; static __inline__ unsigned long ldq_u(unsigned long *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) # if defined(__arch64__) || defined(__sparcv9) const struct __una_u64 *ptr = (const struct __una_u64 *) p; # else @@ -836,7 +801,7 @@ static __inline__ unsigned long ldq_u(unsigned long *p) static __inline__ unsigned long ldl_u(unsigned int *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u32 *ptr = (const struct __una_u32 *) p; return ptr->x; # else @@ -848,7 +813,7 @@ static __inline__ unsigned long ldl_u(unsigned int *p) static __inline__ unsigned long ldw_u(unsigned short *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) const struct __una_u16 *ptr = (const struct __una_u16 *) p; return ptr->x; # else @@ -860,7 +825,7 @@ static __inline__ unsigned long ldw_u(unsigned short *p) static __inline__ void stq_u(unsigned long val, unsigned long *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) # if defined(__arch64__) || defined(__sparcv9) struct __una_u64 *ptr = (struct __una_u64 *) p; # else @@ -875,7 +840,7 @@ static __inline__ void stq_u(unsigned long val, unsigned long *p) static __inline__ void stl_u(unsigned long val, unsigned int *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u32 *ptr = (struct __una_u32 *) p; ptr->x = val; # else @@ -886,7 +851,7 @@ static __inline__ void stl_u(unsigned long val, unsigned int *p) static __inline__ void stw_u(unsigned long val, unsigned short *p) { -# if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91)) +# if defined(__GNUC__) struct __una_u16 *ptr = (struct __una_u16 *) p; ptr->x = val; # else @@ -1067,7 +1032,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, # define write_mem_barrier() /* NOP */ # endif /* __arm32__ */ -# elif (defined(Lynx) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__) +# elif (defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)) && defined(__powerpc__) # ifndef MAP_FAILED # define MAP_FAILED ((void *)-1) @@ -1363,7 +1328,7 @@ do { \ # define write_mem_barrier() /* NOP */ # if !defined(__SUNPRO_C) -# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) +# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) # ifdef GCCUSESGAS /* @@ -1472,7 +1437,7 @@ inl(unsigned short port) # endif /* GCCUSESGAS */ -# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)*/ +# else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__m32r__) */ static __inline__ void outb(unsigned short port, unsigned char val) @@ -1513,7 +1478,6 @@ inl(unsigned short port) # endif /* ix86 */ # else /* !GNUC */ -# if !defined(QNX4) # if defined(__STDC__) && (__STDC__ == 1) # ifndef asm # define asm __asm @@ -1529,13 +1493,13 @@ inl(unsigned short port) # define uint_t unsigned int # define uchar_t unsigned char # endif /* __UNIXWARE__ */ -# if !defined(sgi) && !defined(__SUNPRO_C) +# if !defined(__SUNPRO_C) # include <sys/inline.h> # endif # else # include "scoasm.h" # endif -# if (!defined(__HIGHC__) && !defined(sgi) && !defined(__SUNPRO_C)) || \ +# if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \ defined(__USLC__) # pragma asm partial_optimization outl # pragma asm partial_optimization outw @@ -1544,7 +1508,6 @@ inl(unsigned short port) # pragma asm partial_optimization inw # pragma asm partial_optimization inb # endif -# endif # define ldq_u(p) (*((unsigned long *)(p))) # define ldl_u(p) (*((unsigned int *)(p))) # define ldw_u(p) (*((unsigned short *)(p))) @@ -1555,32 +1518,6 @@ inl(unsigned short port) # define write_mem_barrier() /* NOP */ # endif /* __GNUC__ */ -# if defined(QNX4) -# include <sys/types.h> -extern unsigned inb(unsigned port); -extern unsigned inw(unsigned port); -extern unsigned inl(unsigned port); -extern void outb(unsigned port, unsigned val); -extern void outw(unsigned port, unsigned val); -extern void outl(unsigned port, unsigned val); -# endif /* QNX4 */ - -# if defined(IODEBUG) && defined(__GNUC__) -# undef inb -# undef inw -# undef inl -# undef outb -# undef outw -# undef outl -# define inb(a) __extension__ ({unsigned char __c=RealInb(a); ErrorF("inb(0x%03x) = 0x%02x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;}) -# define inw(a) __extension__ ({unsigned short __c=RealInw(a); ErrorF("inw(0x%03x) = 0x%04x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;}) -# define inl(a) __extension__ ({unsigned int __c=RealInl(a); ErrorF("inl(0x%03x) = 0x%08x\t@ line %4d, file %s\n", a, __c, __LINE__, __FILE__);__c;}) - -# define outb(a,b) (ErrorF("outb(0x%03x, 0x%02x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutb(a,b)) -# define outw(a,b) (ErrorF("outw(0x%03x, 0x%04x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutw(a,b)) -# define outl(a,b) (ErrorF("outl(0x%03x, 0x%08x)\t@ line %4d, file %s\n", a, b, __LINE__, __FILE__),RealOutl(a,b)) -# endif - # endif /* NO_INLINE */ # ifdef __alpha__ @@ -1604,8 +1541,6 @@ extern void (*xf86WriteMmio32)(int, void *, unsigned long); extern void (*xf86WriteMmioNB8)(int, void *, unsigned long); extern void (*xf86WriteMmioNB16)(int, void *, unsigned long); extern void (*xf86WriteMmioNB32)(int, void *, unsigned long); -extern void xf86JensenMemToBus(char *, long, long, int); -extern void xf86JensenBusToMem(char *, char *, unsigned long, int); extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); @@ -1619,20 +1554,13 @@ extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); # define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) # endif -# if defined (JENSEN_SUPPORT) -# define MMIO_OUT32(base, offset, val) \ - (*xf86WriteMmio32)((CARD32)(val), base, offset) -# define MMIO_ONB32(base, offset, val) \ - (*xf86WriteMmioNB32)((CARD32)(val), base, offset) -# else -# define MMIO_OUT32(base, offset, val) \ +# define MMIO_OUT32(base, offset, val) \ do { \ write_mem_barrier(); \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ } while (0) -# define MMIO_ONB32(base, offset, val) \ +# define MMIO_ONB32(base, offset, val) \ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) -# endif # define MMIO_OUT8(base, offset, val) \ (*xf86WriteMmio8)((CARD8)(val), base, offset) diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h index e91521770..a32aa9bcc 100644 --- a/xorg-server/hw/xfree86/common/xf86.h +++ b/xorg-server/hw/xfree86/common/xf86.h @@ -56,6 +56,7 @@ /* General parameters */ extern int xf86DoConfigure; +extern int xf86DoShowOptions; extern Bool xf86DoModalias; extern Bool xf86DoConfigurePass1; extern DevPrivateKey xf86ScreenKey; @@ -65,7 +66,6 @@ extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern const unsigned char byte_reversed[256]; extern ScrnInfoPtr xf86CurrentScreen; extern Bool pciSlotClaimed; -extern Bool isaSlotClaimed; extern Bool fbSlotClaimed; #if defined(__sparc__) || defined(__sparc) extern Bool sbusSlotClaimed; @@ -101,22 +101,15 @@ Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func); Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func); void xf86FormatPciBusNumber(int busnum, char *buffer); -void xf86PrintResList(int verb, resPtr list); resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex); -int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); -int xf86GetIsaInfoForScreen(int scrnIndex); int xf86GetFbInfoForScreen(int scrnIndex); -Bool xf86ParseIsaBusString(const char *busID); int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); void xf86EnableAccess(ScrnInfoPtr pScrn); void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn); Bool xf86IsPrimaryPci(struct pci_device * pPci); -Bool xf86IsPrimaryIsa(void); /* new RAC */ resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex); -resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2); -resPtr xf86DupResList(const resPtr rlist); void xf86FreeResList(resPtr rlist); void xf86ClaimFixedResources(resList list, int entityIndex); Bool xf86DriverHasEntities(DriverPtr drvp); @@ -140,7 +133,6 @@ Bool xf86IsEntityPrimary(int entityIndex); resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); resPtr xf86SetOperatingState(resList list, int entityIndex, int mask); void xf86EnterServerState(xf86State state); -memType xf86ChkConflict(resRange *rgp, int entityIndex); ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86NoSharedResources(int screenIndex, resType res); resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2); @@ -162,8 +154,6 @@ DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex); /* xf86Configure.c */ GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset); -GDevPtr xf86AddDeviceToConfigure( const char *driver, - struct pci_device * pVideo, int chipset ); /* xf86Cursor.c */ @@ -205,8 +195,8 @@ void xf86EnableGeneralHandler(pointer handler); void xf86InterceptSignals(int *signo); void xf86InterceptSigIll(void (*sigillhandler)(void)); Bool xf86EnableVTSwitch(Bool new); -Bool xf86CommonSpecialKey(int key, Bool down, int modifiers); void xf86ProcessActionEvent(ActionEvent action, void *arg); +void xf86PrintBacktrace(void); /* xf86Helper.c */ @@ -246,10 +236,6 @@ int xf86MatchPciInstances(const char *driverName, int vendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets, GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities); -int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets, - IsaChipsets *ISAchipsets, DriverPtr drvp, - FindIsaDevProc FindIsaDevice, GDevPtr *devList, - int numDevs, int **foundEntities); void xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int), void (*ProtectRegs)(ScrnInfoPtr, Bool), @@ -278,7 +264,6 @@ Bool xf86GetModInDevEnabled(void); Bool xf86GetAllowMouseOpenFail(void); Bool xf86IsPc98(void); void xf86DisableRandR(void); -CARD32 xf86GetVersion(void); CARD32 xorgGetVersion(void); CARD32 xf86GetModuleVersion(pointer module); pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name); @@ -301,11 +286,6 @@ ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); -ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, - int entityIndex, IsaChipsets *i_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, @@ -317,19 +297,10 @@ Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, EntityProc enter, EntityProc leave, pointer private); /* Obsolete! don't use */ -Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, - int entityIndex, IsaChipsets *i_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); -void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip, - resList res, EntityProc init, - EntityProc enter, EntityProc leave, - pointer private); void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, EntityProc enter, EntityProc leave, pointer private); @@ -341,23 +312,6 @@ Bool xf86IsUnblank(int mode); _X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module); _X_DEPRECATED void xf86DeleteModuleInfo(int idx); -void xf86getsecs(long *, long *); - -/* xf86Debug.c */ -#ifdef BUILDDEBUG -CARD8 xf86PeekFb8(CARD8 *p); -CARD16 xf86PeekFb16(CARD16 *p); -CARD32 xf86PeekFb32(CARD32 *p); -void xf86PokeFb8(CARD8 *p, CARD8 v); -void xf86PokeFb16(CARD16 *p, CARD16 v); -void xf86PokeFb32(CARD16 *p, CARD32 v); -CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset); -CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset); -CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset); -void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v); -void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v); -void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v); -#endif /* xf86Init.c */ @@ -390,13 +344,14 @@ void xf86PruneDriverModes(ScrnInfoPtr scrp); void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags); void xf86PrintModes(ScrnInfoPtr scrp); void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges); -double xf86ModeHSync(DisplayModePtr mode); -double xf86ModeVRefresh(DisplayModePtr mode); +double xf86ModeHSync(const DisplayModeRec *mode); +double xf86ModeVRefresh(const DisplayModeRec *mode); void xf86SetModeDefaultName(DisplayModePtr mode); void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags); -DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode); +DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode); DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList); -Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2); +Bool xf86ModesEqual(const DisplayModeRec *pMode1, + const DisplayModeRec *pMode2); void xf86PrintModeline(int scrnIndex,DisplayModePtr mode); DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new); @@ -419,12 +374,6 @@ Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, Bool VidModeExtensionInit(ScreenPtr pScreen); -/* xf86Versions.c */ -CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag); -Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, - CARD32 version, int flags); - - #endif /* _NO_XF86_PROTOTYPES */ #endif /* _XF86_H */ diff --git a/xorg-server/hw/xfree86/common/xf86AutoConfig.c b/xorg-server/hw/xfree86/common/xf86AutoConfig.c index 7e5fab412..a9a1fd207 100644 --- a/xorg-server/hw/xfree86/common/xf86AutoConfig.c +++ b/xorg-server/hw/xfree86/common/xf86AutoConfig.c @@ -39,8 +39,16 @@ #include "xf86Config.h" #include "xf86Priv.h" #include "xf86_OSlib.h" +#ifdef __sparc__ +# include "xf86sbusBus.h" +#endif #include "dirent.h" +#ifdef sun +# include <sys/visual_io.h> +# include <ctype.h> +#endif + /* Sections for the default built-in configuration. */ #define BUILTIN_DEVICE_NAME \ @@ -79,11 +87,8 @@ static const char **builtinConfig = NULL; static int builtinLines = 0; -static const char *deviceList[] = { - "fbdev", - "vesa", - NULL -}; + +static void listPossibleVideoDrivers(char *matches[], int nmatches); /* * A built-in config file is stored as an array of strings, with each string @@ -135,87 +140,97 @@ AppendToConfig(const char *s) AppendToList(s, &builtinConfig, &builtinLines); } -static const char * -videoPtrToDriverName(struct pci_device *dev) +static int +videoPtrToDriverList(struct pci_device *dev, + char *returnList[], int returnListMax) { /* * things not handled yet: * cyrix/nsc. should be merged into geode anyway. * xgi. */ + int i; + /* Add more entries here if we ever return more than 4 drivers for + any device */ + char *driverList[5] = { NULL, NULL, NULL, NULL, NULL }; switch (dev->vendor_id) { case 0x1022: - if (dev->device_id == 0x2081) - return "geode"; - else - return NULL; - case 0x1142: return "apm"; - case 0xedd8: return "ark"; - case 0x1a03: return "ast"; - case 0x1002: return "ati"; - case 0x102c: return "chips"; - case 0x1013: return "cirrus"; + if (dev->device_id == 0x2081) { + driverList[0] = "geode"; + driverList[1] = "amd"; + } + break; + case 0x1142: driverList[0] = "apm"; break; + case 0xedd8: driverList[0] = "ark"; break; + case 0x1a03: driverList[0] = "ast"; break; + case 0x1002: driverList[0] = "ati"; break; + case 0x102c: driverList[0] = "chips"; break; + case 0x1013: driverList[0] = "cirrus"; break; case 0x8086: - if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) - return "i740"; - else return "intel"; - case 0x102b: return "mga"; - case 0x10c8: return "neomagic"; - case 0x105d: return "i128"; - case 0x10de: case 0x12d2: return "nv"; - case 0x1163: return "rendition"; + if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) { + driverList[0] = "i740"; + } else { + driverList[0] = "intel"; + driverList[1] = "i810"; + } + break; + case 0x102b: driverList[0] = "mga"; break; + case 0x10c8: driverList[0] = "neomagic"; break; + case 0x105d: driverList[0] = "i128"; break; + case 0x10de: case 0x12d2: driverList[0] = "nv"; break; + case 0x1163: driverList[0] = "rendition"; break; case 0x5333: switch (dev->device_id) { case 0x88d0: case 0x88d1: case 0x88f0: case 0x8811: case 0x8812: case 0x8814: case 0x8901: - return "s3"; + driverList[0] = "s3"; break; case 0x5631: case 0x883d: case 0x8a01: case 0x8a10: case 0x8c01: case 0x8c03: case 0x8904: case 0x8a13: - return "s3virge"; + driverList[0] = "s3virge"; break; default: - return "savage"; + driverList[0] = "savage"; break; } - case 0x1039: return "sis"; - case 0x126f: return "siliconmotion"; + break; + case 0x1039: driverList[0] = "sis"; break; + case 0x126f: driverList[0] = "siliconmotion"; break; case 0x121a: if (dev->device_id < 0x0003) - return "voodoo"; + driverList[0] = "voodoo"; + else + driverList[0] = "tdfx"; + break; + case 0x3d3d: driverList[0] = "glint"; break; + case 0x1023: driverList[0] = "trident"; break; + case 0x100c: driverList[0] = "tseng"; break; + case 0x1106: driverList[0] = "openchrome"; break; + case 0x15ad: driverList[0] = "vmware"; break; + case 0x18ca: + if (dev->device_id == 0x47) + driverList[0] = "xgixp"; else - return "tdfx"; - case 0x3d3d: return "glint"; - case 0x1023: return "trident"; - case 0x100c: return "tseng"; - case 0x1106: return "openchrome"; - case 0x15ad: return "vmware"; + driverList[0] = "xgi"; + break; default: break; } - return NULL; + for (i = 0; (i < returnListMax) && (driverList[i] != NULL); i++) { + returnList[i] = xnfstrdup(driverList[i]); + } + return i; /* Number of entries added */ } Bool xf86AutoConfig(void) { - const char **p; + char *deviceList[20]; + char **p; + const char **cp; char buf[1024]; - const char *driver = NULL; ConfigStatus ret; - driver = chooseVideoDriver(); - - if (driver) { - snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION_PRE, - driver, 0, driver); - AppendToConfig(buf); - ErrorF("New driver is \"%s\"\n", driver); - buf[0] = '\t'; - AppendToConfig(BUILTIN_DEVICE_SECTION_POST); - snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, - driver, 0, driver, 0); - AppendToConfig(buf); - } + listPossibleVideoDrivers(deviceList, 20); for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p); @@ -225,23 +240,23 @@ xf86AutoConfig(void) } AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE); - if (driver) { - snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, driver, 0); - AppendToConfig(buf); - } for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_POST); + for (p = deviceList; *p; p++) { + xfree(*p); + } + xf86MsgVerb(X_DEFAULT, 0, "Using default built-in configuration (%d lines)\n", builtinLines); xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n"); - for (p = builtinConfig; *p; p++) - xf86ErrorFVerb(3, "\t%s", *p); + for (cp = builtinConfig; *cp; cp++) + xf86ErrorFVerb(3, "\t%s", *cp); xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n"); xf86setBuiltinConfig(builtinConfig); @@ -283,11 +298,10 @@ autoConfigDevice(GDevPtr preconf_device) if (preconf_device) { ptr = preconf_device; } else { - ptr = (GDevPtr)xalloc(sizeof(GDevRec)); + ptr = xcalloc(1, sizeof(GDevRec)); if (!ptr) { return NULL; } - memset((GDevPtr)ptr, 0, sizeof(GDevRec)); ptr->chipID = -1; ptr->chipRev = -1; ptr->irq = -1; @@ -416,17 +430,58 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip } #endif /* __linux__ */ -char* -chooseVideoDriver(void) +static void +listPossibleVideoDrivers(char *matches[], int nmatches) { struct pci_device * info = NULL; struct pci_device_iterator *iter; - char *chosen_driver = NULL; int i; - char *matches[20]; /* If we have more than 20 drivers we're in trouble */ - for (i=0 ; i<20 ; i++) + for (i = 0 ; i < nmatches ; i++) { matches[i] = NULL; + } + i = 0; + +#ifdef sun + /* Check for driver type based on /dev/fb type and if valid, use + it instead of PCI bus probe results */ + if (xf86Info.consoleFd >= 0) { + struct vis_identifier visid; + const char *cp; + + if (ioctl(xf86Info.consoleFd, VIS_GETIDENTIFIER, &visid) >= 0) { + xf86Msg(X_PROBED, "console driver: %s\n", visid.name); + + /* Special case from before the general case was set */ + if (strcmp(visid.name, "NVDAnvda") == 0) { + matches[i++] = xnfstrdup("nvidia"); + } + + /* General case - split into vendor name (initial all-caps + prefix) & driver name (rest of the string). */ + if (strcmp(visid.name, "SUNWtext") != 0) { + for (cp = visid.name; (*cp != '\0') && isupper(*cp); cp++) { + /* find end of all uppercase vendor section */ + } + if ((cp != visid.name) && (*cp != '\0')) { + char *driverName = xnfstrdup(cp); + char *vendorName = xnfstrdup(visid.name); + vendorName[cp - visid.name] = '\0'; + + matches[i++] = vendorName; + matches[i++] = driverName; + } + } + } + } +#endif +#ifdef __sparc__ + { + char *sbusDriver = sparcDriverName(); + if (sbusDriver) + matches[i++] = xnfstrdup(sbusDriver); + } +#endif /* Find the primary device, and get some information about it. */ iter = pci_slot_match_iterator_create(NULL); @@ -447,31 +502,52 @@ chooseVideoDriver(void) } #endif /* __linux__ */ - /* TODO Handle multiple drivers claiming to support the same PCI ID */ - if (matches[0]) { - chosen_driver = matches[0]; - } else { - if (info != NULL) - chosen_driver = videoPtrToDriverName(info); - if (chosen_driver == NULL) { -#if defined __i386__ || defined __amd64__ || defined __x86_64__ || defined __hurd__ - chosen_driver = "vesa"; -#elif defined __sparc__ - chosen_driver = "sunffb"; + for (i = 0; (i < nmatches) && (matches[i]); i++) { + /* find end of matches list */ + } + + if ((info != NULL) && (i < nmatches)) { + i += videoPtrToDriverList(info, &(matches[i]), nmatches - i); + } + + /* Fallback to platform default hardware */ + if (i < (nmatches - 1)) { +#if defined(__i386__) || defined(__amd64__) || defined(__hurd__) + matches[i++] = xnfstrdup("vesa"); +#elif defined(__sparc__) && !defined(sun) + matches[i++] = xnfstrdup("sunffb"); +#endif + } + + /* Fallback to platform default frame buffer driver */ + if (i < (nmatches - 1)) { +#if !defined(__linux__) && defined(__sparc__) + matches[i++] = xnfstrdup("wsfb"); #else - chosen_driver = "fbdev"; + matches[i++] = xnfstrdup("fbdev"); #endif - } } +} + +char* +chooseVideoDriver(void) +{ + char *chosen_driver = NULL; + int i; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */ - xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", chosen_driver); + listPossibleVideoDrivers(matches, 20); - i = 0; - while (matches[i]) { + /* TODO Handle multiple drivers claiming to support the same PCI ID */ + chosen_driver = matches[0]; + + xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", + chosen_driver); + + for (i = 0; matches[i] ; i++) { if (matches[i] != chosen_driver) { xfree(matches[i]); } - i++; } return chosen_driver; diff --git a/xorg-server/hw/xfree86/common/xf86Build.h b/xorg-server/hw/xfree86/common/xf86Build.h deleted file mode 100644 index e261f1b5c..000000000 --- a/xorg-server/hw/xfree86/common/xf86Build.h +++ /dev/null @@ -1,2 +0,0 @@ -#define BUILD_DATE 20081105 -#define BUILD_TIME 1144728 diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c index f7ffac85e..b94d500f0 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.c +++ b/xorg-server/hw/xfree86/common/xf86Bus.c @@ -25,7 +25,6 @@ * authorization from the copyright holder(s) and author(s). */ -#define REDUCER /* * This file contains the interfaces to the bus-specific code */ @@ -60,7 +59,10 @@ int xf86NumEntities = 0; static int xf86EntityPrivateCount = 0; BusAccPtr xf86BusAccInfo = NULL; -xf86AccessRec AccessNULL = {NULL,NULL,NULL}; +static void +noopEnableDisable(void *arg) { } + +xf86AccessRec AccessNULL = { noopEnableDisable, noopEnableDisable, NULL }; xf86CurrentAccessRec xf86CurrentAccess = {NULL,NULL}; @@ -68,10 +70,6 @@ BusRec primaryBus = { BUS_NONE, {{0}}}; static Bool xf86ResAccessEnter = FALSE; -#ifdef REDUCER -/* Resources that temporarily conflict with estimated resources */ -static resPtr AccReducers = NULL; -#endif /* resource lists */ resPtr Acc = NULL; @@ -96,10 +94,6 @@ static Bool doFramebufferMode = FALSE; static StateChangeNotificationPtr StateChangeNotificationList; static void notifyStateChange(xf86NotifyState state); -#undef MIN -#define MIN(x,y) ((x<y)?x:y) - - /* * Call the bus probes relevant to the architecture. * @@ -141,8 +135,6 @@ StringToBusType(const char* busID, const char **retID) } if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp")) ret = BUS_PCI; - if (!xf86NameCmp(p, "isa")) - ret = BUS_ISA; if (!xf86NameCmp(p, "sbus")) ret = BUS_SBUS; if (ret != BUS_NONE) @@ -160,8 +152,6 @@ void xf86EntityInit(void) { int i; - resPtr *pprev_next; - resPtr res; xf86AccessPtr pacc; for (i = 0; i < xf86NumEntities; i++) @@ -170,22 +160,9 @@ xf86EntityInit(void) ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f (xf86Entities[i]->access->busAcc); pacc = xf86Entities[i]->access->fallback; - if (pacc->AccessEnable) - pacc->AccessEnable(pacc->arg); + pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityInit(i,xf86Entities[i]->private); - if (pacc->AccessDisable) - pacc->AccessDisable(pacc->arg); - /* remove init resources after init is processed */ - pprev_next = &Acc; - res = Acc; - while (res) { - if (res->res_type & ResInit && (res->entityIndex == i)) { - (*pprev_next) = res->next; - xfree(res); - } else - pprev_next = &(res->next); - res = (*pprev_next); - } + pacc->AccessDisable(pacc->arg); } } @@ -213,11 +190,9 @@ EntityEnter(void) ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f (xf86Entities[i]->access->busAcc); pacc = xf86Entities[i]->access->fallback; - if (pacc->AccessEnable) - pacc->AccessEnable(pacc->arg); + pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityEnter(i,xf86Entities[i]->private); - if (pacc->AccessDisable) - pacc->AccessDisable(pacc->arg); + pacc->AccessDisable(pacc->arg); } } @@ -233,11 +208,9 @@ EntityLeave(void) ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f (xf86Entities[i]->access->busAcc); pacc = xf86Entities[i]->access->fallback; - if (pacc->AccessEnable) - pacc->AccessEnable(pacc->arg); + pacc->AccessEnable(pacc->arg); xf86Entities[i]->entityLeave(i,xf86Entities[i]->private); - if (pacc->AccessDisable) - pacc->AccessDisable(pacc->arg); + pacc->AccessDisable(pacc->arg); } } @@ -251,8 +224,6 @@ xf86IsEntityPrimary(int entityIndex) switch (pEnt->busType) { case BUS_PCI: return (pEnt->bus.id.pci == primaryBus.id.pci); - case BUS_ISA: - return TRUE; case BUS_SBUS: return (pEnt->sbusBusId.fbNum == primaryBus.id.sbus.fbNum); default: @@ -260,7 +231,7 @@ xf86IsEntityPrimary(int entityIndex) } } -_X_EXPORT Bool +Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer private) { @@ -358,10 +329,10 @@ xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) peacc = xf86Entities[pScrn->entityList[i]]->access; (*ptr) = peacc->next; /* disable entity: call disable func */ - if (peacc->pAccess && peacc->pAccess->AccessDisable) + if (peacc->pAccess) peacc->pAccess->AccessDisable(peacc->pAccess->arg); /* also disable fallback - just in case */ - if (peacc->fallback && peacc->fallback->AccessDisable) + if (peacc->fallback) peacc->fallback->AccessDisable(peacc->fallback->arg); for (i++; i < pScrn->numEntities; i++) pScrn->entityList[i-1] = pScrn->entityList[i]; @@ -391,10 +362,10 @@ xf86ClearEntityListForScreen(int scrnIndex) xf86Entities[entityIndex]->inUse = FALSE; /* disable resource: call the disable function */ peacc = xf86Entities[entityIndex]->access; - if (peacc->pAccess && peacc->pAccess->AccessDisable) + if (peacc->pAccess) peacc->pAccess->AccessDisable(peacc->pAccess->arg); /* and the fallback function */ - if (peacc->fallback && peacc->fallback->AccessDisable) + if (peacc->fallback) peacc->fallback->AccessDisable(peacc->fallback->arg); /* shared resources are only needed when entity is active: remove */ xf86DeallocateResourcesForEntity(entityIndex, ResShared); @@ -409,7 +380,7 @@ xf86ClearEntityListForScreen(int scrnIndex) pScrn->entityInstanceList = NULL; } -_X_EXPORT void +void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type) { resPtr *pprev_next = &Acc; @@ -525,14 +496,14 @@ disableAccess(void) for (i = 0; i < xf86NumScreens; i++) { peacc = xf86Screens[i]->CurrentAccess->pIoAccess; while (peacc) { - if (peacc->pAccess && peacc->pAccess->AccessDisable) + if (peacc->pAccess) peacc->pAccess->AccessDisable(peacc->pAccess->arg); peacc = peacc->next; } xf86Screens[i]->CurrentAccess->pIoAccess = NULL; peacc = xf86Screens[i]->CurrentAccess->pMemAccess; while (peacc) { - if (peacc->pAccess && peacc->pAccess->AccessDisable) + if (peacc->pAccess) peacc->pAccess->AccessDisable(peacc->pAccess->arg); peacc = peacc->next; } @@ -541,8 +512,7 @@ disableAccess(void) /* then call the generic entity disable funcs */ for (i = 0; i < xf86NumEntities; i++) { pacc = xf86Entities[i]->access->fallback; - if (pacc->AccessDisable) - pacc->AccessDisable(pacc->arg); + pacc->AccessDisable(pacc->arg); } } @@ -692,16 +662,16 @@ xf86EnableAccess(ScrnInfoPtr pScrn) pScrn->CurrentAccess->pMemAccess = NULL; while (pceAcc) { pAcc = pceAcc->pAccess; - if ( pAcc && pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) + pAcc->AccessDisable(pAcc->arg); pceAcc = pceAcc->next; } if (pScrn->busAccess) ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) - (*pAcc->AccessEnable)(pAcc->arg); + if (pAcc) + pAcc->AccessEnable(pAcc->arg); peAcc = peAcc->next; } pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access; @@ -713,8 +683,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn) tmp = pceAcc; while (pceAcc) { pAcc = pceAcc->pAccess; - if (pAcc && pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) + pAcc->AccessDisable(pAcc->arg); pceAcc = pceAcc->next; } pceAcc = pScrn->CurrentAccess->pMemAccess; @@ -722,8 +692,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn) && tmp !=pceAcc) { while (pceAcc) { pAcc = pceAcc->pAccess; - if (pAcc && pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) + pAcc->AccessDisable(pAcc->arg); pceAcc = pceAcc->next; } } @@ -734,8 +704,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn) } while (pceAcc) { /* current Mem != pAccess */ pAcc = pceAcc->pAccess; - if (pAcc && pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) + pAcc->AccessDisable(pAcc->arg); pceAcc = pceAcc->next; } } @@ -743,8 +713,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn) ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) - (*pAcc->AccessEnable)(pAcc->arg); + if (pAcc) + pAcc->AccessEnable(pAcc->arg); peAcc = peAcc->next; } pScrn->CurrentAccess->pMemAccess = @@ -760,16 +730,16 @@ xf86EnableAccess(ScrnInfoPtr pScrn) pScrn->CurrentAccess->pIoAccess = NULL; while (pceAcc) { pAcc = pceAcc->pAccess; - if ( pAcc && pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) + pAcc->AccessDisable(pAcc->arg); pceAcc = pceAcc->next; } if (pScrn->busAccess) ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) - (*pAcc->AccessEnable)(pAcc->arg); + if (pAcc) + pAcc->AccessEnable(pAcc->arg); peAcc = peAcc->next; } pScrn->CurrentAccess->pMemAccess = (EntityAccessPtr) pScrn->access; @@ -808,13 +778,11 @@ xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn) while (pceAcc) { pAcc = pceAcc->pAccess; - if ( pAcc) { - if (!Enable) { - if (pAcc->AccessDisable) - (*pAcc->AccessDisable)(pAcc->arg); + if (pAcc) { + if (Enable) { + pAcc->AccessEnable(pAcc->arg); } else { - if (pAcc->AccessEnable) - (*pAcc->AccessEnable)(pAcc->arg); + pAcc->AccessDisable(pAcc->arg); } } pceAcc = pceAcc->next; @@ -836,11 +804,6 @@ xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs, rac = xf86Entities[pEnt->index]->rac; - if (funcs->mem == funcs->io_mem && funcs->mem && funcs->io) - xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_MEM_FROM_IO; - if (funcs->io == funcs->io_mem && funcs->mem && funcs->io) - xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_IO_FROM_MEM; - rac->mem_new = funcs->mem; rac->io_new = funcs->io; rac->io_mem_new = funcs->io_mem; @@ -1011,10 +974,6 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state) BusType loc = BUS_NONE; BusType r_loc = BUS_NONE; - /* Ignore overlapped ranges that have been nullified */ - if ((pRes->res_type & ResOverlap) && (pRes->block_begin > pRes->block_end)) - return FALSE; - if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask)) return FALSE; @@ -1025,10 +984,6 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state) if (pRes->res_type & type & ResBios) return FALSE; - /*If requested, skip over estimated resources */ - if (pRes->res_type & type & ResEstimated) - return FALSE; - if (type & pRes->res_type & ResUnused) return FALSE; @@ -1050,33 +1005,10 @@ needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state) if (pRes->entityIndex > -1) r_loc = xf86Entities[pRes->entityIndex]->busType; - switch (type & ResAccMask) { - case ResExclusive: - switch (pRes->res_type & ResAccMask) { - case ResExclusive: - break; - case ResShared: - /* ISA buses are only locally exclusive on a PCI system */ - if (loc == BUS_ISA && r_loc == BUS_PCI) - return FALSE; - break; - } - break; - case ResShared: - switch (pRes->res_type & ResAccMask) { - case ResExclusive: - /* ISA buses are only locally exclusive on a PCI system */ - if (loc == BUS_PCI && r_loc == BUS_ISA) - return FALSE; - break; - case ResShared: - return FALSE; - } - break; - case ResAny: - break; - } - + if ((type & ResAccMask) == ResShared && + (pRes->res_type & ResAccMask) == ResShared) + return FALSE; + if (pRes->entityIndex == entityIndex) return FALSE; if (pRes->entityIndex > -1 && @@ -1106,7 +1038,7 @@ checkConflict(resRange *rgp, resPtr pRes, int entityIndex, case ResBlock: if (rgp->rEnd < rgp->rBegin) { xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n", - rgp->rEnd,rgp->rBegin); + (long)rgp->rEnd, (long)rgp->rBegin); return 0; } if ((ret = checkConflictBlock(rgp, pRes))) { @@ -1119,7 +1051,7 @@ checkConflict(resRange *rgp, resPtr pRes, int entityIndex, if ((rgp->rBase & rgp->rMask) != rgp->rBase) { xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)" "doesn't satisfy (base & mask = mask)\n", - rgp->rBase, rgp->rMask); + (long)rgp->rBase, (long)rgp->rMask); return 0; } if ((ret = checkConflictSparse(rgp, pRes))) { @@ -1135,30 +1067,21 @@ checkConflict(resRange *rgp, resPtr pRes, int entityIndex, } /* - * ChkConflict() -- used within xxxBus ; find conflict with any location. - */ -memType -ChkConflict(resRange *rgp, resPtr res, xf86State state) -{ - return checkConflict(rgp, res, -2, state,FALSE); -} - -/* * xf86ChkConflict() - This function is the low level interface to * the resource broker that gets exported. Tests all resources ie. * performs test with SETUP flag. */ -_X_EXPORT memType +static memType xf86ChkConflict(resRange *rgp, int entityIndex) { - return checkConflict(rgp, Acc, entityIndex, SETUP,FALSE); + return checkConflict(rgp, Acc, entityIndex, SETUP, FALSE); } /* * Resources List handling */ -_X_EXPORT resPtr +static resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2) { resPtr pRes; @@ -1175,7 +1098,7 @@ xf86JoinResLists(resPtr rlist1, resPtr rlist2) return rlist1; } -_X_EXPORT resPtr +resPtr xf86AddResToList(resPtr rlist, resRange *range, int entityIndex) { resPtr new; @@ -1184,7 +1107,7 @@ xf86AddResToList(resPtr rlist, resRange *range, int entityIndex) case ResBlock: if (range->rEnd < range->rBegin) { xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n", - range->rEnd,range->rBegin); + (long)range->rEnd, (long)range->rBegin); return rlist; } break; @@ -1192,7 +1115,7 @@ xf86AddResToList(resPtr rlist, resRange *range, int entityIndex) if ((range->rBase & range->rMask) != range->rBase) { xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)" "doesn't satisfy (base & mask = mask)\n", - range->rBase, range->rMask); + (long)range->rBase, (long)range->rMask); return rlist; } break; @@ -1225,7 +1148,7 @@ xf86FreeResList(resPtr rlist) xfree(rlist); } -_X_EXPORT resPtr +static resPtr xf86DupResList(const resPtr rlist) { resPtr pRes, ret, prev, new; @@ -1245,7 +1168,7 @@ xf86DupResList(const resPtr rlist) return ret; } -_X_EXPORT void +static void xf86PrintResList(int verb, resPtr list) { int i = 0; @@ -1267,14 +1190,17 @@ xf86PrintResList(int verb, resPtr list) "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx (0x%lx)", i, list->entityIndex, (list->res_type & ResDomain) >> 24, - list->block_begin, list->block_end, - list->block_end - list->block_begin + 1); + (long)list->block_begin, + (long)list->block_end, + (long)(list->block_end - + list->block_begin + 1)); break; case ResSparse: xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ", i, list->entityIndex, (list->res_type & ResDomain) >> 24, - list->sparse_base,list->sparse_mask); + (long)list->sparse_base, + (long)list->sparse_mask); break; default: list = list->next; @@ -1309,10 +1235,6 @@ xf86PrintResList(int verb, resPtr list) s = "[?]"; } xf86ErrorFVerb(verb, "%s", s); - if (list->res_type & ResEstimated) - xf86ErrorFVerb(verb, "E"); - if (list->res_type & ResOverlap) - xf86ErrorFVerb(verb, "O"); if (list->res_type & ResInit) xf86ErrorFVerb(verb, "t"); if (list->res_type & ResBios) @@ -1366,187 +1288,10 @@ xf86ResourceBrokerInit(void) xf86PrintResList(3, Acc); } -#define MEM_ALIGN (1024 * 1024) - -/* - * RemoveOverlaps() -- remove overlaps between resources of the - * same kind. - * Beware: This function doesn't check for access attributes. - * At resource broker initialization this is no problem as this - * only deals with exclusive resources. - */ -#if 0 -void -RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated) -{ - resPtr pRes; - memType size, newsize, adjust; - - if (!target) - return; - - for (pRes = list; pRes; pRes = pRes->next) { - if (pRes != target - && ((pRes->res_type & ResTypeMask) == - (target->res_type & ResTypeMask)) - && pRes->block_begin <= target->block_end - && pRes->block_end >= target->block_begin) { - /* Possibly ignore estimated resources */ - if (!useEstimated && (pRes->res_type & ResEstimated)) continue; - /* - * Target should be a larger region than pRes. If pRes fully - * contains target, don't do anything unless target can overlap. - */ - if (pRes->block_begin <= target->block_begin && - pRes->block_end >= target->block_end) { - if (target->res_type & ResOverlap) { - /* Nullify range but keep its ResOverlap bit on */ - target->block_end = target->block_begin - 1; - return; - } - continue; - } - /* - * In cases where the target and pRes have the same starting - * address, reduce the size of the target (given it's an estimate). - */ - if (pRes->block_begin == target->block_begin) { - if (target->res_type & ResOverlap) - target->block_end = target->block_begin - 1; - else - target->block_end = pRes->block_end; - } - /* Otherwise, trim target to remove the overlap */ - else if (pRes->block_begin <= target->block_end) { - target->block_end = pRes->block_begin - 1; - } else if (!pow2Alignment && - pRes->block_end >= target->block_begin) { - target->block_begin = pRes->block_end + 1; - } - if (pow2Alignment) { - /* - * Align to a power of two. This requires finding the - * largest power of two that is smaller than the adjusted - * size. - */ - size = target->block_end - target->block_begin + 1; - newsize = 1UL << (sizeof(memType) * 8 - 1); - while (!(newsize & size)) - newsize >>= 1; - target->block_end = target->block_begin + newsize - 1; - } else if (target->block_end > MEM_ALIGN) { - /* Align the end to MEM_ALIGN */ - if ((adjust = (target->block_end + 1) % MEM_ALIGN)) - target->block_end -= adjust; - } - } - } -} -#else - -void -RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated) -{ - resPtr pRes; - memType size, newsize, adjust; - - if (!target) - return; - - if (!(target->res_type & ResEstimated) /* Don't touch sure resources */ - && !(target->res_type & ResOverlap)) /* Unless they may overlap */ - return; - - for (pRes = list; pRes; pRes = pRes->next) { - if (pRes == target - || ((pRes->res_type & ResTypeMask) != - (target->res_type & ResTypeMask)) - || pRes->block_begin > target->block_end - || pRes->block_end < target->block_begin) - continue; - - if (pRes->block_begin <= target->block_begin) { - /* Possibly ignore estimated resources */ - if (!useEstimated && (pRes->res_type & ResEstimated)) - continue; - - /* Special cases */ - if (pRes->block_end >= target->block_end) { - /* - * If pRes fully contains target, don't do anything - * unless target can overlap. - */ - if (target->res_type & ResOverlap) { - /* Nullify range but keep its ResOverlap bit on */ - target->block_end = target->block_begin - 1; - return; - } else - continue; - } else { -#if 0 /* Don't trim start address - we trust what we got */ - /* - * If !pow2Alignment trim start address: !pow2Alingment - * is only set when estimated OS addresses are handled. - * In cases where the target and pRes have the same - * starting address, reduce the size of the target - * (given it's an estimate). - */ - if (!pow2Alignment) - target->block_begin = pRes->block_end + 1; - else -#endif - if (pRes->block_begin == target->block_begin) - target->block_end = pRes->block_end; - else - continue; - } - } else { - /* Trim target to remove the overlap */ - target->block_end = pRes->block_begin - 1; - } - if (pow2Alignment) { - /* - * Align to a power of two. This requires finding the - * largest power of two that is smaller than the adjusted - * size. - */ - size = target->block_end - target->block_begin + 1; - newsize = 1UL << (sizeof(memType) * 8 - 1); - while (!(newsize & size)) - newsize >>= 1; - target->block_end = target->block_begin + newsize - 1; - } else if (target->block_end > MEM_ALIGN) { - /* Align the end to MEM_ALIGN */ - if ((adjust = (target->block_end + 1) % MEM_ALIGN)) - target->block_end -= adjust; - } - } -} - -#endif - /* - * Resource registrarion + * Resource registration */ -static resList -xf86GetResourcesImplicitly(int entityIndex) -{ - if (entityIndex >= xf86NumEntities) return NULL; - - switch (xf86Entities[entityIndex]->bus.type) { - case BUS_ISA: - case BUS_NONE: - case BUS_SBUS: - return NULL; - case BUS_PCI: - return NULL; - case BUS_last: - return NULL; - } - return NULL; -} - static void convertRange2Host(int entityIndex, resRange *pRange) { @@ -1555,9 +1300,6 @@ convertRange2Host(int entityIndex, resRange *pRange) case BUS_PCI: pciConvertRange2Host(entityIndex,pRange); break; - case BUS_ISA: - isaConvertRange2Host(pRange); - break; default: break; } @@ -1577,24 +1319,19 @@ xf86ConvertListToHost(int entityIndex, resPtr list) /* * xf86RegisterResources() -- attempts to register listed resources. - * If list is NULL it tries to obtain resources implicitly. Function - * returns a resPtr listing all resources not successfully registered. + * Returns a resPtr listing all resources not successfully registered, by + * which we mean, NULL. */ _X_EXPORT resPtr xf86RegisterResources(int entityIndex, resList list, unsigned long access) { - resPtr res = NULL; resRange range; resList list_f = NULL; - if (!list) { - list = xf86GetResourcesImplicitly(entityIndex); - /* these resources have to be in host address space already */ - if (!list) return NULL; - list_f = list; - } - + if (!list) + return NULL; + while(list->type != ResEnd) { range = *list; @@ -1604,15 +1341,7 @@ xf86RegisterResources(int entityIndex, resList list, unsigned long access) range.type = (range.type & ~ResAccMask) | (access & ResAccMask); } range.type &= ~ResEstimated; /* Not allowed for drivers */ -#if !((defined(__alpha__) || (defined(__ia64__))) && defined(linux)) - /* On Alpha Linux, do not check for conflicts, trust the kernel. */ - if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE)) - res = xf86AddResToList(res,&range,entityIndex); - else -#endif - { - Acc = xf86AddResToList(Acc,&range,entityIndex); - } + Acc = xf86AddResToList(Acc,&range,entityIndex); list++; } if (list_f) @@ -1621,12 +1350,8 @@ xf86RegisterResources(int entityIndex, resList list, unsigned long access) #ifdef DEBUG xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n"); xf86PrintResList(3, Acc); - if (res) xf86MsgVerb(X_INFO, 3, - "Failed Resources after driver initialization " - "for Entity: %i\n",entityIndex); - xf86PrintResList(3, res); #endif - return res; + return NULL; } @@ -1635,7 +1360,6 @@ busTypeSpecific(EntityPtr pEnt, xf86AccessPtr *acc_mem, xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io) { switch (pEnt->bus.type) { - case BUS_ISA: case BUS_SBUS: *acc_mem = *acc_io = *acc_mem_io = &AccessNULL; break; @@ -1733,7 +1457,7 @@ setAccess(EntityPtr pEnt, xf86State state) if (pEnt->rac->old) { /* give it to the driver, leave state disabled */ pEnt->rac->old->io = org_io; - } else if (org_io->AccessEnable) { + } else { /* driver doesn't want it - enable generic access */ org_io->AccessEnable(org_io->arg); } @@ -1744,7 +1468,7 @@ setAccess(EntityPtr pEnt, xf86State state) if (pEnt->rac->old) { /* give it to the driver, leave state disabled */ pEnt->rac->old->io_mem = org_mem_io; - } else if (org_mem_io->AccessEnable) { + } else { /* driver doesn't want it - enable generic access */ org_mem_io->AccessEnable(org_mem_io->arg); } @@ -1755,7 +1479,7 @@ setAccess(EntityPtr pEnt, xf86State state) if (pEnt->rac->old) { /* give it to the driver, leave state disabled */ pEnt->rac->old->mem = org_mem; - } else if (org_mem->AccessEnable) { + } else { /* driver doesn't want it - enable generic access */ org_mem->AccessEnable(org_mem->arg); } @@ -1763,27 +1487,26 @@ setAccess(EntityPtr pEnt, xf86State state) if (!(prop & NEED_MEM_SHARED)){ if (prop & NEED_MEM) { - if (acc_mem && acc_mem->AccessEnable) + if (acc_mem) acc_mem->AccessEnable(acc_mem->arg); } else { - if (acc_mem && acc_mem->AccessDisable) + if (acc_mem) acc_mem->AccessDisable(acc_mem->arg); } } if (!(prop & NEED_IO_SHARED)) { if (prop & NEED_IO) { - if (acc_io && acc_io->AccessEnable) - acc_io->AccessEnable(acc_io->arg); + if (acc_io) + acc_io->AccessEnable(acc_io->arg); } else { - if (acc_io && acc_io->AccessDisable) + if (acc_io) acc_io->AccessDisable(acc_io->arg); } } /* disable shared resources */ - if (pEnt->access->pAccess - && pEnt->access->pAccess->AccessDisable) + if (pEnt->access->pAccess) pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg); /* @@ -1820,7 +1543,7 @@ SetSIGIOForState(xf86State state) } } -_X_EXPORT void +void xf86EnterServerState(xf86State state) { EntityPtr pEnt; @@ -1962,44 +1685,6 @@ xf86SetOperatingState(resList list, int entityIndex, int mask) /* * Stage specific code */ - /* - * ProcessEstimatedConflicts() -- Do something about driver-registered - * resources that conflict with estimated resources. For now, just register - * them with a logged warning. - */ -#ifdef REDUCER -static void -ProcessEstimatedConflicts(void) -{ - if (!AccReducers) - return; - - /* Temporary */ - xf86MsgVerb(X_WARNING, 3, - "Registering the following despite conflicts with estimated" - " resources:\n"); - xf86PrintResList(3, AccReducers); - Acc = xf86JoinResLists(Acc, AccReducers); - AccReducers = NULL; -} -#endif - -/* - * xf86ClaimFixedResources() -- This function gets called from the - * driver Probe() function to claim fixed resources. - */ -static void -resError(resList list) -{ - FatalError("A driver tried to allocate the %s %sresource at \n" - "0x%lx:0x%lx which conflicted with another resource. Send the\n" - "output of the server to %s. Please \n" - "specify your computer hardware as closely as possible.\n", - ResIsBlock(list)?"Block":"Sparse", - ResIsMem(list)?"Mem":"Io", - ResIsBlock(list)?list->rBegin:list->rBase, - ResIsBlock(list)?list->rEnd:list->rMask,BUILDERADDR); -} /* * xf86ClaimFixedResources() is used to allocate non-relocatable resources. @@ -2023,20 +1708,7 @@ xf86ClaimFixedResources(resList list, int entityIndex) case ResExclusive: if (!xf86ChkConflict(&range, entityIndex)) { Acc = xf86AddResToList(Acc, &range, entityIndex); -#ifdef REDUCER - } else { - range.type |= ResEstimated; - if (!xf86ChkConflict(&range, entityIndex) && - !checkConflict(&range, AccReducers, entityIndex, - SETUP, FALSE)) { - range.type &= ~(ResEstimated | ResBios); - AccReducers = - xf86AddResToList(AccReducers, &range, entityIndex); -#endif - } else resError(&range); /* no return */ -#ifdef REDUCER - } -#endif + } else FatalError("xf86ClaimFixedResources conflict\n"); break; case ResShared: /* at this stage the resources are just added to the @@ -2058,9 +1730,6 @@ xf86ClaimFixedResources(resList list, int entityIndex) xf86MsgVerb(X_INFO, 3, "resource ranges after xf86ClaimFixedResources() call:\n"); xf86PrintResList(3,Acc); -#ifdef REDUCER - ProcessEstimatedConflicts(); -#endif #ifdef DEBUG if (ptr) { xf86MsgVerb(X_INFO, 3, "to be registered later:\n"); @@ -2156,10 +1825,10 @@ xf86PostProbe(void) { memType val; int i,j; - resPtr resp, acc, tmp, resp_x, *pprev_next; + resPtr resp, acc, tmp, resp_x; if (fbSlotClaimed) { - if (pciSlotClaimed || isaSlotClaimed + if (pciSlotClaimed #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) || sbusSlotClaimed #endif @@ -2176,17 +1845,7 @@ xf86PostProbe(void) return; } } - /* don't compare against ResInit - remove it from clone.*/ acc = tmp = xf86DupResList(Acc); - pprev_next = &acc; - while (tmp) { - if (tmp->res_type & ResInit) { - (*pprev_next) = tmp->next; - xfree(tmp); - } else - pprev_next = &(tmp->next); - tmp = (*pprev_next); - } for (i=0; i<xf86NumEntities; i++) { resp = xf86Entities[i]->resources; @@ -2199,32 +1858,17 @@ xf86PostProbe(void) resp_x = resp; resp = resp->next; resp_x->next = tmp; -#ifdef REDUCER - } else { - resp->res_type |= ResEstimated; - if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) { - resp->res_type &= ~(ResEstimated | ResBios); - tmp = AccReducers; - AccReducers = resp; - resp = resp->next; - AccReducers->next = tmp; -#endif } else { - xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n",val); + xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n", + (long)val); resp->res_type &= ~ResEstimated; tmp = xf86Entities[i]->resources; xf86Entities[i]->resources = resp; resp = resp->next; xf86Entities[i]->resources->next = tmp; } -#ifdef REDUCER - } -#endif } xf86JoinResLists(Acc,resp_x); -#ifdef REDUCER - ProcessEstimatedConflicts(); -#endif } xf86FreeResList(acc); @@ -2276,13 +1920,6 @@ checkRequiredResources(int entityIndex) pAcc = pAcc->next; } - /* check if we can separately enable mem/io resources */ - /* XXX we still need to find out how to set this yet */ - if ( ((pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO) - && (pEnt->entityProp & NEED_MEM_SHARED)) - || ((pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM) - && (pEnt->entityProp & NEED_IO_SHARED)) ) - pEnt->entityProp |= NEED_SHARED; /* * After we have checked all resources of an entity agains any * other resource we know if the entity need this resource type @@ -2290,13 +1927,11 @@ checkRequiredResources(int entityIndex) * so no need to share it either. */ if ((pEnt->entityProp & NEED_MEM_SHARED) - && (!(pEnt->entityProp & NEED_MEM)) - && (!(pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO))) + && (!(pEnt->entityProp & NEED_MEM))) pEnt->entityProp &= ~(unsigned long)NEED_MEM_SHARED; if ((pEnt->entityProp & NEED_IO_SHARED) - && (!(pEnt->entityProp & NEED_IO)) - && (!(pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM))) + && (!(pEnt->entityProp & NEED_IO))) pEnt->entityProp &= ~(unsigned long)NEED_IO_SHARED; } @@ -2730,9 +2365,6 @@ xf86ExtractTypeFromList(resPtr list, unsigned long type) return ret; } -/*------------------------------------------------------------*/ -static void CheckGenericGA(void); - /* * xf86FindPrimaryDevice() - Find the display device which * was active when the server was started. @@ -2740,9 +2372,6 @@ static void CheckGenericGA(void); void xf86FindPrimaryDevice() { - /* if no VGA device is found check for primary PCI device */ - if (primaryBus.type == BUS_NONE && xorgHWAccess) - CheckGenericGA(); if (primaryBus.type != BUS_NONE) { char *bus; char loc[16]; @@ -2756,10 +2385,6 @@ xf86FindPrimaryDevice() primaryBus.id.pci->dev, primaryBus.id.pci->func); break; - case BUS_ISA: - bus = "ISA"; - loc[0] = '\0'; - break; case BUS_SBUS: bus = "SBUS"; snprintf(loc, sizeof(loc), " %2.2x", primaryBus.id.sbus.fbNum); @@ -2773,40 +2398,7 @@ xf86FindPrimaryDevice() } } -#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) -#include "vgaHW.h" -#include "compiler.h" -#endif - -/* - * CheckGenericGA() - Check for presence of a VGA device. - */ -static void -CheckGenericGA() -{ -/* This needs to be changed for multiple domains */ -#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) - IOADDRESS GenericIOBase = VGAHW_GET_IOBASE(); - CARD8 CurrentValue, TestValue; - - /* VGA CRTC registers are not used here, so don't bother unlocking them */ - - /* VGA has one more read/write attribute register than EGA */ - (void) inb(GenericIOBase + VGA_IN_STAT_1_OFFSET); /* Reset flip-flop */ - outb(VGA_ATTR_INDEX, 0x14 | 0x20); - CurrentValue = inb(VGA_ATTR_DATA_R); - outb(VGA_ATTR_DATA_W, CurrentValue ^ 0x0F); - outb(VGA_ATTR_INDEX, 0x14 | 0x20); - TestValue = inb(VGA_ATTR_DATA_R); - outb(VGA_ATTR_DATA_W, CurrentValue); - - if ((CurrentValue ^ 0x0F) == TestValue) { - primaryBus.type = BUS_ISA; - } -#endif -} - -_X_EXPORT Bool +Bool xf86NoSharedResources(int screenIndex,resType res) { int j; diff --git a/xorg-server/hw/xfree86/common/xf86Bus.h b/xorg-server/hw/xfree86/common/xf86Bus.h index 489ee3459..c2d5bb7d4 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.h +++ b/xorg-server/hw/xfree86/common/xf86Bus.h @@ -137,11 +137,8 @@ extern BusAccPtr xf86BusAccInfo; int xf86AllocateEntity(void); BusType StringToBusType(const char* busID, const char **retID); -memType ChkConflict(resRange *rgp, resPtr res, xf86State state); Bool xf86IsSubsetOf(resRange range, resPtr list); resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type); resPtr xf86FindIntersect(resRange Range, resPtr list); -void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, - Bool useEstimated); #endif /* _XF86_BUS_H */ diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c index e91eadd19..93761193e 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.c +++ b/xorg-server/hw/xfree86/common/xf86Config.c @@ -62,10 +62,8 @@ #include "extension.h" #include "Pci.h" -#ifdef XINPUT #include "xf86Xinput.h" extern DeviceAssocRec mouse_assoc; -#endif #ifdef XKB #undef XKB_IN_SERVER @@ -112,13 +110,10 @@ extern DeviceAssocRec mouse_assoc; #define PROJECTROOT "/usr/X11R6" #endif -static char *fontPath = NULL; - static ModuleDefault ModuleDefaults[] = { {.name = "extmod", .toLoad = TRUE, .load_opt=NULL}, {.name = "dbe", .toLoad = TRUE, .load_opt=NULL}, {.name = "glx", .toLoad = TRUE, .load_opt=NULL}, - {.name = "freetype", .toLoad = TRUE, .load_opt=NULL}, #ifdef XRECORD {.name = "record", .toLoad = TRUE, .load_opt=NULL}, #endif @@ -309,7 +304,7 @@ xf86ModulelistFromConfig(pointer **optlist) } } if (found == FALSE) { - XF86ConfModulePtr ptr = xf86configptr->conf_modules; + XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name); } @@ -318,7 +313,7 @@ xf86ModulelistFromConfig(pointer **optlist) xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec)); for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { if (ModuleDefaults[i].toLoad == TRUE) { - XF86ConfModulePtr ptr = xf86configptr->conf_modules; + XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); } } @@ -589,89 +584,64 @@ xf86ConfigError(char *msg, ...) static void configFiles(XF86ConfFilesPtr fileconf) { - MessageType pathFrom = X_DEFAULT; - int countDirs; - char *temp_path; - char *log_buf; - - /* FontPath */ - /* Try XF86Config FontPath first */ - if (!xf86fpFlag) { - if (fileconf) { - if (fileconf->file_fontpath) { - char *f = xf86ValidateFontPath(fileconf->file_fontpath); - pathFrom = X_CONFIG; - if (*f) { - if (xf86Info.useDefaultFontPath) { - xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath); - char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3); - strcpy(g, f); - strcat(g, ","); - defaultFontPath = strcat(g, defaultFontPath); - xfree(f); - } else { - defaultFontPath = f; - } - } else { - xf86Msg(X_WARNING, - "FontPath is completely invalid. Using compiled-in default.\n"); - fontPath = NULL; - pathFrom = X_DEFAULT; - } - } - } else { - xf86Msg(X_DEFAULT, - "No FontPath specified. Using compiled-in default.\n"); - pathFrom = X_DEFAULT; - } - } else { - /* Use fontpath specified with '-fp' */ - if (fontPath) - { - fontPath = NULL; + MessageType pathFrom; + Bool must_copy; + int size, countDirs; + char *temp_path, *log_buf, *start, *end; + + /* FontPath */ + must_copy = TRUE; + + temp_path = defaultFontPath ? defaultFontPath : ""; + if (xf86fpFlag) + pathFrom = X_CMDLINE; + else if (fileconf && fileconf->file_fontpath) { + pathFrom = X_CONFIG; + if (xf86Info.useDefaultFontPath) { + defaultFontPath = Xprintf("%s%s%s", + fileconf->file_fontpath, + *temp_path ? "," : "", temp_path); + if (defaultFontPath != NULL) { + must_copy = FALSE; + } + } + else + defaultFontPath = fileconf->file_fontpath; } - pathFrom = X_CMDLINE; - } - if (!fileconf) { - /* xf86ValidateFontPath will write into it's arg, but defaultFontPath - could be static, so we make a copy. */ - char *f = xnfalloc(strlen(defaultFontPath) + 1); - f[0] = '\0'; - strcpy (f, defaultFontPath); - defaultFontPath = xf86ValidateFontPath(f); - xfree(f); - } else { - if (fileconf) { - if (!fileconf->file_fontpath) { - /* xf86ValidateFontPath will write into it's arg, but defaultFontPath - could be static, so we make a copy. */ - char *f = xnfalloc(strlen(defaultFontPath) + 1); - f[0] = '\0'; - strcpy (f, defaultFontPath); - defaultFontPath = xf86ValidateFontPath(f); - xfree(f); - } - } - } - - /* If defaultFontPath is still empty, exit here */ + else + pathFrom = X_DEFAULT; + temp_path = defaultFontPath ? defaultFontPath : ""; + + /* ensure defaultFontPath contains "built-ins" */ + start = strstr(temp_path, "built-ins"); + end = start + strlen("built-ins"); + if (start == NULL || + !((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) { + defaultFontPath = Xprintf("%s%sbuilt-ins", + temp_path, *temp_path ? "," : ""); + if (must_copy == TRUE) { + if (defaultFontPath != NULL) { + must_copy = FALSE; + } + } else { + /* already made a copy of the font path */ + xfree(temp_path); + } + } + /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ + temp_path = must_copy ? XNFstrdup(defaultFontPath) : defaultFontPath; + defaultFontPath = xf86ValidateFontPath(temp_path); + free(temp_path); - if (! *defaultFontPath) - FatalError("No valid FontPath could be found."); + /* make fontpath more readable in the logfiles */ + countDirs = 1; + temp_path = defaultFontPath; + while ((temp_path = index(temp_path, ',')) != NULL) { + countDirs++; + temp_path++; + } - /* make fontpath more readable in the logfiles */ - countDirs = 1; - temp_path = defaultFontPath; - while((temp_path = index(temp_path, ',')) != NULL) { - countDirs++; - temp_path++; - } - log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); - if(!log_buf) /* fallback to old method */ - xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath); - else { - char *start, *end; - int size; + log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); temp_path = log_buf; start = defaultFontPath; while((end = index(start, ',')) != NULL) { @@ -687,7 +657,6 @@ configFiles(XF86ConfFilesPtr fileconf) strcpy(temp_path, start); xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf); xfree(log_buf); - } if (fileconf && fileconf->file_inputdevs) { @@ -708,6 +677,11 @@ configFiles(XF86ConfFilesPtr fileconf) xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath); + if (!xf86xkbdirFlag && fileconf && fileconf->file_xkbdir) { + XkbBaseDirectory = fileconf->file_xkbdir; + xf86Msg(X_CONFIG, "XKB base directory set to \"%s\"\n", + XkbBaseDirectory); + } #if 0 /* LogFile */ /* @@ -740,23 +714,14 @@ typedef enum { FLAG_ALLOWMOUSEOPENFAIL, FLAG_VTSYSREQ, FLAG_XKBDISABLE, - FLAG_PCIPROBE1, - FLAG_PCIPROBE2, - FLAG_PCIFORCECONFIG1, - FLAG_PCIFORCECONFIG2, - FLAG_PCIFORCENONE, - FLAG_PCIOSCONFIG, FLAG_SAVER_BLANKTIME, FLAG_DPMS_STANDBYTIME, FLAG_DPMS_SUSPENDTIME, FLAG_DPMS_OFFTIME, FLAG_PIXMAP, FLAG_PC98, - FLAG_ESTIMATE_SIZES_AGGRESSIVELY, FLAG_NOPM, FLAG_XINERAMA, - FLAG_ALLOW_DEACTIVATE_GRABS, - FLAG_ALLOW_CLOSEDOWN_GRABS, FLAG_LOG, FLAG_RENDER_COLORMAP_MODE, FLAG_HANDLE_SPECIAL_KEYS, @@ -794,18 +759,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_PCIPROBE1, "PciProbe1" , OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_PCIPROBE2, "PciProbe2", OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_PCIFORCECONFIG1, "PciForceConfig1", OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_PCIFORCECONFIG2, "PciForceConfig2", OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_PCIFORCENONE, "PciForceNone", OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_PCIOSCONFIG, "PciOsConfig", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER, {0}, FALSE }, { FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER, @@ -818,16 +771,10 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_PC98, "PC98", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_ESTIMATE_SIZES_AGGRESSIVELY,"EstimateSizesAggressively",OPTV_INTEGER, - {0}, FALSE }, { FLAG_NOPM, "NoPM", OPTV_BOOLEAN, {0}, FALSE }, { FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN, {0}, FALSE }, - { FLAG_ALLOW_DEACTIVATE_GRABS,"AllowDeactivateGrabs", OPTV_BOOLEAN, - {0}, FALSE }, - { FLAG_ALLOW_CLOSEDOWN_GRABS, "AllowClosedownGrabs", OPTV_BOOLEAN, - {0}, FALSE }, { FLAG_LOG, "Log", OPTV_STRING, {0}, FALSE }, { FLAG_RENDER_COLORMAP_MODE, "RenderColormapMode", OPTV_STRING, @@ -884,6 +831,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) Bool value; MessageType from; const char *s; +#ifdef XKB + char *rules = "base"; +#endif /* * Merge the ServerLayout and ServerFlags options. The former have @@ -907,10 +857,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap); xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom); - xf86GetOptValBool(FlagOptions, FLAG_ALLOW_DEACTIVATE_GRABS, - &(xf86Info.grabInfo.allowDeactivate)); - xf86GetOptValBool(FlagOptions, FLAG_ALLOW_CLOSEDOWN_GRABS, - &(xf86Info.grabInfo.allowClosedown)); xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI); if (xf86Info.ignoreABI) { xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); @@ -922,7 +868,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) from = X_CONFIG; } else { - xf86Info.autoAddDevices = TRUE; from = X_DEFAULT; } xf86Msg(from, "%sutomatically adding devices\n", @@ -934,7 +879,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) from = X_CONFIG; } else { - xf86Info.autoEnableDevices = TRUE; from = X_DEFAULT; } xf86Msg(from, "%sutomatically enabling devices\n", @@ -952,13 +896,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.vidModeAllowNonLocal = value; #endif -#ifdef XF86MISC - if (xf86GetOptValBool(FlagOptions, FLAG_DISABLEMODINDEV, &value)) - xf86Info.miscModInDevEnabled = !value; - if (xf86GetOptValBool(FlagOptions, FLAG_MODINDEVALLOWNONLOCAL, &value)) - xf86Info.miscModInDevAllowNonLocal = value; -#endif - if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value)) xf86Info.allowMouseOpenFail = value; @@ -982,19 +919,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) #endif } - if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE1)) - xf86Info.pciFlags = PCIProbe1; - if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE2)) - xf86Info.pciFlags = PCIProbe2; - if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCECONFIG1)) - xf86Info.pciFlags = PCIForceConfig1; - if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCECONFIG2)) - xf86Info.pciFlags = PCIForceConfig2; - if (xf86IsOptionSet(FlagOptions, FLAG_PCIOSCONFIG)) - xf86Info.pciFlags = PCIOsConfig; - if (xf86IsOptionSet(FlagOptions, FLAG_PCIFORCENONE)) - xf86Info.pciFlags = PCIForceNone; - xf86Info.pmFlag = TRUE; if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) xf86Info.pmFlag = !value; @@ -1053,12 +977,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.randRFrom = X_CONFIG; } #endif - i = -1; - xf86GetOptValInteger(FlagOptions, FLAG_ESTIMATE_SIZES_AGGRESSIVELY, &i); - if (i >= 0) - xf86Info.estimateSizesAggressively = i; - else - xf86Info.estimateSizesAggressively = 0; xf86Info.aiglx = TRUE; xf86Info.aiglxFrom = X_DEFAULT; @@ -1078,7 +996,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } else if (!xf86NameCmp(s, "all")) { xf86Info.glxVisuals = XF86_GlxVisualsAll; } else { - xf86Msg(X_WARNING,"Unknown HandleSpecialKeys option\n"); + xf86Msg(X_WARNING,"Unknown GlxVisuals option\n"); } } @@ -1092,6 +1010,15 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); + /* AEI on? Then we're not using kbd, so use the evdev rules set. */ +#ifdef XKB +#if defined(linux) + if (xf86Info.allowEmptyInput) + rules = "evdev"; +#endif + XkbSetRulesDflts(rules, "pc105", "us", NULL, NULL); +#endif + xf86Info.useDefaultFontPath = TRUE; xf86Info.useDefaultFontPathFrom = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { @@ -1237,8 +1164,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * remove the core attribute from the later ones. */ for (devs = servlayoutp->inputs; devs && *devs; devs++) { - indp = *devs; pointer opt1 = NULL, opt2 = NULL; + indp = *devs; if (indp->commonOptions && xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) { opt1 = indp->commonOptions; @@ -1552,9 +1479,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) { +#ifdef CONFIG_HAL xf86Msg(X_INFO, "The server relies on HAL to provide the list of " "input devices.\n\tIf no devices become available, " "reconfigure HAL or disable AllowEmptyInput.\n"); +#else + xf86Msg(X_INFO, "HAL is disabled and no input devices were configured.\n" + "\tTry disabling AllowEmptyInput.\n"); +#endif } return TRUE; @@ -1631,10 +1563,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, count++; adjp = (XF86ConfAdjacencyPtr)adjp->list.next; } + #ifdef DEBUG ErrorF("Found %d screens in the layout section %s", count, conf_layout->lay_identifier); #endif + if (!count) /* alloc enough storage even if no screen is specified */ + count = 1; + slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec)); slp[count].screen = NULL; /* @@ -1689,6 +1625,20 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, adjp = (XF86ConfAdjacencyPtr)adjp->list.next; } + /* No screen was specified in the layout. take the first one from the + * config file, or - if it is NULL - configScreen autogenerates one for + * us */ + if (!count) + { + slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); + if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst, + 0, X_CONFIG)) { + xfree(slp[0].screen); + xfree(slp); + return FALSE; + } + } + /* XXX Need to tie down the upper left screen. */ /* Fill in the refscreen and top/bottom/left/right values */ @@ -1879,7 +1829,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) indp = xnfalloc(sizeof(IDevPtr)); *indp = NULL; servlayoutp->inputs = indp; - + return TRUE; } @@ -2064,6 +2014,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) XF86ConfModesLinkPtr modeslnk = conf_monitor->mon_modes_sect_lst; Gamma zeros = {0.0, 0.0, 0.0}; float badgamma = 0.0; + double maxPixClock; xf86Msg(X_CONFIG, "| |-->Monitor \"%s\"\n", conf_monitor->mon_identifier); @@ -2198,8 +2149,11 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) xf86ProcessOptions(-1, monitorp->options, MonitorOptions); xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, &monitorp->reducedblanking); - xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, - &monitorp->maxPixClock); + if (xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, + &maxPixClock) == TRUE) { + monitorp->maxPixClock = (int) maxPixClock; + } + return TRUE; } @@ -2493,13 +2447,14 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { while(*dev) { if (strcmp((*dev)->driver, "kbd") == 0 || - strcmp((*dev)->driver, "mouse") == 0) + strcmp((*dev)->driver, "mouse") == 0 || + strcmp((*dev)->driver, "vmmouse") == 0) { IDevPtr *current; if (!warned) { xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using " - "drivers 'kbd' or 'mouse' will be disabled.\n"); + "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n"); warned = TRUE; } @@ -2545,10 +2500,9 @@ xf86HandleConfigFile(Bool autoconfig) xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename); xf86ConfigFile = xnfstrdup(filename); } else { - xf86Msg(X_ERROR, "Unable to locate/open config file"); if (xf86ConfigFile) - xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile); - xf86ErrorFVerb(0, "\n"); + xf86Msg(X_ERROR, "Unable to locate/open config file: \"%s\"\n", + xf86ConfigFile); return CONFIG_NOFILE; } } @@ -2653,13 +2607,6 @@ xf86HandleConfigFile(Bool autoconfig) xf86Info.vidModeAllowNonLocal = TRUE; #endif -#ifdef XF86MISC - if (xf86MiscModInDevDisabled) - xf86Info.miscModInDevEnabled = FALSE; - if (xf86MiscModInDevAllowNonLocal) - xf86Info.miscModInDevAllowNonLocal = TRUE; -#endif - if (xf86AllowMouseOpenFail) xf86Info.allowMouseOpenFail = TRUE; diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c index 536f89700..77326b6d4 100644 --- a/xorg-server/hw/xfree86/common/xf86Configure.c +++ b/xorg-server/hw/xfree86/common/xf86Configure.c @@ -76,12 +76,6 @@ static char *DFLT_MOUSE_PROTO = "OSMouse"; #elif defined(__UNIXWARE__) static char *DFLT_MOUSE_PROTO = "OSMouse"; static char *DFLT_MOUSE_DEV = "/dev/mouse"; -#elif defined(QNX4) -static char *DFLT_MOUSE_PROTO = "OSMouse"; -static char *DFLT_MOUSE_DEV = "/dev/mouse"; -#elif defined(__QNXNTO__) -static char *DFLT_MOUSE_PROTO = "OSMouse"; -static char *DFLT_MOUSE_DEV = "/dev/devi/mouse0"; #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) static char *DFLT_MOUSE_DEV = "/dev/sysmouse"; static char *DFLT_MOUSE_PROTO = "auto"; @@ -121,18 +115,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int return NULL; isPrimary = xf86IsPrimaryPci(pVideo); break; - case BUS_ISA: - /* - * This needs to be revisited as it doesn't allow for non-PCI - * multihead. - */ - if (!xf86IsPrimaryIsa()) - return NULL; - isPrimary = TRUE; - for (i = 0; i < nDevToConfig; i++) - if (!DevToConfig[i].pVideo) - return NULL; - break; #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: for (i = 0; i < nDevToConfig; i++) @@ -208,10 +190,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset = (pVideo->vendor_id << 16) | pVideo->device_id; } break; - case BUS_ISA: - NewDevice.GDev.identifier = "ISA Adapter"; - NewDevice.GDev.busID = "ISA"; - break; #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: { char *promPath = NULL; @@ -247,17 +225,6 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int # undef NewDevice } -/* - * Backwards compatibility - */ -_X_EXPORT GDevPtr -xf86AddDeviceToConfigure(const char *driver, struct pci_device * pVideo, - int chipset) -{ - return xf86AddBusDeviceToConfigure(driver, pVideo ? BUS_PCI : BUS_ISA, - pVideo, chipset); -} - static XF86ConfInputPtr configureInputSection (void) { @@ -293,8 +260,7 @@ configureInputSection (void) #endif } - mouse = xf86confmalloc(sizeof(XF86ConfInputRec)); - memset((XF86ConfInputPtr)mouse,0,sizeof(XF86ConfInputRec)); + mouse = xf86confcalloc(1, sizeof(XF86ConfInputRec)); mouse->inp_identifier = "Mouse0"; mouse->inp_driver = "mouse"; mouse->inp_option_lst = @@ -330,8 +296,7 @@ configureScreenSection (int screennum) { XF86ConfDisplayPtr display; - display = xf86confmalloc(sizeof(XF86ConfDisplayRec)); - memset((XF86ConfDisplayPtr)display,0,sizeof(XF86ConfDisplayRec)); + display = xf86confcalloc(1, sizeof(XF86ConfDisplayRec)); display->disp_depth = depths[i]; display->disp_black.red = display->disp_white.red = -1; display->disp_black.green = display->disp_white.green = -1; @@ -532,8 +497,7 @@ configureModuleSection (void) for (el = elist; *el; el++) { XF86LoadPtr module; - module = xf86confmalloc(sizeof(XF86LoadRec)); - memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec)); + module = xf86confcalloc(1, sizeof(XF86LoadRec)); module->load_name = *el; ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem( (glp)ptr->mod_load_lst, (glp)module); @@ -547,8 +511,7 @@ configureModuleSection (void) for (el = elist; *el; el++) { XF86LoadPtr module; - module = xf86confmalloc(sizeof(XF86LoadRec)); - memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec)); + module = xf86confcalloc(1, sizeof(XF86LoadRec)); module->load_name = *el; /* Add only those font backends which are referenced by fontpath */ @@ -672,12 +635,17 @@ configureDDCMonitorSection (int screennum) return ptr; } +#if !defined(PATH_MAX) +# define PATH_MAX 1024 +#endif + void -DoConfigure() +DoConfigure(void) { int i,j, screennum = -1; char *home = NULL; - char *filename = NULL; + char filename[PATH_MAX]; + char *addslash = ""; XF86ConfigPtr xf86config = NULL; char **vlist, **vl; int *dev2screen; @@ -722,11 +690,7 @@ DoConfigure() xf86FindPrimaryDevice(); /* Create XF86Config file structure */ - xf86config = malloc(sizeof(XF86ConfigRec)); - memset ((XF86ConfigPtr)xf86config, 0, sizeof(XF86ConfigRec)); - xf86config->conf_device_lst = NULL; - xf86config->conf_screen_lst = NULL; - xf86config->conf_monitor_lst = NULL; + xf86config = calloc(1, sizeof(XF86ConfigRec)); /* Call all of the probe functions, reporting the results. */ for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) { @@ -779,33 +743,26 @@ DoConfigure() xf86config->conf_input_lst = configureInputSection(); xf86config->conf_layout_lst = configureLayoutSection(); - if (!(home = getenv("HOME"))) + home = getenv("HOME"); + if ((home == NULL) || (home[0] == '\0')) { home = "/"; - { -#if !defined(PATH_MAX) -#define PATH_MAX 1024 -#endif - const char* configfile = XF86CONFIGFILE".new"; - char homebuf[PATH_MAX]; - /* getenv might return R/O memory, as with OS/2 */ - strncpy(homebuf,home,PATH_MAX-1); - homebuf[PATH_MAX-1] = '\0'; - home = homebuf; - if (!(filename = - (char *)xalloc(strlen(home) + - strlen(configfile) + 3))) - - if (home[0] == '/' && home[1] == '\0') - home[0] = '\0'; -#ifndef QNX4 - sprintf(filename, "%s/%s", home,configfile); -#else - sprintf(filename, "//%d%s/%s", getnid(),home,configfile); -#endif - + } else { + /* Determine if trailing slash is present or needed */ + int l = strlen(home); + + if (home[l-1] != '/') { + addslash = "/"; + } } - xf86writeConfigFile(filename, xf86config); + snprintf(filename, sizeof(filename), "%s%s" XF86CONFIGFILE ".new", + home, addslash); + + if (xf86writeConfigFile(filename, xf86config) == 0) { + xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", + filename, strerror(errno)); + goto bail; + } xf86DoConfigurePass1 = FALSE; /* Try to get DDC information filled in */ @@ -901,7 +858,11 @@ DoConfigure() (glp)xf86config->conf_screen_lst, (glp)ScreenPtr); } - xf86writeConfigFile(filename, xf86config); + if (xf86writeConfigFile(filename, xf86config) == 0) { + xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", + filename, strerror(errno)); + goto bail; + } ErrorF("\n"); diff --git a/xorg-server/hw/xfree86/common/xf86Cursor.c b/xorg-server/hw/xfree86/common/xf86Cursor.c index 3ea1b4d91..c6f603959 100644 --- a/xorg-server/hw/xfree86/common/xf86Cursor.c +++ b/xorg-server/hw/xfree86/common/xf86Cursor.c @@ -44,10 +44,8 @@ #include "xf86Priv.h" #include "xf86_OSproc.h" -#ifdef XINPUT #include <X11/extensions/XIproto.h> #include "xf86Xinput.h" -#endif #ifdef XFreeXDGA #include "dgaproc.h" @@ -67,7 +65,7 @@ typedef struct { static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y); static void xf86CrossScreen(ScreenPtr pScreen, Bool entering); -static void xf86WarpCursor(ScreenPtr pScreen, int x, int y); +static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); static void xf86PointerMoved(int scrnIndex, int x, int y); @@ -206,6 +204,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) ScreenPtr pCursorScreen; Bool Switched; int px, py; + DeviceIntPtr dev, it; if (!pScr->vtSema || !mode || !pScr->SwitchMode) return FALSE; @@ -221,9 +220,20 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (mode->HDisplay > pScr->virtualX || mode->VDisplay > pScr->virtualY) return FALSE; - pCursorScreen = miPointerGetScreen(inputInfo.pointer); + /* Let's take an educated guess for which pointer to take here. And about as + educated as it gets is to take the first pointer we find. + */ + for (dev = inputInfo.devices; dev; dev = dev->next) + { + if (IsPointerDevice(dev) && dev->spriteInfo->spriteOwner) + break; + } + if (!dev) + dev = inputInfo.pointer; + + pCursorScreen = miPointerGetScreen(dev); if (pScreen == pCursorScreen) - miPointerGetPosition(inputInfo.pointer, &px, &py); + miPointerGetPosition(dev, &px, &py); xf86EnterServerState(SETUP); Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0); @@ -232,6 +242,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) /* * Adjust frame for new display size. + * Frame is centered around cursor position if cursor is on same screen. */ if (pScreen == pCursorScreen) pScr->frameX0 = px - (mode->HDisplay / 2) + 1; @@ -266,8 +277,42 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (pScr->AdjustFrame) (*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); + /* The original code centered the frame around the cursor if possible. + * Since this is hard to achieve with multiple cursors, we do the following: + * - center around the first pointer + * - move all other pointers to the nearest edge on the screen (or leave + * them unmodified if they are within the boundaries). + */ if (pScreen == pCursorScreen) - xf86WarpCursor(pScreen, px, py); + { + xf86WarpCursor(dev, pScreen, px, py); + } + + for (it = inputInfo.devices; it; it = it->next) + { + if (it == dev) + continue; + + if (IsPointerDevice(it) && it->spriteInfo->spriteOwner) + { + pCursorScreen = miPointerGetScreen(it); + if (pScreen == pCursorScreen) + { + miPointerGetPosition(it, &px, &py); + if (px < pScr->frameX0) + px = pScr->frameX0; + else if (px > pScr->frameX1) + px = pScr->frameX1; + + if(py < pScr->frameY0) + py = pScr->frameY0; + else if(py > pScr->frameY1) + py = pScr->frameY1; + + xf86WarpCursor(it, pScreen, px, py); + } + } + } return Switched; } @@ -424,13 +469,13 @@ xf86CrossScreen (ScreenPtr pScreen, Bool entering) /* ARGSUSED */ static void -xf86WarpCursor (ScreenPtr pScreen, int x, int y) +xf86WarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { int sigstate; sigstate = xf86BlockSIGIO (); - miPointerWarpCursor(pScreen,x,y); + miPointerWarpCursor(pDev, pScreen, x, y); - xf86Info.currentScreen = pScreen; + xf86Info.currentScreen = pScreen; xf86UnblockSIGIO (sigstate); } diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c index 0daf1de44..a06f285f1 100644 --- a/xorg-server/hw/xfree86/common/xf86DGA.c +++ b/xorg-server/hw/xfree86/common/xf86DGA.c @@ -46,10 +46,13 @@ #include <xkbsrv.h> #endif #include "xf86Xinput.h" +#include "exglobals.h" +#include "exevents.h" #include "mi.h" -static DevPrivateKey DGAScreenKey = NULL; +static int DGAScreenKeyIndex; +static DevPrivateKey DGAScreenKey; static int mieq_installed = 0; static Bool DGACloseScreen(int i, ScreenPtr pScreen); @@ -115,7 +118,7 @@ DGAInit( if(!modes || num <= 0) return FALSE; - DGAScreenKey = &DGAScreenKey; + DGAScreenKey = &DGAScreenKeyIndex; if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec)))) return FALSE; @@ -912,7 +915,7 @@ DGAVTSwitch(void) } Bool -DGAStealKeyEvent(int index, int key_code, int is_down) +DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down) { DGAScreenPtr pScreenPriv; dgaEvent de; @@ -920,6 +923,9 @@ DGAStealKeyEvent(int index, int key_code, int is_down) if(DGAScreenKey == NULL) /* no DGA */ return FALSE; + if (key_code < 8 || key_code > 255) + return FALSE; + pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]); if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */ @@ -928,7 +934,7 @@ DGAStealKeyEvent(int index, int key_code, int is_down) de.u.u.type = *XDGAEventBase + (is_down ? KeyPress : KeyRelease); de.u.u.detail = key_code; de.u.event.time = GetTimeInMillis(); - mieqEnqueue (inputInfo.keyboard, (xEvent *) &de); + mieqEnqueue (dev, (xEvent *) &de); return TRUE; } @@ -936,7 +942,7 @@ DGAStealKeyEvent(int index, int key_code, int is_down) static int DGAMouseX, DGAMouseY; Bool -DGAStealMotionEvent(int index, int dx, int dy) +DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy) { DGAScreenPtr pScreenPriv; dgaEvent de; @@ -966,12 +972,12 @@ DGAStealMotionEvent(int index, int dx, int dy) de.u.event.dy = dy; de.u.event.pad1 = DGAMouseX; de.u.event.pad2 = DGAMouseY; - mieqEnqueue (inputInfo.pointer, (xEvent *) &de); + mieqEnqueue (dev, (xEvent *) &de); return TRUE; } Bool -DGAStealButtonEvent(int index, int button, int is_down) +DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) { DGAScreenPtr pScreenPriv; dgaEvent de; @@ -991,7 +997,7 @@ DGAStealButtonEvent(int index, int button, int is_down) de.u.event.dy = 0; de.u.event.pad1 = DGAMouseX; de.u.event.pad2 = DGAMouseY; - mieqEnqueue (inputInfo.pointer, (xEvent *) &de); + mieqEnqueue (dev, (xEvent *) &de); return TRUE; } @@ -1025,16 +1031,12 @@ static Mask filters[] = static void DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd) { - int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; int coreEquiv; - xEvent core; + xEvent xi; KeyClassPtr keyc = keybd->key; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); - + DeviceIntPtr pointer = GetPairedDevice(keybd); + coreEquiv = de->u.u.type - *XDGAEventBase; /* @@ -1043,84 +1045,36 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd) de->u.event.dx = 0; de->u.event.dy = 0; de->u.event.screen = pScreen->myNum; - de->u.event.state = keyc->state | (inputInfo.pointer)->button->state; + de->u.event.state = keyc->state | pointer->button->state; + + de->u.u.type = (IEventBase - 1) + coreEquiv; /* change to XI event */ + UpdateDeviceState(keybd, (xEvent*)de, 1); + de->u.u.type = *XDGAEventBase + coreEquiv; /* change back */ - /* - * Keep the core state in sync by duplicating what - * CoreProcessKeyboardEvent does - */ - key = de->u.u.detail; - kptr = &keyc->down[key >> 3]; - bit = 1 << (key & 7); - modifiers = keyc->modifierMap[key]; - switch (coreEquiv) - { - case KeyPress: - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr |= bit; - keyc->prev_state = keyc->state; -#ifdef XKB - if (noXkbExtension) -#endif - { - - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) - { - /* This key affects modifier "i" */ - keyc->modifierKeyCount[i]++; - keyc->state |= mask; - modifiers &= ~mask; - } - } - } - break; - case KeyRelease: - inputInfo.pointer->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; - keyc->prev_state = keyc->state; -#ifdef XKB - if (noXkbExtension) -#endif - { - for (i = 0, mask = 1; modifiers; i++, mask <<= 1) - { - if (mask & modifiers) { - /* This key affects modifier "i" */ - if (--keyc->modifierKeyCount[i] <= 0) { - keyc->state &= ~mask; - keyc->modifierKeyCount[i] = 0; - } - modifiers &= ~mask; - } - } - } - break; - } /* * Deliver the DGA event */ if (pScreenPriv->client) { /* If the DGA client has selected input, then deliver based on the usual filter */ - TryClientEvents (pScreenPriv->client, (xEvent *) de, 1, + TryClientEvents (pScreenPriv->client, keybd, (xEvent *) de, 1, filters[coreEquiv], pScreenPriv->input, 0); } else { /* If the keyboard is actively grabbed, deliver a grabbed core event */ - if (keybd->grab && !keybd->fromPassiveGrab) + if (keybd->deviceGrab.grab && !keybd->deviceGrab.fromPassiveGrab) { - core.u.u.type = coreEquiv; - core.u.u.detail = de->u.u.detail; - core.u.keyButtonPointer.time = de->u.event.time; - core.u.keyButtonPointer.eventX = de->u.event.dx; - core.u.keyButtonPointer.eventY = de->u.event.dy; - core.u.keyButtonPointer.rootX = de->u.event.dx; - core.u.keyButtonPointer.rootY = de->u.event.dy; - core.u.keyButtonPointer.state = de->u.event.state; - DeliverGrabbedEvent (&core, keybd, FALSE, 1); + xi.u.u.type = (IEventBase - 1) + coreEquiv; + xi.u.u.detail = de->u.u.detail; + xi.u.keyButtonPointer.time = de->u.event.time; + xi.u.keyButtonPointer.eventX = de->u.event.dx; + xi.u.keyButtonPointer.eventY = de->u.event.dy; + xi.u.keyButtonPointer.rootX = de->u.event.dx; + xi.u.keyButtonPointer.rootY = de->u.event.dy; + xi.u.keyButtonPointer.state = de->u.event.state; + ((deviceKeyButtonPointer*)&xi)->deviceid = keybd->id; + DeliverGrabbedEvent (&xi, keybd, FALSE, 1); } } } @@ -1129,77 +1083,44 @@ static void DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse) { ButtonClassPtr butc = mouse->button; - int coreEquiv; + int coreEquiv; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); - xEvent core; + xEvent xi; coreEquiv = de->u.u.type - *XDGAEventBase; /* * Fill in remaining event state */ de->u.event.screen = pScreen->myNum; - de->u.event.state = butc->state | inputInfo.keyboard->key->state; - /* - * Keep the core state in sync by duplicating what - * CoreProcessPointerEvent does - */ - if (coreEquiv != MotionNotify) - { - register int key; - register BYTE *kptr; - int bit; - - key = de->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); - switch (coreEquiv) - { - case ButtonPress: - mouse->valuator->motionHintWindow = NullWindow; - if (!(*kptr & bit)) - butc->buttonsDown++; - butc->motionMask = ButtonMotionMask; - *kptr |= bit; - if (key <= 5) - butc->state |= (Button1Mask >> 1) << key; - break; - case ButtonRelease: - mouse->valuator->motionHintWindow = NullWindow; - if (*kptr & bit) - --butc->buttonsDown; - if (!butc->buttonsDown) - butc->motionMask = 0; - *kptr &= ~bit; - if (key == 0) - return; - if (key <= 5) - butc->state &= ~((Button1Mask >> 1) << key); - break; - } - } + de->u.event.state = butc->state | GetPairedDevice(mouse)->key->state; + + de->u.u.type = (IEventBase - 1) + coreEquiv; /* change to XI event */ + UpdateDeviceState(mouse, (xEvent*)de, 1); + de->u.u.type = *XDGAEventBase + coreEquiv; /* change back */ + /* * Deliver the DGA event */ if (pScreenPriv->client) { /* If the DGA client has selected input, then deliver based on the usual filter */ - TryClientEvents (pScreenPriv->client, (xEvent *) de, 1, + TryClientEvents (pScreenPriv->client, mouse, (xEvent *) de, 1, filters[coreEquiv], pScreenPriv->input, 0); } else { /* If the pointer is actively grabbed, deliver a grabbed core event */ - if (mouse->grab && !mouse->fromPassiveGrab) + if (mouse->deviceGrab.grab && !mouse->deviceGrab.fromPassiveGrab) { - core.u.u.type = coreEquiv; - core.u.u.detail = de->u.u.detail; - core.u.keyButtonPointer.time = de->u.event.time; - core.u.keyButtonPointer.eventX = de->u.event.dx; - core.u.keyButtonPointer.eventY = de->u.event.dy; - core.u.keyButtonPointer.rootX = de->u.event.dx; - core.u.keyButtonPointer.rootY = de->u.event.dy; - core.u.keyButtonPointer.state = de->u.event.state; - DeliverGrabbedEvent (&core, mouse, FALSE, 1); + xi.u.u.type = (IEventBase - 1 ) + coreEquiv; + xi.u.u.detail = de->u.u.detail; + xi.u.keyButtonPointer.time = de->u.event.time; + xi.u.keyButtonPointer.eventX = de->u.event.dx; + xi.u.keyButtonPointer.eventY = de->u.event.dy; + xi.u.keyButtonPointer.rootX = de->u.event.dx; + xi.u.keyButtonPointer.rootY = de->u.event.dy; + xi.u.keyButtonPointer.state = de->u.event.state; + DeliverGrabbedEvent (&xi, mouse, FALSE, 1); } } } @@ -1287,10 +1208,10 @@ DGAHandleEvent(int screen_num, xEvent *event, DeviceIntPtr device, int nevents) switch (coreEquiv) { case KeyPress: case KeyRelease: - DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard); + DGAProcessKeyboardEvent (pScreen, de, device); break; default: - DGAProcessPointerEvent (pScreen, de, inputInfo.pointer); + DGAProcessPointerEvent (pScreen, de, device); break; } } diff --git a/xorg-server/hw/xfree86/common/xf86DPMS.c b/xorg-server/hw/xfree86/common/xf86DPMS.c index 4fb901aae..5ee5e2451 100644 --- a/xorg-server/hw/xfree86/common/xf86DPMS.c +++ b/xorg-server/hw/xfree86/common/xf86DPMS.c @@ -47,7 +47,8 @@ #ifdef DPMSExtension -static DevPrivateKey DPMSKey = NULL; +static int DPMSKeyIndex; +static DevPrivateKey DPMSKey; static Bool DPMSClose(int i, ScreenPtr pScreen); static int DPMSCount = 0; #endif @@ -62,7 +63,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) pointer DPMSOpt; MessageType enabled_from = X_INFO; - DPMSKey = &DPMSKey; + DPMSKey = &DPMSKeyIndex; if (DPMSDisabledSwitch) DPMSEnabled = FALSE; diff --git a/xorg-server/hw/xfree86/common/xf86Debug.c b/xorg-server/hw/xfree86/common/xf86Debug.c deleted file mode 100644 index 5b609652b..000000000 --- a/xorg-server/hw/xfree86/common/xf86Debug.c +++ /dev/null @@ -1,77 +0,0 @@ - -/* - * Copyright (c) 2000-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <sys/time.h> -#include <unistd.h> -#include <X11/X.h> -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "compiler.h" - -CARD8 xf86PeekFb8(CARD8 *p) { return *p; } -CARD16 xf86PeekFb16(CARD16 *p) { return *p; } -CARD32 xf86PeekFb32(CARD32 *p) { return *p; } -void xf86PokeFb8(CARD8 *p, CARD8 v) { *p = v; } -void xf86PokeFb16(CARD16 *p, CARD16 v) { *p = v; } -void xf86PokeFb32(CARD16 *p, CARD32 v) { *p = v; } - -CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset) -{ - return MMIO_IN8(Base,Offset); -} - -CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset) -{ - return MMIO_IN16(Base,Offset); -} - -CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset) -{ - return MMIO_IN32(Base,Offset); -} - -void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v) -{ - MMIO_OUT8(Base,Offset,v); -} - -void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v) -{ - MMIO_OUT16(Base,Offset,v); -} - -void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v) -{ - MMIO_OUT32(Base,Offset,v); -} diff --git a/xorg-server/hw/xfree86/common/xf86DoProbe.c b/xorg-server/hw/xfree86/common/xf86DoProbe.c deleted file mode 100644 index bba6ab7e8..000000000 --- a/xorg-server/hw/xfree86/common/xf86DoProbe.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 1999-2002 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * finish setting up the server - * Load the driver modules and call their probe functions. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <ctype.h> -#include <stdlib.h> -#include <X11/X.h> -#include <X11/Xmd.h> -#include "os.h" -#include "loaderProcs.h" -#include "xf86Config.h" -#include "xf86_OSlib.h" -#include "xf86.h" -#include "xf86Priv.h" - -void -DoProbe() -{ - int i; - Bool probeResult; - Bool ioEnableFailed = FALSE; - - /* Find the list of video driver modules. */ - char **list = xf86DriverlistFromCompile(); - char **l; - - if (list) { - ErrorF("List of video driver modules:\n"); - for (l = list; *l; l++) - ErrorF("\t%s\n", *l); - } else { - ErrorF("No video driver modules found\n"); - } - - /* Load all the drivers that were found. */ - xf86LoadModules(list, NULL); - - /* Disable PCI devices */ - xf86AccessInit(); - - /* Call all of the probe functions, reporting the results. */ - for (i = 0; i < xf86NumDrivers; i++) { - DriverRec * const drv = xf86DriverList[i]; - - if (!xorgHWAccess) { - xorgHWFlags flags; - if (!drv->driverFunc - || !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags ) - || NEED_IO_ENABLED(flags)) { - if (ioEnableFailed) - continue; - if (!xf86EnableIO()) { - ioEnableFailed = TRUE; - continue; - } - xorgHWAccess = TRUE; - } - } - - - xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n", drv->driverName); - - probeResult = xf86CallDriverProbe( drv, TRUE ); - if (!probeResult) { - xf86ErrorF("Probe in driver `%s' returns FALSE\n", - drv->driverName); - } else { - xf86ErrorF("Probe in driver `%s' returns TRUE\n", - drv->driverName); - - /* If we have a result, then call driver's Identify function */ - if (drv->Identify != NULL) { - const int verbose = xf86SetVerbosity(1); - (*drv->Identify)(0); - xf86SetVerbosity(verbose); - } - } - } - - OsCleanup(TRUE); - AbortDDX(); - fflush(stderr); - exit(0); -} diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c index 76c207a13..d6ef93a1b 100644 --- a/xorg-server/hw/xfree86/common/xf86Events.c +++ b/xorg-server/hw/xfree86/common/xf86Events.c @@ -57,26 +57,20 @@ #include <X11/Xpoll.h> #include <X11/Xproto.h> #include "misc.h" - #include "compiler.h" - #include "xf86.h" #include "xf86Priv.h" #define XF86_OS_PRIVS #include "xf86_OSlib.h" -#include "atKeynames.h" - +#include <X11/keysym.h> #ifdef XFreeXDGA #include "dgaproc.h" #endif -#ifdef XINPUT #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#else #include "inputstr.h" -#endif #include "xf86Xinput.h" #include "mi.h" @@ -87,25 +81,12 @@ #include <X11/extensions/xf86bigfont.h> #endif -#ifdef XKB -extern Bool noXkbExtension; -#endif - #ifdef DPMSExtension #define DPMS_SERVER #include <X11/extensions/dpms.h> #include "dpmsproc.h" #endif -#define XE_POINTER 1 -#define XE_KEYBOARD 2 - -#define EqEnqueue(pDev, ev) { \ - int __sigstate = xf86BlockSIGIO (); \ - mieqEnqueue (pDev, ev); \ - xf86UnblockSIGIO(__sigstate); \ -} - /* * The first of many hacks to get VT switching to work under * Solaris 2.1 for x86. The basic problem is that Solaris is supposed @@ -160,7 +141,6 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) * Function used for screensaver purposes by the os module. Returns the * time in milliseconds since there last was any input. */ - int TimeSinceLastInputEvent() { @@ -170,90 +150,34 @@ TimeSinceLastInputEvent() return GetTimeInMillis() - xf86Info.lastEventTime; } - - /* * SetTimeSinceLastInputEvent -- * Set the lastEventTime to now. */ - _X_EXPORT void SetTimeSinceLastInputEvent() { xf86Info.lastEventTime = GetTimeInMillis(); } - - /* * ProcessInputEvents -- * Retrieve all waiting input events and pass them to DIX in their * correct chronological order. Only reads from the system pointer * and keyboard. */ - void ProcessInputEvents () { int x, y; -#ifdef INHERIT_LOCK_STATE - static int generation = 0; -#endif - - /* - * With INHERIT_LOCK_STATE defined, the initial state of CapsLock, NumLock - * and ScrollLock will be set to match that of the VT the server is - * running on. - */ -#ifdef INHERIT_LOCK_STATE - if (generation != serverGeneration) { - xEvent kevent; - DevicePtr pKeyboard = xf86Info.pKeyboard; - extern unsigned int xf86InitialCaps, xf86InitialNum, xf86InitialScroll; - - generation = serverGeneration; - kevent.u.keyButtonPointer.time = GetTimeInMillis(); - kevent.u.keyButtonPointer.rootX = 0; - kevent.u.keyButtonPointer.rootY = 0; - kevent.u.u.type = KeyPress; - - - if (xf86InitialCaps) { - kevent.u.u.detail = xf86InitialCaps; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialCaps = 0; - } - if (xf86InitialNum) { - kevent.u.u.detail = xf86InitialNum; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialNum = 0; - } - if (xf86InitialScroll) { - kevent.u.u.detail = xf86InitialScroll; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialScroll = 0; - } - } -#endif - - xf86Info.inputPending = FALSE; mieqProcessInputEvents(); - miPointerUpdateSprite(inputInfo.pointer); + /* FIXME: This is a problem if we have multiple pointers */ miPointerGetPosition(inputInfo.pointer, &x, &y); xf86SetViewport(xf86Info.currentScreen, x, y); } -void -xf86GrabServerCallback(CallbackListPtr *callbacks, pointer data, pointer args) -{ - ServerGrabInfoRec *grab = (ServerGrabInfoRec*)args; - - xf86Info.grabInfo.server.client = grab->client; - xf86Info.grabInfo.server.grabstate = grab->grabstate; -} - /* * Handle keyboard events that cause some kind of "action" * (i.e., server termination, video mode changes, VT switches, etc.) @@ -281,42 +205,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) if (!xf86Info.dontZoom) xf86ZoomViewport(xf86Info.currentScreen, -1); break; - case ACTION_DISABLEGRAB: - if (!xf86Info.grabInfo.disabled && xf86Info.grabInfo.allowDeactivate) { - if (inputInfo.pointer && inputInfo.pointer->grab != NULL && - inputInfo.pointer->DeactivateGrab) - inputInfo.pointer->DeactivateGrab(inputInfo.pointer); - if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL && - inputInfo.keyboard->DeactivateGrab) - inputInfo.keyboard->DeactivateGrab(inputInfo.keyboard); - } - break; - case ACTION_CLOSECLIENT: - if (!xf86Info.grabInfo.disabled && xf86Info.grabInfo.allowClosedown) { - ClientPtr pointer, keyboard, server; - - pointer = keyboard = server = NULL; - if (inputInfo.pointer && inputInfo.pointer->grab != NULL) - pointer = clients[CLIENT_ID(inputInfo.pointer->grab->resource)]; - if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL) { - keyboard = clients[CLIENT_ID(inputInfo.keyboard->grab->resource)]; - if (keyboard == pointer) - keyboard = NULL; - } - if ((xf86Info.grabInfo.server.grabstate == SERVER_GRABBED) && - (((server = xf86Info.grabInfo.server.client) == pointer) || - (server == keyboard))) - server = NULL; - - if (pointer) - CloseDownClient(pointer); - if (keyboard) - CloseDownClient(keyboard); - if (server) - CloseDownClient(server); - } - break; -#if !defined(__SOL8__) && !defined(sgi) && \ +#if !defined(__SOL8__) && \ (!defined(sun) || defined(__i386__)) && defined(VT_ACTIVATE) case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { @@ -324,12 +213,8 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) #if defined(__SCO__) || defined(__UNIXWARE__) vtno--; #endif -#if defined(QNX4) - xf86Info.vtRequestsPending = vtno; -#else if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); -#endif } break; case ACTION_SWITCHSCREEN_NEXT: @@ -355,78 +240,11 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) } break; #endif - case ACTION_MESSAGE: - { - char *retstr, *message = (char *) arg; - ScrnInfoPtr pScr = XF86SCRNINFO(xf86Info.currentScreen); - -#ifdef DEBUG - ErrorF("ActionMessage: '%s'\n", message); -#endif - /* Okay the message made it to the ddx. The common layer */ - /* can check for relevant messages here and react to any */ - /* that have a global effect. For example: */ - /* */ - /* if (!strcmp(message, "foo") { */ - /* do_foo(); break */ - /* } */ - /* */ - /* otherwise fallback to sending a key event message to */ - /* the current screen's driver: */ - if (*pScr->HandleMessage != NULL) { - (void) (*pScr->HandleMessage)(pScr->scrnIndex, - "KeyEventMessage", message, &retstr); - } - } - break; default: break; } } -#define ModifierIsSet(k) ((modifiers & (k)) == (k)) - -_X_EXPORT Bool -xf86CommonSpecialKey(int key, Bool down, int modifiers) -{ - if ((!ModifierIsSet(ShiftMask)) && - (((ModifierIsSet(ControlMask | AltMask)) || - (ModifierIsSet(ControlMask | AltLangMask))))) { - switch (key) { - - case KEY_BackSpace: - xf86ProcessActionEvent(ACTION_TERMINATE, NULL); - break; - - /* - * Check grabs - */ - case KEY_KP_Divide: - xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL); - break; - case KEY_KP_Multiply: - xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL); - break; - - /* - * The idea here is to pass the scancode down to a list of - * registered routines. There should be some standard conventions - * for processing certain keys. - */ - case KEY_KP_Minus: /* Keypad - */ - if (down) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL); - if (!xf86Info.dontZoom) return TRUE; - break; - - case KEY_KP_Plus: /* Keypad + */ - if (down) xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL); - if (!xf86Info.dontZoom) return TRUE; - break; - } - } - return FALSE; -} - /* * xf86Wakeup -- * Os wakeup handler. @@ -436,7 +254,6 @@ xf86CommonSpecialKey(int key, Bool down, int modifiers) void xf86Wakeup(pointer blockData, int err, pointer pReadmask) { -#if !defined(__QNX__) fd_set* LastSelectMask = (fd_set*)pReadmask; fd_set devicesWithInput; InputInfoPtr pInfo; @@ -463,27 +280,6 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) } } } -#else /* __QNX__ */ - - InputInfoPtr pInfo; - - pInfo = xf86InputDevs; - while (pInfo) { - if (pInfo->read_input && pInfo->fd >= 0) { - int sigstate = xf86BlockSIGIO(); - - pInfo->read_input(pInfo); - xf86UnblockSIGIO(sigstate); - /* - * Must break here because more than one device may share - * the same file descriptor. - */ - break; - } - pInfo = pInfo->next; - } - -#endif /* __QNX__ */ if (err >= 0) { /* we don't want the handlers called if select() */ IHPtr ih; /* returned with an error condition, do we? */ @@ -497,8 +293,6 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) } if (xf86VTSwitchPending()) xf86VTSwitch(); - - if (xf86Info.inputPending) ProcessInputEvents(); } @@ -593,6 +387,19 @@ xf86SigHandler(int signo) FatalError("Caught signal %d. Server aborting\n", signo); } +/* + * xf86PrintBacktrace -- + * Print a stack backtrace for debugging purposes. + */ +_X_EXPORT void +xf86PrintBacktrace(void) +{ + xorg_backtrace(); +} + +#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7))) +#define ModifierDown(k) ((keyc->state & (k)) == (k)) + static void xf86ReleaseKeys(DeviceIntPtr pDev) { @@ -643,7 +450,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev) int sigstate = xf86BlockSIGIO (); nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); for (j = 0; j < nevents; j++) - mieqEnqueue(pDev, xf86Events + j); + mieqEnqueue(pDev, (xf86Events + j)->event); xf86UnblockSIGIO(sigstate); } break; diff --git a/xorg-server/hw/xfree86/common/xf86Globals.c b/xorg-server/hw/xfree86/common/xf86Globals.c index f5babbc49..04a96cbdc 100644 --- a/xorg-server/hw/xfree86/common/xf86Globals.c +++ b/xorg-server/hw/xfree86/common/xf86Globals.c @@ -47,10 +47,13 @@ /* Globals that video drivers may access */ /* Index into pScreen.devPrivates */ -DevPrivateKey xf86CreateRootWindowKey = &xf86CreateRootWindowKey; +static int xf86CreateRootWindowKeyIndex; +DevPrivateKey xf86CreateRootWindowKey = &xf86CreateRootWindowKeyIndex; /* Index of ScrnInfo in pScreen.devPrivates */ -_X_EXPORT DevPrivateKey xf86ScreenKey = &xf86ScreenKey; -_X_EXPORT DevPrivateKey xf86PixmapKey = &xf86PixmapKey; +static int xf86ScreenKeyIndex; +_X_EXPORT DevPrivateKey xf86ScreenKey = &xf86ScreenKeyIndex; +static int xf86PixmapKeyIndex; +_X_EXPORT DevPrivateKey xf86PixmapKey = &xf86PixmapKeyIndex; _X_EXPORT ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */ _X_EXPORT const unsigned char byte_reversed[256] = { @@ -95,45 +98,46 @@ InputInfoPtr xf86InputDevs = NULL; /* Globals that video drivers may not access */ xf86InfoRec xf86Info = { - -1, /* consoleFd */ - -1, /* vtno */ - FALSE, /* vtSysreq */ - SKWhenNeeded, /* ddxSpecialKeys */ - NULL, /* pMouse */ -#ifdef XINPUT - NULL, /* mouseLocal */ -#endif - -1, /* lastEventTime */ - FALSE, /* vtRequestsPending */ - FALSE, /* inputPending */ - FALSE, /* dontVTSwitch */ - FALSE, /* dontZap */ - FALSE, /* dontZoom */ - FALSE, /* notrapSignals */ - FALSE, /* caughtSignal */ - FALSE, /* sharedMonitor */ - NULL, /* currentScreen */ + .consoleFd = -1, + .vtno = -1, + .vtSysreq = FALSE, + .ddxSpecialKeys = SKWhenNeeded, + .lastEventTime = -1, + .vtRequestsPending = FALSE, + .dontVTSwitch = FALSE, + .dontZap = FALSE, + .dontZoom = FALSE, + .notrapSignals = FALSE, + .caughtSignal = FALSE, + .currentScreen = NULL, #ifdef CSRG_BASED - -1, /* screenFd */ - -1, /* consType */ + .screenFd = -1, + .consType = -1, #endif - FALSE, /* allowMouseOpenFail */ - TRUE, /* vidModeEnabled */ - FALSE, /* vidModeAllowNonLocal */ - TRUE, /* miscModInDevEnabled */ - FALSE, /* miscModInDevAllowNonLocal */ - PCIOsConfig, /* pciFlags */ - Pix24DontCare, /* pixmap24 */ - X_DEFAULT, /* pix24From */ + .allowMouseOpenFail = FALSE, + .vidModeEnabled = TRUE, + .vidModeAllowNonLocal = FALSE, + .miscModInDevEnabled = TRUE, + .miscModInDevAllowNonLocal = FALSE, + .pixmap24 = Pix24DontCare, + .pix24From = X_DEFAULT, #ifdef __i386__ - FALSE, /* pc98 */ + .pc98 = FALSE, +#endif + .pmFlag = TRUE, + .log = LogNone, + .kbdCustomKeycodes = FALSE, + .disableRandR = FALSE, + .randRFrom = X_DEFAULT, +#ifdef CONFIG_HAL + .allowEmptyInput = TRUE, + .autoAddDevices = TRUE, + .autoEnableDevices = TRUE +#else + .allowEmptyInput = FALSE, + .autoAddDevices = FALSE, + .autoEnableDevices = FALSE #endif - TRUE, /* pmFlag */ - LogNone, /* syncLog */ - 0, /* estimateSizesAggressively */ - FALSE, /* kbdCustomKeycodes */ - FALSE, /* disableRandR */ - X_DEFAULT /* randRFrom */ }; const char *xf86ConfigFile = NULL; const char *xf86InputDeviceList = NULL; @@ -149,6 +153,7 @@ Bool xf86Resetting = FALSE; Bool xf86Initialising = FALSE; Bool xf86DoProbe = FALSE; Bool xf86DoConfigure = FALSE; +Bool xf86DoShowOptions = FALSE; Bool xf86DoModalias = FALSE; DriverPtr *xf86DriverList = NULL; int xf86NumDrivers = 0; @@ -168,11 +173,11 @@ const char *xf86VisualNames[] = { /* Parameters set only from the command line */ char *xf86ServerName = "no-name"; Bool xf86fpFlag = FALSE; -Bool xf86coFlag = FALSE; Bool xf86sFlag = FALSE; Bool xf86bsEnableFlag = FALSE; Bool xf86bsDisableFlag = FALSE; Bool xf86silkenMouseDisableFlag = FALSE; +Bool xf86xkbdirFlag = FALSE; #ifdef HAVE_ACPI Bool xf86acpiDisableFlag = FALSE; #endif @@ -189,17 +194,11 @@ int xf86Depth = -1; rgb xf86Weight = {0, 0, 0}; Bool xf86FlipPixels = FALSE; Gamma xf86Gamma = {0.0, 0.0, 0.0}; -Bool xf86ShowUnresolved = DEFAULT_UNRESOLVED; -Bool xf86BestRefresh = DEFAULT_BEST_REFRESH; Bool xf86AllowMouseOpenFail = FALSE; #ifdef XF86VIDMODE Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif -#ifdef XF86MISC -Bool xf86MiscModInDevDisabled = FALSE; -Bool xf86MiscModInDevAllowNonLocal = FALSE; -#endif RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; _X_EXPORT Bool xf86inSuspend = FALSE; Bool xorgHWAccess = FALSE; diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index 282eb49f9..00df10574 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -60,7 +60,6 @@ #include "mivalidate.h" #include "xf86RAC.h" #include "xf86Bus.h" -#include "xf86Version.h" /* For xf86GetClocks */ #if defined(CSRG_BASED) || defined(__GNU__) @@ -357,11 +356,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) if (pInp->drv) pInp->drv->refCount--; - /* This should *really* be handled in drv->UnInit(dev) call instead */ -#if 0 + /* This should *really* be handled in drv->UnInit(dev) call instead, but + * if the driver forgets about it make sure we free it or at least crash + * with flying colors */ if (pInp->private) xfree(pInp->private); -#endif /* Remove the entry from the list. */ if (pInp == xf86InputDevs) @@ -448,10 +447,6 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) #define GLOBAL_DEFAULT_DEPTH 24 #endif -#ifndef GLOBAL_DEFAULT_FBBPP -#define GLOBAL_DEFAULT_FBBPP 32 -#endif - _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, int depth24flags) @@ -529,7 +524,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, if (depth > 0) scrp->depth = depth; } else { - scrp->bitsPerPixel = GLOBAL_DEFAULT_FBBPP; scrp->depth = GLOBAL_DEFAULT_DEPTH; } } @@ -1097,9 +1091,6 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = FALSE; -#ifdef DO_SAVE_UNDERS - Bool dosave = FALSE; -#endif WindowPtr pLayerWin; BoxRec box; @@ -1169,12 +1160,6 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) anyMarked = TRUE; } -#ifdef DO_SAVE_UNDERS - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ if (anyMarked) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); @@ -1184,10 +1169,6 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) { if (anyMarked) (*pScreen->HandleExposures)(pWin); -#ifdef DO_SAVE_UNDERS - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ if (anyMarked && pScreen->PostValidateTree) (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); } @@ -1552,6 +1533,21 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist) return i; } +static Bool +pciDeviceHasBars(struct pci_device *pci) +{ + int i; + + for (i = 0; i < 6; i++) + if (pci->regions[i].size) + return TRUE; + + if (pci->rom_size) + return TRUE; + + return FALSE; +} + struct Inst { struct pci_device * pci; GDevPtr dev; @@ -1687,8 +1683,8 @@ xf86MatchPciInstances(const char *driverName, int vendorID, if ( xf86DoConfigure && xf86DoConfigurePass1 ) { if (xf86CheckPciSlot(pPci)) { GDevPtr pGDev = - xf86AddDeviceToConfigure(drvp->driverName, - pPci, -1); + xf86AddBusDeviceToConfigure(drvp->driverName, + BUS_PCI, pPci, -1); if (pGDev) { /* After configure pass 1, chipID and chipRev * are treated as over-rides, so clobber them @@ -1806,7 +1802,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, } if (devBus) dev = devBus; /* busID preferred */ if (!dev) { - if ( xf86CheckPciSlot( pPci ) ) { + if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID PCI:%u@%u:%u:%u) found\n", driverName, pPci->domain, pPci->bus, pPci->dev, @@ -1957,108 +1953,6 @@ xf86MatchPciInstances(const char *driverName, int vendorID, return numFound; } -_X_EXPORT int -xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets, - IsaChipsets *ISAchipsets, DriverPtr drvp, - FindIsaDevProc FindIsaDevice, GDevPtr *devList, - int numDevs, int **foundEntities) -{ - SymTabRec *c; - IsaChipsets *Chips; - int i; - int numFound = 0; - int foundChip = -1; - int *retEntities = NULL; - - *foundEntities = NULL; - -#if defined(__sparc__) || defined(__powerpc__) - FindIsaDevice = NULL; /* Temporary */ -#endif - - if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) { - if (FindIsaDevice && - ((foundChip = (*FindIsaDevice)(NULL)) != -1)) { - xf86AddDeviceToConfigure(drvp->driverName, NULL, foundChip); - return 1; - } - return 0; - } - - for (i = 0; i < numDevs; i++) { - MessageType from = X_CONFIG; - GDevPtr dev = NULL; - GDevPtr devBus = NULL; - - if (devList[i]->busID && *devList[i]->busID) { - if (xf86ParseIsaBusString(devList[i]->busID)) { - if (devBus) xf86MsgVerb(X_WARNING,0, - "%s: More than one matching Device " - "section for ISA-Bus found: %s\n", - driverName,devList[i]->identifier); - else devBus = devList[i]; - } - } else { - if (xf86IsPrimaryIsa()) { - if (dev) xf86MsgVerb(X_WARNING,0, - "%s: More than one matching " - "Device section found: %s\n", - driverName,devList[i]->identifier); - else dev = devList[i]; - } - } - if (devBus) dev = devBus; - if (dev) { - if (dev->chipset) { - for (c = chipsets; c->token >= 0; c++) { - if (xf86NameCmp(c->name, dev->chipset) == 0) - break; - } - if (c->token == -1) { - xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device " - "section \"%s\" isn't valid for this driver\n", - driverName, dev->chipset, - dev->identifier); - } else - foundChip = c->token; - } else { - if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev); - /* Probe it */ - from = X_PROBED; - } - } - - /* Check if the chip type is listed in the chipset table - for sanity*/ - - if (foundChip >= 0){ - for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) { - if (Chips->numChipset == foundChip) - break; - } - if (Chips->numChipset == -1){ - foundChip = -1; - xf86MsgVerb(X_WARNING,0, - "%s: Driver detected unknown ISA-Bus Chipset\n", - driverName); - } - } - if (foundChip != -1) { - numFound++; - retEntities = xnfrealloc(retEntities,numFound * sizeof(int)); - retEntities[numFound - 1] = - xf86ClaimIsaSlot(drvp,foundChip,dev, dev->active ? TRUE : FALSE); - for (c = chipsets; c->token >= 0; c++) { - if (c->token == foundChip) - break; - } - xf86Msg(from, "Chipset %s found\n", c->name); - } - } - *foundEntities = retEntities; - - return numFound; -} - /* * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ... */ @@ -2098,14 +1992,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int), cnt = 0; sync = 200000; - /* XXX How critical is this? */ - if (!xf86DisableInterrupts()) - { - (*ClockFunc)(pScrn, CLK_REG_RESTORE); - ErrorF("Failed to disable interrupts during clock probe. If\n"); - ErrorF("your OS does not support disabling interrupts, then you\n"); - FatalError("must specify a Clocks line in the XF86Config file.\n"); - } while ((inb(status) & maskval) == 0x00) if (sync-- == 0) goto finish; /* Something appears to be happening, so reset sync count */ @@ -2126,8 +2012,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int), } finish: - xf86EnableInterrupts(); - pScrn->clock[i] = cnt ? cnt : -1; if (BlankScreen) (*BlankScreen)(pScrn, TRUE); @@ -2339,12 +2223,6 @@ xf86DisableRandR() } _X_EXPORT CARD32 -xf86GetVersion() -{ - return XF86_VERSION_CURRENT; -} - -_X_EXPORT CARD32 xf86GetModuleVersion(pointer module) { return (CARD32)LoaderGetModuleVersion(module); @@ -2567,49 +2445,6 @@ xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name, #include "loader/os.c" /* new RAC */ -/* - * xf86ConfigIsa/PciEntity() -- These helper functions assign an - * active entity to a screen, registers its fixed resources, assign - * special enter/leave functions and their private scratch area to - * this entity, take the dog for a walk... - */ -_X_EXPORT ScrnInfoPtr -xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, - IsaChipsets *i_chip, resList res, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) -{ - IsaChipsets *i_id; - EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); - if (!pEnt) return pScrn; - - if (!(pEnt->location.type == BUS_ISA)) { - xfree(pEnt); - return pScrn; - } - - if (!pEnt->active) { - xf86ConfigIsaEntityInactive(pEnt, i_chip, res, init, enter, - leave, private); - xfree(pEnt); - return pScrn; - } - - if (!pScrn) - pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); - xf86AddEntityToScreen(pScrn,entityIndex); - - if (i_chip) { - for (i_id = i_chip; i_id->numChipset != -1; i_id++) { - if (pEnt->chipset == i_id->numChipset) break; - } - xf86ClaimFixedResources(i_id->resList,entityIndex); - } - xfree(pEnt); - xf86ClaimFixedResources(res,entityIndex); - xf86SetEntityFuncs(entityIndex,init,enter,leave,private); - - return pScrn; -} _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, @@ -2685,39 +2520,9 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, /* * - * OBSOLETE ! xf86ConfigActiveIsaEntity() and xf86ConfigActivePciEntity() - * are obsolete functions. They the are likely to be removed - * Don't use! + * OBSOLETE ! xf86ConfigActivePciEntity() is an obsolete functions. + * They the are likely to be removed. Don't use! */ -_X_EXPORT Bool -xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex, - IsaChipsets *i_chip, resList res, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) -{ - IsaChipsets *i_id; - EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); - if (!pEnt) return FALSE; - - if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) { - xfree(pEnt); - return FALSE; - } - - xf86AddEntityToScreen(pScrn,entityIndex); - - if (i_chip) { - for (i_id = i_chip; i_id->numChipset != -1; i_id++) { - if (pEnt->chipset == i_id->numChipset) break; - } - xf86ClaimFixedResources(i_id->resList,entityIndex); - } - xfree(pEnt); - xf86ClaimFixedResources(res,entityIndex); - if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) - return FALSE; - - return TRUE; -} _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, @@ -2750,10 +2555,10 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, } /* - * xf86ConfigPci/IsaEntityInactive() -- These functions can be used + * xf86ConfigPciEntityInactive() -- This functions can be used * to configure an inactive entity as well as to reconfigure an * previously active entity inactive. If the entity has been - * assigned to a screen before it will be removed. If p_pci(p_isa) is + * assigned to a screen before it will be removed. If p_pci is * non-NULL all static resources listed there will be registered. */ _X_EXPORT void @@ -2778,28 +2583,6 @@ xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip, xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); } -_X_EXPORT void -xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip, - resList res, EntityProc init, EntityProc enter, - EntityProc leave, pointer private) -{ - IsaChipsets *i_id; - ScrnInfoPtr pScrn; - - if ((pScrn = xf86FindScreenForEntity(pEnt->index))) - xf86RemoveEntityFromScreen(pScrn,pEnt->index); - else if (i_chip) { - for (i_id = i_chip; i_id->numChipset != -1; i_id++) { - if (pEnt->chipset == i_id->numChipset) break; - } - xf86ClaimFixedResources(i_id->resList,pEnt->index); - } - xf86ClaimFixedResources(res,pEnt->index); - /* shared resources are only needed when entity is active: remove */ - xf86DeallocateResourcesForEntity(pEnt->index, ResShared); - xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); -} - void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, EntityProc enter, EntityProc leave, pointer private) @@ -2939,21 +2722,7 @@ xf86MotionHistoryAllocate(LocalDevicePtr local) _X_EXPORT int xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start, - unsigned long stop, ScreenPtr pScreen) -{ - return GetMotionHistory(pDev, buff, start, stop, pScreen); -} - -_X_EXPORT void -xf86getsecs(long * secs, long * usecs) + unsigned long stop, ScreenPtr pScreen, BOOL core) { - struct timeval tv; - - X_GETTIMEOFDAY(&tv); - if (secs) - *secs = tv.tv_sec; - if (usecs) - *usecs= tv.tv_usec; - - return; + return GetMotionHistory(pDev, buff, start, stop, pScreen, core); } diff --git a/xorg-server/hw/xfree86/common/xf86InPriv.h b/xorg-server/hw/xfree86/common/xf86InPriv.h index 62e4820cb..3838d6940 100644 --- a/xorg-server/hw/xfree86/common/xf86InPriv.h +++ b/xorg-server/hw/xfree86/common/xf86InPriv.h @@ -38,7 +38,7 @@ extern InputDriverPtr *xf86InputDriverList; extern int xf86NumInputDrivers; /* xf86Xinput.c */ -void xf86ActivateDevice(InputInfoPtr pInfo); +int xf86ActivateDevice(InputInfoPtr pInfo); /* xf86Helper.c */ InputDriverPtr xf86LookupInputDriver(const char *name); diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index fc50cafc7..f029915c6 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -71,12 +71,8 @@ #include "xf86Date.h" #include "xf86Build.h" #include "mipointer.h" -#ifdef XINPUT #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#else -#include "inputstr.h" -#endif #include "xf86DDC.h" #include "xf86Xinput.h" #include "xf86InPriv.h" @@ -97,12 +93,6 @@ #include "xf86Bus.h" /* forward declarations */ - -static void xf86PrintBanner(void); -static void xf86PrintMarkers(void); -static void xf86PrintDefaultModulePath(void); -static void xf86PrintDefaultLibraryPath(void); - static Bool probe_devices_from_device_sections(DriverPtr drvp); static Bool add_matching_devices_to_configure_list(DriverPtr drvp); static Bool check_for_matching_devices(DriverPtr drvp); @@ -142,7 +132,7 @@ static Bool formatsDone = FALSE; #endif static void -xf86PrintBanner() +xf86PrintBanner(void) { #if PRE_RELEASE ErrorF("\n" @@ -249,13 +239,13 @@ xf86PrintBanner() } static void -xf86PrintMarkers() +xf86PrintMarkers(void) { LogPrintMarkers(); } static void -DoModalias() +DoModalias(void) { int i = -1; char **vlist; @@ -379,10 +369,10 @@ xf86CreateRootWindow(WindowPtr pWin) pProp->size, pProp->data, FALSE); } - + /* Look at err */ ret &= (err==Success); - + } else { xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " "non-root window %p (parent %p)\n", @@ -399,7 +389,7 @@ xf86CreateRootWindow(WindowPtr pWin) static void -PostConfigInit(void) +InstallSignalHandlers(void) { /* * Install signal handler for unexpected signals @@ -425,13 +415,6 @@ PostConfigInit(void) signal(SIGXFSZ,xf86SigHandler); #endif } - -#ifdef XF86PM - xf86OSPMClose = xf86OSPMOpen(); -#endif - - /* Do this after XF86Config is read (it's normally in OsInit()) */ - OsInitColors(); } @@ -459,7 +442,7 @@ probe_devices_from_device_sections(DriverPtr drvp) iter = pci_id_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { if (devList[i]->busID && *devList[i]->busID) { - if (xf86ComparePciBusString(devList[i]->busID, + if (xf86ComparePciBusString(devList[i]->busID, ((pPci->domain << 8) | pPci->bus), pPci->dev, @@ -506,7 +489,7 @@ probe_devices_from_device_sections(DriverPtr drvp) ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n", drvp->driverName, pPci->bus, pPci->dev, pPci->func); #endif - + /* Allocate an entry in the lists to be returned */ entry = xf86ClaimPciSlot(pPci, drvp, device_id, devList[i], devList[i]->active); @@ -526,7 +509,7 @@ probe_devices_from_device_sections(DriverPtr drvp) } } } - + if (entry != -1) { if ((*drvp->PciProbe)(drvp, entry, pPci, devices[j].match_data)) { @@ -539,7 +522,7 @@ probe_devices_from_device_sections(DriverPtr drvp) } } - + return foundScreen; } @@ -565,8 +548,8 @@ add_matching_devices_to_configure_list(DriverPtr drvp) && ((devices[j].device_class_mask & pPci->device_class) == devices[j].device_class) ) { if (xf86CheckPciSlot(pPci)) { - GDevPtr pGDev = - xf86AddDeviceToConfigure(drvp->driverName, pPci, -1); + GDevPtr pGDev = xf86AddBusDeviceToConfigure( + drvp->driverName, BUS_PCI, pPci, -1); if (pGDev != NULL) { /* After configure pass 1, chipID and chipRev are * treated as over-rides, so clobber them here. @@ -600,11 +583,11 @@ check_for_matching_devices(DriverPtr drvp) for (j = 0; ! END_OF_MATCHES(devices[j]); j++) { struct pci_device_iterator *iter; struct pci_device *dev; - + iter = pci_id_match_iterator_create(& devices[j]); dev = pci_device_next(iter); pci_iterator_destroy(iter); - + if (dev != NULL) { return TRUE; } @@ -623,9 +606,9 @@ check_for_matching_devices(DriverPtr drvp) * is found, it is called. If \c DriverRec::PciProbe or no devices can be * successfully probed with it (e.g., only non-PCI devices are available), * the driver's \c DriverRec::Probe function is called. - * + * * \param drv Driver to probe - * + * * \return * If a device can be successfully probed by the driver, \c TRUE is * returned. Otherwise, \c FALSE is returned. @@ -653,13 +636,83 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) if ( ! foundScreen && (drv->Probe != NULL) ) { xf86Msg( X_WARNING, "Falling back to old probe method for %s\n", drv->driverName ); - foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT + foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT : PROBE_DEFAULT ); } return foundScreen; } +static void +DoProbe(void) +{ + int i; + Bool probeResult; + Bool ioEnableFailed = FALSE; + + /* Find the list of video driver modules. */ + char **list = xf86DriverlistFromCompile(); + char **l; + + if (list) { + ErrorF("List of video driver modules:\n"); + for (l = list; *l; l++) + ErrorF("\t%s\n", *l); + } else { + ErrorF("No video driver modules found\n"); + } + + /* Load all the drivers that were found. */ + xf86LoadModules(list, NULL); + + /* Disable PCI devices */ + xf86AccessInit(); + + /* Call all of the probe functions, reporting the results. */ + for (i = 0; i < xf86NumDrivers; i++) { + DriverRec * const drv = xf86DriverList[i]; + + if (!xorgHWAccess) { + xorgHWFlags flags; + if (!drv->driverFunc + || !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags ) + || NEED_IO_ENABLED(flags)) { + if (ioEnableFailed) + continue; + if (!xf86EnableIO()) { + ioEnableFailed = TRUE; + continue; + } + xorgHWAccess = TRUE; + } + } + + + xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n", drv->driverName); + + probeResult = xf86CallDriverProbe( drv, TRUE ); + if (!probeResult) { + xf86ErrorF("Probe in driver `%s' returns FALSE\n", + drv->driverName); + } else { + xf86ErrorF("Probe in driver `%s' returns TRUE\n", + drv->driverName); + + /* If we have a result, then call driver's Identify function */ + if (drv->Identify != NULL) { + const int verbose = xf86SetVerbosity(1); + (*drv->Identify)(0); + xf86SetVerbosity(verbose); + } + } + } + + OsCleanup(TRUE); + AbortDDX(); + fflush(stderr); + exit(0); +} + /* * InitOutput -- * Initialize screenInfo for all actually accessible framebuffers. @@ -677,7 +730,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; Bool autoconfig = FALSE; - + GDevPtr configured_device; + xf86Initialising = TRUE; if (serverGeneration == 1) { @@ -703,7 +757,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } /* Read and parse the config file */ - if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias) { + if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias && !xf86DoShowOptions) { switch (xf86HandleConfigFile(FALSE)) { case CONFIG_OK: break; @@ -716,8 +770,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } } - if (!autoconfig) - PostConfigInit(); + InstallSignalHandlers(); /* Initialise the loader */ LoaderInit(); @@ -729,6 +782,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); } + if (xf86DoShowOptions) + DoShowOptions(); + xf86OpenConsole(); /* Do a general bus probe. This will be a PCI probe for x86 platforms */ @@ -749,9 +805,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Msg(X_ERROR, "Auto configuration failed\n"); return; } - PostConfigInit(); } +#ifdef XF86PM + xf86OSPMClose = xf86OSPMOpen(); +#endif + /* Initialise the resource broker */ xf86ResourceBrokerInit(); @@ -766,7 +825,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* If there aren't any specified in the config file, autoconfig them */ /* FIXME: Does not handle multiple active screen sections, but I'm not * sure if we really want to handle that case*/ - GDevPtr configured_device = xf86ConfigLayout.screens->screen->device; + configured_device = xf86ConfigLayout.screens->screen->device; if ((!configured_device) || (!configured_device->driver)) { if (!autoConfigDevice(configured_device)) { xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); @@ -812,14 +871,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumDrivers; i++) { xorgHWFlags flags; - /* The Identify function is mandatory, but if it isn't there continue */ + if (xf86DriverList[i]->Identify != NULL) xf86DriverList[i]->Identify(0); - else { - xf86Msg(X_WARNING, "Driver `%s' has no Identify function\n", - xf86DriverList[i]->driverName ? xf86DriverList[i]->driverName - : "noname"); - } + if (!xorgHWAccess && (!xf86DriverList[i]->driverFunc || !xf86DriverList[i]->driverFunc(NULL, @@ -830,19 +885,16 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } /* Enable full I/O access */ - if (xorgHWAccess) { - if(!xf86EnableIO()) - /* oops, we have failed */ - xorgHWAccess = FALSE; - } + if (xorgHWAccess) + xorgHWAccess = xf86EnableIO(); /* * Locate bus slot that had register IO enabled at server startup */ - - xf86AccessInit(); - xf86FindPrimaryDevice(); - + if (xorgHWAccess) { + xf86AccessInit(); + xf86FindPrimaryDevice(); + } /* * Now call each of the Probe functions. Each successful probe will * result in an extra entry added to the xf86Screens[] list for each @@ -856,7 +908,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) || !xf86DriverList[i]->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags) - || NEED_IO_ENABLED(flags)) + || NEED_IO_ENABLED(flags)) continue; } @@ -892,7 +944,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) layout++) { Bool found = FALSE; for (j = 0; j < xf86Screens[i]->numEntities; j++) { - + GDevPtr dev = xf86GetDevFromEntity(xf86Screens[i]->entityList[j], xf86Screens[i]->entityInstanceList[j]); @@ -950,7 +1002,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) * Call the driver's PreInit()'s to complete initialisation for the first * generation. */ - + for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->PreInit && @@ -960,7 +1012,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) xf86DeleteScreen(i--, 0); - + /* * If no screens left, return now. */ @@ -971,46 +1023,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) return; } - /* This could be moved into a separate function */ - - /* - * Check that all screens have initialised the mandatory function - * entry points. Delete those which have not. - */ - -#define WARN_SCREEN(func) \ - xf86Msg(X_ERROR, "Driver `%s' has no %s function, deleting.\n", \ - xf86Screens[i]->name, (warned++, func)) - for (i = 0; i < xf86NumScreens; i++) { - int warned = 0; if (xf86Screens[i]->name == NULL) { - xf86Screens[i]->name = xnfalloc(strlen("screen") + 1 + 1); - if (i < 10) - sprintf(xf86Screens[i]->name, "screen%c", i + '0'); - else - sprintf(xf86Screens[i]->name, "screen%c", i - 10 + 'A'); + xf86Screens[i]->name = xnfalloc(strlen("screen") + 10 + 1); + sprintf(xf86Screens[i]->name, "screen%d", i); xf86MsgVerb(X_WARNING, 0, "Screen driver %d has no name set, using `%s'.\n", i, xf86Screens[i]->name); } - if (xf86Screens[i]->ScreenInit == NULL) - WARN_SCREEN("ScreenInit"); - if (xf86Screens[i]->EnterVT == NULL) - WARN_SCREEN("EnterVT"); - if (xf86Screens[i]->LeaveVT == NULL) - WARN_SCREEN("LeaveVT"); - if (warned) - xf86DeleteScreen(i--, 0); - } - - /* - * If no screens left, return now. - */ - - if (xf86NumScreens == 0) { - xf86Msg(X_ERROR, "Screen(s) found, but drivers were unusable.\n"); - return; } /* XXX Should this be before or after loading dependent modules? */ @@ -1121,12 +1141,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) FatalError("Unable to make VT property - out of memory. Exiting...\n"); } *VT = xf86Info.vtno; - + VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - VTAtom, XA_INTEGER, 32, + VTAtom, XA_INTEGER, 32, 1, VT ); if (ret != Success) xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, @@ -1143,14 +1163,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } } -#ifdef XKB - xf86InitXkb(); -#endif /* set up the proper access funcs */ xf86PostPreInit(); - AddCallback(&ServerGrabCallback, xf86GrabServerCallback, NULL); - } else { /* * serverGeneration != 1; some OSs have to do things here, too. @@ -1174,34 +1189,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86EnableIO(); } -#if 0 - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) - { - signal(SIGSEGV,xf86SigHandler); - signal(SIGILL,xf86SigHandler); -#ifdef SIGEMT - signal(SIGEMT,xf86SigHandler); -#endif - signal(SIGFPE,xf86SigHandler); -#ifdef SIGBUS - signal(SIGBUS,xf86SigHandler); -#endif -#ifdef SIGSYS - signal(SIGSYS,xf86SigHandler); -#endif -#ifdef SIGXCPU - signal(SIGXCPU,xf86SigHandler); -#endif -#ifdef SIGXFSZ - signal(SIGXFSZ,xf86SigHandler); -#endif - } -#endif - /* * Use the previously collected parts to setup pScreenInfo */ @@ -1215,7 +1202,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) pScreenInfo->formats[i] = formats[i]; /* Make sure the server's VT is active */ - + if (serverGeneration != 1) { xf86Resetting = TRUE; /* All screens are in the same state, so just check the first */ @@ -1225,7 +1212,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #endif xf86AccessEnter(); xf86EnterServerState(SETUP); - } + } } #ifdef SCO325 else { @@ -1242,8 +1229,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } #endif /* SCO325 */ - for (i = 0; i < xf86NumScreens; i++) { - xf86EnableAccess(xf86Screens[i]); + for (i = 0; i < xf86NumScreens; i++) { + xf86EnableAccess(xf86Screens[i]); /* * Almost everything uses these defaults, and many of those that * don't, will wrap them. @@ -1251,7 +1238,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; xf86Screens[i]->SetDGAMode = xf86SetDGAMode; xf86Screens[i]->DPMSSet = NULL; - xf86Screens[i]->LoadPalette = NULL; + xf86Screens[i]->LoadPalette = NULL; xf86Screens[i]->SetOverscan = NULL; xf86Screens[i]->DriverFunc = NULL; xf86Screens[i]->pScreen = NULL; @@ -1286,7 +1273,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #ifdef RENDER if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown) { - xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); + xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); PictureSetSubpixelOrder (xf86Screens[i]->pScreen, DDC ? (DDC->features.input_type ? @@ -1320,15 +1307,15 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void InitInput(argc, argv) - int argc; - char **argv; + int argc; + char **argv; { IDevPtr* pDev; - InputDriverPtr pDrv; - InputInfoPtr pInfo; + DeviceIntPtr dev; xf86Info.vtRequestsPending = FALSE; - xf86Info.inputPending = FALSE; + + mieqInit(); /* Call the PreInit function for each input device instance. */ for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { @@ -1337,51 +1324,18 @@ InitInput(argc, argv) strcpy((*pDev)->driver, "kbd"); } - if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) { - xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver); - /* XXX For now, just continue. */ - continue; - } - if (!pDrv->PreInit) { - xf86MsgVerb(X_WARNING, 0, - "Input driver `%s' has no PreInit function (ignoring)\n", - pDrv->driverName); - continue; - } - pInfo = pDrv->PreInit(pDrv, *pDev, 0); - if (!pInfo) { - xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", - (*pDev)->identifier); - continue; - } else if (!(pInfo->flags & XI86_CONFIGURED)) { - xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - (*pDev)->identifier); - xf86DeleteInput(pInfo, 0); - continue; - } - } - - /* Initialise all input devices. */ - pInfo = xf86InputDevs; - while (pInfo) { - xf86Msg(X_INFO, "evaluating device (%s)\n", pInfo->name); - xf86ActivateDevice(pInfo); - pInfo = pInfo->next; + /* If one fails, the others will too */ + if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc) + break; } - - mieqInit(); } -#ifndef SET_STDERR_NONBLOCKING -#define SET_STDERR_NONBLOCKING 1 -#endif - /* * OsVendorInit -- * OS/Vendor-specific initialisations. Called from OsInit(), which * is called by dix before establishing the well known sockets. */ - + void OsVendorInit() { @@ -1390,15 +1344,10 @@ OsVendorInit() #ifdef SIGCHLD signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ #endif - OsDelayInitColors = TRUE; -#ifndef BUILTIN_FONTS - loadableFonts = TRUE; -#endif if (!beenHere) xf86LogInit(); -#if SET_STDERR_NONBLOCKING /* Set stderr to non-blocking. */ #ifndef O_NONBLOCK #if defined(FNDELAY) @@ -1406,7 +1355,6 @@ OsVendorInit() #elif defined(O_NDELAY) #define O_NONBLOCK O_NDELAY #endif -#endif #ifdef O_NONBLOCK if (!beenHere) { @@ -1456,9 +1404,6 @@ ddxGiveUp() xf86Screens[i]->busAccess = NULL; } -#ifdef USE_XF86_SERVERLOCK - xf86UnlockServer(); -#endif #ifdef XFreeXDGA DGAShutdown(); #endif @@ -1507,9 +1452,9 @@ AbortDDX() (xf86Screens[i]->LeaveVT)(i, 0); } } - + xf86AccessLeave(); - + /* * This is needed for an abnormal server exit, since the normal exit stuff * MUST also be performed (i.e. the vt must be left in a defined state) @@ -1553,6 +1498,18 @@ xf86SetLogVerbosity(int verb) return save; } +static void +xf86PrintDefaultModulePath(void) +{ + ErrorF("%s\n", DEFAULT_MODULE_PATH); +} + +static void +xf86PrintDefaultLibraryPath(void) +{ + ErrorF("%s\n", DEFAULT_LIBRARY_PATH); +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is @@ -1561,8 +1518,6 @@ xf86SetLogVerbosity(int verb) * */ - - /* ARGSUSED */ int ddxProcessArgument(int argc, char **argv, int i) @@ -1578,7 +1533,7 @@ ddxProcessArgument(int argc, char **argv, int i) UseMsg(); \ FatalError("Required argument to %s not specified\n", argv[i]); \ } - + /* First the options that are only allowed for root */ if (getuid() == 0 || geteuid() != 0) { @@ -1622,11 +1577,6 @@ ddxProcessArgument(int argc, char **argv, int i) xf86ConfigFile = argv[i + 1]; return 2; } - if (!strcmp(argv[i],"-showunresolved")) - { - xf86ShowUnresolved = TRUE; - return 1; - } if (!strcmp(argv[i],"-probeonly")) { xf86ProbeOnly = TRUE; @@ -1649,28 +1599,11 @@ ddxProcessArgument(int argc, char **argv, int i) return 1; } #endif -#ifdef XF86MISC - if (!strcmp(argv[i],"-disableModInDev")) - { - xf86MiscModInDevDisabled = TRUE; - return 1; - } - if (!strcmp(argv[i],"-allowNonLocalModInDev")) - { - xf86MiscModInDevAllowNonLocal = TRUE; - return 1; - } -#endif if (!strcmp(argv[i],"-allowMouseOpenFail")) { xf86AllowMouseOpenFail = TRUE; return 1; } - if (!strcmp(argv[i],"-bestRefresh")) - { - xf86BestRefresh = TRUE; - return 1; - } if (!strcmp(argv[i],"-ignoreABI")) { LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); @@ -1734,12 +1667,6 @@ ddxProcessArgument(int argc, char **argv, int i) xf86fpFlag = TRUE; return 0; } - /* Notice the -co flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "-co")) - { - xf86coFlag = TRUE; - return 0; - } /* Notice the -bs flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-bs")) { @@ -1815,11 +1742,11 @@ ddxProcessArgument(int argc, char **argv, int i) return 0; } } - if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || + if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma")) { double gamma; - CHECK_FOR_REQUIRED_ARGUMENT(); + CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%lf", &gamma) == 1) { if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) { ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f" @@ -1854,7 +1781,7 @@ ddxProcessArgument(int argc, char **argv, int i) } if (!strcmp(argv[i], "-keyboard")) { - CHECK_FOR_REQUIRED_ARGUMENT(); + CHECK_FOR_REQUIRED_ARGUMENT(); xf86KeyboardName = argv[++i]; return 2; } @@ -1891,6 +1818,15 @@ ddxProcessArgument(int argc, char **argv, int i) xf86AllowMouseOpenFail = TRUE; return 1; } + if (!strcmp(argv[i], "-showopts")) + { + if (getuid() != 0 && geteuid() == 0) { + ErrorF("The '-showopts' option can only be used by root.\n"); + exit(1); + } + xf86DoShowOptions = TRUE; + return 1; + } if (!strcmp(argv[i], "-isolateDevice")) { int bus, device, func; @@ -1908,15 +1844,17 @@ ddxProcessArgument(int argc, char **argv, int i) FatalError("Invalid isolated device specification\n"); } } + /* Notice cmdline xkbdir, but pass to dix as well */ + if (!strcmp(argv[i], "-xkbdir")) + { + xf86xkbdirFlag = TRUE; + return 0; + } + /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); } -/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ -void ddxInitGlobals(void) -{ -} - /* * ddxUseMsg -- * Print out correct use of device dependent commandline options. @@ -1934,6 +1872,7 @@ ddxUseMsg() ErrorF("-modulepath paths specify the module search path\n"); ErrorF("-logfile file specify a log file name\n"); ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n"); + ErrorF("-showopts print available options for all installed drivers\n"); } ErrorF("-modalias output a modalias-style filter for each driver installed\n"); ErrorF("-config file specify a configuration file, relative to the\n"); @@ -1961,13 +1900,7 @@ ddxUseMsg() ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n"); #endif -#ifdef XF86MISC - ErrorF("-disableModInDev disable dynamic modification of input device settings\n"); - ErrorF("-allowNonLocalModInDev allow changes to keyboard and mouse settings\n"); - ErrorF(" from non-local clients\n"); ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); -#endif - ErrorF("-bestRefresh choose modes with the best refresh rate\n"); ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); ErrorF("-version show the server version\n"); @@ -1978,21 +1911,10 @@ ddxUseMsg() ErrorF("\n"); } -static void -xf86PrintDefaultModulePath(void) -{ - ErrorF("%s\n", DEFAULT_MODULE_PATH); -} - -static void -xf86PrintDefaultLibraryPath(void) -{ - ErrorF("%s\n", DEFAULT_LIBRARY_PATH); -} /* * xf86LoadModules iterates over a list that is being passed in. - */ + */ Bool xf86LoadModules(char **list, pointer *optlist) { @@ -2063,7 +1985,7 @@ xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) return &format; } } - + for (i = 0; i < numFormats; i++) if (formats[i].depth == depth) break; @@ -2085,11 +2007,10 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) { PixmapFormatPtr format; - + format = xf86GetPixFormat(pScrn, depth); if (format) return format->bitsPerPixel; else return 0; } - diff --git a/xorg-server/hw/xfree86/common/xf86MiscExt.c b/xorg-server/hw/xfree86/common/xf86MiscExt.c deleted file mode 100644 index 40c196a3e..000000000 --- a/xorg-server/hw/xfree86/common/xf86MiscExt.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Copyright (c) 1999-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * This file contains the Pointer/Keyboard functions needed by the - * XFree86-Misc extension. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/X.h> -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" - -#ifdef XF86MISC -#define _XF86MISC_SERVER_ -#include <X11/extensions/xf86misc.h> -#include "xf86miscproc.h" -#endif - -#define XF86_OS_PRIVS -#include "xf86_OSlib.h" - -#ifdef XINPUT -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> -#include "xf86Xinput.h" -#else -#include "inputstr.h" -#endif - -#include "xf86OSmouse.h" - -#ifdef DEBUG -# define DEBUG_P(x) ErrorF(x"\n"); -#else -# define DEBUG_P(x) /**/ -#endif - -#ifdef XF86MISC - -typedef struct { - int type; - int baudrate; - int samplerate; - int resolution; - int buttons; - Bool em3buttons; - int em3timeout; - Bool chordmiddle; - int flags; - char* device; - pointer private; -} mseParamsRec, *mseParamsPtr; - -typedef struct { - int type; - int rate; - int delay; - int serverNumLock; /* obsolete */ - pointer private; -} kbdParamsRec, *kbdParamsPtr; - -/* - Sigh... - - The extension should probably be changed to use protocol - names instead of ID numbers -*/ -static struct mouse_map { - int mtype; - MouseProtocolID proto; -} m_map[] = -{ - { MTYPE_MICROSOFT, PROT_MS }, - { MTYPE_MOUSESYS, PROT_MSC }, - { MTYPE_MMSERIES, PROT_MM }, - { MTYPE_LOGITECH, PROT_LOGI }, - { MTYPE_LOGIMAN, PROT_LOGIMAN }, - { MTYPE_MMHIT, PROT_MMHIT }, - { MTYPE_GLIDEPOINT, PROT_GLIDE }, - { MTYPE_IMSERIAL, PROT_IMSERIAL }, - { MTYPE_THINKING, PROT_THINKING }, - { MTYPE_ACECAD, PROT_ACECAD }, - { MTYPE_PS_2, PROT_PS2 }, - { MTYPE_IMPS2, PROT_IMPS2 }, - { MTYPE_EXPPS2, PROT_EXPPS2 }, - { MTYPE_THINKINGPS2, PROT_THINKPS2 }, - { MTYPE_MMANPLUSPS2, PROT_MMPS2 }, - { MTYPE_GLIDEPOINTPS2, PROT_GLIDEPS2 }, - { MTYPE_NETPS2, PROT_NETPS2 }, - { MTYPE_NETSCROLLPS2, PROT_NETSCPS2 }, - { MTYPE_BUSMOUSE, PROT_BM }, - { MTYPE_AUTOMOUSE, PROT_AUTO }, - { MTYPE_SYSMOUSE, PROT_SYSMOUSE }, - { MTYPE_UNKNOWN, PROT_UNKNOWN } -}; - -static int -MapMseProtoToMisc(MouseProtocolID proto) -{ - int i; - - for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++) - if (proto == m_map[i].proto) - return m_map[i].mtype; - - return MTYPE_UNKNOWN; -} - -static MouseProtocolID -MapMseMiscToProto(int proto) -{ - int i; - - for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++) - if (proto == m_map[i].mtype) - return m_map[i].proto; - - return PROT_UNKNOWN; -} - -_X_EXPORT Bool -MiscExtGetMouseSettings(pointer *mouse, char **devname) -{ - mseParamsPtr mseptr; - - mseptr = MiscExtCreateStruct(MISC_POINTER); - if (!mseptr) - return FALSE; - - { - InputInfoPtr pInfo = mseptr->private; - MouseDevPtr pMse; - - *devname = xf86FindOptionValue(pInfo->options, "Device"); - pMse = pInfo->private; - - mseptr->type = MapMseProtoToMisc(pMse->protocolID); - mseptr->baudrate = pMse->baudRate; - mseptr->samplerate = pMse->sampleRate; - mseptr->resolution = pMse->resolution; - mseptr->buttons = pMse->buttons; - mseptr->em3buttons = pMse->emulate3Buttons; - mseptr->em3timeout = pMse->emulate3Timeout; - mseptr->chordmiddle = pMse->chordMiddle; - mseptr->flags = pMse->mouseFlags; - } - *mouse = mseptr; - return TRUE; -} - -_X_EXPORT int -MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype) -{ - mseParamsPtr mse = mouse; - - switch (valtype) { - case MISC_MSE_PROTO: return mse->type; - case MISC_MSE_BAUDRATE: return mse->baudrate; - case MISC_MSE_SAMPLERATE: return mse->samplerate; - case MISC_MSE_RESOLUTION: return mse->resolution; - case MISC_MSE_BUTTONS: return mse->buttons; - case MISC_MSE_EM3BUTTONS: return mse->em3buttons; - case MISC_MSE_EM3TIMEOUT: return mse->em3timeout; - case MISC_MSE_CHORDMIDDLE: return mse->chordmiddle; - case MISC_MSE_FLAGS: return mse->flags; - } - return 0; -} - -_X_EXPORT Bool -MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value) -{ - mseParamsPtr mse = mouse; - - switch (valtype) { - case MISC_MSE_PROTO: - mse->type = value; - return TRUE; - case MISC_MSE_BAUDRATE: - mse->baudrate = value; - return TRUE; - case MISC_MSE_SAMPLERATE: - mse->samplerate = value; - return TRUE; - case MISC_MSE_RESOLUTION: - mse->resolution = value; - return TRUE; - case MISC_MSE_BUTTONS: - mse->buttons = value; - return TRUE; - case MISC_MSE_EM3BUTTONS: - mse->em3buttons = value; - return TRUE; - case MISC_MSE_EM3TIMEOUT: - mse->em3timeout = value; - return TRUE; - case MISC_MSE_CHORDMIDDLE: - mse->chordmiddle = value; - return TRUE; - case MISC_MSE_FLAGS: - mse->flags = value; - return TRUE; - } - return FALSE; -} - -_X_EXPORT Bool -MiscExtSetMouseDevice(pointer mouse, char* device) -{ - mseParamsPtr mse = mouse; - mse->device = device; - - return TRUE; -} - -_X_EXPORT Bool -MiscExtGetKbdSettings(pointer *kbd) -{ - return FALSE; -} - -_X_EXPORT int -MiscExtGetKbdValue(pointer keyboard, MiscExtKbdValType valtype) -{ - return 0; -} - -_X_EXPORT Bool -MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value) -{ - return FALSE; -} - -static void -MiscExtClientStateCallback(CallbackListPtr *callbacks, - pointer data, pointer args) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec*)args; - - if (clientinfo->client == xf86Info.grabInfo.override && - clientinfo->client->clientState == ClientStateGone) { - xf86Info.grabInfo.override = NULL; - xf86Info.grabInfo.disabled = 0; - DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL); - } -} - -#define MiscExtGrabStateSuccess 0 /* No errors */ -#define MiscExtGrabStateLocked 1 /* A client already requested that - * grabs cannot be removed/killed */ -#define MiscExtGrabStateAlready 2 /* Request for enabling/disabling - * grab removeal/kill already done */ -_X_EXPORT int -MiscExtSetGrabKeysState(ClientPtr client, int state) -{ - if (xf86Info.grabInfo.override == NULL || - xf86Info.grabInfo.override == client) { - if (state == 0 && xf86Info.grabInfo.disabled == 0) { - xf86Info.grabInfo.disabled = 1; - AddCallback(&ClientStateCallback, - MiscExtClientStateCallback, NULL); - xf86Info.grabInfo.override = client; - } - else if (state == 1 && xf86Info.grabInfo.disabled == 1) { - xf86Info.grabInfo.disabled = 0; - DeleteCallback(&ClientStateCallback, - MiscExtClientStateCallback, NULL); - xf86Info.grabInfo.override = NULL; - } - else - return MiscExtGrabStateAlready; - - return MiscExtGrabStateSuccess; - } - - return MiscExtGrabStateLocked; -} - -_X_EXPORT pointer -MiscExtCreateStruct(MiscExtStructType mse_or_kbd) -{ - switch (mse_or_kbd) { - case MISC_POINTER: - { - mseParamsPtr mseptr; - InputInfoPtr pInfo = xf86InputDevs; - - while (pInfo) { - if (pInfo->dev == inputInfo.pointer) - break; - pInfo = pInfo->next; - } - if (!pInfo) - return NULL; - - mseptr = xcalloc(sizeof(mseParamsRec),1); - if (mseptr) - mseptr->private = pInfo; - return mseptr; - } - case MISC_KEYBOARD: - return xcalloc(sizeof(kbdParamsRec),1); - } - return 0; -} - -_X_EXPORT void -MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd) -{ - switch (mse_or_kbd) { - case MISC_POINTER: - case MISC_KEYBOARD: - xfree(structure); - } -} - -static Bool -MiscExtAuthorizeDevice(InputInfoPtr pInfo, char *device) -{ - Bool authorized = FALSE; - char *elem; - struct stat dev, dev_list; - const char *olddev = xf86FindOptionValue(pInfo->options, "Device"); - - if (stat(device,&dev)) - return FALSE; - - if (!S_ISCHR(dev.st_mode)) - return FALSE; - - if (!stat(olddev,&dev_list)) { - if (dev_list.st_dev == dev.st_dev - && dev_list.st_ino == dev.st_ino) { - authorized = TRUE; - } - } - - if (!authorized) { - char *path; - - if (!xf86InputDeviceList - || (path = strdup(xf86InputDeviceList)) == NULL) - return FALSE; - - elem = strtok(path,","); - - while (elem) { - - if (!stat(elem,&dev_list)) { - if (dev_list.st_dev == dev.st_dev - && dev_list.st_ino == dev.st_ino) { - authorized = TRUE; - break; - - } - } - elem = strtok(NULL,","); - } - xfree(path); - } -#if 0 - ErrorF("AUTHORIZED: %s\n",authorized?"Yes":"No"); -#endif - return (authorized); -} - -_X_EXPORT MiscExtReturn -MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd) -{ - if (mse_or_kbd == MISC_POINTER) { - Bool protoChanged = FALSE; - int oldflags; - Bool reopen = FALSE; - MouseProtocolID newProtocol; - mseParamsPtr mse = structure; - InputInfoPtr pInfo; - MouseDevPtr pMse; - pointer xf86MouseProtocolIDToName - = LoaderSymbol("xf86MouseProtocolIDToName"); - if (!xf86MouseProtocolIDToName) - return MISC_RET_NOMODULE; - if (mse->type < MTYPE_MICROSOFT - || (mse->type > MTYPE_EXPPS2 - && (mse->type != MTYPE_OSMOUSE))) - return MISC_RET_BADMSEPROTO; -#ifdef OSMOUSE_ONLY - if (mse->type != MTYPE_OSMOUSE) - return MISC_RET_BADMSEPROTO; -#else - if (mse->type == MTYPE_OSMOUSE) - return MISC_RET_BADMSEPROTO; -#endif /* OSMOUSE_ONLY */ - - if (mse->em3timeout < 0) - return MISC_RET_BADVAL; - - if (mse->type == MTYPE_LOGIMAN - && !(mse->baudrate == 0 - || mse->baudrate == 1200 - || mse->baudrate == 9600)) - return MISC_RET_BADBAUDRATE; - if (mse->type == MTYPE_LOGIMAN && mse->samplerate) - return MISC_RET_BADCOMBO; - - if (mse->flags & MF_REOPEN) { - reopen = TRUE; - mse->flags &= ~MF_REOPEN; - } - if (mse->type != MTYPE_OSMOUSE - && mse->type != MTYPE_PS_2 - && mse->type != MTYPE_BUSMOUSE - && mse->type != MTYPE_IMPS2 - && mse->type != MTYPE_THINKINGPS2 - && mse->type != MTYPE_MMANPLUSPS2 - && mse->type != MTYPE_GLIDEPOINTPS2 - && mse->type != MTYPE_NETPS2 - && mse->type != MTYPE_NETSCROLLPS2 - && mse->type != MTYPE_SYSMOUSE) - { - if (mse->baudrate % 1200 != 0 - || (mse->baudrate != 0 && mse->baudrate < 1200) - || mse->baudrate > 9600) - return MISC_RET_BADBAUDRATE; - } - if ((mse->flags & (MF_CLEAR_DTR|MF_CLEAR_RTS)) - && (mse->type != MTYPE_MOUSESYS)) - return MISC_RET_BADFLAGS; - - if (mse->type != MTYPE_OSMOUSE - && mse->type != MTYPE_BUSMOUSE) - { - if (mse->samplerate < 0) - return MISC_RET_BADVAL; - } - - if (mse->resolution < 0) - return MISC_RET_BADVAL; - if (mse->chordmiddle) - { - if (mse->em3buttons || !(mse->type == MTYPE_MICROSOFT - || mse->type == MTYPE_LOGIMAN) ) - return MISC_RET_BADCOMBO; - } - - /* XXX - This still needs work */ - - pInfo = mse->private; - pMse = pInfo->private; - oldflags = pMse->mouseFlags; - - newProtocol = MapMseMiscToProto(mse->type); - protoChanged = pMse->protocolID != newProtocol; - if (protoChanged - || pMse->baudRate != mse->baudrate - || pMse->sampleRate != mse->samplerate - || pMse->resolution != mse->resolution - || pMse->mouseFlags != mse->flags) - reopen = TRUE; - - if (mse->device) - reopen = TRUE; - - if (reopen) - (pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE); - - pMse->protocolID = newProtocol; - pMse->baudRate = mse->baudrate; - pMse->sampleRate = mse->samplerate; - pMse->resolution = mse->resolution; - pMse->buttons = mse->buttons; - pMse->emulate3Buttons = mse->em3buttons; - pMse->emulate3Timeout = mse->em3timeout; - pMse->chordMiddle = mse->chordmiddle; - pMse->mouseFlags = mse->flags; - - pMse->protocol = ((const char *(*)(MouseProtocolID)) - xf86MouseProtocolIDToName)(pMse->protocolID); - - if (mse->device) { - if (MiscExtAuthorizeDevice(pInfo, mse->device)) { - xf86ReplaceStrOption(pInfo->options, "Device", mse->device); - } else { - return MISC_RET_BADVAL; - } - } - - if (reopen) { - /* Only if protocol is changed explicitely disable auto detect */ - if (protoChanged) - pMse->autoProbe = FALSE; - (pMse->device->deviceProc)(pMse->device, DEVICE_ON); - } - /* Set pInfo->options too */ - - if ((oldflags & MF_CLEAR_DTR) != (pMse->mouseFlags & MF_CLEAR_DTR)) - xf86ReplaceBoolOption(pInfo->options, "ClearDTR", - pMse->mouseFlags | MF_CLEAR_DTR); - if ((oldflags & MF_CLEAR_RTS) != (pMse->mouseFlags & MF_CLEAR_RTS)) - xf86ReplaceBoolOption(pInfo->options, "ClearRTS", - pMse->mouseFlags | MF_CLEAR_RTS); - } - return MISC_RET_BADVAL; -} - -_X_EXPORT Bool -MiscExtGetFilePaths(const char **configfile, const char **modulepath, - const char **logfile) -{ - *configfile = xf86ConfigFile; - *modulepath = xf86ModulePath; - *logfile = xf86LogFile; - - return TRUE; -} - -_X_EXPORT int -MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval, - char **retstr) -{ - ScrnInfoPtr pScr = xf86Screens[scrnIndex]; - - /* should check this in the protocol, but xf86NumScreens isn't exported */ - if (scrnIndex >= xf86NumScreens) - return BadValue; - - if (*pScr->HandleMessage == NULL) - return BadImplementation; - return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr); -} - -#endif /* XF86MISC */ - diff --git a/xorg-server/hw/xfree86/common/xf86Mode.c b/xorg-server/hw/xfree86/common/xf86Mode.c index c1b0a5fc9..24a431dc5 100644 --- a/xorg-server/hw/xfree86/common/xf86Mode.c +++ b/xorg-server/hw/xfree86/common/xf86Mode.c @@ -39,6 +39,7 @@ #endif #include <X11/X.h> +#include "xf86Modes.h" #include "os.h" #include "servermd.h" #include "mibank.h" @@ -705,16 +706,9 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor) * -- libv */ - /* Is the horizontal blanking a bit lowish? */ - if (((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) { - /* is this a cvt -r mode, and only a cvt -r mode? */ - if (((mode->HTotal - mode->HDisplay) == 160) && - ((mode->HSyncEnd - mode->HDisplay) == 80) && - ((mode->HSyncEnd - mode->HSyncStart) == 32) && - ((mode->VSyncStart - mode->VDisplay) == 3)) { - if (!monitor->reducedblanking && !(mode->type & M_T_DRIVER)) - return MODE_NO_REDUCED; - } + if (xf86ModeIsReduced(mode)) { + if (!monitor->reducedblanking && !(mode->type & M_T_DRIVER)) + return MODE_NO_REDUCED; } if ((monitor->maxPixClock) && (mode->Clock > monitor->maxPixClock)) diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index 5ce6e8a26..81011e163 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -42,7 +42,6 @@ #define _XF86MODULE_H #include "misc.h" -#include "xf86Version.h" #ifndef NULL #define NULL ((void *)0) #endif @@ -83,9 +82,9 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(4, 1) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(2, 1) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(1, 1) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(5, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(4, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(2, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 @@ -194,7 +193,6 @@ pointer LoadSubModuleLocal(pointer, const char *, const char **, const char **, pointer, const XF86ModReqInfo *, int *, int *); void UnloadSubModule(pointer); -void LoadFont(pointer); void UnloadModule (pointer); #endif pointer LoaderSymbol(const char *); @@ -209,6 +207,7 @@ void LoaderReqSymLists(const char **, ...); void LoaderReqSymbols(const char *, ...); int LoaderCheckUnresolved(int); void LoaderGetOS(const char **name, int *major, int *minor, int *teeny); +Bool LoaderShouldIgnoreABI(void); int LoaderGetABIVersion(const char *abiclass); typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); diff --git a/xorg-server/hw/xfree86/common/xf86Priv.h b/xorg-server/hw/xfree86/common/xf86Priv.h index c0d240dd5..41ca8f531 100644 --- a/xorg-server/hw/xfree86/common/xf86Priv.h +++ b/xorg-server/hw/xfree86/common/xf86Priv.h @@ -39,6 +39,7 @@ #include "xf86Privstr.h" #include "propertyst.h" +#include "input.h" /* * Parameters set ONLY from the command line options @@ -50,16 +51,12 @@ extern Bool xf86AllowMouseOpenFail; extern Bool xf86VidModeDisabled; extern Bool xf86VidModeAllowNonLocal; #endif -#ifdef XF86MISC -extern Bool xf86MiscModInDevDisabled; -extern Bool xf86MiscModInDevAllowNonLocal; -#endif extern Bool xf86fpFlag; -extern Bool xf86coFlag; extern Bool xf86sFlag; extern Bool xf86bsEnableFlag; extern Bool xf86bsDisableFlag; extern Bool xf86silkenMouseDisableFlag; +extern Bool xf86xkbdirFlag; extern Bool xf86acpiDisableFlag; extern char *xf86LayoutName; extern char *xf86ScreenName; @@ -73,10 +70,8 @@ extern int xf86Depth; extern Pix24Flags xf86Pix24; extern rgb xf86Weight; extern Bool xf86FlipPixels; -extern Bool xf86BestRefresh; extern Gamma xf86Gamma; extern char *xf86ServerName; -extern Bool xf86ShowUnresolved; extern struct pci_slot_match xf86IsolateDevice; /* Other parameters */ @@ -156,20 +151,19 @@ Bool xf86PathIsSafe(const char *path); extern const DisplayModeRec xf86DefaultModes[]; extern const int xf86NumDefaultModes; -/* xf86DoProbe.c */ -void DoProbe(void); +/* xf86Configure.c */ void DoConfigure(void); +/* xf86ShowOpts.c */ +void DoShowOptions(void); + /* xf86Events.c */ -void xf86PostKbdEvent(unsigned key); -void xf86PostMseEvent(DeviceIntPtr device, int buttons, int dx, int dy); void xf86Wakeup(pointer blockData, int err, pointer pReadmask); void xf86SigHandler(int signo); void xf86HandlePMEvents(int fd, pointer data); extern int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num); extern pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event); -void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer); /* xf86Helper.c */ void xf86LogInit(void); @@ -181,18 +175,8 @@ int xf86SetVerbosity(int verb); int xf86SetLogVerbosity(int verb); Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only ); -/* xf86Lock.c */ - -#ifdef USE_XF86_SERVERLOCK -void xf86UnlockServer(void); -#endif - -/* xf86XKB.c */ - -void xf86InitXkb(void); - /* xf86Xinput.c */ -extern xEvent *xf86Events; +extern EventList *xf86Events; #endif /* _NO_XF86_PROTOTYPES */ diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h index 8cab56ec8..6a7a6dc86 100644 --- a/xorg-server/hw/xfree86/common/xf86Privstr.h +++ b/xorg-server/hw/xfree86/common/xf86Privstr.h @@ -37,17 +37,6 @@ #include "xf86Pci.h" #include "xf86str.h" -/* PCI probe flags */ - -typedef enum { - PCIProbe1 = 0, - PCIProbe2, - PCIForceConfig1, - PCIForceConfig2, - PCIForceNone, - PCIOsConfig -} PciProbeType; - typedef enum { LogNone, LogFlush, @@ -78,16 +67,9 @@ typedef struct { Bool vtSysreq; SpecialKeysInDDX ddxSpecialKeys; - /* mouse part */ - DeviceIntPtr pMouse; -#ifdef XINPUT - pointer mouseLocal; -#endif - /* event handler part */ int lastEventTime; Bool vtRequestsPending; - Bool inputPending; Bool dontVTSwitch; Bool dontZap; Bool dontZoom; @@ -95,7 +77,6 @@ typedef struct { Bool caughtSignal; /* graphics part */ - Bool sharedMonitor; ScreenPtr currentScreen; #if defined(CSRG_BASED) || defined(__FreeBSD_kernel__) int screenFd; /* fd for memory mapped access to @@ -111,7 +92,6 @@ typedef struct { Bool miscModInDevEnabled; /* Allow input devices to be * changed */ Bool miscModInDevAllowNonLocal; - PciProbeType pciFlags; Pix24Flags pixmap24; MessageType pix24From; #ifdef __i386__ @@ -119,7 +99,6 @@ typedef struct { #endif Bool pmFlag; Log log; - int estimateSizesAggressively; Bool kbdCustomKeycodes; Bool disableRandR; MessageType randRFrom; @@ -131,18 +110,6 @@ typedef struct { Bool useDefaultFontPath; MessageType useDefaultFontPathFrom; Bool ignoreABI; - struct { - Bool disabled; /* enable/disable deactivating - * grabs or closing the - * connection to the grabbing - * client */ - ClientPtr override; /* client that disabled - * grab deactivation. - */ - Bool allowDeactivate; - Bool allowClosedown; - ServerGrabInfoRec server; - } grabInfo; Bool allowEmptyInput; /* Allow the server to start with no input * devices. */ diff --git a/xorg-server/hw/xfree86/common/xf86RAC.c b/xorg-server/hw/xfree86/common/xf86RAC.c new file mode 100644 index 000000000..24d29e445 --- /dev/null +++ b/xorg-server/hw/xfree86/common/xf86RAC.c @@ -0,0 +1,1171 @@ +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif + +#include "misc.h" +#include "xf86.h" +#include "xf86_OSproc.h" + +#include <X11/X.h> +#include "colormapst.h" +#include "scrnintstr.h" +#include "screenint.h" +#include "gcstruct.h" +#include "pixmapstr.h" +#include "pixmap.h" +#include "windowstr.h" +#include "window.h" +#include "xf86str.h" +#include "xf86RAC.h" +#include "mipointer.h" +#include "mipointrst.h" +#ifdef RENDER +# include "picturestr.h" +#endif + +#ifdef DEBUG +#define DPRINT_S(x,y) ErrorF(x ": %i\n",y); +#define DPRINT(x) ErrorF(x "\n"); +#else +#define DPRINT_S(x,y) +#define DPRINT(x) +#endif + +#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\ + pScreen->x = y;} +#define WRAP_SCREEN_COND(x,y,cond) \ + {pScreenPriv->x = pScreen->x;\ + if (flag & (cond))\ + pScreen->x = y;} +#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x + +#define SCREEN_PROLOG(x) pScreen->x = ((RACScreenPtr) \ + dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->x +#define SCREEN_EPILOG(x,y) pScreen->x = y; + +#define WRAP_PICT_COND(x,y,cond) if (ps)\ + {pScreenPriv->x = ps->x;\ + if (flag & (cond))\ + ps->x = y;} +#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;} + +#define PICTURE_PROLOGUE(field) ps->field = \ + ((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey))->field +#define PICTURE_EPILOGUE(field, wrap) \ + ps->field = wrap + +#define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\ + pScrn->x = y;} +#define WRAP_SCREEN_INFO_COND(x,y,cond) \ + {pScreenPriv->x = pScrn->x;\ + if (flag & (cond))\ + pScrn->x = y;} +#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x + +#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \ + (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); \ + RACScreenPtr pScreenPriv = \ + ((RACScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, RACScreenKey));\ + PointPriv->spriteFuncs = pScreenPriv->miSprite; +#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\ + PointPriv->spriteFuncs = &RACSpriteFuncs; +#define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\ + if(flag & (cond))\ + PointPriv->spriteFuncs = &RACSpriteFuncs;} +#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite + + +#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\ + pGCPriv->wrapFuncs = (x)->funcs;\ + (x)->ops = &RACGCOps;\ + (x)->funcs = &RACGCFuncs; +#define GC_UNWRAP(x)\ + RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&(x)->devPrivates, RACGCKey);\ + (x)->ops = pGCPriv->wrapOps;\ + (x)->funcs = pGCPriv->wrapFuncs; + +#define GC_SCREEN register ScrnInfoPtr pScrn \ + = xf86Screens[pGC->pScreen->myNum] + +#define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum]) +#define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum]) + +typedef struct _RACScreen { + CreateGCProcPtr CreateGC; + CloseScreenProcPtr CloseScreen; + GetImageProcPtr GetImage; + GetSpansProcPtr GetSpans; + SourceValidateProcPtr SourceValidate; + CopyWindowProcPtr CopyWindow; + ClearToBackgroundProcPtr ClearToBackground; + CreatePixmapProcPtr CreatePixmap; + SaveScreenProcPtr SaveScreen; + /* Colormap */ + StoreColorsProcPtr StoreColors; + /* Cursor */ + DisplayCursorProcPtr DisplayCursor; + RealizeCursorProcPtr RealizeCursor; + UnrealizeCursorProcPtr UnrealizeCursor; + RecolorCursorProcPtr RecolorCursor; + SetCursorPositionProcPtr SetCursorPosition; + void (*AdjustFrame)(int,int,int,int); + Bool (*SwitchMode)(int, DisplayModePtr,int); + Bool (*EnterVT)(int, int); + void (*LeaveVT)(int, int); + void (*FreeScreen)(int, int); + miPointerSpriteFuncPtr miSprite; +#ifdef RENDER + CompositeProcPtr Composite; + GlyphsProcPtr Glyphs; + CompositeRectsProcPtr CompositeRects; +#endif +} RACScreenRec, *RACScreenPtr; + +typedef struct _RACGC { + GCOps *wrapOps; + GCFuncs *wrapFuncs; +} RACGCRec, *RACGCPtr; + +/* Screen funcs */ +static Bool RACCloseScreen (int i, ScreenPtr pScreen); +static void RACGetImage (DrawablePtr pDrawable, int sx, int sy, + int w, int h, unsigned int format, + unsigned long planemask, char *pdstLine); +static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, + int *pwidth, int nspans, char *pdstStart); +static void RACSourceValidate (DrawablePtr pDrawable, + int x, int y, int width, int height ); +static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, + RegionPtr prgnSrc ); +static void RACClearToBackground (WindowPtr pWin, int x, int y, + int w, int h, Bool generateExposures ); +static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, + unsigned usage_hint); +static Bool RACCreateGC(GCPtr pGC); +static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank); +static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); +static void RACRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCurs, Bool displayed); +static Bool RACRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool RACSetCursorPosition (DeviceIntPtr pDev, ScreenPtr pScreen, + int x, int y, Bool generateEvent); +static void RACAdjustFrame(int index, int x, int y, int flags); +static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags); +static Bool RACEnterVT(int index, int flags); +static void RACLeaveVT(int index, int flags); +static void RACFreeScreen(int index, int flags); +/* GC funcs */ +static void RACValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); +static void RACChangeGC(GCPtr pGC, unsigned long mask); +static void RACCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); +static void RACDestroyGC(GCPtr pGC); +static void RACChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); +static void RACDestroyClip(GCPtr pGC); +static void RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc); +/* GC ops */ +static void RACFillSpans( DrawablePtr pDraw, GC *pGC, int nInit, + DDXPointPtr pptInit, int *pwidthInit, int fSorted ); +static void RACSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc, + register DDXPointPtr ppt, int *pwidth, int nspans, + int fSorted ); +static void RACPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, + int x, int y, int w, int h, int leftPad, + int format, char *pImage ); +static RegionPtr RACCopyArea(DrawablePtr pSrc, DrawablePtr pDst, + GC *pGC, int srcx, int srcy, + int width, int height, + int dstx, int dsty ); +static RegionPtr RACCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, + GCPtr pGC, int srcx, int srcy, + int width, int height, int dstx, int dsty, + unsigned long bitPlane ); +static void RACPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, + int npt, xPoint *pptInit ); +static void RACPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, + int npt, DDXPointPtr pptInit ); +static void RACPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, + xSegment *pSeg ); +static void RACPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit, + xRectangle *pRectsInit ); +static void RACPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, + xArc *parcs ); +static void RACFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode, + int count, DDXPointPtr ptsIn ); +static void RACPolyFillRect( DrawablePtr pDraw, GCPtr pGC, int nrectFill, + xRectangle *prectInit ); +static void RACPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs, + xArc *parcs ); +static int RACPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, + int count, char *chars ); +static int RACPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, + int count, unsigned short *chars ); +static void RACImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y, + int count, char *chars ); +static void RACImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, + int count, unsigned short *chars ); +static void RACImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, + int yInit, unsigned int nglyph, + CharInfoPtr *ppci, pointer pglyphBase ); +static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, + int yInit, unsigned int nglyph, + CharInfoPtr *ppci, pointer pglyphBase ); +static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, + int dx, int dy, int xOrg, int yOrg ); +/* miSpriteFuncs */ +static Bool RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCur); +static Bool RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCur); +static void RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCur, int x, int y); +static void RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + int x, int y); +#ifdef RENDER +static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, + PicturePtr pDst, INT16 xSrc, INT16 ySrc, + INT16 xMask, INT16 yMask, INT16 xDst, + INT16 yDst, CARD16 width, CARD16 height); +static void RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int nlist, GlyphListPtr list, GlyphPtr *glyphs); +static void RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, + int nRect, xRectangle *rects); +#endif + +static GCFuncs RACGCFuncs = { + RACValidateGC, RACChangeGC, RACCopyGC, RACDestroyGC, + RACChangeClip, RACDestroyClip, RACCopyClip +}; + +static GCOps RACGCOps = { + RACFillSpans, RACSetSpans, RACPutImage, RACCopyArea, + RACCopyPlane, RACPolyPoint, RACPolylines, RACPolySegment, + RACPolyRectangle, RACPolyArc, RACFillPolygon, RACPolyFillRect, + RACPolyFillArc, RACPolyText8, RACPolyText16, RACImageText8, + RACImageText16, RACImageGlyphBlt, RACPolyGlyphBlt, RACPushPixels, + {NULL} /* devPrivate */ +}; + +static miPointerSpriteFuncRec RACSpriteFuncs = { + RACSpriteRealizeCursor, RACSpriteUnrealizeCursor, RACSpriteSetCursor, + RACSpriteMoveCursor +}; + +static int RACScreenKeyIndex; +static DevPrivateKey RACScreenKey = &RACScreenKeyIndex; +static int RACGCKeyIndex; +static DevPrivateKey RACGCKey = &RACGCKeyIndex; + + +Bool +xf86RACInit(ScreenPtr pScreen, unsigned int flag) +{ + ScrnInfoPtr pScrn; + RACScreenPtr pScreenPriv; + miPointerScreenPtr PointPriv; +#ifdef RENDER + PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); +#endif + + pScrn = xf86Screens[pScreen->myNum]; + PointPriv = (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miPointerScreenKey); + DPRINT_S("RACInit",pScreen->myNum); + + if (!dixRequestPrivate(RACGCKey, sizeof(RACGCRec))) + return FALSE; + + if (!(pScreenPriv = xalloc(sizeof(RACScreenRec)))) + return FALSE; + + dixSetPrivate(&pScreen->devPrivates, RACScreenKey, pScreenPriv); + + WRAP_SCREEN(CloseScreen, RACCloseScreen); + WRAP_SCREEN(SaveScreen, RACSaveScreen); + WRAP_SCREEN_COND(CreateGC, RACCreateGC, RAC_FB); + WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB); + WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB); + WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB); + WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB); + WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB); + WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB); + WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP); + WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR); + WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR); + WRAP_SCREEN_COND(UnrealizeCursor, RACUnrealizeCursor, RAC_CURSOR); + WRAP_SCREEN_COND(RecolorCursor, RACRecolorCursor, RAC_CURSOR); + WRAP_SCREEN_COND(SetCursorPosition, RACSetCursorPosition, RAC_CURSOR); +#ifdef RENDER + WRAP_PICT_COND(Composite,RACComposite,RAC_FB); + WRAP_PICT_COND(Glyphs,RACGlyphs,RAC_FB); + WRAP_PICT_COND(CompositeRects,RACCompositeRects,RAC_FB); +#endif + WRAP_SCREEN_INFO_COND(AdjustFrame, RACAdjustFrame, RAC_VIEWPORT); + WRAP_SCREEN_INFO(SwitchMode, RACSwitchMode); + WRAP_SCREEN_INFO(EnterVT, RACEnterVT); + WRAP_SCREEN_INFO(LeaveVT, RACLeaveVT); + WRAP_SCREEN_INFO(FreeScreen, RACFreeScreen); + WRAP_SPRITE_COND(RAC_CURSOR); + + return TRUE; +} + +/* Screen funcs */ +static Bool +RACCloseScreen (int i, ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, miPointerScreenKey); +#ifdef RENDER + PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); +#endif + + DPRINT_S("RACCloseScreen",pScreen->myNum); + UNWRAP_SCREEN(CreateGC); + UNWRAP_SCREEN(CloseScreen); + UNWRAP_SCREEN(GetImage); + UNWRAP_SCREEN(GetSpans); + UNWRAP_SCREEN(SourceValidate); + UNWRAP_SCREEN(CopyWindow); + UNWRAP_SCREEN(ClearToBackground); + UNWRAP_SCREEN(SaveScreen); + UNWRAP_SCREEN(StoreColors); + UNWRAP_SCREEN(DisplayCursor); + UNWRAP_SCREEN(RealizeCursor); + UNWRAP_SCREEN(UnrealizeCursor); + UNWRAP_SCREEN(RecolorCursor); + UNWRAP_SCREEN(SetCursorPosition); +#ifdef RENDER + UNWRAP_PICT(Composite); + UNWRAP_PICT(Glyphs); + UNWRAP_PICT(CompositeRects); +#endif + UNWRAP_SCREEN_INFO(AdjustFrame); + UNWRAP_SCREEN_INFO(SwitchMode); + UNWRAP_SCREEN_INFO(EnterVT); + UNWRAP_SCREEN_INFO(LeaveVT); + UNWRAP_SCREEN_INFO(FreeScreen); + UNWRAP_SPRITE; + + xfree ((pointer) pScreenPriv); + + if (xf86Screens[pScreen->myNum]->vtSema) { + xf86EnterServerState(SETUP); + ENABLE; + } + return (*pScreen->CloseScreen) (i, pScreen); +} + +static void +RACGetImage ( + DrawablePtr pDrawable, + int sx, int sy, int w, int h, + unsigned int format, + unsigned long planemask, + char *pdstLine + ) +{ + ScreenPtr pScreen = pDrawable->pScreen; + DPRINT_S("RACGetImage",pScreen->myNum); + SCREEN_PROLOG(GetImage); + if (xf86Screens[pScreen->myNum]->vtSema) { + ENABLE; + } + (*pScreen->GetImage) (pDrawable, sx, sy, w, h, + format, planemask, pdstLine); + SCREEN_EPILOG (GetImage, RACGetImage); +} + +static void +RACGetSpans ( + DrawablePtr pDrawable, + int wMax, + DDXPointPtr ppt, + int *pwidth, + int nspans, + char *pdstStart + ) +{ + ScreenPtr pScreen = pDrawable->pScreen; + + DPRINT_S("RACGetSpans",pScreen->myNum); + SCREEN_PROLOG (GetSpans); + ENABLE; + (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); + SCREEN_EPILOG (GetSpans, RACGetSpans); +} + +static void +RACSourceValidate ( + DrawablePtr pDrawable, + int x, int y, int width, int height ) +{ + ScreenPtr pScreen = pDrawable->pScreen; + DPRINT_S("RACSourceValidate",pScreen->myNum); + SCREEN_PROLOG (SourceValidate); + ENABLE; + if (pScreen->SourceValidate) + (*pScreen->SourceValidate) (pDrawable, x, y, width, height); + SCREEN_EPILOG (SourceValidate, RACSourceValidate); +} + +static void +RACCopyWindow( + WindowPtr pWin, + DDXPointRec ptOldOrg, + RegionPtr prgnSrc ) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + DPRINT_S("RACCopyWindow",pScreen->myNum); + SCREEN_PROLOG (CopyWindow); + ENABLE; + (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); + SCREEN_EPILOG (CopyWindow, RACCopyWindow); +} + +static void +RACClearToBackground ( + WindowPtr pWin, + int x, int y, + int w, int h, + Bool generateExposures ) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + DPRINT_S("RACClearToBackground",pScreen->myNum); + SCREEN_PROLOG ( ClearToBackground); + ENABLE; + (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); + SCREEN_EPILOG (ClearToBackground, RACClearToBackground); +} + +static PixmapPtr +RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) +{ + PixmapPtr pPix; + + DPRINT_S("RACCreatePixmap",pScreen->myNum); + SCREEN_PROLOG ( CreatePixmap); + ENABLE; + pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); + SCREEN_EPILOG (CreatePixmap, RACCreatePixmap); + + return pPix; +} + +static Bool +RACSaveScreen(ScreenPtr pScreen, Bool unblank) +{ + Bool val; + + DPRINT_S("RACSaveScreen",pScreen->myNum); + SCREEN_PROLOG (SaveScreen); + ENABLE; + val = (*pScreen->SaveScreen) (pScreen, unblank); + SCREEN_EPILOG (SaveScreen, RACSaveScreen); + + return val; +} + +static void +RACStoreColors ( + ColormapPtr pmap, + int ndef, + xColorItem *pdefs) +{ + ScreenPtr pScreen = pmap->pScreen; + + DPRINT_S("RACStoreColors",pScreen->myNum); + SCREEN_PROLOG (StoreColors); + ENABLE; + (*pScreen->StoreColors) (pmap,ndef,pdefs); + + SCREEN_EPILOG ( StoreColors, RACStoreColors); +} + +static void +RACRecolorCursor ( + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCurs, + Bool displayed + ) +{ + DPRINT_S("RACRecolorCursor",pScreen->myNum); + SCREEN_PROLOG (RecolorCursor); + ENABLE; + (*pScreen->RecolorCursor) (pDev, pScreen,pCurs,displayed); + + SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor); +} + +static Bool +RACRealizeCursor ( + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor + ) +{ + Bool val; + + DPRINT_S("RACRealizeCursor",pScreen->myNum); + SCREEN_PROLOG (RealizeCursor); + ENABLE; + val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor); + + SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor); + return val; +} + +static Bool +RACUnrealizeCursor ( + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor + ) +{ + Bool val; + + DPRINT_S("RACUnrealizeCursor",pScreen->myNum); + SCREEN_PROLOG (UnrealizeCursor); + ENABLE; + val = (*pScreen->UnrealizeCursor) (pDev, pScreen,pCursor); + + SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor); + return val; +} + +static Bool +RACDisplayCursor ( + DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor + ) +{ + Bool val; + + DPRINT_S("RACDisplayCursor",pScreen->myNum); + SCREEN_PROLOG (DisplayCursor); + ENABLE; + val = (*pScreen->DisplayCursor) (pDev, pScreen,pCursor); + + SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor); + return val; +} + +static Bool +RACSetCursorPosition ( + DeviceIntPtr pDev, + ScreenPtr pScreen, + int x, int y, + Bool generateEvent) +{ + Bool val; + + DPRINT_S("RACSetCursorPosition",pScreen->myNum); + SCREEN_PROLOG (SetCursorPosition); + ENABLE; + val = (*pScreen->SetCursorPosition) (pDev, pScreen,x,y,generateEvent); + + SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition); + return val; +} + +static void +RACAdjustFrame(int index, int x, int y, int flags) +{ + ScreenPtr pScreen = screenInfo.screens[index]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + + DPRINT_S("RACAdjustFrame",index); + xf86EnableAccess(xf86Screens[index]); + + (*pScreenPriv->AdjustFrame)(index, x, y, flags); +} + +static Bool +RACSwitchMode(int index, DisplayModePtr mode, int flags) +{ + ScreenPtr pScreen = screenInfo.screens[index]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + + DPRINT_S("RACSwitchMode",index); + xf86EnableAccess(xf86Screens[index]); + + return (*pScreenPriv->SwitchMode)(index, mode, flags); +} + +static Bool +RACEnterVT(int index, int flags) +{ + ScreenPtr pScreen = screenInfo.screens[index]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + + DPRINT_S("RACEnterVT",index); + xf86EnableAccess(xf86Screens[index]); + + return (*pScreenPriv->EnterVT)(index, flags); +} + +static void +RACLeaveVT(int index, int flags) +{ + ScreenPtr pScreen = screenInfo.screens[index]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + + DPRINT_S("RACLeaveVT",index); + xf86EnableAccess(xf86Screens[index]); + + (*pScreenPriv->LeaveVT)(index, flags); +} + +static void +RACFreeScreen(int index, int flags) +{ + ScreenPtr pScreen = screenInfo.screens[index]; + RACScreenPtr pScreenPriv = (RACScreenPtr)dixLookupPrivate( + &pScreen->devPrivates, RACScreenKey); + + DPRINT_S("RACFreeScreen",index); + xf86EnableAccess(xf86Screens[index]); + + (*pScreenPriv->FreeScreen)(index, flags); +} + +static Bool +RACCreateGC(GCPtr pGC) +{ + ScreenPtr pScreen = pGC->pScreen; + RACGCPtr pGCPriv = (RACGCPtr)dixLookupPrivate(&pGC->devPrivates, RACGCKey); + Bool ret; + + DPRINT_S("RACCreateGC",pScreen->myNum); + SCREEN_PROLOG(CreateGC); + + ret = (*pScreen->CreateGC)(pGC); + + GC_WRAP(pGC); + SCREEN_EPILOG(CreateGC,RACCreateGC); + + return ret; +} + +/* GC funcs */ +static void +RACValidateGC( + GCPtr pGC, + unsigned long changes, + DrawablePtr pDraw ) +{ + GC_UNWRAP(pGC); + DPRINT("RACValidateGC"); + (*pGC->funcs->ValidateGC)(pGC, changes, pDraw); + GC_WRAP(pGC); +} + + +static void +RACDestroyGC(GCPtr pGC) +{ + GC_UNWRAP (pGC); + DPRINT("RACDestroyGC"); + (*pGC->funcs->DestroyGC)(pGC); + GC_WRAP (pGC); +} + +static void +RACChangeGC ( + GCPtr pGC, + unsigned long mask) +{ + GC_UNWRAP (pGC); + DPRINT("RACChangeGC"); + (*pGC->funcs->ChangeGC) (pGC, mask); + GC_WRAP (pGC); +} + +static void +RACCopyGC ( + GCPtr pGCSrc, + unsigned long mask, + GCPtr pGCDst) +{ + GC_UNWRAP (pGCDst); + DPRINT("RACCopyGC"); + (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); + GC_WRAP (pGCDst); +} + +static void +RACChangeClip ( + GCPtr pGC, + int type, + pointer pvalue, + int nrects ) +{ + GC_UNWRAP (pGC); + DPRINT("RACChangeClip"); + (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); + GC_WRAP (pGC); +} + +static void +RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc) +{ + GC_UNWRAP (pgcDst); + DPRINT("RACCopyClip"); + (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc); + GC_WRAP (pgcDst); +} + +static void +RACDestroyClip(GCPtr pGC) +{ + GC_UNWRAP (pGC); + DPRINT("RACDestroyClip"); + (* pGC->funcs->DestroyClip)(pGC); + GC_WRAP (pGC); +} + +/* GC Ops */ +static void +RACFillSpans( + DrawablePtr pDraw, + GC *pGC, + int nInit, + DDXPointPtr pptInit, + int *pwidthInit, + int fSorted ) +{ + GC_UNWRAP(pGC); + DPRINT("RACFillSpans"); + ENABLE_GC; + (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); + GC_WRAP(pGC); +} + +static void +RACSetSpans( + DrawablePtr pDraw, + GCPtr pGC, + char *pcharsrc, + register DDXPointPtr ppt, + int *pwidth, + int nspans, + int fSorted ) +{ + GC_UNWRAP(pGC); + DPRINT("RACSetSpans"); + ENABLE_GC; + (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); + GC_WRAP(pGC); +} + +static void +RACPutImage( + DrawablePtr pDraw, + GCPtr pGC, + int depth, + int x, int y, int w, int h, + int leftPad, + int format, + char *pImage ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPutImage"); + ENABLE_GC; + (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, + leftPad, format, pImage); + GC_WRAP(pGC); +} + +static RegionPtr +RACCopyArea( + DrawablePtr pSrc, + DrawablePtr pDst, + GC *pGC, + int srcx, int srcy, + int width, int height, + int dstx, int dsty ) +{ + RegionPtr ret; + + GC_UNWRAP(pGC); + DPRINT("RACCopyArea"); + ENABLE_GC; + ret = (*pGC->ops->CopyArea)(pSrc, pDst, + pGC, srcx, srcy, width, height, dstx, dsty); + GC_WRAP(pGC); + return ret; +} + +static RegionPtr +RACCopyPlane( + DrawablePtr pSrc, + DrawablePtr pDst, + GCPtr pGC, + int srcx, int srcy, + int width, int height, + int dstx, int dsty, + unsigned long bitPlane ) +{ + RegionPtr ret; + + GC_UNWRAP(pGC); + DPRINT("RACCopyPlane"); + ENABLE_GC; + ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy, + width, height, dstx, dsty, bitPlane); + GC_WRAP(pGC); + return ret; +} + +static void +RACPolyPoint( + DrawablePtr pDraw, + GCPtr pGC, + int mode, + int npt, + xPoint *pptInit ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyPoint"); + ENABLE_GC; + (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit); + GC_WRAP(pGC); +} + + +static void +RACPolylines( + DrawablePtr pDraw, + GCPtr pGC, + int mode, + int npt, + DDXPointPtr pptInit ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolylines"); + ENABLE_GC; + (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); + GC_WRAP(pGC); +} + +static void +RACPolySegment( + DrawablePtr pDraw, + GCPtr pGC, + int nseg, + xSegment *pSeg ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolySegment"); + ENABLE_GC; + (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg); + GC_WRAP(pGC); +} + +static void +RACPolyRectangle( + DrawablePtr pDraw, + GCPtr pGC, + int nRectsInit, + xRectangle *pRectsInit ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyRectangle"); + ENABLE_GC; + (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit); + GC_WRAP(pGC); +} + +static void +RACPolyArc( + DrawablePtr pDraw, + GCPtr pGC, + int narcs, + xArc *parcs ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyArc"); + ENABLE_GC; + (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs); + GC_WRAP(pGC); +} + +static void +RACFillPolygon( + DrawablePtr pDraw, + GCPtr pGC, + int shape, + int mode, + int count, + DDXPointPtr ptsIn ) +{ + GC_UNWRAP(pGC); + DPRINT("RACFillPolygon"); + ENABLE_GC; + (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn); + GC_WRAP(pGC); +} + + +static void +RACPolyFillRect( + DrawablePtr pDraw, + GCPtr pGC, + int nrectFill, + xRectangle *prectInit ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyFillRect"); + ENABLE_GC; + (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit); + GC_WRAP(pGC); +} + + +static void +RACPolyFillArc( + DrawablePtr pDraw, + GCPtr pGC, + int narcs, + xArc *parcs ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyFillArc"); + ENABLE_GC; + (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs); + GC_WRAP(pGC); +} + +static int +RACPolyText8( + DrawablePtr pDraw, + GCPtr pGC, + int x, + int y, + int count, + char *chars ) +{ + int ret; + + GC_UNWRAP(pGC); + DPRINT("RACPolyText8"); + ENABLE_GC; + ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars); + GC_WRAP(pGC); + return ret; +} + +static int +RACPolyText16( + DrawablePtr pDraw, + GCPtr pGC, + int x, + int y, + int count, + unsigned short *chars ) +{ + int ret; + + GC_UNWRAP(pGC); + DPRINT("RACPolyText16"); + ENABLE_GC; + ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars); + GC_WRAP(pGC); + return ret; +} + +static void +RACImageText8( + DrawablePtr pDraw, + GCPtr pGC, + int x, + int y, + int count, + char *chars ) +{ + GC_UNWRAP(pGC); + DPRINT("RACImageText8"); + ENABLE_GC; + (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars); + GC_WRAP(pGC); +} + +static void +RACImageText16( + DrawablePtr pDraw, + GCPtr pGC, + int x, + int y, + int count, + unsigned short *chars ) +{ + GC_UNWRAP(pGC); + DPRINT("RACImageText16"); + ENABLE_GC; + (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars); + GC_WRAP(pGC); +} + + +static void +RACImageGlyphBlt( + DrawablePtr pDraw, + GCPtr pGC, + int xInit, int yInit, + unsigned int nglyph, + CharInfoPtr *ppci, + pointer pglyphBase ) +{ + GC_UNWRAP(pGC); + DPRINT("RACImageGlyphBlt"); + ENABLE_GC; + (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, + nglyph, ppci, pglyphBase); + GC_WRAP(pGC); +} + +static void +RACPolyGlyphBlt( + DrawablePtr pDraw, + GCPtr pGC, + int xInit, int yInit, + unsigned int nglyph, + CharInfoPtr *ppci, + pointer pglyphBase ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPolyGlyphBlt"); + ENABLE_GC; + (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, + nglyph, ppci, pglyphBase); + GC_WRAP(pGC); +} + +static void +RACPushPixels( + GCPtr pGC, + PixmapPtr pBitMap, + DrawablePtr pDraw, + int dx, int dy, int xOrg, int yOrg ) +{ + GC_UNWRAP(pGC); + DPRINT("RACPushPixels"); + ENABLE_GC; + (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); + GC_WRAP(pGC); +} + + +/* miSpriteFuncs */ +static Bool +RACSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) +{ + Bool val; + SPRITE_PROLOG; + DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum); + ENABLE; + val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur); + SPRITE_EPILOG; + return val; +} + +static Bool +RACSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur) +{ + Bool val; + SPRITE_PROLOG; + DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum); + ENABLE; + val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur); + SPRITE_EPILOG; + return val; +} + +static void +RACSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCur, int x, int y) +{ + SPRITE_PROLOG; + DPRINT_S("RACSpriteSetCursor",pScreen->myNum); + ENABLE; + PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y); + SPRITE_EPILOG; +} + +static void +RACSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) +{ + SPRITE_PROLOG; + DPRINT_S("RACSpriteMoveCursor",pScreen->myNum); + ENABLE; + PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y); + SPRITE_EPILOG; +} + +#ifdef RENDER +static void +RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, + PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, + INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, + CARD16 height) +{ + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + + PICTURE_PROLOGUE(Composite); + + ENABLE; + (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, + yDst, width, height); + + PICTURE_EPILOGUE(Composite, RACComposite); +} + +static void +RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, + GlyphListPtr list, GlyphPtr *glyphs) +{ + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + + PICTURE_PROLOGUE(Glyphs); + + ENABLE; + (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); + + PICTURE_EPILOGUE (Glyphs, RACGlyphs); +} + +static void +RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect, + xRectangle *rects) +{ + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + + PICTURE_PROLOGUE(CompositeRects); + + ENABLE; + (*ps->CompositeRects)(op, pDst, color, nRect, rects); + + PICTURE_EPILOGUE (CompositeRects, RACCompositeRects); +} +#endif + diff --git a/xorg-server/hw/xfree86/common/xf86RAC.h b/xorg-server/hw/xfree86/common/xf86RAC.h new file mode 100644 index 000000000..366c21485 --- /dev/null +++ b/xorg-server/hw/xfree86/common/xf86RAC.h @@ -0,0 +1,17 @@ + +#ifndef __XF86RAC_H +#define __XF86RAC_H 1 + +#include "screenint.h" +#include "misc.h" +#include "xf86.h" + +Bool xf86RACInit(ScreenPtr pScreen, unsigned int flag); + +/* flags */ +#define RAC_FB 0x01 +#define RAC_CURSOR 0x02 +#define RAC_COLORMAP 0x04 +#define RAC_VIEWPORT 0x08 + +#endif /* __XF86RAC_H */ diff --git a/xorg-server/hw/xfree86/common/xf86RandR.c b/xorg-server/hw/xfree86/common/xf86RandR.c index a55b93d4c..de2f78c5f 100644 --- a/xorg-server/hw/xfree86/common/xf86RandR.c +++ b/xorg-server/hw/xfree86/common/xf86RandR.c @@ -34,6 +34,7 @@ #include "xf86DDC.h" #include "mipointer.h" #include <randrstr.h> +#include "inputstr.h" typedef struct _xf86RandRInfo { CreateScreenResourcesProcPtr CreateScreenResources; @@ -45,7 +46,8 @@ typedef struct _xf86RandRInfo { Rotation rotation; } XF86RandRInfoRec, *XF86RandRInfoPtr; -static DevPrivateKey xf86RandRKey = NULL; +static int xf86RandRKeyIndex; +static DevPrivateKey xf86RandRKey; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr)dixLookupPrivate(&(p)->devPrivates, xf86RandRKey)) @@ -72,7 +74,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) *rotations = RR_Rotate_0; - for (mode = scrp->modes; ; mode = mode->next) + for (mode = scrp->modes; mode != NULL ; mode = mode->next) { int refresh = xf86RandRModeRefresh (mode); @@ -244,7 +246,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; - miPointerPosition (&px, &py); + miPointerGetPosition(inputInfo.pointer, &px, &py); for (mode = scrp->modes; ; mode = mode->next) { if (mode->HDisplay == pSize->width && @@ -311,7 +313,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, xf86SetViewport(pScreen, px, py); - (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE); + (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE); } return TRUE; @@ -422,7 +424,7 @@ xf86RandRInit (ScreenPtr pScreen) return TRUE; #endif - xf86RandRKey = &xf86RandRKey; + xf86RandRKey = &xf86RandRKeyIndex; randrp = xalloc (sizeof (XF86RandRInfoRec)); if (!randrp) diff --git a/xorg-server/hw/xfree86/common/xf86ShowOpts.c b/xorg-server/hw/xfree86/common/xf86ShowOpts.c new file mode 100644 index 000000000..b8efa73c2 --- /dev/null +++ b/xorg-server/hw/xfree86/common/xf86ShowOpts.c @@ -0,0 +1,129 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86ShopwOpts.c,v 3.80 2003/10/08 14:58:27 dawes Exp $ */ +/* + * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Marcus Schaefer, ms@suse.de + * + */ + +#include <ctype.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <X11/X.h> +#include <X11/Xmd.h> +#include "os.h" +#ifdef XFree86LOADER +#include "loaderProcs.h" +#endif +#include "xf86.h" +#include "xf86Config.h" +#include "xf86_OSlib.h" +#include "xf86Priv.h" +/* #include "xf86PciData.h" */ +#define IN_XSERVER +#include "xf86Parser.h" +#include "xf86tokens.h" +#include "Configint.h" +#include "vbe.h" +#include "xf86DDC.h" +#if defined(__sparc__) && !defined(__OpenBSD__) +#include "xf86Bus.h" +#include "xf86Sbus.h" +#endif +#include "globals.h" + +static const char* +optionTypeToSting(OptionValueType type) +{ + switch (type) { + case OPTV_NONE: + return ""; + case OPTV_INTEGER: + return "<int>"; + case OPTV_STRING: + return "<str>"; + case OPTV_ANYSTR: + return "<str>"; + case OPTV_REAL: + return "<real>"; + case OPTV_BOOLEAN: + return "<bool>"; + case OPTV_FREQ: + return "<freq>"; + default: + return "<undef>"; + } +} + +void DoShowOptions (void) { + int i = 0; + char **vlist = 0; + char *pSymbol = 0; + XF86ModuleData *initData = 0; + if (! (vlist = xf86DriverlistFromCompile())) { + ErrorF("Missing output drivers\n"); + goto bail; + } + xf86LoadModules (vlist,0); + xfree (vlist); + for (i = 0; i < xf86NumDrivers; i++) { + if (xf86DriverList[i]->AvailableOptions) { + OptionInfoPtr pOption = (OptionInfoPtr)(*xf86DriverList[i]->AvailableOptions)(0,0); + if (! pOption) { + ErrorF ("(EE) Couldn't read option table for %s driver\n", + xf86DriverList[i]->driverName + ); + continue; + } + pSymbol = xalloc ( + strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1 + ); + strcpy (pSymbol, xf86DriverList[i]->driverName); + strcat (pSymbol, "ModuleData"); + initData = LoaderSymbol (pSymbol); + if (initData) { + XF86ModuleVersionInfo *vers = initData->vers; + ErrorF ("Driver[%d]:%s[%s] {\n", + i,xf86DriverList[i]->driverName,vers->vendor + ); + OptionInfoPtr p; + for (p = pOption; p->name != NULL; p++) { + const char *opttype = optionTypeToSting(p->type); + char *optname = xalloc(strlen(p->name) + 2 + 1); + if (!optname) { + continue; + } + sprintf(optname, "%s", p->name); + ErrorF ("\t%s:%s\n", optname,opttype); + } + ErrorF ("}\n"); + } + } + } + bail: + OsCleanup (TRUE); + AbortDDX (); + fflush (stderr); + exit (0); +} diff --git a/xorg-server/hw/xfree86/common/xf86Version.h b/xorg-server/hw/xfree86/common/xf86Version.h deleted file mode 100644 index b93ac7d23..000000000 --- a/xorg-server/hw/xfree86/common/xf86Version.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1994-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifndef XF86_VERSION_CURRENT - -#define XF86_VERSION_MAJOR 4 -#define XF86_VERSION_MINOR 3 -#define XF86_VERSION_PATCH 99 -#define XF86_VERSION_SNAP 902 - -/* This has five arguments for compatibilty reasons */ -#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \ - (((major) * 10000000) + ((minor) * 100000) + ((patch) * 1000) + snap) - -#define XF86_GET_MAJOR_VERSION(vers) ((vers) / 10000000) -#define XF86_GET_MINOR_VERSION(vers) (((vers) % 10000000) / 100000) -#define XF86_GET_PATCH_VERSION(vers) (((vers) % 100000) / 1000) -#define XF86_GET_SNAP_VERSION(vers) ((vers) % 1000) - -/* Define these for compatibility. They'll be removed at some point. */ -#define XF86_VERSION_SUBMINOR XF86_VERSION_PATCH -#define XF86_VERSION_BETA 0 -#define XF86_VERSION_ALPHA XF86_VERSION_SNAP - -#define XF86_VERSION_CURRENT \ - XF86_VERSION_NUMERIC(XF86_VERSION_MAJOR, \ - XF86_VERSION_MINOR, \ - XF86_VERSION_PATCH, \ - XF86_VERSION_SNAP, \ - 0) - -#endif diff --git a/xorg-server/hw/xfree86/common/xf86Versions.c b/xorg-server/hw/xfree86/common/xf86Versions.c deleted file mode 100644 index 97a35590e..000000000 --- a/xorg-server/hw/xfree86/common/xf86Versions.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "xf86.h" -#include "xf86OSmouse.h" - -static CARD32 registeredVersions[NUM_BUILTIN_IFS]; - -_X_EXPORT CARD32 -xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flags) -{ - if (iface < 0 || iface >= NUM_BUILTIN_IFS) { - xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: Unexpected interface" - "query: %d\n", iface); - return 0; - } - - if (registeredVersions[iface]) - return registeredVersions[iface]; - - /* Most built-in interfaces are handled this way. */ - switch (iface) { - case BUILTIN_IF_OSMOUSE: - return OS_MOUSE_VERSION_CURRENT; - default: - xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: internal error: " - "interface %d not handled\n", iface); - return 0; - } -} - -_X_EXPORT Bool -xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, CARD32 version, - int flags) -{ - if (iface < 0 || iface >= NUM_BUILTIN_IFS) { - xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: " - "unexpected interface number: %d\n", iface); - return FALSE; - } - if (version == 0) { - xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: " - "versions must be greater than zero\n"); - return FALSE; - } - registeredVersions[iface] = version; - return TRUE; -} - diff --git a/xorg-server/hw/xfree86/common/xf86VidMode.c b/xorg-server/hw/xfree86/common/xf86VidMode.c index 9260bb57b..24fccd31b 100644 --- a/xorg-server/hw/xfree86/common/xf86VidMode.c +++ b/xorg-server/hw/xfree86/common/xf86VidMode.c @@ -47,7 +47,8 @@ #include "vidmodeproc.h" #include "xf86cmap.h" -static DevPrivateKey VidModeKey = NULL; +static int VidModeKeyIndex; +static DevPrivateKey VidModeKey; static int VidModeCount = 0; static Bool VidModeClose(int i, ScreenPtr pScreen); @@ -72,7 +73,7 @@ VidModeExtensionInit(ScreenPtr pScreen) return FALSE; } - VidModeKey = &VidModeKey; + VidModeKey = &VidModeKeyIndex; if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey, xcalloc(sizeof(VidModeRec), 1))) { diff --git a/xorg-server/hw/xfree86/common/xf86XKB.c b/xorg-server/hw/xfree86/common/xf86XKB.c deleted file mode 100644 index 11694544a..000000000 --- a/xorg-server/hw/xfree86/common/xf86XKB.c +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************ -Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting -documentation, and that the name of Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ -/* - * Copyright (c) 1994-2002 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <stdio.h> -#define NEED_EVENTS 1 -#include <X11/X.h> -#include <X11/Xproto.h> -#include <X11/keysym.h> -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include <X11/extensions/XI.h> - -#include "compiler.h" - -#include "xf86.h" -#include "xf86Priv.h" -#define XF86_OS_PRIVS -#include "xf86_OSlib.h" - -#include <xkbsrv.h> - -void -xf86InitXkb(void) -{ -} diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c index 710e787fd..1f412349c 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.c +++ b/xorg-server/hw/xfree86/common/xf86Xinput.c @@ -52,19 +52,17 @@ #include <X11/Xfuncproto.h> #include <X11/Xmd.h> -#ifdef XINPUT #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#endif #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" -#ifdef XINPUT #include "XIstubs.h" #include "xf86Optrec.h" -#endif #include "mipointer.h" #include "xf86InPriv.h" +#include "compiler.h" +#include "extinit.h" #ifdef DPMSExtension #define DPMS_SERVER @@ -86,11 +84,157 @@ #include "mi.h" +#include <ptrveloc.h> /* dix pointer acceleration */ + #ifdef XFreeXDGA #include "dgaproc.h" #endif -xEvent *xf86Events = NULL; +#ifdef XKB +#include "xkbsrv.h" +#endif + +#include "os.h" + +EventListPtr xf86Events = NULL; + +/** + * Eval config and modify DeviceVelocityRec accordingly + */ +static void +ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){ + int tempi, i; + float tempf, tempf2; + + if(!s) + return; + + tempf = xf86SetRealOption(list, "FilterHalflife", -1); + if(tempf > 0) + tempf = 1.0 / tempf; /* set reciprocal if possible */ + + tempf2 = xf86SetRealOption(list, "FilterChainProgression", 2.0); + xf86Msg(X_CONFIG, "%s: (accel) filter chain progression: %.2f\n", + devname, tempf2); + if(tempf2 < 1) + tempf2 = 2; + + tempi = xf86SetIntOption(list, "FilterChainLength", 1); + if(tempi < 1 || tempi > MAX_VELOCITY_FILTERS) + tempi = 1; + + if(tempf > 0.0f && tempi >= 1 && tempf2 >= 1.0f) + InitFilterChain(s, tempf, tempf2, tempi, 40); + + for(i = 0; i < tempi; i++) + xf86Msg(X_CONFIG, "%s: (accel) filter stage %i: %.2f ms\n", + devname, i, 1.0f / (s->filters[i].rdecay)); + + tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0); + if(tempf > 1.0){ + xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n", + devname, tempf); + s->const_acceleration = 1.0 / tempf; /* set reciprocal deceleration + alias acceleration */ + } + + tempf = xf86SetRealOption(list, "AdaptiveDeceleration", 1.0); + if(tempf > 1.0){ + xf86Msg(X_CONFIG, "%s: (accel) adaptive deceleration by %.1f\n", + devname, tempf); + s->min_acceleration = 1.0 / tempf; /* set minimum acceleration */ + } + + tempf = xf86SetRealOption(list, "VelocityCoupling", -1); + if(tempf >= 0){ + xf86Msg(X_CONFIG, "%s: (accel) velocity coupling is %.1f%%\n", devname, + tempf*100.0); + s->coupling = tempf; + } + + /* Configure softening. If const deceleration is used, this is expected + * to provide better subpixel information so we enable + * softening by default only if ConstantDeceleration is not used + */ + s->use_softening = xf86SetBoolOption(list, "Softening", + s->const_acceleration == 1.0); + + s->average_accel = xf86SetBoolOption(list, "AccelerationProfileAveraging", + s->average_accel); + + s->reset_time = xf86SetIntOption(list, "VelocityReset", s->reset_time); + + tempf = xf86SetRealOption(list, "ExpectedRate", 0); + if(tempf > 0){ + s->corr_mul = 1000.0 / tempf; + }else{ + s->corr_mul = xf86SetRealOption(list, "VelocityScale", s->corr_mul); + } + + /* select profile by number */ + tempi= xf86SetIntOption(list, "AccelerationProfile", + s->statistics.profile_number); + + if(SetAccelerationProfile(s, tempi)){ + xf86Msg(X_CONFIG, "%s: (accel) set acceleration profile %i\n", devname, tempi); + }else{ + xf86Msg(X_CONFIG, "%s: (accel) acceleration profile %i is unknown\n", + devname, tempi); + } +} + +static void +ApplyAccelerationSettings(DeviceIntPtr dev){ + int scheme; + DeviceVelocityPtr pVel; + LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; + char* schemeStr; + + if(dev->valuator){ + schemeStr = xf86SetStrOption(local->options, "AccelerationScheme", ""); + + scheme = dev->valuator->accelScheme.number; + + if(!xf86NameCmp(schemeStr, "predictable")) + scheme = PtrAccelPredictable; + + if(!xf86NameCmp(schemeStr, "lightweight")) + scheme = PtrAccelLightweight; + + if(!xf86NameCmp(schemeStr, "none")) + scheme = PtrAccelNoOp; + + /* reinit scheme if needed */ + if(dev->valuator->accelScheme.number != scheme){ + if(dev->valuator->accelScheme.AccelCleanupProc){ + dev->valuator->accelScheme.AccelCleanupProc(dev); + } + + if(InitPointerAccelerationScheme(dev, scheme)){ + xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n", + local->name, schemeStr, scheme); + }else{ + xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n", + local->name, schemeStr); + scheme = dev->valuator->accelScheme.number; + } + }else{ + xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n", + local->name, scheme); + } + + xfree(schemeStr); + + /* process special configuration */ + switch(scheme){ + case PtrAccelPredictable: + pVel = GetDevicePredictableAccelData(dev); + ProcessVelocityConfiguration (local->name, local->options, + pVel); + break; + } + } +} static Bool xf86SendDragEvents(DeviceIntPtr device) @@ -135,7 +279,7 @@ xf86ProcessCommonOptions(LocalDevicePtr local, local->history_size = GetMotionHistorySize(); /* Preallocate xEvent store */ if (!xf86Events) - xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + GetEventList(&xf86Events); if (!xf86Events) FatalError("Couldn't allocate event store\n"); } @@ -143,22 +287,28 @@ xf86ProcessCommonOptions(LocalDevicePtr local, /*********************************************************************** * * xf86ActivateDevice -- - * + * * Initialize an input device. * + * Returns TRUE on success, or FALSE otherwise. *********************************************************************** */ -_X_EXPORT void +_X_EXPORT int xf86ActivateDevice(LocalDevicePtr local) { DeviceIntPtr dev; if (local->flags & XI86_CONFIGURED) { - dev = AddInputDevice(local->device_control, TRUE); + dev = AddInputDevice(serverClient, local->device_control, TRUE); if (dev == NULL) - FatalError("Too many input devices"); - + { + xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n", + local->name); + local->dev = NULL; + return FALSE; + } + local->atom = MakeAtom(local->type_name, strlen(local->type_name), TRUE); @@ -166,9 +316,21 @@ xf86ActivateDevice(LocalDevicePtr local) dev->public.devicePrivate = (pointer) local; local->dev = dev; - dev->coreEvents = local->flags & XI86_ALWAYS_CORE; - RegisterOtherDevice(dev); + dev->coreEvents = local->flags & XI86_ALWAYS_CORE; + dev->isMaster = FALSE; + dev->spriteInfo->spriteOwner = FALSE; + + if (DeviceIsPointerType(dev)) + { + dev->deviceGrab.ActivateGrab = ActivatePointerGrab; + dev->deviceGrab.DeactivateGrab = DeactivatePointerGrab; + } else + { + dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; + dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; + } + RegisterOtherDevice(dev); #ifdef XKB if (!noXkbExtension) XkbSetExtension(dev, ProcessKeyboardEvent); @@ -178,10 +340,11 @@ xf86ActivateDevice(LocalDevicePtr local) xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n", local->name, local->type_name); } + + return TRUE; } -#ifdef XINPUT /*********************************************************************** * * Caller: ProcXOpenDevice @@ -292,6 +455,7 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) if (!local->control_proc) { switch (control->control) { case DEVICE_CORE: + return BadMatch; case DEVICE_RESOLUTION: case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: @@ -310,16 +474,107 @@ void AddOtherInputDevices() { } -#endif -int -NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) +/** + * Create a new input device, activate and enable it. + * + * Possible return codes: + * BadName .. a bad driver name was supplied. + * BadImplementation ... The driver does not have a PreInit function. This + * is a driver bug. + * BadMatch .. device initialization failed. + * BadAlloc .. too many input devices + * + * @param idev The device, already set up with identifier, driver, and the + * options. + * @param pdev Pointer to the new device, if Success was reported. + * @param enable Enable the device after activating it. + * + * @return Success or an error code + */ +_X_INTERNAL int +xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) { - IDevRec *idev = NULL; InputDriverPtr drv = NULL; InputInfoPtr pInfo = NULL; - InputOption *option = NULL; DeviceIntPtr dev = NULL; + int rval; + + /* Memory leak for every attached device if we don't + * test if the module is already loaded first */ + drv = xf86LookupInputDriver(idev->driver); + if (!drv) + if (xf86LoadOneModule(idev->driver, NULL)) + drv = xf86LookupInputDriver(idev->driver); + if (!drv) { + xf86Msg(X_ERROR, "No input driver matching `%s'\n", idev->driver); + rval = BadName; + goto unwind; + } + + if (!drv->PreInit) { + xf86Msg(X_ERROR, + "Input driver `%s' has no PreInit function (ignoring)\n", + drv->driverName); + rval = BadImplementation; + goto unwind; + } + + pInfo = drv->PreInit(drv, idev, 0); + + if (!pInfo) { + xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier); + rval = BadMatch; + goto unwind; + } + else if (!(pInfo->flags & XI86_CONFIGURED)) { + xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", + idev->identifier); + rval = BadMatch; + goto unwind; + } + + if (!xf86ActivateDevice(pInfo)) + { + rval = BadAlloc; + goto unwind; + } + + dev = pInfo->dev; + rval = ActivateDevice(dev); + if (rval != Success) + { + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); + RemoveDevice(dev); + goto unwind; + } + + /* Enable it if it's properly initialised and we're currently in the VT */ + if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) + { + EnableDevice(dev); + /* send enter/leave event, update sprite window */ + CheckMotion(NULL, dev); + } + + *pdev = dev; + return Success; + +unwind: + if(pInfo) { + if(drv->UnInit) + drv->UnInit(drv, pInfo, 0); + else + xf86DeleteInput(pInfo, 0); + } + return rval; +} + +_X_EXPORT int +NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) +{ + IDevRec *idev = NULL; + InputOption *option = NULL; int rval = Success; int is_auto = 0; @@ -333,18 +588,6 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) rval = BadRequest; goto unwind; } - /* Memory leak for every attached device if we don't - * test if the module is already loaded first */ - drv = xf86LookupInputDriver(option->value); - if (!drv) - if (xf86LoadOneModule(option->value, NULL)) - drv = xf86LookupInputDriver(option->value); - if (!drv) { - xf86Msg(X_ERROR, "No input driver matching `%s'\n", - option->value); - rval = BadName; - goto unwind; - } idev->driver = xstrdup(option->value); if (!idev->driver) { rval = BadAlloc; @@ -382,12 +625,9 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) goto unwind; } - if (!drv->PreInit) { - xf86Msg(X_ERROR, - "Input driver `%s' has no PreInit function (ignoring)\n", - drv->driverName); - rval = BadImplementation; - goto unwind; + if (!idev->identifier) { + xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n"); + return BadMatch; } for (option = options; option; option = option->next) { @@ -399,40 +639,12 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) option->value = NULL; } - pInfo = drv->PreInit(drv, idev, 0); - - if (!pInfo) { - xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier); - rval = BadMatch; - goto unwind; - } - else if (!(pInfo->flags & XI86_CONFIGURED)) { - xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - idev->identifier); - rval = BadMatch; - goto unwind; - } - - xf86ActivateDevice(pInfo); - - dev = pInfo->dev; - ActivateDevice(dev); - /* Enable it if it's properly initialised, we're currently in the VT, and - * either it's a manual request, or we're automatically enabling devices. */ - if (dev->inited && dev->startup && xf86Screens[0]->vtSema && - (!is_auto || xf86Info.autoEnableDevices)) - EnableDevice(dev); - - *pdev = dev; - return Success; + rval = xf86NewInputDevice(idev, pdev, + (!is_auto || (is_auto && xf86Info.autoEnableDevices))); + if (rval == Success) + return Success; unwind: - if(pInfo) { - if(drv->UnInit) - drv->UnInit(drv, pInfo, 0); - else - xf86DeleteInput(pInfo, 0); - } if(idev->driver) xfree(idev->driver); if(idev->identifier) @@ -442,50 +654,51 @@ unwind: return rval; } -void +_X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr pDev) { LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; - InputDriverPtr drv; - IDevRec *idev; - BOOL found; + InputDriverPtr drv = NULL; + IDevRec *idev = NULL; IDevPtr *it; + Bool isMaster = pDev->isMaster; if (pInfo) /* need to get these before RemoveDevice */ { drv = pInfo->drv; idev = pInfo->conf_idev; } - RemoveDevice(pDev); - if (!pInfo) /* VCP and VCK */ - return; - - if(drv->UnInit) - drv->UnInit(drv, pInfo, 0); - else - xf86DeleteInput(pInfo, 0); - - /* devices added through HAL aren't in the config layout */ - it = xf86ConfigLayout.inputs; - while(*it && *it != idev) - it++; + OsBlockSignals(); + RemoveDevice(pDev); - if (!(*it)) /* end of list, not in the layout */ + if (!isMaster) { - xfree(idev->driver); - xfree(idev->identifier); - xf86optionListFree(idev->commonOptions); - xfree(idev); + if(drv->UnInit) + drv->UnInit(drv, pInfo, 0); + else + xf86DeleteInput(pInfo, 0); + + /* devices added through HAL aren't in the config layout */ + it = xf86ConfigLayout.inputs; + while(*it && *it != idev) + it++; + + if (!(*it)) /* end of list, not in the layout */ + { + xfree(idev->driver); + xfree(idev->identifier); + xf86optionListFree(idev->commonOptions); + xfree(idev); + } } + OsReleaseSignals(); } /* * convenient functions to post events */ -#define MAX_VALUATORS 36 /* XXX from comment in dix/getevents.c */ - _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, @@ -498,8 +711,8 @@ xf86PostMotionEvent(DeviceIntPtr device, static int valuators[MAX_VALUATORS]; if (num_valuators > MAX_VALUATORS) { - xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d" - " is greater than MAX_VALUATORS\n", num_valuators); + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); return; } @@ -519,15 +732,15 @@ xf86PostMotionEventP(DeviceIntPtr device, int *valuators) { int i = 0, nevents = 0; - int dx, dy; + int dx = 0, dy = 0; Bool drag = xf86SendDragEvents(device); xEvent *xE = NULL; int index; int flags = 0; if (num_valuators > MAX_VALUATORS) { - xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d" - " is greater than MAX_VALUATORS\n", num_valuators); + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); return; } @@ -537,36 +750,41 @@ xf86PostMotionEventP(DeviceIntPtr device, flags = POINTER_RELATIVE | POINTER_ACCELERATE; #if XFreeXDGA - if (first_valuator == 0 && num_valuators >= 2) { - if (miPointerGetScreen(inputInfo.pointer)) { - index = miPointerGetScreen(inputInfo.pointer)->myNum; - if (is_absolute) { - dx = valuators[0] - device->valuator->lastx; - dy = valuators[1] - device->valuator->lasty; - } - else { + /* The evdev driver may not always send all axes across. */ + if (num_valuators >= 1 && first_valuator <= 1) { + if (miPointerGetScreen(device)) { + index = miPointerGetScreen(device)->myNum; + if (first_valuator == 0) + { dx = valuators[0]; - dy = valuators[1]; + if (is_absolute) + dx -= device->last.valuators[0]; } - if (DGAStealMotionEvent(index, dx, dy)) + + if (first_valuator == 1 || num_valuators >= 2) + { + dy = valuators[1 - first_valuator]; + if (is_absolute) + dy -= device->last.valuators[1]; + } + + if (DGAStealMotionEvent(device, index, dx, dy)) return; } } #endif - if (!xf86Events) - FatalError("Didn't allocate event store\n"); - + GetEventList(&xf86Events); nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0, flags, first_valuator, num_valuators, valuators); for (i = 0; i < nevents; i++) { - xE = xf86Events + i; + xE = (xf86Events + i)->event; /* Don't post core motion events for devices not registered to send * drag events. */ if (xE->u.u.type != MotionNotify || drag) { - mieqEnqueue(device, xf86Events + i); + mieqEnqueue(device, (xf86Events + i)->event); } } } @@ -584,8 +802,8 @@ xf86PostProximityEvent(DeviceIntPtr device, if (num_valuators > MAX_VALUATORS) { - xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d" - " is greater than MAX_VALUATORS\n", num_valuators); + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); return; } @@ -594,14 +812,12 @@ xf86PostProximityEvent(DeviceIntPtr device, valuators[i] = va_arg(var, int); va_end(var); - if (!xf86Events) - FatalError("Didn't allocate event store\n"); - + GetEventList(&xf86Events); nevents = GetProximityEvents(xf86Events, device, is_in ? ProximityIn : ProximityOut, first_valuator, num_valuators, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(device, xf86Events + i); + mieqEnqueue(device, (xf86Events + i)->event); } @@ -620,34 +836,32 @@ xf86PostButtonEvent(DeviceIntPtr device, int index; #if XFreeXDGA - if (miPointerGetScreen(inputInfo.pointer)) { - index = miPointerGetScreen(inputInfo.pointer)->myNum; - if (DGAStealButtonEvent(index, button, is_down)) + if (miPointerGetScreen(device)) { + index = miPointerGetScreen(device)->myNum; + if (DGAStealButtonEvent(device, index, button, is_down)) return; } #endif if (num_valuators > MAX_VALUATORS) { - xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d" - " is greater than MAX_VALUATORS\n", num_valuators); + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); return; } - + va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuators[i] = va_arg(var, int); va_end(var); - if (!xf86Events) - FatalError("Didn't allocate event store\n"); - + GetEventList(&xf86Events); nevents = GetPointerEvents(xf86Events, device, is_down ? ButtonPress : ButtonRelease, button, - is_absolute ? POINTER_ABSOLUTE : - POINTER_RELATIVE, + (is_absolute) ? POINTER_ABSOLUTE : POINTER_RELATIVE, first_valuator, num_valuators, valuators); for (i = 0; i < nevents; i++) - mieqEnqueue(device, xf86Events + i); + mieqEnqueue(device, (xf86Events + i)->event); + } _X_EXPORT void @@ -669,20 +883,18 @@ xf86PostKeyEvent(DeviceIntPtr device, "broken.\n"); if (num_valuators > MAX_VALUATORS) { - xf86Msg(X_ERROR, "xf86PostMotionEvent: num_valuator %d" - " is greater than MAX_VALUATORS\n", num_valuators); + xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" + " MAX_VALUATORS\n", __FUNCTION__, num_valuators); return; } - if (!xf86Events) - FatalError("Didn't allocate event store\n"); - if (is_absolute) { va_start(var, num_valuators); for (i = 0; i < num_valuators; i++) valuators[i] = va_arg(var, int); va_end(var); + GetEventList(&xf86Events); nevents = GetKeyboardValuatorEvents(xf86Events, device, is_down ? KeyPress : KeyRelease, key_code, first_valuator, @@ -695,7 +907,7 @@ xf86PostKeyEvent(DeviceIntPtr device, } for (i = 0; i < nevents; i++) - mieqEnqueue(device, xf86Events + i); + mieqEnqueue(device, (xf86Events + i)->event); } _X_EXPORT void @@ -707,21 +919,24 @@ xf86PostKeyboardEvent(DeviceIntPtr device, int index; #if XFreeXDGA - if (miPointerGetScreen(inputInfo.pointer)) { - index = miPointerGetScreen(inputInfo.pointer)->myNum; - if (DGAStealKeyEvent(index, key_code, is_down)) + DeviceIntPtr pointer; + + /* Some pointers send key events, paired device is wrong then. */ + pointer = IsPointerDevice(device) ? device : GetPairedDevice(device); + + if (miPointerGetScreen(pointer)) { + index = miPointerGetScreen(pointer)->myNum; + if (DGAStealKeyEvent(device, index, key_code, is_down)) return; } #endif - if (!xf86Events) - FatalError("Didn't allocate event store\n"); - + GetEventList(&xf86Events); nevents = GetKeyboardEvents(xf86Events, device, is_down ? KeyPress : KeyRelease, key_code); for (i = 0; i < nevents; i++) - mieqEnqueue(device, xf86Events + i); + mieqEnqueue(device, (xf86Events + i)->event); } _X_EXPORT LocalDevicePtr @@ -763,10 +978,10 @@ xf86ScaleAxis(int Cx, ErrorF ("Divide by Zero in xf86ScaleAxis"); } - if (X > Sxlow) - X = Sxlow; - if (X < Sxhigh) + if (X > Sxhigh) X = Sxhigh; + if (X < Sxlow) + X = Sxlow; return (X); } @@ -810,12 +1025,15 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) { if (axnum == 0) { dev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; - dev->valuator->lastx = dev->valuator->axisVal[0]; + dev->last.valuators[0] = dev->valuator->axisVal[0]; } else if (axnum == 1) { dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; - dev->valuator->lasty = dev->valuator->axisVal[1]; + dev->last.valuators[1] = dev->valuator->axisVal[1]; } + + if(axnum == 0) /* to prevent double invocation */ + ApplyAccelerationSettings(dev); } diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h index d88bbbeee..2ca2073f9 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.h +++ b/xorg-server/hw/xfree86/common/xf86Xinput.h @@ -57,11 +57,9 @@ #endif #include "xf86str.h" #include "inputstr.h" -#ifdef XINPUT #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" -#endif /* Input device flags */ #define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */ @@ -89,7 +87,6 @@ #define TS_Raw 60 #define TS_Scaled 61 -#ifdef XINPUT /* This holds the input driver entry and module information. */ typedef struct _InputDriverRec { int driverVersion; @@ -103,7 +100,6 @@ typedef struct _InputDriverRec { pointer module; int refCount; } InputDriverRec, *InputDriverPtr; -#endif /* This is to input devices what the ScrnInfoRec is to screens. */ @@ -174,10 +170,7 @@ void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down, ...); void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); -void xf86XinputFinalizeInit(DeviceIntPtr dev); -void xf86ActivateDevice(LocalDevicePtr local); -Bool xf86CheckButton(int button, int down); -void xf86SwitchCoreDevice(LocalDevicePtr device, DeviceIntPtr core); +int xf86ActivateDevice(LocalDevicePtr local); LocalDevicePtr xf86FirstLocalDevice(void); int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow); void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y); @@ -190,6 +183,7 @@ void xf86AddEnabledDevice(InputInfoPtr pInfo); void xf86RemoveEnabledDevice(InputInfoPtr pInfo); void xf86DisableDevice(DeviceIntPtr dev, Bool panic); void xf86EnableDevice(DeviceIntPtr dev); +int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto); /* xf86Helper.c */ void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags); @@ -201,7 +195,7 @@ void xf86DeleteInput(InputInfoPtr pInp, int flags); void xf86MotionHistoryAllocate(LocalDevicePtr local); int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff, unsigned long start, unsigned long stop, - ScreenPtr pScreen); + ScreenPtr pScreen, BOOL core); /* xf86Option.c */ void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, diff --git a/xorg-server/hw/xfree86/common/xf86cmap.c b/xorg-server/hw/xfree86/common/xf86cmap.c index 764647ee4..e57844764 100644 --- a/xorg-server/hw/xfree86/common/xf86cmap.c +++ b/xorg-server/hw/xfree86/common/xf86cmap.c @@ -29,8 +29,7 @@ #include <xorg-config.h> #endif -#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) \ - || (defined(sun) && defined(__SVR4)) +#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) #include <math.h> #else #define _XOPEN_SOURCE /* to get prototype for pow on some systems */ @@ -102,8 +101,10 @@ typedef struct { int overscan; } CMapColormapRec, *CMapColormapPtr; -static DevPrivateKey CMapScreenKey = NULL; -static DevPrivateKey CMapColormapKey = &CMapColormapKey; +static int CMapScreenKeyIndex; +static DevPrivateKey CMapScreenKey; +static int CMapColormapKeyIndex; +static DevPrivateKey CMapColormapKey = &CMapColormapKeyIndex; static void CMapInstallColormap(ColormapPtr); static void CMapStoreColors(ColormapPtr, int, xColorItem *); @@ -143,7 +144,7 @@ _X_EXPORT Bool xf86HandleColormaps( if(!maxColors || !sigRGBbits || !loadPalette) return FALSE; - CMapScreenKey = &CMapScreenKey; + CMapScreenKey = &CMapScreenKeyIndex; elements = 1 << sigRGBbits; diff --git a/xorg-server/hw/xfree86/common/xf86fbman.c b/xorg-server/hw/xfree86/common/xf86fbman.c index 9fd2e6c70..5471c58f0 100644 --- a/xorg-server/hw/xfree86/common/xf86fbman.c +++ b/xorg-server/hw/xfree86/common/xf86fbman.c @@ -42,14 +42,15 @@ #define DEBUG */ -static DevPrivateKey xf86FBManagerKey = NULL; +static int xf86FBManagerKeyIndex; +static DevPrivateKey xf86FBManagerKey; _X_EXPORT Bool xf86RegisterOffscreenManager( ScreenPtr pScreen, FBManagerFuncsPtr funcs ){ - xf86FBManagerKey = &xf86FBManagerKey; + xf86FBManagerKey = &xf86FBManagerKeyIndex; dixSetPrivate(&pScreen->devPrivates, xf86FBManagerKey, funcs); return TRUE; @@ -269,7 +270,8 @@ xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen) \************************************************************/ -static DevPrivateKey xf86FBScreenKey = &xf86FBScreenKey; +static int xf86FBScreenKeyIndex; +static DevPrivateKey xf86FBScreenKey = &xf86FBScreenKeyIndex; typedef struct _FBLink { FBArea area; diff --git a/xorg-server/hw/xfree86/common/xf86isaBus.c b/xorg-server/hw/xfree86/common/xf86isaBus.c deleted file mode 100644 index 3abad38ef..000000000 --- a/xorg-server/hw/xfree86/common/xf86isaBus.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 1997-2000 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - - -/* - * This file contains the interfaces to the bus-specific code - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <ctype.h> -#include <stdlib.h> -#include <unistd.h> -#include <X11/X.h> -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Resources.h" - -#include "xf86Bus.h" - -#define XF86_OS_PRIVS -#define NEED_OS_RAC_PROTOS -#include "xf86_OSproc.h" - -#include "xf86RAC.h" - -Bool isaSlotClaimed = FALSE; - -/* - * If the slot requested is already in use, return FALSE. - * Otherwise, claim the slot for the screen requesting it. - */ - -_X_EXPORT int -xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) -{ - EntityPtr p; - BusAccPtr pbap = xf86BusAccInfo; - int num; - - num = xf86AllocateEntity(); - p = xf86Entities[num]; - p->driver = drvp; - p->chipset = chipset; - p->busType = BUS_ISA; - p->active = active; - p->inUse = FALSE; - xf86AddDevToEntity(num, dev); - p->access = xnfcalloc(1,sizeof(EntityAccessRec)); - p->access->fallback = &AccessNULL; - p->access->pAccess = &AccessNULL; - p->busAcc = NULL; - while (pbap) { - if (pbap->type == BUS_ISA) - p->busAcc = pbap; - pbap = pbap->next; - } - isaSlotClaimed = TRUE; - return num; -} - -/* - * Get the list of ISA "slots" claimed by a screen - * - * Note: The ISA implementation here assumes that only one ISA "slot" type - * can be claimed by any one screen. That means a return value other than - * 0 or 1 isn't useful. - */ -int -xf86GetIsaInfoForScreen(int scrnIndex) -{ - int num = 0; - int i; - EntityPtr p; - - for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) { - p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]]; - if (p->busType == BUS_ISA) { - num++; - } - } - return num; -} - -/* - * Parse a BUS ID string, and return True if it is a ISA bus id. - */ - -_X_EXPORT Bool -xf86ParseIsaBusString(const char *busID) -{ - /* - * The format assumed to be "isa" or "isa:" - */ - return (StringToBusType(busID,NULL) == BUS_ISA); -} - - -/* - * xf86IsPrimaryIsa() -- return TRUE if primary device - * is ISA. - */ - -_X_EXPORT Bool -xf86IsPrimaryIsa(void) -{ - return ( primaryBus.type == BUS_ISA ); -} - -void -isaConvertRange2Host(resRange *pRange) -{ - return; -} diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.c b/xorg-server/hw/xfree86/common/xf86pciBus.c index d5ae75b3a..5b29a1511 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.c +++ b/xorg-server/hw/xfree86/common/xf86pciBus.c @@ -417,18 +417,16 @@ xf86PciProbe(void) if (xf86IsPrimaryPci(info)) prim = "*"; - xf86Msg( X_PROBED, "PCI:%s(%u@%u:%u:%u) ", prim, info->domain, - info->bus, info->dev, info->func ); + xf86Msg(X_PROBED, "PCI:%s(%u:%u:%u:%u) %04x:%04x:%04x:%04x ", prim, + info->domain, info->bus, info->dev, info->func, + info->vendor_id, info->device_id, + info->subvendor_id, info->subdevice_id); if (vendorname) xf86ErrorF("%s ", vendorname); - else - xf86ErrorF("unknown vendor (0x%04x) ", info->vendor_id); if (chipname) xf86ErrorF("%s ", chipname); - else - xf86ErrorF("unknown chipset (0x%04x) ", info->device_id); xf86ErrorF("rev %d", info->revision); @@ -441,7 +439,7 @@ xf86PciProbe(void) memdone = TRUE; } else xf86ErrorF(", "); - xf86ErrorF("0x%08lx/%ld", r->base_addr, r->size); + xf86ErrorF("0x%08lx/%ld", (long)r->base_addr, (long)r->size); } } @@ -454,12 +452,12 @@ xf86PciProbe(void) iodone = TRUE; } else xf86ErrorF(", "); - xf86ErrorF("0x%08lx/%ld", r->base_addr, r->size); + xf86ErrorF("0x%08lx/%ld", (long)r->base_addr, (long)r->size); } } if ( info->rom_size ) { - xf86ErrorF(", BIOS @ 0x\?\?\?\?\?\?\?\?/%ld", info->rom_size); + xf86ErrorF(", BIOS @ 0x\?\?\?\?\?\?\?\?/%ld", (long)info->rom_size); } xf86ErrorF("\n"); @@ -564,11 +562,6 @@ initPciBusState(void) pbap->disable_f = pciBusAccessDisable; savePciBusState(pbap); break; - case PCI_SUBCLASS_BRIDGE_ISA: - case PCI_SUBCLASS_BRIDGE_EISA: - case PCI_SUBCLASS_BRIDGE_MC: - pbap->type = BUS_ISA; - break; } pbap->next = xf86BusAccInfo; xf86BusAccInfo = pbap; diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.h b/xorg-server/hw/xfree86/common/xf86pciBus.h index 7d08502fc..1cbfa38ea 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.h +++ b/xorg-server/hw/xfree86/common/xf86pciBus.h @@ -70,6 +70,5 @@ void PciBusStateEnter(void); void PciStateLeave(void); void PciBusStateLeave(void); void pciConvertRange2Host(int entityIndex, resRange *pRange); -void isaConvertRange2Host(resRange *pRange); #endif /* _XF86_PCI_BUS_H */ diff --git a/xorg-server/hw/xfree86/common/xf86sbusBus.c b/xorg-server/hw/xfree86/common/xf86sbusBus.c index 63d1cb31c..af2b14539 100644 --- a/xorg-server/hw/xfree86/common/xf86sbusBus.c +++ b/xorg-server/hw/xfree86/common/xf86sbusBus.c @@ -602,7 +602,8 @@ xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp) pScrn->virtualY = psdp->height; } -static DevPrivateKey sbusPaletteKey = &sbusPaletteKey; +static sbusPaletteKeyIndex; +static DevPrivateKey sbusPaletteKey = &sbusPaletteKeyIndex; typedef struct _sbusCmap { sbusDevicePtr psdp; CloseScreenProcPtr CloseScreen; diff --git a/xorg-server/hw/xfree86/common/xf86sbusBus.h b/xorg-server/hw/xfree86/common/xf86sbusBus.h index 8576409d4..6161a08e2 100644 --- a/xorg-server/hw/xfree86/common/xf86sbusBus.h +++ b/xorg-server/hw/xfree86/common/xf86sbusBus.h @@ -60,6 +60,7 @@ extern struct sbus_devtable { int devId; int fbType; char *promName; + char *driverName; char *descr; } sbusDeviceTable[]; @@ -93,5 +94,6 @@ int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop); void sparcPromAssignNodes(void); char * sparcPromNode2Pathname(sbusPromNodePtr pnode); int sparcPromPathname2Node(const char *pathName); +char *sparcDriverName(void); #endif /* _XF86_SBUSBUS_H */ diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h index fc94284cb..904c369a6 100644 --- a/xorg-server/hw/xfree86/common/xf86str.h +++ b/xorg-server/hw/xfree86/common/xf86str.h @@ -383,17 +383,12 @@ typedef enum { struct pci_device; typedef struct { - unsigned int dummy; -} IsaBusId; - -typedef struct { int fbNum; } SbusBusId; typedef struct _bus { BusType type; union { - IsaBusId isa; struct pci_device *pci; SbusBusId sbus; } id; @@ -436,8 +431,6 @@ typedef struct { int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; -typedef int (*FindIsaDevProc)(GDevPtr dev); - typedef struct { char * identifier; char * driver; @@ -623,9 +616,6 @@ typedef struct _CurrAccRec { #define ResMem 0x0001 #define ResIo 0x0002 -#define ResIrq 0x0003 -#define ResDma 0x0004 -#define ResPciCfg 0x000e /* PCI Configuration space */ #define ResPhysMask 0x000F #define ResExclusive 0x0010 @@ -648,7 +638,6 @@ typedef struct _CurrAccRec { #define ResMiscMask 0x00F000 #define ResBus 0x010000 -#define ResOverlap 0x020000 #if defined(__alpha__) && defined(linux) # define ResDomain 0x1ff000000ul @@ -687,7 +676,6 @@ typedef struct _CurrAccRec { #define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock) #define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse) #define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated) -#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap)) typedef struct { unsigned long type; /* shared, exclusive, unused etc. */ @@ -722,11 +710,6 @@ typedef struct _resRec { #define block_end val.rEnd #define res_type val.type -typedef struct { - int numChipset; - resRange *resList; -} IsaChipsets; - typedef struct _PciChipsets { /** * Key used to match this device with its name in an array of @@ -851,7 +834,6 @@ typedef int xf86SetDGAModeProc (int, int, DGADevicePtr); typedef int xf86ChangeGammaProc (int, Gamma); typedef void xf86PointerMovedProc (int, int, int); typedef Bool xf86PMEventProc (int, pmEvent, Bool); -typedef int xf86HandleMessageProc (int, const char*, const char*, char**); typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int); typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr); typedef void xf86SetOverscanProc (ScrnInfoPtr, int); @@ -1006,7 +988,6 @@ typedef struct _ScrnInfoRec { xf86ChangeGammaProc *ChangeGamma; xf86PointerMovedProc *PointerMoved; xf86PMEventProc *PMEvent; - xf86HandleMessageProc *HandleMessage; xf86DPMSSetProc *DPMSSet; xf86LoadPaletteProc *LoadPalette; xf86SetOverscanProc *SetOverscan; @@ -1090,14 +1071,6 @@ typedef void (*InputHandlerProc)(int fd, pointer data); #define CLK_REG_SAVE -1 #define CLK_REG_RESTORE -2 -/* xf86Debug.c */ -#ifdef BUILDDEBUG -typedef struct { - long sec; - long usec; -} xf86TsRec, *xf86TsPtr; -#endif - /* * misc constants */ @@ -1111,13 +1084,6 @@ typedef struct { #define OVERLAY_8_16_DUALFB 0x00000004 #define OVERLAY_8_32_PLANAR 0x00000008 -#if 0 -#define LD_RESOLV_IFDONE 0 /* only check if no more - delays pending */ -#define LD_RESOLV_NOW 1 /* finish one delay step */ -#define LD_RESOLV_FORCE 2 /* force checking... */ -#endif - /* Values of xf86Info.mouseFlags */ #define MF_CLEAR_DTR 1 #define MF_CLEAR_RTS 2 @@ -1127,36 +1093,9 @@ typedef enum { ACTION_TERMINATE = 0, /* Terminate Server */ ACTION_NEXT_MODE = 10, /* Switch to next video mode */ ACTION_PREV_MODE, - ACTION_DISABLEGRAB = 20, /* Cancel server/pointer/kbd grabs */ - ACTION_CLOSECLIENT, /* Kill client holding grab */ ACTION_SWITCHSCREEN = 100, /* VT switch */ ACTION_SWITCHSCREEN_NEXT, ACTION_SWITCHSCREEN_PREV, - ACTION_MESSAGE = 9999 /* Generic message passing */ } ActionEvent; -/* xf86Versions.c */ -/* - * Never change existing values, and always assign values explicitly. - * NUM_BUILTIN_IFS must always be the last entry. - */ -typedef enum { - BUILTIN_IF_OSMOUSE = 0, - BUILTIN_IF_OSKBD = 1, - NUM_BUILTIN_IFS -} BuiltinInterface; - -/* - * These are intentionally the same as the module version macros. - * It is possible to register a module as providing a specific interface, - * in which case the module's version is used. This feature isn't - * really ready for use yet though. - */ - -#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \ - ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF)) -#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF) -#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF) -#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF) - #endif /* _XF86STR_H */ diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index 7483e20d2..02d6e37a4 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -110,8 +110,10 @@ static void xf86XVAdjustFrame(int index, int x, int y, int flags); static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int); -static DevPrivateKey XF86XVWindowKey = &XF86XVWindowKey; -DevPrivateKey XF86XvScreenKey; +static int XF86XVWindowKeyIndex; +static DevPrivateKey XF86XVWindowKey = &XF86XVWindowKeyIndex; +static int XF86XvScreenKeyIndex; +DevPrivateKey XF86XvScreenKey = &XF86XvScreenKeyIndex; static unsigned long PortResource = 0; DevPrivateKey (*XvGetScreenKeyProc)(void) = NULL; @@ -962,9 +964,8 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) } if(!winPriv) { - winPriv = xalloc(sizeof(XF86XVWindowRec)); + winPriv = xcalloc(1, sizeof(XF86XVWindowRec)); if(!winPriv) return BadAlloc; - memset(winPriv, 0, sizeof(XF86XVWindowRec)); winPriv->PortRec = portPriv; winPriv->next = PrivRoot; dixSetPrivate(&pWin->devPrivates, XF86XVWindowKey, winPriv); @@ -1173,7 +1174,7 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) int c; /* Clear offscreen images */ - (void)memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0])); + memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0])); if(!ScreenPriv) return TRUE; diff --git a/xorg-server/hw/xfree86/common/xf86xvmc.c b/xorg-server/hw/xfree86/common/xf86xvmc.c index 05267a240..41ef0a0ca 100644 --- a/xorg-server/hw/xfree86/common/xf86xvmc.c +++ b/xorg-server/hw/xfree86/common/xf86xvmc.c @@ -56,7 +56,8 @@ typedef struct { XvMCAdaptorPtr dixinfo; } xf86XvMCScreenRec, *xf86XvMCScreenPtr; -static DevPrivateKey XF86XvMCScreenKey = &XF86XvMCScreenKey; +static int XF86XvMCScreenKeyIndex; +static DevPrivateKey XF86XvMCScreenKey = &XF86XvMCScreenKeyIndex; #define XF86XVMC_GET_PRIVATE(pScreen) (xf86XvMCScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, XF86XvMCScreenKey) diff --git a/xorg-server/hw/xfree86/common/xisb.c b/xorg-server/hw/xfree86/common/xisb.c index d021ec15b..6314094a0 100644 --- a/xorg-server/hw/xfree86/common/xisb.c +++ b/xorg-server/hw/xfree86/common/xisb.c @@ -41,7 +41,6 @@ #include <misc.h> #include <xf86.h> -#include <xf86Version.h> #include <xf86_OSproc.h> #include <xf86_OSlib.h> #include <xf86Xinput.h> |