diff options
Diffstat (limited to 'xorg-server/hw/xfree86/dixmods/extmod')
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/Makefile.am | 10 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/Makefile.in | 100 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/dgaproc.h | 7 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/modinit.c | 81 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/modinit.h | 64 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86dga.c | 309 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c | 369 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86misc.c | 821 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86miscproc.h | 69 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c | 40 |
10 files changed, 386 insertions, 1484 deletions
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am b/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am index f90e144ea..dd4ccd633 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am +++ b/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am @@ -4,26 +4,19 @@ extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = libextmod.la if DGA -DGA_SRCS = xf86dga.c xf86dga2.c dgaproc.h xf86dgaext.h +DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h endif if XV XV_SRCS = xvmod.c xvmodproc.h endif -if XF86MISC -XF86MISC_SRCS = xf86misc.c xf86miscproc.h -endif - if XF86VIDMODE XF86VMODE_SRCS = xf86vmode.c vidmodeproc.h endif AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/afb \ - -I$(top_srcdir)/mfb \ - -I$(top_srcdir)/cfb \ -I$(top_srcdir)/dbe \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow @@ -32,7 +25,6 @@ libextmod_la_LDFLAGS = -avoid-version libextmod_la_SOURCES = modinit.c \ modinit.h \ $(DGA_SRCS) \ - $(XF86MISC_SRCS) \ $(XF86VMODE_SRCS) \ $(XV_SRCS) libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la diff --git a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.in b/xorg-server/hw/xfree86/dixmods/extmod/Makefile.in index 157358c47..d4ead8762 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.in +++ b/xorg-server/hw/xfree86/dixmods/extmod/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, @@ -45,7 +45,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 \ @@ -61,15 +60,14 @@ am__installdirs = "$(DESTDIR)$(extsmoduledir)" "$(DESTDIR)$(sdkdir)" extsmoduleLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(extsmodule_LTLIBRARIES) libextmod_la_DEPENDENCIES = $(top_builddir)/Xext/libXextmodule.la -am__libextmod_la_SOURCES_DIST = modinit.c modinit.h xf86dga.c \ - xf86dga2.c dgaproc.h xf86dgaext.h xf86misc.c xf86miscproc.h \ - xf86vmode.c vidmodeproc.h xvmod.c xvmodproc.h -@DGA_TRUE@am__objects_1 = xf86dga.lo xf86dga2.lo -@XF86MISC_TRUE@am__objects_2 = xf86misc.lo -@XF86VIDMODE_TRUE@am__objects_3 = xf86vmode.lo -@XV_TRUE@am__objects_4 = xvmod.lo +am__libextmod_la_SOURCES_DIST = modinit.c modinit.h xf86dga2.c \ + dgaproc.h xf86dgaext.h xf86vmode.c vidmodeproc.h xvmod.c \ + xvmodproc.h +@DGA_TRUE@am__objects_1 = xf86dga2.lo +@XF86VIDMODE_TRUE@am__objects_2 = xf86vmode.lo +@XV_TRUE@am__objects_3 = xvmod.lo am_libextmod_la_OBJECTS = modinit.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) $(am__objects_4) + $(am__objects_3) libextmod_la_OBJECTS = $(am_libextmod_la_OBJECTS) libextmod_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -79,9 +77,6 @@ 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) \ @@ -98,8 +93,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@ @@ -120,10 +116,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@ @@ -145,6 +137,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@ @@ -154,18 +147,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@ @@ -184,7 +174,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@ @@ -198,7 +188,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@ @@ -210,8 +203,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@ @@ -220,8 +212,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@ @@ -254,7 +246,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@ @@ -264,27 +255,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@ @@ -295,10 +271,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@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -307,13 +279,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@ @@ -346,8 +313,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@ @@ -367,7 +333,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@ @@ -377,12 +342,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@ @@ -400,20 +365,14 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ sdk_HEADERS = dgaproc.h extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = libextmod.la -@DGA_TRUE@DGA_SRCS = xf86dga.c xf86dga2.c dgaproc.h xf86dgaext.h +@DGA_TRUE@DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h @XV_TRUE@XV_SRCS = xvmod.c xvmodproc.h -@XF86MISC_TRUE@XF86MISC_SRCS = xf86misc.c xf86miscproc.h @XF86VIDMODE_TRUE@XF86VMODE_SRCS = xf86vmode.c vidmodeproc.h AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/afb \ - -I$(top_srcdir)/mfb \ - -I$(top_srcdir)/cfb \ -I$(top_srcdir)/dbe \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow @@ -422,7 +381,6 @@ libextmod_la_LDFLAGS = -avoid-version libextmod_la_SOURCES = modinit.c \ modinit.h \ $(DGA_SRCS) \ - $(XF86MISC_SRCS) \ $(XF86VMODE_SRCS) \ $(XV_SRCS) @@ -435,8 +393,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; \ @@ -497,9 +455,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modinit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86dga.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86dga2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86vmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvmod.Plo@am__quote@ @@ -552,7 +508,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/dixmods/extmod/dgaproc.h b/xorg-server/hw/xfree86/dixmods/extmod/dgaproc.h index aaea4e20c..f4d3fe45b 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/dgaproc.h +++ b/xorg-server/hw/xfree86/dixmods/extmod/dgaproc.h @@ -120,9 +120,10 @@ int DGAGetOldDGAMode(int Index); int DGAGetModeInfo(int Index, XDGAModePtr mode, int num); Bool DGAVTSwitch(void); -Bool DGAStealButtonEvent(int Index, int button, int is_down); -Bool DGAStealMotionEvent(int Index, int dx, int dy); -Bool DGAStealKeyEvent(int Index, int key_code, int is_down); +Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index, int button, + int is_down); +Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy); +Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index, int key_code, int is_down); Bool DGAIsDgaEvent (xEvent *e); Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e); diff --git a/xorg-server/hw/xfree86/dixmods/extmod/modinit.c b/xorg-server/hw/xfree86/dixmods/extmod/modinit.c index 8c8a4ceeb..9bcf51f00 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/modinit.c +++ b/xorg-server/hw/xfree86/dixmods/extmod/modinit.c @@ -47,15 +47,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef SHAPE - { - ShapeExtensionInit, - SHAPENAME, - &noShapeExtension, - NULL, - NULL - }, -#endif #ifdef MULTIBUFFER { MultibufferExtensionInit, @@ -65,15 +56,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef MITMISC - { - MITMiscExtensionInit, - MITMISCNAME, - &noMITMiscExtension, - NULL, - NULL - }, -#endif #ifdef notyet { XTestExtensionInit, @@ -83,24 +65,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef BIGREQS - { - BigReqExtensionInit, - XBigReqExtensionName, - &noBigReqExtension, - NULL, - NULL - }, -#endif -#ifdef XSYNC - { - SyncExtensionInit, - SYNC_NAME, - &noSyncExtension, - NULL, - NULL - }, -#endif #ifdef SCREENSAVER { ScreenSaverExtensionInit, @@ -110,15 +74,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef XCMISC - { - XCMiscExtensionInit, - XCMiscExtensionName, - &noXCMiscExtension, - NULL, - NULL - }, -#endif #ifdef XF86VIDMODE { XFree86VidModeExtensionInit, @@ -128,15 +83,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef XF86MISC - { - XFree86MiscExtensionInit, - XF86MISCNAME, - &noXFree86MiscExtension, - NULL, - NULL - }, -#endif #ifdef XFreeXDGA { XFree86DGAExtensionInit, @@ -155,33 +101,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef FONTCACHE - { - FontCacheExtensionInit, - FONTCACHENAME, - &noFontCacheExtension, - NULL, - NULL - }, -#endif -#ifdef TOGCUP - { - XcupExtensionInit, - XCUPNAME, - &noXcupExtension, - NULL, - NULL - }, -#endif -#ifdef EVI - { - EVIExtensionInit, - EVINAME, - &noEVIExtension, - NULL, - NULL - }, -#endif #ifdef XV { XvExtensionInit, diff --git a/xorg-server/hw/xfree86/dixmods/extmod/modinit.h b/xorg-server/hw/xfree86/dixmods/extmod/modinit.h index 3c2e2022a..1de14858c 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/modinit.h +++ b/xorg-server/hw/xfree86/dixmods/extmod/modinit.h @@ -7,10 +7,8 @@ #define INITARGS void #endif -#ifdef SHAPE #define _SHAPE_SERVER_ /* don't want Xlib structures */ #include <X11/extensions/shapestr.h> -#endif #ifdef MULTIBUFFER extern void MultibufferExtensionInit(INITARGS); @@ -18,12 +16,6 @@ extern void MultibufferExtensionInit(INITARGS); #include <X11/extensions/multibufst.h> #endif -#ifdef MITMISC -extern void MITMiscExtensionInit(INITARGS); -#define _MITMISC_SERVER_ -#include <X11/extensions/mitmiscstr.h> -#endif - #ifdef XTEST extern void XTestExtensionInit(INITARGS); #define _XTEST_SERVER_ @@ -35,41 +27,17 @@ extern void XTestExtensionInit(INITARGS); extern void XTestExtension1Init(INITARGS); #endif -#ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); -#include <X11/extensions/bigreqstr.h> -#endif - -#ifdef XSYNC -extern void SyncExtensionInit(INITARGS); -#define _SYNC_SERVER -#include <X11/extensions/sync.h> -#include <X11/extensions/syncstr.h> -#endif - #ifdef SCREENSAVER extern void ScreenSaverExtensionInit (INITARGS); #include <X11/extensions/saver.h> #endif -#ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); -#include <X11/extensions/xcmiscstr.h> -#endif - #ifdef XF86VIDMODE extern void XFree86VidModeExtensionInit(INITARGS); #define _XF86VIDMODE_SERVER_ #include <X11/extensions/xf86vmstr.h> #endif -#ifdef XF86MISC -extern void XFree86MiscExtensionInit(INITARGS); -#define _XF86MISC_SERVER_ -#define _XF86MISC_SAVER_COMPAT_ -#include <X11/extensions/xf86mscstr.h> -#endif - #ifdef XFreeXDGA extern void XFree86DGAExtensionInit(INITARGS); extern void XFree86DGARegister(INITARGS); @@ -82,25 +50,6 @@ extern void DPMSExtensionInit(INITARGS); #include <X11/extensions/dpmsstr.h> #endif -#ifdef FONTCACHE -extern void FontCacheExtensionInit(INITARGS); -#define _FONTCACHE_SERVER_ -#include "fontcacheP.h" -#include "fontcachstr.h" -#endif - -#ifdef TOGCUP -extern void XcupExtensionInit(INITARGS); -#define _XCUP_SERVER_ -#include <X11/extensions/Xcupstr.h> -#endif - -#ifdef EVI -extern void EVIExtensionInit(INITARGS); -#define _XEVI_SERVER_ -#include <X11/extensions/XEVIstr.h> -#endif - #ifdef XV extern void XvExtensionInit(INITARGS); extern void XvMCExtensionInit(INITARGS); @@ -117,9 +66,6 @@ extern void ResExtensionInit(INITARGS); #ifdef SHM extern void ShmExtensionInit(INITARGS); #include <X11/extensions/shmstr.h> -extern void ShmSetPixmapFormat( - ScreenPtr pScreen, - int format); extern void ShmRegisterFuncs( ScreenPtr pScreen, ShmFuncsPtr funcs); @@ -130,16 +76,12 @@ extern void SELinuxExtensionInit(INITARGS); #include "xselinux.h" #endif -#if 1 -extern void SecurityExtensionInit(INITARGS); -#endif - -#if 1 -extern void XagExtensionInit(INITARGS); +#ifdef XEVIE +extern void XevieExtensionInit(INITARGS); #endif #if 1 -extern void XpExtensionInit(INITARGS); +extern void SecurityExtensionInit(INITARGS); #endif #if 1 diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga.c deleted file mode 100644 index c66bca26b..000000000 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga.c +++ /dev/null @@ -1,309 +0,0 @@ - -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995, 1996, 1999 XFree86 Inc - -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include <X11/X.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "servermd.h" -#define _XF86DGA_SERVER_ -#include <X11/extensions/xf86dga.h> -#include <X11/extensions/xf86dgastr.h> -#include "swaprep.h" -#include "dgaproc.h" - -#include "xf86dgaext.h" - - -static DISPATCH_PROC(ProcXF86DGADirectVideo); -static DISPATCH_PROC(ProcXF86DGAGetVidPage); -static DISPATCH_PROC(ProcXF86DGAGetVideoLL); -static DISPATCH_PROC(ProcXF86DGAGetViewPortSize); -static DISPATCH_PROC(ProcXF86DGASetVidPage); -static DISPATCH_PROC(ProcXF86DGASetViewPort); -static DISPATCH_PROC(ProcXF86DGAInstallColormap); -static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo); -static DISPATCH_PROC(ProcXF86DGAViewPortChanged); - - -static int -ProcXF86DGAGetVideoLL(ClientPtr client) -{ - REQUEST(xXF86DGAGetVideoLLReq); - xXF86DGAGetVideoLLReply rep; - XDGAModeRec mode; - int num, offset, flags; - char *name; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if(!DGAAvailable(stuff->screen)) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - - if(!(num = DGAGetOldDGAMode(stuff->screen))) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - - /* get the parameters for the mode that best matches */ - DGAGetModeInfo(stuff->screen, &mode, num); - - if(!DGAOpenFramebuffer(stuff->screen, &name, - (unsigned char**)(&rep.offset), - (int*)(&rep.bank_size), &offset, &flags)) - return BadAlloc; - - rep.offset += mode.offset; - rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3); - rep.ram_size = rep.bank_size >> 10; - - WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DGADirectVideo(ClientPtr client) -{ - int num; - PixmapPtr pix; - XDGAModeRec mode; - REQUEST(xXF86DGADirectVideoReq); - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (stuff->enable & XF86DGADirectGraphics) { - if(!(num = DGAGetOldDGAMode(stuff->screen))) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - } else - num = 0; - - if(Success != DGASetMode(stuff->screen, num, &mode, &pix)) - return (DGAErrorBase + XF86DGAScreenNotActive); - - DGASetInputMode (stuff->screen, - (stuff->enable & XF86DGADirectKeyb) != 0, - (stuff->enable & XF86DGADirectMouse) != 0); - - return (client->noClientException); -} - -static int -ProcXF86DGAGetViewPortSize(ClientPtr client) -{ - int num; - XDGAModeRec mode; - REQUEST(xXF86DGAGetViewPortSizeReq); - xXF86DGAGetViewPortSizeReply rep; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAAvailable(stuff->screen)) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - - if(!(num = DGAGetOldDGAMode(stuff->screen))) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - - DGAGetModeInfo(stuff->screen, &mode, num); - - rep.width = mode.viewportWidth; - rep.height = mode.viewportHeight; - - WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DGASetViewPort(ClientPtr client) -{ - REQUEST(xXF86DGASetViewPortReq); - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); - - if (!DGAAvailable(stuff->screen)) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - - if (!DGAActive(stuff->screen)) - { - int num; - PixmapPtr pix; - XDGAModeRec mode; - - if(!(num = DGAGetOldDGAMode(stuff->screen))) - return (DGAErrorBase + XF86DGANoDirectVideoMode); - if(Success != DGASetMode(stuff->screen, num, &mode, &pix)) - return (DGAErrorBase + XF86DGAScreenNotActive); - } - - if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE) - != Success) - return DGAErrorBase + XF86DGADirectNotActivated; - - return (client->noClientException); -} - -static int -ProcXF86DGAGetVidPage(ClientPtr client) -{ - REQUEST(xXF86DGAGetVidPageReq); - xXF86DGAGetVidPageReply rep; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.vpage = 0; /* silently fail */ - - WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep); - return (client->noClientException); -} - - -static int -ProcXF86DGASetVidPage(ClientPtr client) -{ - REQUEST(xXF86DGASetVidPageReq); - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); - - /* silently fail */ - - return (client->noClientException); -} - - -static int -ProcXF86DGAInstallColormap(ClientPtr client) -{ - ColormapPtr pcmp; - REQUEST(xXF86DGAInstallColormapReq); - - REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); - - if (!DGAActive(stuff->screen)) - return (DGAErrorBase + XF86DGADirectNotActivated); - - pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP); - if (pcmp) { - DGAInstallCmap(pcmp); - return (client->noClientException); - } else { - client->errorValue = stuff->id; - return (BadColor); - } -} - -static int -ProcXF86DGAQueryDirectVideo(ClientPtr client) -{ - REQUEST(xXF86DGAQueryDirectVideoReq); - xXF86DGAQueryDirectVideoReply rep; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.flags = 0; - - if (DGAAvailable(stuff->screen)) - rep.flags = XF86DGADirectPresent; - - WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86DGAViewPortChanged(ClientPtr client) -{ - REQUEST(xXF86DGAViewPortChangedReq); - xXF86DGAViewPortChangedReply rep; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); - - if (!DGAActive(stuff->screen)) - return (DGAErrorBase + XF86DGADirectNotActivated); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.result = 1; - - WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep); - return (client->noClientException); -} - -int -ProcXF86DGADispatch(register ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) - { - case X_XF86DGAGetVideoLL: - return ProcXF86DGAGetVideoLL(client); - case X_XF86DGADirectVideo: - return ProcXF86DGADirectVideo(client); - case X_XF86DGAGetViewPortSize: - return ProcXF86DGAGetViewPortSize(client); - case X_XF86DGASetViewPort: - return ProcXF86DGASetViewPort(client); - case X_XF86DGAGetVidPage: - return ProcXF86DGAGetVidPage(client); - case X_XF86DGASetVidPage: - return ProcXF86DGASetVidPage(client); - case X_XF86DGAInstallColormap: - return ProcXF86DGAInstallColormap(client); - case X_XF86DGAQueryDirectVideo: - return ProcXF86DGAQueryDirectVideo(client); - case X_XF86DGAViewPortChanged: - return ProcXF86DGAViewPortChanged(client); - default: - return BadRequest; - } -} - diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c index 295e05e9e..df0030e80 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -1,8 +1,10 @@ /* - Copyright (c) 1999 - The XFree86 Project Inc. - - Written by Mark Vojkovich -*/ + * Copyright (c) 1995 Jon Tombs + * Copyright (c) 1995, 1996, 1999 XFree86 Inc + * Copyright (c) 1999 - The XFree86 Project Inc. + * + * Written by Mark Vojkovich + */ #ifdef HAVE_XORG_CONFIG_H @@ -33,6 +35,8 @@ #include "modinit.h" +#define DGA_PROTOCOL_OLD_SUPPORT 1 + static DISPATCH_PROC(ProcXDGADispatch); static DISPATCH_PROC(SProcXDGADispatch); static DISPATCH_PROC(ProcXDGAQueryVersion); @@ -62,7 +66,8 @@ unsigned char DGAReqCode = 0; int DGAErrorBase; int DGAEventBase; -static DevPrivateKey DGAClientPrivateKey = &DGAClientPrivateKey; +static int DGAClientPrivateKeyIndex; +static DevPrivateKey DGAClientPrivateKey = &DGAClientPrivateKeyIndex; static int DGACallbackRefCount = 0; /* This holds the client's version information */ @@ -140,7 +145,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client) if (stuff->screen > screenInfo.numScreens) return BadValue; - if (!DGAAvailable(stuff->screen)) + if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); @@ -148,9 +153,9 @@ ProcXDGAOpenFramebuffer(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; - if(!DGAOpenFramebuffer(stuff->screen, &deviceName, + if(!DGAOpenFramebuffer(stuff->screen, &deviceName, (unsigned char**)(&rep.mem1), - (int*)&rep.size, (int*)&rep.offset, (int*)&rep.extra)) + (int*)&rep.size, (int*)&rep.offset, (int*)&rep.extra)) { return BadAlloc; } @@ -174,7 +179,7 @@ ProcXDGACloseFramebuffer(ClientPtr client) if (stuff->screen > screenInfo.numScreens) return BadValue; - if (!DGAAvailable(stuff->screen)) + if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); @@ -258,7 +263,7 @@ ProcXDGAQueryModes(ClientPtr client) info.viewport_flags = mode[i].viewportFlags; info.reserved1 = mode[i].reserved1; info.reserved2 = mode[i].reserved2; - + WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info)); WriteToClient(client, size, mode[i].name); } @@ -269,7 +274,7 @@ ProcXDGAQueryModes(ClientPtr client) } -static void +static void DGAClientStateChange ( CallbackListPtr* pcbl, pointer nulldata, @@ -286,7 +291,7 @@ DGAClientStateChange ( } } - if(client && + if(client && ((client->clientState == ClientStateGone) || (client->clientState == ClientStateRetained))) { XDGAModeRec mode; @@ -321,10 +326,10 @@ ProcXDGASetMode(ClientPtr client) rep.flags = 0; rep.sequenceNumber = client->sequence; - if (!DGAAvailable(stuff->screen)) + if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; - if(DGAClients[stuff->screen] && + if(DGAClients[stuff->screen] && (DGAClients[stuff->screen] != client)) return DGAErrorBase + XF86DGANoDirectVideoMode; @@ -338,7 +343,7 @@ ProcXDGASetMode(ClientPtr client) DGASetMode(stuff->screen, 0, &mode, &pPix); WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep); return (client->noClientException); - } + } if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) return BadValue; @@ -358,7 +363,7 @@ ProcXDGASetMode(ClientPtr client) } size = strlen(mode.name) + 1; - + info.byte_order = mode.byteOrder; info.depth = mode.depth; info.num = mode.num; @@ -426,7 +431,7 @@ ProcXDGAInstallColormap(ClientPtr client) return DGAErrorBase + XF86DGADirectNotActivated; REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - + cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP); if (cmap) { DGAInstallCmap(cmap); @@ -452,7 +457,7 @@ ProcXDGASelectInput(ClientPtr client) return DGAErrorBase + XF86DGADirectNotActivated; REQUEST_SIZE_MATCH(xXDGASelectInputReq); - + if(DGAClients[stuff->screen] == client) DGASelectInput(stuff->screen, client, stuff->mask); @@ -472,7 +477,7 @@ ProcXDGAFillRectangle(ClientPtr client) return DGAErrorBase + XF86DGADirectNotActivated; REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); - + if(Success != DGAFillRect(stuff->screen, stuff->x, stuff->y, stuff->width, stuff->height, stuff->color)) return BadMatch; @@ -492,7 +497,7 @@ ProcXDGACopyArea(ClientPtr client) return DGAErrorBase + XF86DGADirectNotActivated; REQUEST_SIZE_MATCH(xXDGACopyAreaReq); - + if(Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy, stuff->width, stuff->height, stuff->dstx, stuff->dsty)) return BadMatch; @@ -513,7 +518,7 @@ ProcXDGACopyTransparentArea(ClientPtr client) return DGAErrorBase + XF86DGADirectNotActivated; REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); - + if(Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy, stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key)) return BadMatch; @@ -606,7 +611,7 @@ ProcXDGAChangePixmapMode(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - + x = stuff->x; y = stuff->y; @@ -637,8 +642,8 @@ ProcXDGACreateColormap(ClientPtr client) if(!stuff->mode) return BadValue; - - result = DGACreateColormap(stuff->screen, client, stuff->id, + + result = DGACreateColormap(stuff->screen, client, stuff->id, stuff->mode, stuff->alloc); if(result != Success) return result; @@ -646,6 +651,287 @@ ProcXDGACreateColormap(ClientPtr client) return (client->noClientException); } +/* + * + * Support for the old DGA protocol, used to live in xf86dga.c + * + */ + +#ifdef DGA_PROTOCOL_OLD_SUPPORT + +static DISPATCH_PROC(ProcXF86DGADirectVideo); +static DISPATCH_PROC(ProcXF86DGAGetVidPage); +static DISPATCH_PROC(ProcXF86DGAGetVideoLL); +static DISPATCH_PROC(ProcXF86DGAGetViewPortSize); +static DISPATCH_PROC(ProcXF86DGASetVidPage); +static DISPATCH_PROC(ProcXF86DGASetViewPort); +static DISPATCH_PROC(ProcXF86DGAInstallColormap); +static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo); +static DISPATCH_PROC(ProcXF86DGAViewPortChanged); + + +static int +ProcXF86DGAGetVideoLL(ClientPtr client) +{ + REQUEST(xXF86DGAGetVideoLLReq); + xXF86DGAGetVideoLLReply rep; + XDGAModeRec mode; + int num, offset, flags; + char *name; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if(!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + /* get the parameters for the mode that best matches */ + DGAGetModeInfo(stuff->screen, &mode, num); + + if(!DGAOpenFramebuffer(stuff->screen, &name, + (unsigned char**)(&rep.offset), + (int*)(&rep.bank_size), &offset, &flags)) + return BadAlloc; + + rep.offset += mode.offset; + rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3); + rep.ram_size = rep.bank_size >> 10; + + WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGADirectVideo(ClientPtr client) +{ + int num; + PixmapPtr pix; + XDGAModeRec mode; + REQUEST(xXF86DGADirectVideoReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (DGAClients[stuff->screen] && + (DGAClients[stuff->screen] != client)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (stuff->enable & XF86DGADirectGraphics) { + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + } else + num = 0; + + if(Success != DGASetMode(stuff->screen, num, &mode, &pix)) + return (DGAErrorBase + XF86DGAScreenNotActive); + + DGASetInputMode (stuff->screen, + (stuff->enable & XF86DGADirectKeyb) != 0, + (stuff->enable & XF86DGADirectMouse) != 0); + + /* We need to track the client and attach the teardown callback */ + if (stuff->enable & + (XF86DGADirectGraphics | XF86DGADirectKeyb | XF86DGADirectMouse)) { + if (!DGAClients[stuff->screen]) { + if (DGACallbackRefCount++ == 0) + AddCallback (&ClientStateCallback, DGAClientStateChange, NULL); + } + + DGAClients[stuff->screen] = client; + } else { + if (DGAClients[stuff->screen]) { + if (--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } + + DGAClients[stuff->screen] = NULL; + } + + return (client->noClientException); +} + +static int +ProcXF86DGAGetViewPortSize(ClientPtr client) +{ + int num; + XDGAModeRec mode; + REQUEST(xXF86DGAGetViewPortSizeReq); + xXF86DGAGetViewPortSizeReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + if(!(num = DGAGetOldDGAMode(stuff->screen))) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + DGAGetModeInfo(stuff->screen, &mode, num); + + rep.width = mode.viewportWidth; + rep.height = mode.viewportHeight; + + WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGASetViewPort(ClientPtr client) +{ + REQUEST(xXF86DGASetViewPortReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if (DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); + + if (!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + + if (!DGAActive(stuff->screen)) + return DGAErrorBase + XF86DGADirectNotActivated; + + if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE) + != Success) + return DGAErrorBase + XF86DGADirectNotActivated; + + return (client->noClientException); +} + +static int +ProcXF86DGAGetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGAGetVidPageReq); + xXF86DGAGetVidPageReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.vpage = 0; /* silently fail */ + + WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep); + return (client->noClientException); +} + + +static int +ProcXF86DGASetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGASetVidPageReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); + + /* silently fail */ + + return (client->noClientException); +} + + +static int +ProcXF86DGAInstallColormap(ClientPtr client) +{ + ColormapPtr pcmp; + REQUEST(xXF86DGAInstallColormapReq); + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if (DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); + + if (!DGAActive(stuff->screen)) + return (DGAErrorBase + XF86DGADirectNotActivated); + + pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP); + if (pcmp) { + DGAInstallCmap(pcmp); + return (client->noClientException); + } else { + client->errorValue = stuff->id; + return (BadColor); + } +} + +static int +ProcXF86DGAQueryDirectVideo(ClientPtr client) +{ + REQUEST(xXF86DGAQueryDirectVideoReq); + xXF86DGAQueryDirectVideoReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.flags = 0; + + if (DGAAvailable(stuff->screen)) + rep.flags = XF86DGADirectPresent; + + WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcXF86DGAViewPortChanged(ClientPtr client) +{ + REQUEST(xXF86DGAViewPortChangedReq); + xXF86DGAViewPortChangedReply rep; + + if (stuff->screen > screenInfo.numScreens) + return BadValue; + + if (DGAClients[stuff->screen] != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); + + if (!DGAActive(stuff->screen)) + return (DGAErrorBase + XF86DGADirectNotActivated); + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.result = 1; + + WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep); + return (client->noClientException); +} + +#endif /* DGA_PROTOCOL_OLD_SUPPORT */ static int SProcXDGADispatch (ClientPtr client) @@ -701,15 +987,11 @@ ProcXDGADispatch (ClientPtr client) if (stuff->data <= X_XDGACreateColormap) fprintf (stderr, " DGA %s\n", dgaMinor[stuff->data]); #endif - - /* divert old protocol */ -#if 1 - if( (stuff->data <= X_XF86DGAViewPortChanged) && - (stuff->data >= X_XF86DGAGetVideoLL)) - return ProcXF86DGADispatch(client); -#endif switch (stuff->data){ + /* + * DGA2 Protocol + */ case X_XDGAQueryVersion: return ProcXDGAQueryVersion(client); case X_XDGAQueryModes: @@ -742,6 +1024,29 @@ ProcXDGADispatch (ClientPtr client) return ProcXDGAChangePixmapMode(client); case X_XDGACreateColormap: return ProcXDGACreateColormap(client); + /* + * Old DGA Protocol + */ +#ifdef DGA_PROTOCOL_OLD_SUPPORT + case X_XF86DGAGetVideoLL: + return ProcXF86DGAGetVideoLL(client); + case X_XF86DGADirectVideo: + return ProcXF86DGADirectVideo(client); + case X_XF86DGAGetViewPortSize: + return ProcXF86DGAGetViewPortSize(client); + case X_XF86DGASetViewPort: + return ProcXF86DGASetViewPort(client); + case X_XF86DGAGetVidPage: + return ProcXF86DGAGetVidPage(client); + case X_XF86DGASetVidPage: + return ProcXF86DGASetVidPage(client); + case X_XF86DGAInstallColormap: + return ProcXF86DGAInstallColormap(client); + case X_XF86DGAQueryDirectVideo: + return ProcXF86DGAQueryDirectVideo(client); + case X_XF86DGAViewPortChanged: + return ProcXF86DGAViewPortChanged(client); +#endif /* DGA_PROTOCOL_OLD_SUPPORT */ default: return BadRequest; } @@ -750,5 +1055,5 @@ ProcXDGADispatch (ClientPtr client) void XFree86DGARegister(INITARGS) { - XDGAEventBase = &DGAEventBase; + XDGAEventBase = &DGAEventBase; } diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86misc.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86misc.c deleted file mode 100644 index 8127afdff..000000000 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86misc.c +++ /dev/null @@ -1,821 +0,0 @@ - -/* - * Copyright (c) 1995, 1996 The XFree86 Project, Inc - */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include <X11/X.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "dixstruct.h" -#include "extnsionst.h" -#include "scrnintstr.h" -#include "inputstr.h" -#include "servermd.h" -#define _XF86MISC_SERVER_ -#undef _XF86MISC_SAVER_COMPAT_ -#include <X11/extensions/xf86mscstr.h> -#include "swaprep.h" -#include "xf86.h" -#include <X11/Xfuncproto.h> -#include "xf86miscproc.h" - -#if 0 -#include <X11/Xtrans/Xtrans.h> -#include "../os/osdep.h" -#include <X11/Xauth.h> -#ifndef USL -#ifndef Lynx -#include <sys/socket.h> -#else -#include <socket.h> -#endif -#endif /* USL */ -#endif - -static int miscErrorBase; -static DevPrivateKey MiscClientPrivateKey = &MiscClientPrivateKey; - -/* This holds the client's version information */ -typedef struct { - int major; - int minor; -} MiscPrivRec, *MiscPrivPtr; - -#define M_GETPRIV(c) ((MiscPrivPtr) \ - dixLookupPrivate(&(c)->devPrivates, MiscClientPrivateKey)) -#define M_SETPRIV(c,p) \ - dixSetPrivate(&(c)->devPrivates, MiscClientPrivateKey, p) - -static void XF86MiscResetProc( - ExtensionEntry* /* extEntry */ -); - -static void -ClientVersion(ClientPtr client, int *major, int *minor) -{ - MiscPrivPtr pPriv; - - pPriv = M_GETPRIV(client); - if (!pPriv) { - if (major) *major = 0; - if (minor) *minor = 0; - return; - } - - if (major) *major = pPriv->major; - if (minor) *minor = pPriv->minor; -} - -static DISPATCH_PROC(ProcXF86MiscDispatch); -static DISPATCH_PROC(ProcXF86MiscQueryVersion); -static DISPATCH_PROC(ProcXF86MiscGetKbdSettings); -static DISPATCH_PROC(ProcXF86MiscGetMouseSettings); -static DISPATCH_PROC(ProcXF86MiscSetKbdSettings); -static DISPATCH_PROC(ProcXF86MiscSetMouseSettings); -static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState); -static DISPATCH_PROC(ProcXF86MiscSetClientVersion); -static DISPATCH_PROC(ProcXF86MiscGetFilePaths); -static DISPATCH_PROC(ProcXF86MiscPassMessage); -#ifdef _XF86MISC_SAVER_COMPAT_ -static DISPATCH_PROC(ProcXF86MiscGetSaver); -static DISPATCH_PROC(ProcXF86MiscSetSaver); -#endif -static DISPATCH_PROC(SProcXF86MiscDispatch); -static DISPATCH_PROC(SProcXF86MiscQueryVersion); -static DISPATCH_PROC(SProcXF86MiscGetKbdSettings); -static DISPATCH_PROC(SProcXF86MiscGetMouseSettings); -static DISPATCH_PROC(SProcXF86MiscSetKbdSettings); -static DISPATCH_PROC(SProcXF86MiscSetMouseSettings); -static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState); -static DISPATCH_PROC(SProcXF86MiscSetClientVersion); -static DISPATCH_PROC(SProcXF86MiscGetFilePaths); -static DISPATCH_PROC(SProcXF86MiscPassMessage); -#ifdef _XF86MISC_SAVER_COMPAT_ -static DISPATCH_PROC(SProcXF86MiscGetSaver); -static DISPATCH_PROC(SProcXF86MiscSetSaver); -#endif - -#if 0 -static unsigned char XF86MiscReqCode = 0; -#endif - -#ifdef DEBUG -# define DEBUG_P(x) ErrorF x; -#else -# define DEBUG_P(x) do {} while (0) -#endif - -#define MISCERR(x) (miscErrorBase + x) - -void -XFree86MiscExtensionInit(void) -{ - ExtensionEntry* extEntry; - - if (!xf86GetModInDevEnabled()) - return; - - if ( - (extEntry = AddExtension(XF86MISCNAME, - XF86MiscNumberEvents, - XF86MiscNumberErrors, - ProcXF86MiscDispatch, - SProcXF86MiscDispatch, - XF86MiscResetProc, - StandardMinorOpcode))) { -#if 0 - XF86MiscReqCode = (unsigned char)extEntry->base; -#endif - miscErrorBase = extEntry->errorBase; - } -} - -/*ARGSUSED*/ -static void -XF86MiscResetProc (extEntry) - ExtensionEntry* extEntry; -{ -} - -static int -ProcXF86MiscQueryVersion(client) - register ClientPtr client; -{ - xXF86MiscQueryVersionReply rep; - register int n; - - REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XF86MISC_MAJOR_VERSION; - rep.minorVersion = XF86MISC_MINOR_VERSION; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xXF86MiscQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - -#ifdef _XF86MISC_SAVER_COMPAT_ -/* THESE HAVE NOT BEEN CONVERTED TO THE NEW DESIGN */ - -/* - * This will go away, but remains for now for compatibility with older - * clients. - */ -static int -ProcXF86MiscSetSaver(client) - register ClientPtr client; -{ - REQUEST(xXF86MiscSetSaverReq); - ScrnInfoPtr vptr; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - vptr = (ScrnInfoPtr) - dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates, - xf86ScreenKey); - - REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq); - - if (stuff->suspendTime < 0) - return BadValue; - if (stuff->offTime < 0) - return BadValue; - - return (client->noClientException); -} - -/* - * This will go away, but remains for now for compatibility with older - * clients. - */ -static int -ProcXF86MiscGetSaver(client) - register ClientPtr client; -{ - REQUEST(xXF86MiscGetSaverReq); - xXF86MiscGetSaverReply rep; - register int n; - ScrnInfoPtr vptr; - - if (stuff->screen > screenInfo.numScreens) - return BadValue; - - vptr = (ScrnInfoPtr) - dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates, - xf86ScreenKey); - - REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.suspendTime = 0; - rep.offTime = 0; - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.suspendTime, n); - swapl(&rep.offTime, n); - } - WriteToClient(client, SIZEOF(xXF86MiscGetSaverReply), (char *)&rep); - return (client->noClientException); -} - -#endif /* _XF86MISC_SAVER_COMPAT_ */ - -static int -ProcXF86MiscGetMouseSettings(client) - register ClientPtr client; -{ - xXF86MiscGetMouseSettingsReply rep; - char *devname; - pointer mouse; - register int n; - int devnamelen; - - REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - - if (!MiscExtGetMouseSettings(&mouse, &devname)) - return BadValue; - - rep.mousetype = MiscExtGetMouseValue(mouse, MISC_MSE_PROTO); - rep.baudrate = MiscExtGetMouseValue(mouse, MISC_MSE_BAUDRATE); - rep.samplerate = MiscExtGetMouseValue(mouse, MISC_MSE_SAMPLERATE); - rep.resolution = MiscExtGetMouseValue(mouse, MISC_MSE_RESOLUTION); - rep.buttons = MiscExtGetMouseValue(mouse, MISC_MSE_BUTTONS); - rep.emulate3buttons = MiscExtGetMouseValue(mouse, MISC_MSE_EM3BUTTONS); - rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT); - rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE); - rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS); - devnamelen = rep.devnamelen = (devname? strlen(devname): 0); - rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) - - sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2; - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.mousetype, n); - swapl(&rep.baudrate, n); - swapl(&rep.samplerate, n); - swapl(&rep.resolution, n); - swapl(&rep.buttons, n); - swapl(&rep.emulate3buttons, n); - swapl(&rep.emulate3timeout, n); - swapl(&rep.chordmiddle, n); - swapl(&rep.flags, n); - } - WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep); - MiscExtDestroyStruct(mouse, MISC_POINTER); - - if (devnamelen) - WriteToClient(client, devnamelen, devname); - return (client->noClientException); -} - -static int -ProcXF86MiscGetKbdSettings(client) - register ClientPtr client; -{ - xXF86MiscGetKbdSettingsReply rep; - pointer kbd; - register int n; - - REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!MiscExtGetKbdSettings(&kbd)) - return BadValue; - - rep.kbdtype = MiscExtGetKbdValue(kbd, MISC_KBD_TYPE); - rep.rate = MiscExtGetKbdValue(kbd, MISC_KBD_RATE); - rep.delay = MiscExtGetKbdValue(kbd, MISC_KBD_DELAY); - rep.servnumlock = MiscExtGetKbdValue(kbd, MISC_KBD_SERVNUMLOCK); - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.kbdtype, n); - swapl(&rep.rate, n); - swapl(&rep.delay, n); - } - WriteToClient(client, SIZEOF(xXF86MiscGetKbdSettingsReply), (char *)&rep); - return (client->noClientException); -} - -static int -ProcXF86MiscSetMouseSettings(client) - register ClientPtr client; -{ - MiscExtReturn ret; - pointer mouse; - char *devname = NULL; - int major, minor; - - REQUEST(xXF86MiscSetMouseSettingsReq); - - REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq); - - ClientVersion(client, &major, &minor); - - if (xf86GetVerbosity() > 1) { - DEBUG_P(("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n", - (int)stuff->mousetype, (int)stuff->baudrate, - (int)stuff->samplerate, stuff->chordmiddle)); - DEBUG_P((" em3but: %d em3tim: %d res: %d flags: %ld\n", - stuff->emulate3buttons, (int)stuff->emulate3timeout, - (int)stuff->resolution, (unsigned long)stuff->flags)); - } - - if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0) - return BadAlloc; - - MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype); - MiscExtSetMouseValue(mouse, MISC_MSE_BAUDRATE, stuff->baudrate); - MiscExtSetMouseValue(mouse, MISC_MSE_SAMPLERATE, stuff->samplerate); - MiscExtSetMouseValue(mouse, MISC_MSE_RESOLUTION, stuff->resolution); - MiscExtSetMouseValue(mouse, MISC_MSE_BUTTONS, stuff->buttons); - MiscExtSetMouseValue(mouse, MISC_MSE_EM3BUTTONS, stuff->emulate3buttons); - MiscExtSetMouseValue(mouse, MISC_MSE_EM3TIMEOUT, stuff->emulate3timeout); - MiscExtSetMouseValue(mouse, MISC_MSE_CHORDMIDDLE, stuff->chordmiddle); - MiscExtSetMouseValue(mouse, MISC_MSE_FLAGS, stuff->flags); - - if ((major > 0 || minor > 5) && stuff->devnamelen) { - int size = sizeof(xXF86MiscSetMouseSettingsReq) + stuff->devnamelen; - size = (size + 3) >> 2; - if (client->req_len < size) - return BadLength; - if (stuff->devnamelen) { - if (!(devname = xalloc(stuff->devnamelen))) - return BadAlloc; - strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen); - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetMouseSettings - device: %s\n",devname)); - MiscExtSetMouseDevice(mouse, devname); - } - } - - ret = MiscExtApply(mouse, MISC_POINTER); - - if (devname) - xfree(devname); - - switch ((ret)) { - case MISC_RET_SUCCESS: break; - case MISC_RET_BADVAL: return BadValue; - case MISC_RET_BADMSEPROTO: return MISCERR(XF86MiscBadMouseProtocol); - case MISC_RET_BADBAUDRATE: return MISCERR(XF86MiscBadMouseBaudRate); - case MISC_RET_BADFLAGS: return MISCERR(XF86MiscBadMouseFlags); - case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo); - case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule); - default: - DEBUG_P(("Unexpected return from MiscExtApply(POINTER) = %d\n", ret)); - return BadImplementation; - } - - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetMouseSettings - Succeeded\n")); - return (client->noClientException); -} - -static int -ProcXF86MiscSetKbdSettings(client) - register ClientPtr client; -{ - MiscExtReturn ret; - pointer kbd; - REQUEST(xXF86MiscSetKbdSettingsReq); - - REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq); - - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n", - (int)stuff->kbdtype, (int)stuff->rate, - (int)stuff->delay, stuff->servnumlock)); - - if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0) - return BadAlloc; - - MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype); - MiscExtSetKbdValue(kbd, MISC_KBD_RATE, stuff->rate); - MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, stuff->delay); - MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, stuff->servnumlock); - - switch ((ret = MiscExtApply(kbd, MISC_KEYBOARD))) { - case MISC_RET_SUCCESS: break; - case MISC_RET_BADVAL: return BadValue; - case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType); - default: - DEBUG_P(("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret)); - return BadImplementation; - } - - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetKbdSettings - Succeeded\n")); - return (client->noClientException); -} - -static int -ProcXF86MiscSetGrabKeysState(client) - register ClientPtr client; -{ - int n, status; - xXF86MiscSetGrabKeysStateReply rep; - REQUEST(xXF86MiscSetGrabKeysStateReq); - - REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq); - - if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) { - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetGrabKeysState - %s\n", - stuff->enable ? "enabled" : "disabled")); - } - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.status = status; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); - } - WriteToClient(client, SIZEOF(xXF86MiscSetGrabKeysStateReply), (char *)&rep); - - return (client->noClientException); -} - -static int -ProcXF86MiscSetClientVersion(ClientPtr client) -{ - REQUEST(xXF86MiscSetClientVersionReq); - - MiscPrivPtr pPriv; - - REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq); - - if ((pPriv = M_GETPRIV(client)) == NULL) { - pPriv = xalloc(sizeof(MiscPrivRec)); - if (!pPriv) - return BadAlloc; - M_SETPRIV(client, pPriv); - } - if (xf86GetVerbosity() > 1) - DEBUG_P(("SetClientVersion: %i %i\n",stuff->major,stuff->minor)); - pPriv->major = stuff->major; - pPriv->minor = stuff->minor; - - return (client->noClientException); -} - -static int -ProcXF86MiscGetFilePaths(client) - register ClientPtr client; -{ - xXF86MiscGetFilePathsReply rep; - const char *configfile; - const char *modulepath; - const char *logfile; - register int n; - int configlen, modulelen, loglen; - - REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - - if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile)) - return BadValue; - - configlen = rep.configlen = (configfile? strlen(configfile): 0); - modulelen = rep.modulelen = (modulepath? strlen(modulepath): 0); - loglen = rep.loglen = (logfile? strlen(logfile): 0); - rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) + - ((rep.configlen + 3) & ~3) + - ((rep.modulelen + 3) & ~3) + - ((rep.loglen + 3) & ~3) ) >> 2; - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.configlen, n); - swaps(&rep.modulelen, n); - swaps(&rep.loglen, n); - } - WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep); - - if (configlen) - WriteToClient(client, configlen, (char *)configfile); - if (modulelen) - WriteToClient(client, modulelen, (char *)modulepath); - if (loglen) - WriteToClient(client, loglen, (char *)logfile); - - return (client->noClientException); -} - -static int -ProcXF86MiscPassMessage(client) - register ClientPtr client; -{ - xXF86MiscPassMessageReply rep; - char *msgtype, *msgval, *retstr; - int retval, size; - register int n; - int mesglen; - - REQUEST(xXF86MiscPassMessageReq); - - REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq); - size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2; - size+= (stuff->typelen + 3) >> 2; - size+= (stuff->vallen + 3) >> 2; - if (client->req_len < size) - return BadLength; - if (stuff->typelen) { - if (!(msgtype = xalloc(stuff->typelen))) - return BadAlloc; - strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen); - } else return BadValue; - if (stuff->vallen) { - if (!(msgval = xalloc(stuff->vallen))) { - xfree(msgtype); - return BadAlloc; - } - strncpy(msgval,(char*)((char*)&stuff[1] + ((stuff->typelen + 3) & ~3)), - stuff->vallen); - } else { - xfree(msgtype); - return BadValue; - } - - if ((retval = MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0) { - xfree(msgtype); - xfree(msgval); - return retval; - } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - mesglen = rep.mesglen = (retstr? strlen(retstr): 0); - rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) + - ((rep.mesglen + 3) & ~3)) >> 2; - rep.status = 0; - - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.mesglen, n); - } - WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep); - - if (mesglen) - WriteToClient(client, mesglen, (char *)retstr); - - xfree(msgtype); - xfree(msgval); - - return (client->noClientException); -} - -static int -ProcXF86MiscDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_XF86MiscQueryVersion: - return ProcXF86MiscQueryVersion(client); -#ifdef _XF86MISC_SAVER_COMPAT_ - case X_XF86MiscGetSaver: - return ProcXF86MiscGetSaver(client); - case X_XF86MiscSetSaver: - return ProcXF86MiscSetSaver(client); -#endif - case X_XF86MiscGetMouseSettings: - return ProcXF86MiscGetMouseSettings(client); - case X_XF86MiscGetKbdSettings: - return ProcXF86MiscGetKbdSettings(client); - case X_XF86MiscSetClientVersion: - return ProcXF86MiscSetClientVersion(client); - case X_XF86MiscGetFilePaths: - return ProcXF86MiscGetFilePaths(client); - case X_XF86MiscPassMessage: - return ProcXF86MiscPassMessage(client); - default: - if (!xf86GetModInDevEnabled()) - return miscErrorBase + XF86MiscModInDevDisabled; - if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) { - switch (stuff->data) { - case X_XF86MiscSetMouseSettings: - return ProcXF86MiscSetMouseSettings(client); - case X_XF86MiscSetKbdSettings: - return ProcXF86MiscSetKbdSettings(client); - case X_XF86MiscSetGrabKeysState: - return ProcXF86MiscSetGrabKeysState(client); - default: - return BadRequest; - } - } else - return miscErrorBase + XF86MiscModInDevClientNotLocal; - } -} - -static int -SProcXF86MiscQueryVersion(client) - register ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscQueryVersionReq); - swaps(&stuff->length, n); - return ProcXF86MiscQueryVersion(client); -} - -#ifdef _XF86MISC_SAVER_COMPAT_ -static int -SProcXF86MiscGetSaver(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscGetSaverReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq); - swaps(&stuff->screen, n); - return ProcXF86MiscGetSaver(client); -} - -static int -SProcXF86MiscSetSaver(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscSetSaverReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq); - swaps(&stuff->screen, n); - swapl(&stuff->suspendTime, n); - swapl(&stuff->offTime, n); - return ProcXF86MiscSetSaver(client); -} -#endif /* _XF86MISC_SAVER_COMPAT_ */ - -static int -SProcXF86MiscGetMouseSettings(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscGetMouseSettingsReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq); - return ProcXF86MiscGetMouseSettings(client); -} - -static int -SProcXF86MiscGetKbdSettings(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscGetKbdSettingsReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq); - return ProcXF86MiscGetKbdSettings(client); -} - -static int -SProcXF86MiscSetMouseSettings(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscSetMouseSettingsReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq); - swapl(&stuff->mousetype, n); - swapl(&stuff->baudrate, n); - swapl(&stuff->samplerate, n); - swapl(&stuff->resolution, n); - swapl(&stuff->buttons, n); - swapl(&stuff->emulate3timeout, n); - swapl(&stuff->flags, n); - return ProcXF86MiscSetMouseSettings(client); -} - -static int -SProcXF86MiscSetKbdSettings(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscSetKbdSettingsReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq); - swapl(&stuff->kbdtype, n); - swapl(&stuff->rate, n); - swapl(&stuff->delay, n); - return ProcXF86MiscSetKbdSettings(client); -} - -static int -SProcXF86MiscSetGrabKeysState(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscSetGrabKeysStateReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq); - swaps(&stuff->enable, n); - return ProcXF86MiscSetGrabKeysState(client); -} - -static int -SProcXF86MiscSetClientVersion(ClientPtr client) -{ - register int n; - REQUEST(xXF86MiscSetClientVersionReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq); - swaps(&stuff->major, n); - swaps(&stuff->minor, n); - return ProcXF86MiscSetClientVersion(client); -} - -static int -SProcXF86MiscGetFilePaths(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscGetFilePathsReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq); - return ProcXF86MiscGetFilePaths(client); -} - -static int -SProcXF86MiscPassMessage(client) - ClientPtr client; -{ - register int n; - REQUEST(xXF86MiscPassMessageReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq); - return ProcXF86MiscPassMessage(client); -} - -static int -SProcXF86MiscDispatch (client) - register ClientPtr client; -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_XF86MiscQueryVersion: - return SProcXF86MiscQueryVersion(client); -#ifdef _XF86MISC_SAVER_COMPAT_ - case X_XF86MiscGetSaver: - return SProcXF86MiscGetSaver(client); - case X_XF86MiscSetSaver: - return SProcXF86MiscSetSaver(client); -#endif - case X_XF86MiscGetMouseSettings: - return SProcXF86MiscGetMouseSettings(client); - case X_XF86MiscGetKbdSettings: - return SProcXF86MiscGetKbdSettings(client); - case X_XF86MiscSetClientVersion: - return SProcXF86MiscSetClientVersion(client); - case X_XF86MiscGetFilePaths: - return SProcXF86MiscGetFilePaths(client); - case X_XF86MiscPassMessage: - return SProcXF86MiscPassMessage(client); - default: - if (!xf86GetModInDevEnabled()) - return miscErrorBase + XF86MiscModInDevDisabled; - if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) { - switch (stuff->data) { - case X_XF86MiscSetMouseSettings: - return SProcXF86MiscSetMouseSettings(client); - case X_XF86MiscSetKbdSettings: - return SProcXF86MiscSetKbdSettings(client); - case X_XF86MiscSetGrabKeysState: - return SProcXF86MiscSetGrabKeysState(client); - default: - return BadRequest; - } - } else - return miscErrorBase + XF86MiscModInDevClientNotLocal; - } -} - diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86miscproc.h b/xorg-server/hw/xfree86/dixmods/extmod/xf86miscproc.h deleted file mode 100644 index 93b193ca7..000000000 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86miscproc.h +++ /dev/null @@ -1,69 +0,0 @@ - -/* Prototypes for Pointer/Keyboard functions that the DDX must provide */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#ifndef _XF86MISCPROC_H_ -#define _XF86MISCPROC_H_ - -typedef enum { - MISC_MSE_PROTO, - MISC_MSE_BAUDRATE, - MISC_MSE_SAMPLERATE, - MISC_MSE_RESOLUTION, - MISC_MSE_BUTTONS, - MISC_MSE_EM3BUTTONS, - MISC_MSE_EM3TIMEOUT, - MISC_MSE_CHORDMIDDLE, - MISC_MSE_FLAGS -} MiscExtMseValType; - -typedef enum { - MISC_KBD_TYPE, - MISC_KBD_RATE, - MISC_KBD_DELAY, - MISC_KBD_SERVNUMLOCK -} MiscExtKbdValType; - -typedef enum { - MISC_RET_SUCCESS, - MISC_RET_BADVAL, - MISC_RET_BADMSEPROTO, - MISC_RET_BADBAUDRATE, - MISC_RET_BADFLAGS, - MISC_RET_BADCOMBO, - MISC_RET_BADKBDTYPE, - MISC_RET_NOMODULE -} MiscExtReturn; - -typedef enum { - MISC_POINTER, - MISC_KEYBOARD -} MiscExtStructType; - -#define MISC_MSEFLAG_CLEARDTR 1 -#define MISC_MSEFLAG_CLEARRTS 2 -#define MISC_MSEFLAG_REOPEN 128 - -void XFree86MiscExtensionInit(void); - -Bool MiscExtGetMouseSettings(pointer *mouse, char **devname); -int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype); -Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value); -Bool MiscExtGetKbdSettings(pointer *kbd); -int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype); -Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value); -int MiscExtSetGrabKeysState(ClientPtr client, int enable); -pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd); -void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd); -MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd); -Bool MiscExtSetMouseDevice(pointer mouse, char* device); -Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, - const char **logfile); -int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval, - char **retstr); - -#endif - diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c index 718d40fbd..aecaf94ff 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -48,11 +48,13 @@ from Kaleb S. KEITHLEY #include "swaprep.h" #include "xf86.h" #include "vidmodeproc.h" +#include "globals.h" #define DEFAULT_XF86VIDMODE_VERBOSITY 3 static int VidModeErrorBase; -static DevPrivateKey VidModeClientPrivateKey = &VidModeClientPrivateKey; +static int VidModeClientPrivateKeyIndex; +static DevPrivateKey VidModeClientPrivateKey = &VidModeClientPrivateKeyIndex; /* This holds the client's version information */ typedef struct { @@ -65,10 +67,6 @@ typedef struct { #define VM_SETPRIV(c,p) \ dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p) -static void XF86VidModeResetProc( - ExtensionEntry* /* extEntry */ -); - static DISPATCH_PROC(ProcXF86VidModeDispatch); static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines); static DISPATCH_PROC(ProcXF86VidModeGetModeLine); @@ -126,8 +124,6 @@ static void SXF86VidModeNotifyEvent(); xXF86VidModeNotifyEvent * /* to */ ); -extern WindowPtr *WindowTable; - static RESTYPE EventType; /* resource type for event masks */ typedef struct _XF86VidModeEvent *XF86VidModeEventPtr; @@ -146,8 +142,9 @@ typedef struct _XF86VidModeScreenPrivate { XF86VidModeEventPtr events; Bool hasWindow; } XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr; - -static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKey; + +static int ScreenPrivateKeyIndex; +static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex; #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey)) @@ -199,7 +196,7 @@ XFree86VidModeExtensionInit(void) XF86VidModeNumberErrors, ProcXF86VidModeDispatch, SProcXF86VidModeDispatch, - XF86VidModeResetProc, + NULL, StandardMinorOpcode))) { #if 0 XF86VidModeReqCode = (unsigned char)extEntry->base; @@ -212,13 +209,6 @@ XFree86VidModeExtensionInit(void) } } -/*ARGSUSED*/ -static void -XF86VidModeResetProc (extEntry) - ExtensionEntry* extEntry; -{ -} - static int ClientMajorVersion(ClientPtr client) { @@ -1553,6 +1543,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) { CARD16 *ramp = NULL; int n, length, i; + size_t ramplen; xXF86VidModeGetGammaRampReply rep; REQUEST(xXF86VidModeGetGammaRampReq); @@ -1567,7 +1558,8 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) length = (stuff->size + 1) & ~1; if(stuff->size) { - if(!(ramp = xalloc(length * 3 * sizeof(CARD16)))) + ramplen = length * 3 * sizeof(CARD16); + if (!(ramp = xalloc(ramplen))) return BadAlloc; if (!VidModeGetGammaRamp(stuff->screen, stuff->size, @@ -1585,13 +1577,12 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); swaps(&rep.size, n); - for(i = 0; i < length * 3; i++) - swaps(&ramp[i],n); + SwapShorts(ramp, length * 3); } WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep); if(stuff->size) { - WriteToClient(client, rep.length << 2, (char*)ramp); + WriteToClient(client, ramplen, (char*)ramp); xfree(ramp); } @@ -2072,7 +2063,6 @@ SProcXF86VidModeGetGamma(ClientPtr client) static int SProcXF86VidModeSetGammaRamp(ClientPtr client) { - CARD16 *ramp; int length, n; REQUEST(xXF86VidModeSetGammaRampReq); swaps(&stuff->length, n); @@ -2081,11 +2071,7 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client) swaps(&stuff->screen, n); length = ((stuff->size + 1) & ~1) * 6; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); - ramp = (CARD16*)&stuff[1]; - while(length--) { - swaps(ramp, n); - ramp++; - } + SwapRestS(stuff); return ProcXF86VidModeSetGammaRamp(client); } |