diff options
author | marha <marha@users.sourceforge.net> | 2009-09-02 21:09:13 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-02 21:09:13 +0000 |
commit | 8fedf58693f42869528b41408ac4d6012839e973 (patch) | |
tree | 62a817bea7dfc71050292d302ba94f5e349c67a7 /xorg-server/dix | |
parent | ac14083f465166b298162a57fff0bad90e528fff (diff) | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-8fedf58693f42869528b41408ac4d6012839e973.tar.gz vcxsrv-8fedf58693f42869528b41408ac4d6012839e973.tar.bz2 vcxsrv-8fedf58693f42869528b41408ac4d6012839e973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/dix')
-rw-r--r-- | xorg-server/dix/Makefile.in | 126 | ||||
-rw-r--r-- | xorg-server/dix/cursor.c | 8 | ||||
-rw-r--r-- | xorg-server/dix/deprecated.c | 34 | ||||
-rw-r--r-- | xorg-server/dix/dispatch.c | 70 | ||||
-rw-r--r-- | xorg-server/dix/dixutils.c | 4 | ||||
-rw-r--r-- | xorg-server/dix/events.c | 16 | ||||
-rw-r--r-- | xorg-server/dix/gc.c | 8 | ||||
-rw-r--r-- | xorg-server/dix/resource.c | 39 | ||||
-rw-r--r-- | xorg-server/dix/window.c | 10 |
9 files changed, 214 insertions, 101 deletions
diff --git a/xorg-server/dix/Makefile.in b/xorg-server/dix/Makefile.in index 28de940f1..3d10eb3c0 100644 --- a/xorg-server/dix/Makefile.in +++ b/xorg-server/dix/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. +# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,8 +19,9 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -52,6 +54,7 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xwin-config.h \ $(top_builddir)/include/kdrive-config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libdix_la_LIBADD = am_libdix_la_OBJECTS = atom.lo colormap.lo cursor.lo deprecated.lo \ @@ -68,6 +71,7 @@ dix_O_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -81,9 +85,23 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(miscconfigdir)" -dist_miscconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_miscconfig_DATA) ETAGS = etags CTAGS = ctags @@ -219,6 +237,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -427,9 +446,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign dix/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign dix/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign dix/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign dix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -447,6 +466,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -460,11 +480,13 @@ libdix.la: $(libdix_la_OBJECTS) $(libdix_la_DEPENDENCIES) $(LINK) $(libdix_la_OBJECTS) $(libdix_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list @XSERVER_DTRACE_FALSE@dix.O$(EXEEXT): $(dix_O_OBJECTS) $(dix_O_DEPENDENCIES) @XSERVER_DTRACE_FALSE@ @rm -f dix.O$(EXEEXT) @XSERVER_DTRACE_FALSE@ $(LINK) $(dix_O_OBJECTS) $(dix_O_LDADD) $(LIBS) @@ -509,21 +531,21 @@ distclean-compile: .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -536,20 +558,23 @@ clean-libtool: install-dist_miscconfigDATA: $(dist_miscconfig_DATA) @$(NORMAL_INSTALL) test -z "$(miscconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(miscconfigdir)" - @list='$(dist_miscconfig_DATA)'; for p in $$list; do \ + @list='$(dist_miscconfig_DATA)'; test -n "$(miscconfigdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_miscconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(miscconfigdir)/$$f'"; \ - $(dist_miscconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(miscconfigdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(miscconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(miscconfigdir)" || exit $$?; \ done uninstall-dist_miscconfigDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_miscconfig_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(miscconfigdir)/$$f'"; \ - rm -f "$(DESTDIR)$(miscconfigdir)/$$f"; \ - done + @list='$(dist_miscconfig_DATA)'; test -n "$(miscconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(miscconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(miscconfigdir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -563,7 +588,7 @@ tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -571,29 +596,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -614,13 +644,17 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -654,6 +688,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -676,6 +711,8 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: @@ -684,18 +721,28 @@ install-data-am: install-dist_miscconfigDATA install-dvi: install-dvi-am +install-dvi-am: + install-exec-am: install-html: install-html-am +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-pdf: install-pdf-am +install-pdf-am: + install-ps: install-ps-am +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -718,7 +765,7 @@ ps-am: uninstall-am: uninstall-dist_miscconfigDATA -.MAKE: install-am install-strip +.MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ @@ -749,6 +796,7 @@ uninstall-am: uninstall-dist_miscconfigDATA dix.c: touch $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/xorg-server/dix/cursor.c b/xorg-server/dix/cursor.c index 81540fd89..0017c661d 100644 --- a/xorg-server/dix/cursor.c +++ b/xorg-server/dix/cursor.c @@ -298,15 +298,15 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, GlyphSharePtr pShare; DeviceIntPtr pDev; - rc = dixLookupResource((pointer *)&sourcefont, source, RT_FONT, client, - DixUseAccess); + rc = dixLookupResourceByType((pointer *)&sourcefont, source, RT_FONT, client, + DixUseAccess); if (rc != Success) { client->errorValue = source; return (rc == BadValue) ? BadFont : rc; } - rc = dixLookupResource((pointer *)&maskfont, mask, RT_FONT, client, - DixUseAccess); + rc = dixLookupResourceByType((pointer *)&maskfont, mask, RT_FONT, client, + DixUseAccess); if (rc != Success && mask != None) { client->errorValue = mask; diff --git a/xorg-server/dix/deprecated.c b/xorg-server/dix/deprecated.c index 2bb81190c..4e20d6082 100644 --- a/xorg-server/dix/deprecated.c +++ b/xorg-server/dix/deprecated.c @@ -115,48 +115,66 @@ LookupClient(XID id, ClientPtr client) return (i == Success) ? pClient : NULL; } -/* replaced by dixLookupResource */ +/* replaced by dixLookupResourceByType */ _X_EXPORT pointer SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask access_mode) { pointer retval; - int i = dixLookupResource(&retval, id, rtype, client, access_mode); + int i = dixLookupResourceByType(&retval, id, rtype, client, access_mode); static int warn = 1; if (warn > 0 && --warn) ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() " "are deprecated. Please convert your driver/module " - "to use dixLookupResource().\n"); + "to use dixLookupResourceByType().\n"); return (i == Success) ? retval : NULL; } -/* replaced by dixLookupResource */ +/* replaced by dixLookupResourceByClass */ _X_EXPORT pointer SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask access_mode) { pointer retval; - int i = dixLookupResource(&retval, id, classes, client, access_mode); + int i = dixLookupResourceByClass(&retval, id, classes, client, access_mode); static int warn = 1; if (warn > 0 && --warn) ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() " "are deprecated. Please convert your driver/module " - "to use dixLookupResource().\n"); + "to use dixLookupResourceByClass().\n"); return (i == Success) ? retval : NULL; } -/* replaced by dixLookupResource */ +/* replaced by dixLookupResourceByType */ _X_EXPORT pointer LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, DixUnknownAccess); } -/* replaced by dixLookupResource */ +/* replaced by dixLookupResourceByClass */ _X_EXPORT pointer LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, DixUnknownAccess); } +/* replaced by dixLookupResourceBy{Type,Class} */ +_X_EXPORT int +dixLookupResource (pointer *result, XID id, RESTYPE rtype, + ClientPtr client, Mask mode) +{ + Bool istype = ((rtype & TypeMask) && (rtype != RC_ANY)) || (rtype == RT_NONE); + + static int warn = 1; + if (warn > 0 && --warn) + ErrorF("Warning: dixLookupResource() " + "is deprecated. Please convert your driver/module " + "to use dixLookupResourceByType/dixLookupResourceByClass().\n"); + if (istype) + return dixLookupResourceByType (result, id, rtype, client, mode); + else + return dixLookupResourceByClass (result, id, rtype, client, mode); +} + /* end deprecated functions */ diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index 2f8b3d69c..b4f5f437f 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -251,6 +251,7 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; long SmartScheduleTime; +int SmartScheduleLatencyLimited = 0; static ClientPtr SmartLastClient; static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1]; @@ -321,7 +322,7 @@ SmartScheduleClient (int *clientReady, int nready) /* * Adjust slice */ - if (nready == 1) + if (nready == 1 && SmartScheduleLatencyLimited == 0) { /* * If it's been a long time since another client @@ -341,6 +342,23 @@ SmartScheduleClient (int *clientReady, int nready) return best; } +void +EnableLimitedSchedulingLatency(void) +{ + ++SmartScheduleLatencyLimited; + SmartScheduleSlice = SmartScheduleInterval; +} + +void +DisableLimitedSchedulingLatency(void) +{ + --SmartScheduleLatencyLimited; + + /* protect against bugs */ + if (SmartScheduleLatencyLimited < 0) + SmartScheduleLatencyLimited = 0; +} + #define MAJOROP ((xReq *)client->requestBuffer)->reqType void @@ -360,6 +378,7 @@ Dispatch(void) if (!clientReady) return; + SmartScheduleSlice = SmartScheduleInterval; while (!dispatchException) { if (*icheck[0] != *icheck[1]) @@ -470,6 +489,7 @@ Dispatch(void) KillAllClients(); xfree(clientReady); dispatchException &= ~DE_RESET; + SmartScheduleLatencyLimited = 0; } #undef MAJOROP @@ -1123,11 +1143,11 @@ ProcQueryFont(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); client->errorValue = stuff->id; /* EITHER font or gc */ - rc = dixLookupResource((pointer *)&pFont, stuff->id, RT_FONT, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT, client, + DixGetAttrAccess); if (rc == BadValue) { - rc = dixLookupResource((pointer *)&pGC, stuff->id, RT_GC, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pGC, stuff->id, RT_GC, client, + DixGetAttrAccess); if (rc == Success) pFont = pGC->font; } @@ -1181,10 +1201,10 @@ ProcQueryTextExtents(ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); client->errorValue = stuff->fid; /* EITHER font or gc */ - rc = dixLookupResource((pointer *)&pFont, stuff->fid, RT_FONT, client, - DixGetAttrAccess); + rc = dixLookupResourceByType((pointer *)&pFont, stuff->fid, RT_FONT, client, + DixGetAttrAccess); if (rc == BadValue) { - rc = dixLookupResource((pointer *)&pGC, stuff->fid, RT_GC, client, + rc = dixLookupResourceByType((pointer *)&pGC, stuff->fid, RT_GC, client, DixGetAttrAccess); if (rc == Success) pFont = pGC->font; @@ -1329,7 +1349,7 @@ ProcFreePixmap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pMap, stuff->id, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&pMap, stuff->id, RT_PIXMAP, client, DixDestroyAccess); if (rc == Success) { @@ -2275,7 +2295,7 @@ ProcFreeColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pmap, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pmap, stuff->id, RT_COLORMAP, client, DixDestroyAccess); if (rc == Success) { @@ -2303,7 +2323,7 @@ ProcCopyColormapAndFree(ClientPtr client) REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); - rc = dixLookupResource((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, + rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP, client, DixReadAccess|DixRemoveAccess); if (rc == Success) { @@ -2328,7 +2348,7 @@ ProcInstallColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, DixInstallAccess); if (rc != Success) goto out; @@ -2353,7 +2373,7 @@ ProcUninstallColormap(ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client, DixUninstallAccess); if (rc != Success) goto out; @@ -2420,7 +2440,7 @@ ProcAllocColor (ClientPtr client) REQUEST(xAllocColorReq); REQUEST_SIZE_MATCH(xAllocColorReq); - rc = dixLookupResource((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2461,7 +2481,7 @@ ProcAllocNamedColor (ClientPtr client) REQUEST(xAllocNamedColorReq); REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2512,7 +2532,7 @@ ProcAllocColorCells (ClientPtr client) REQUEST(xAllocColorCellsReq); REQUEST_SIZE_MATCH(xAllocColorCellsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2579,7 +2599,7 @@ ProcAllocColorPlanes(ClientPtr client) REQUEST(xAllocColorPlanesReq); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { @@ -2644,7 +2664,7 @@ ProcFreeColors(ClientPtr client) REQUEST(xFreeColorsReq); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixRemoveAccess); if (rc == Success) { @@ -2679,7 +2699,7 @@ ProcStoreColors (ClientPtr client) REQUEST(xStoreColorsReq); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { @@ -2713,7 +2733,7 @@ ProcStoreNamedColor (ClientPtr client) REQUEST(xStoreNamedColorReq); REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixWriteAccess); if (rc == Success) { @@ -2747,7 +2767,7 @@ ProcQueryColors(ClientPtr client) REQUEST(xQueryColorsReq); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { @@ -2799,7 +2819,7 @@ ProcLookupColor(ClientPtr client) REQUEST(xLookupColorReq); REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); - rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { @@ -2848,14 +2868,14 @@ ProcCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH(xCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - rc = dixLookupResource((pointer *)&src, stuff->source, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&src, stuff->source, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->source; return (rc == BadValue) ? BadPixmap : rc; } - rc = dixLookupResource((pointer *)&msk, stuff->mask, RT_PIXMAP, client, + rc = dixLookupResourceByType((pointer *)&msk, stuff->mask, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { @@ -2953,7 +2973,7 @@ ProcFreeCursor (ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - rc = dixLookupResource((pointer *)&pCursor, stuff->id, RT_CURSOR, client, + rc = dixLookupResourceByType((pointer *)&pCursor, stuff->id, RT_CURSOR, client, DixDestroyAccess); if (rc == Success) { diff --git a/xorg-server/dix/dixutils.c b/xorg-server/dix/dixutils.c index 340564ecd..66e5bc51b 100644 --- a/xorg-server/dix/dixutils.c +++ b/xorg-server/dix/dixutils.c @@ -216,7 +216,7 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, if (id == INVALID) return BadDrawable; - rc = dixLookupResource((pointer *)&pTmp, id, RC_DRAWABLE, client, access); + rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access); if (rc == BadValue) return BadDrawable; @@ -259,7 +259,7 @@ dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) if (!clientIndex || !clients[clientIndex] || (rid & SERVER_BIT)) goto bad; - rc = dixLookupResource(&pRes, rid, RC_ANY, client, DixGetAttrAccess); + rc = dixLookupResourceByClass(&pRes, rid, RC_ANY, client, DixGetAttrAccess); if (rc != Success) goto bad; diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index f15c46090..f9448ba76 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -1161,7 +1161,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) #ifdef XKB /* Fix for key repeating bug. */ if (device->key != NULL && device->key->xkbInfo != NULL && - xE->u.u.type == KeyRelease) + (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease)) AccessXCancelRepeatKey(device->key->xkbInfo, xE->u.u.detail); #endif @@ -2661,8 +2661,8 @@ WindowsRestructured(void) DeviceIntPtr pDev = inputInfo.devices; while(pDev) { - if (DevHasCursor(pDev)) - CheckMotion((xEvent *)NULL, pDev); + if (pDev->isMaster || !pDev->u.master) + CheckMotion(NULL, pDev); pDev = pDev->next; } } @@ -4445,7 +4445,7 @@ ProcGrabPointer(ClientPtr client) cursor = NullCursor; else { - rc = dixLookupResource((pointer *)&cursor, stuff->cursor, RT_CURSOR, + rc = dixLookupResourceByType((pointer *)&cursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { @@ -4545,8 +4545,8 @@ ProcChangeActivePointerGrab(ClientPtr client) newCursor = NullCursor; else { - int rc = dixLookupResource((pointer *)&newCursor, stuff->cursor, - RT_CURSOR, client, DixUseAccess); + int rc = dixLookupResourceByType((pointer *)&newCursor, stuff->cursor, + RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = stuff->cursor; @@ -5146,7 +5146,7 @@ ProcGrabButton(ClientPtr client) cursor = NullCursor; else { - rc = dixLookupResource((pointer *)&cursor, stuff->cursor, RT_CURSOR, + rc = dixLookupResourceByType((pointer *)&cursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) if (!cursor) @@ -5396,7 +5396,7 @@ ProcRecolorCursor(ClientPtr client) REQUEST(xRecolorCursorReq); REQUEST_SIZE_MATCH(xRecolorCursorReq); - rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR, + rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor, RT_CURSOR, client, DixWriteAccess); if (rc != Success) { diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c index b9256940d..44bfe8b65 100644 --- a/xorg-server/dix/gc.c +++ b/xorg-server/dix/gc.c @@ -273,7 +273,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr else { NEXTVAL(XID, newpix); - rc = dixLookupResource((pointer *)&pPixmap, newpix, + rc = dixLookupResourceByType((pointer *)&pPixmap, newpix, RT_PIXMAP, client, DixReadAccess); } if (rc == Success) @@ -310,7 +310,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr else { NEXTVAL(XID, newstipple) - rc = dixLookupResource((pointer *)&pPixmap, newstipple, + rc = dixLookupResourceByType((pointer *)&pPixmap, newstipple, RT_PIXMAP, client, DixReadAccess); } if (rc == Success) @@ -353,7 +353,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr else { NEXTVAL(XID, newfont) - rc = dixLookupResource((pointer *)&pFont, newfont, + rc = dixLookupResourceByType((pointer *)&pFont, newfont, RT_FONT, client, DixUseAccess); } if (rc == Success) @@ -420,7 +420,7 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pPixmap = NullPixmap; } else { - rc = dixLookupResource((pointer *)&pPixmap, pid, + rc = dixLookupResourceByType((pointer *)&pPixmap, pid, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { diff --git a/xorg-server/dix/resource.c b/xorg-server/dix/resource.c index 7b0441ee9..7b133cae4 100644 --- a/xorg-server/dix/resource.c +++ b/xorg-server/dix/resource.c @@ -846,11 +846,10 @@ LegalNewID(XID id, ClientPtr client) } _X_EXPORT int -dixLookupResource(pointer *result, XID id, RESTYPE rtype, - ClientPtr client, Mask mode) +dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype, + ClientPtr client, Mask mode) { int cid = CLIENT_ID(id); - int istype = (rtype & TypeMask) && (rtype != RC_ANY); ResourcePtr res = NULL; *result = NULL; @@ -859,8 +858,38 @@ dixLookupResource(pointer *result, XID id, RESTYPE rtype, res = clientTable[cid].resources[Hash(cid, id)]; for (; res; res = res->next) - if ((res->id == id) && ((istype && res->type == rtype) || - (!istype && res->type & rtype))) + if (res->id == id && res->type == rtype) + break; + } + if (!res) + return BadValue; + + if (client) { + client->errorValue = id; + cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, + res->value, RT_NONE, NULL, mode); + if (cid != Success) + return cid; + } + + *result = res->value; + return Success; +} + +_X_EXPORT int +dixLookupResourceByClass(pointer *result, XID id, RESTYPE rclass, + ClientPtr client, Mask mode) +{ + int cid = CLIENT_ID(id); + ResourcePtr res = NULL; + + *result = NULL; + + if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { + res = clientTable[cid].resources[Hash(cid, id)]; + + for (; res; res = res->next) + if (res->id == id && (res->type & rclass)) break; } if (!res) diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 03ef09ac4..7b1af49cb 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -1068,7 +1068,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) } else { - rc = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP, + rc = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { @@ -1128,7 +1128,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) pixID = pWin->parent->border.pixmap->drawable.id; } } - rc = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP, + rc = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { @@ -1290,7 +1290,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) error = BadMatch; goto PatchUp; } - rc = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP, + rc = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP, client, DixUseAccess); if (rc != Success) { @@ -1366,7 +1366,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) } else { - rc = dixLookupResource((pointer *)&pCursor, cursorID, + rc = dixLookupResourceByType((pointer *)&pCursor, cursorID, RT_CURSOR, client, DixUseAccess); if (rc != Success) { @@ -3172,8 +3172,6 @@ dixSaveScreens(ClientPtr client, int on, int mode) if (on == SCREEN_SAVER_FORCER) { - UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; if (mode == ScreenSaverReset) what = SCREEN_SAVER_OFF; else |