summaryrefslogtreecommitdiff
path: root/xserver/randr
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
commit269d40cbcc43b41f621ca6d91c182952f60ec48e (patch)
tree872f2fddd3f2207e57a28595e73886713ce4a77a /xserver/randr
parent917a2249b787451cad3f9697872aeccfd0da3324 (diff)
Update to xserver 1.8. Tested by many. Ok oga@, todd@.
Diffstat (limited to 'xserver/randr')
-rw-r--r--xserver/randr/Makefile.in95
-rw-r--r--xserver/randr/randr.c14
-rw-r--r--xserver/randr/randrstr.h273
-rw-r--r--xserver/randr/rrcrtc.c114
-rw-r--r--xserver/randr/rrdispatch.c29
-rw-r--r--xserver/randr/rrmode.c50
-rw-r--r--xserver/randr/rroutput.c51
-rw-r--r--xserver/randr/rrproperty.c48
-rw-r--r--xserver/randr/rrscreen.c18
-rw-r--r--xserver/randr/rrsdispatch.c6
-rw-r--r--xserver/randr/rrtransform.h12
-rw-r--r--xserver/randr/rrxinerama.c13
12 files changed, 366 insertions, 357 deletions
diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in
index 3d8d5c75e..bbdb4772e 100644
--- a/xserver/randr/Makefile.in
+++ b/xserver/randr/Makefile.in
@@ -42,8 +42,8 @@ subdir = randr
DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(install_sh) -d
@@ -53,7 +53,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
- $(top_builddir)/include/kdrive-config.h
+ $(top_builddir)/include/kdrive-config.h \
+ $(top_builddir)/include/version-config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
librandr_la_LIBADD =
@@ -67,7 +68,7 @@ am_librandr_la_OBJECTS = mirandr.lo randr.lo rrcrtc.lo rrdispatch.lo \
rrinfo.lo rrmode.lo rroutput.lo rrpointer.lo rrproperty.lo \
rrscreen.lo rrsdispatch.lo rrtransform.lo $(am__objects_2)
librandr_la_OBJECTS = $(am_librandr_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -103,12 +104,13 @@ ALPHA_VIDEO_TRUE = @ALPHA_VIDEO_TRUE@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
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@
+ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@
ARM_VIDEO_FALSE = @ARM_VIDEO_FALSE@
ARM_VIDEO_TRUE = @ARM_VIDEO_TRUE@
AS = @AS@
@@ -136,6 +138,7 @@ CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
COMPOSITE_FALSE = @COMPOSITE_FALSE@
COMPOSITE_TRUE = @COMPOSITE_TRUE@
@@ -145,8 +148,11 @@ CONFIG_HAL_FALSE = @CONFIG_HAL_FALSE@
CONFIG_HAL_TRUE = @CONFIG_HAL_TRUE@
CONFIG_NEED_DBUS_FALSE = @CONFIG_NEED_DBUS_FALSE@
CONFIG_NEED_DBUS_TRUE = @CONFIG_NEED_DBUS_TRUE@
+CONFIG_UDEV_FALSE = @CONFIG_UDEV_FALSE@
+CONFIG_UDEV_TRUE = @CONFIG_UDEV_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -160,6 +166,7 @@ DBUS_LIBS = @DBUS_LIBS@
DEBUG_FALSE = @DEBUG_FALSE@
DEBUG_TRUE = @DEBUG_TRUE@
DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGDIR = @DEFAULT_LOGDIR@
DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
DEFS = @DEFS@
@@ -169,7 +176,9 @@ DGA_FALSE = @DGA_FALSE@
DGA_LIBS = @DGA_LIBS@
DGA_TRUE = @DGA_TRUE@
DIX_CFLAGS = @DIX_CFLAGS@
+DIX_LIB = @DIX_LIB@
DLLTOOL = @DLLTOOL@
+DLOPEN_LIBS = @DLOPEN_LIBS@
DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
@@ -185,6 +194,7 @@ DMX_BUILD_USB_TRUE = @DMX_BUILD_USB_TRUE@
DMX_FALSE = @DMX_FALSE@
DMX_TRUE = @DMX_TRUE@
DOLT_BASH = @DOLT_BASH@
+DOXYGEN = @DOXYGEN@
DPMSExtension_FALSE = @DPMSExtension_FALSE@
DPMSExtension_TRUE = @DPMSExtension_TRUE@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
@@ -197,8 +207,10 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
DRIPROTO_LIBS = @DRIPROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_CFLAGS = @DRI_CFLAGS@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
DRI_FALSE = @DRI_FALSE@
+DRI_LIBS = @DRI_LIBS@
DRI_TRUE = @DRI_TRUE@
DSYMUTIL = @DSYMUTIL@
DTRACE = @DTRACE@
@@ -214,8 +226,17 @@ FBDEVHW_TRUE = @FBDEVHW_TRUE@
FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FONT100DPIDIR = @FONT100DPIDIR@
+FONT75DPIDIR = @FONT75DPIDIR@
+FONTMISCDIR = @FONTMISCDIR@
+FONTOTFDIR = @FONTOTFDIR@
+FONTROOTDIR = @FONTROOTDIR@
+FONTTTFDIR = @FONTTTFDIR@
+FONTTYPE1DIR = @FONTTYPE1DIR@
FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GLX_FALSE = @GLX_FALSE@
@@ -225,18 +246,17 @@ GL_LIBS = @GL_LIBS@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_LIBS@
-HAVE_AGL_FRAMEWORK_FALSE = @HAVE_AGL_FRAMEWORK_FALSE@
-HAVE_AGL_FRAMEWORK_TRUE = @HAVE_AGL_FRAMEWORK_TRUE@
HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
-HAVE_XPLUGIN_FALSE = @HAVE_XPLUGIN_FALSE@
-HAVE_XPLUGIN_TRUE = @HAVE_XPLUGIN_TRUE@
+HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
+HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@
HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@
HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@
HPPA_VIDEO_TRUE = @HPPA_VIDEO_TRUE@
I386_VIDEO_FALSE = @I386_VIDEO_FALSE@
I386_VIDEO_TRUE = @I386_VIDEO_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_LIBXF86CONFIG_FALSE = @INSTALL_LIBXF86CONFIG_FALSE@
INSTALL_LIBXF86CONFIG_TRUE = @INSTALL_LIBXF86CONFIG_TRUE@
@@ -245,6 +265,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_SETUID_FALSE = @INSTALL_SETUID_FALSE@
INSTALL_SETUID_TRUE = @INSTALL_SETUID_TRUE@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT10MODULE_FALSE = @INT10MODULE_FALSE@
+INT10MODULE_TRUE = @INT10MODULE_TRUE@
INT10_STUB_FALSE = @INT10_STUB_FALSE@
INT10_STUB_TRUE = @INT10_STUB_TRUE@
INT10_VM86_FALSE = @INT10_VM86_FALSE@
@@ -257,20 +279,23 @@ KDRIVELINUX_FALSE = @KDRIVELINUX_FALSE@
KDRIVELINUX_TRUE = @KDRIVELINUX_TRUE@
KDRIVEOPENBSD_FALSE = @KDRIVEOPENBSD_FALSE@
KDRIVEOPENBSD_TRUE = @KDRIVEOPENBSD_TRUE@
-KDRIVEVESA_FALSE = @KDRIVEVESA_FALSE@
-KDRIVEVESA_TRUE = @KDRIVEVESA_TRUE@
KDRIVEWSCONS_FALSE = @KDRIVEWSCONS_FALSE@
KDRIVEWSCONS_TRUE = @KDRIVEWSCONS_TRUE@
KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_EVDEV_FALSE = @KDRIVE_EVDEV_FALSE@
+KDRIVE_EVDEV_TRUE = @KDRIVE_EVDEV_TRUE@
KDRIVE_FALSE = @KDRIVE_FALSE@
-KDRIVE_HW_FALSE = @KDRIVE_HW_FALSE@
-KDRIVE_HW_TRUE = @KDRIVE_HW_TRUE@
KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_KBD_FALSE = @KDRIVE_KBD_FALSE@
+KDRIVE_KBD_TRUE = @KDRIVE_KBD_TRUE@
KDRIVE_LIBS = @KDRIVE_LIBS@
KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_MOUSE_FALSE = @KDRIVE_MOUSE_FALSE@
+KDRIVE_MOUSE_TRUE = @KDRIVE_MOUSE_TRUE@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
KDRIVE_TRUE = @KDRIVE_TRUE@
+LAUNCHD_ID_PREFIX = @LAUNCHD_ID_PREFIX@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
LEX = @LEX@
@@ -299,12 +324,12 @@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
MAKE_PS = @MAKE_PS@
MAKE_TEXT = @MAKE_TEXT@
-MESA_SOURCE = @MESA_SOURCE@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MITSHM_FALSE = @MITSHM_FALSE@
@@ -323,6 +348,9 @@ OBJCFLAGS = @OBJCFLAGS@
OBJCLINK = @OBJCLINK@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+OS_LIB = @OS_LIB@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -351,34 +379,51 @@ SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
SECURE_RPC_FALSE = @SECURE_RPC_FALSE@
SECURE_RPC_TRUE = @SECURE_RPC_TRUE@
SED = @SED@
+SELINUX_CFLAGS = @SELINUX_CFLAGS@
+SELINUX_LIBS = @SELINUX_LIBS@
SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SGI_VIDEO_FALSE = @SGI_VIDEO_FALSE@
SGI_VIDEO_TRUE = @SGI_VIDEO_TRUE@
+SHA1_CFLAGS = @SHA1_CFLAGS@
+SHA1_LIBS = @SHA1_LIBS@
SHELL = @SHELL@
SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
SOLARIS_ASM_INLINE_FALSE = @SOLARIS_ASM_INLINE_FALSE@
SOLARIS_ASM_INLINE_TRUE = @SOLARIS_ASM_INLINE_TRUE@
SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
-SOLARIS_USL_CONSOLE_FALSE = @SOLARIS_USL_CONSOLE_FALSE@
-SOLARIS_USL_CONSOLE_TRUE = @SOLARIS_USL_CONSOLE_TRUE@
+SOLARIS_VT_FALSE = @SOLARIS_VT_FALSE@
+SOLARIS_VT_TRUE = @SOLARIS_VT_TRUE@
SPARC64_VIDEO_FALSE = @SPARC64_VIDEO_FALSE@
SPARC64_VIDEO_TRUE = @SPARC64_VIDEO_TRUE@
+SPECIAL_DTRACE_OBJECTS_FALSE = @SPECIAL_DTRACE_OBJECTS_FALSE@
+SPECIAL_DTRACE_OBJECTS_TRUE = @SPECIAL_DTRACE_OBJECTS_TRUE@
STANDALONE_XPBPROXY_FALSE = @STANDALONE_XPBPROXY_FALSE@
STANDALONE_XPBPROXY_TRUE = @STANDALONE_XPBPROXY_TRUE@
STRIP = @STRIP@
+SYSCONFDIR = @SYSCONFDIR@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_FALSE = @TSLIB_FALSE@
TSLIB_LIBS = @TSLIB_LIBS@
TSLIB_TRUE = @TSLIB_TRUE@
+UDEV_CFLAGS = @UDEV_CFLAGS@
+UDEV_LIBS = @UDEV_LIBS@
+UNITTESTS_FALSE = @UNITTESTS_FALSE@
+UNITTESTS_TRUE = @UNITTESTS_TRUE@
UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
-VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
-VENDOR_NAME = @VENDOR_NAME@
+VBE_FALSE = @VBE_FALSE@
+VBE_TRUE = @VBE_TRUE@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
-VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
+VGAHW_FALSE = @VGAHW_FALSE@
+VGAHW_TRUE = @VGAHW_TRUE@
+WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@
+WINDOWSWM_LIBS = @WINDOWSWM_LIBS@
+WINDRES = @WINDRES@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XAA_FALSE = @XAA_FALSE@
+XAA_TRUE = @XAA_TRUE@
XACE_FALSE = @XACE_FALSE@
XACE_TRUE = @XACE_TRUE@
XCALIBRATE_FALSE = @XCALIBRATE_FALSE@
@@ -403,6 +448,7 @@ XEPHYR_LIBS = @XEPHYR_LIBS@
XEPHYR_TRUE = @XEPHYR_TRUE@
XF86BIGFONT_FALSE = @XF86BIGFONT_FALSE@
XF86BIGFONT_TRUE = @XF86BIGFONT_TRUE@
+XF86CONFIGDIR = @XF86CONFIGDIR@
XF86CONFIGFILE = @XF86CONFIGFILE@
XF86UTILS_FALSE = @XF86UTILS_FALSE@
XF86UTILS_TRUE = @XF86UTILS_TRUE@
@@ -445,15 +491,14 @@ XORG_TRUE = @XORG_TRUE@
XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
XPBPROXY_LIBS = @XPBPROXY_LIBS@
XQUARTZ_FALSE = @XQUARTZ_FALSE@
+XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
+XQUARTZ_SPARKLE_FALSE = @XQUARTZ_SPARKLE_FALSE@
+XQUARTZ_SPARKLE_TRUE = @XQUARTZ_SPARKLE_TRUE@
XQUARTZ_TRUE = @XQUARTZ_TRUE@
XREGISTRY_FALSE = @XREGISTRY_FALSE@
XREGISTRY_TRUE = @XREGISTRY_TRUE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
-XSDLSERVER_FALSE = @XSDLSERVER_FALSE@
-XSDLSERVER_TRUE = @XSDLSERVER_TRUE@
-XSDL_INCS = @XSDL_INCS@
-XSDL_LIBS = @XSDL_LIBS@
XSELINUX_FALSE = @XSELINUX_FALSE@
XSELINUX_TRUE = @XSELINUX_TRUE@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
@@ -501,10 +546,10 @@ X_PRIVSEP_FALSE = @X_PRIVSEP_FALSE@
X_PRIVSEP_TRUE = @X_PRIVSEP_TRUE@
YACC = @YACC@
YFLAGS = @YFLAGS@
+__XCONFIGDIR__ = @__XCONFIGDIR__@
__XCONFIGFILE__ = @__XCONFIGFILE__@
abi_ansic = @abi_ansic@
abi_extension = @abi_extension@
-abi_font = @abi_font@
abi_videodrv = @abi_videodrv@
abi_xinput = @abi_xinput@
ac_ct_CC = @ac_ct_CC@
@@ -559,7 +604,9 @@ psdir = @psdir@
sbindir = @sbindir@
sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
+symbol_visibility = @symbol_visibility@
sysconfdir = @sysconfdir@
+sysconfigdir = @sysconfigdir@
target_alias = @target_alias@
noinst_LTLIBRARIES = librandr.la
AM_CFLAGS = $(DIX_CFLAGS)
diff --git a/xserver/randr/randr.c b/xserver/randr/randr.c
index 5bcb3597a..b63a7f22e 100644
--- a/xserver/randr/randr.c
+++ b/xserver/randr/randr.c
@@ -25,8 +25,6 @@
* Keith Packard, Intel Corporation
*/
-#define NEED_REPLIES
-#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -100,6 +98,8 @@ RRCloseScreen (int i, ScreenPtr pScreen)
for (j = pScrPriv->numOutputs - 1; j >= 0; j--)
RROutputDestroy (pScrPriv->outputs[j]);
+ xfree (pScrPriv->crtcs);
+ xfree (pScrPriv->outputs);
xfree (pScrPriv);
RRNScreens -= 1; /* ok, one fewer screen with RandR running */
return (*pScreen->CloseScreen) (i, pScreen);
@@ -288,7 +288,8 @@ RRFreeClient (pointer data, XID id)
pRREvent = (RREventPtr) data;
pWin = pRREvent->window;
- pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, RREventType);
+ dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ RREventType, serverClient, DixDestroyAccess);
if (pHead) {
pPrev = 0;
for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next)
@@ -335,10 +336,10 @@ RRExtensionInit (void)
if (!AddCallback (&ClientStateCallback, RRClientCallback, 0))
return;
- RRClientType = CreateNewResourceType(RRFreeClient);
+ RRClientType = CreateNewResourceType(RRFreeClient, "RandRClient");
if (!RRClientType)
return;
- RREventType = CreateNewResourceType(RRFreeEvents);
+ RREventType = CreateNewResourceType(RRFreeEvents, "RandREvent");
if (!RREventType)
return;
extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors,
@@ -366,7 +367,8 @@ TellChanged (WindowPtr pWin, pointer value)
rrScrPriv(pScreen);
int i;
- pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, RREventType);
+ dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ RREventType, serverClient, DixReadAccess);
if (!pHead)
return WT_WALKCHILDREN;
diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h
index 9c9b7c074..975fe3396 100644
--- a/xserver/randr/randrstr.h
+++ b/xserver/randr/randrstr.h
@@ -65,10 +65,10 @@ typedef XID RRMode;
typedef XID RROutput;
typedef XID RRCrtc;
-extern int RREventBase, RRErrorBase;
+extern _X_EXPORT int RREventBase, RRErrorBase;
-extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr);
-extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
+extern _X_EXPORT int (*ProcRandrVector[RRNumberRequests])(ClientPtr);
+extern _X_EXPORT int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
/*
* Modeline for a monitor. Name follows directly after this struct
@@ -173,6 +173,9 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen,
RRCrtcPtr crtc);
+typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen,
+ RRCrtcPtr crtc);
+
typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
@@ -245,6 +248,7 @@ typedef struct _rrScrPriv {
RRScreenSetSizeProcPtr rrScreenSetSize;
RRCrtcSetProcPtr rrCrtcSet;
RRCrtcSetGammaProcPtr rrCrtcSetGamma;
+ RRCrtcGetGammaProcPtr rrCrtcGetGamma;
RROutputSetPropertyProcPtr rrOutputSetProperty;
RROutputValidateModeProcPtr rrOutputValidateMode;
RRModeDestroyProcPtr rrModeDestroy;
@@ -297,7 +301,7 @@ typedef struct _rrScrPriv {
#endif
} rrScrPrivRec, *rrScrPrivPtr;
-extern DevPrivateKey rrPrivKey;
+extern _X_EXPORT DevPrivateKey rrPrivKey;
#define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey))
#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
@@ -332,32 +336,52 @@ typedef struct _RRClient {
/* RRTimesRec times[0]; */
} RRClientRec, *RRClientPtr;
-extern RESTYPE RRClientType, RREventType; /* resource types for event masks */
-extern DevPrivateKey RRClientPrivateKey;
-extern RESTYPE RRCrtcType, RRModeType, RROutputType;
-
-#define LookupOutput(client,id,a) ((RROutputPtr) \
- (SecurityLookupIDByType (client, id, \
- RROutputType, a)))
-#define LookupCrtc(client,id,a) ((RRCrtcPtr) \
- (SecurityLookupIDByType (client, id, \
- RRCrtcType, a)))
-#define LookupMode(client,id,a) ((RRModePtr) \
- (SecurityLookupIDByType (client, id, \
- RRModeType, a)))
+extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for event masks */
+extern _X_EXPORT DevPrivateKey RRClientPrivateKey;
+extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
+
+#define VERIFY_RR_OUTPUT(id, ptr, a)\
+ {\
+ int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
+ RROutputType, client, a);\
+ if (rc != Success) {\
+ client->errorValue = id;\
+ return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;\
+ }\
+ }
+
+#define VERIFY_RR_CRTC(id, ptr, a)\
+ {\
+ int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
+ RRCrtcType, client, a);\
+ if (rc != Success) {\
+ client->errorValue = id;\
+ return (rc == BadValue) ? RRErrorBase + BadRRCrtc : rc;\
+ }\
+ }
+
+#define VERIFY_RR_MODE(id, ptr, a)\
+ {\
+ int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
+ RRModeType, client, a);\
+ if (rc != Success) {\
+ client->errorValue = id;\
+ return (rc == BadValue) ? RRErrorBase + BadRRMode : rc;\
+ }\
+ }
#define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
/* Initialize the extension */
-void
+extern _X_EXPORT void
RRExtensionInit (void);
#ifdef RANDR_12_INTERFACE
/*
* Set the range of sizes for the screen
*/
-void
+extern _X_EXPORT void
RRScreenSetSizeRange (ScreenPtr pScreen,
CARD16 minWidth,
CARD16 minHeight,
@@ -371,13 +395,13 @@ RRScreenSetSizeRange (ScreenPtr pScreen,
* The driver is responsible for calling this whenever it has changed
* the size of the screen
*/
-void
+extern _X_EXPORT void
RRScreenSizeNotify (ScreenPtr pScreen);
/*
* Request that the screen be resized
*/
-Bool
+extern _X_EXPORT Bool
RRScreenSizeSet (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
@@ -387,47 +411,44 @@ RRScreenSizeSet (ScreenPtr pScreen,
/*
* Send ConfigureNotify event to root window when 'something' happens
*/
-void
+extern _X_EXPORT void
RRSendConfigNotify (ScreenPtr pScreen);
/*
* screen dispatch
*/
-int
+extern _X_EXPORT int
ProcRRGetScreenSizeRange (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRSetScreenSize (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetScreenResources (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetScreenResourcesCurrent (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRSetScreenConfig (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetScreenInfo (ClientPtr client);
/*
* Deliver a ScreenNotify event
*/
-void
+extern _X_EXPORT void
RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
/* mirandr.c */
-Bool
+extern _X_EXPORT Bool
miRandRInit (ScreenPtr pScreen);
-Bool
+extern _X_EXPORT Bool
miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
-Bool
-miRRGetScreenInfo (ScreenPtr pScreen);
-
-Bool
+extern _X_EXPORT Bool
miRRCrtcSet (ScreenPtr pScreen,
RRCrtcPtr crtc,
RRModePtr mode,
@@ -437,23 +458,23 @@ miRRCrtcSet (ScreenPtr pScreen,
int numOutput,
RROutputPtr *outputs);
-Bool
+extern _X_EXPORT Bool
miRROutputSetProperty (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
RRPropertyValuePtr value);
-Bool
+extern _X_EXPORT Bool
miRROutputGetProperty (ScreenPtr pScreen,
RROutputPtr output,
Atom property);
-Bool
+extern _X_EXPORT Bool
miRROutputValidateMode (ScreenPtr pScreen,
RROutputPtr output,
RRModePtr mode);
-void
+extern _X_EXPORT void
miRRModeDestroy (ScreenPtr pScreen,
RRModePtr mode);
@@ -461,26 +482,26 @@ miRRModeDestroy (ScreenPtr pScreen,
/*
* Send all pending events
*/
-void
+extern _X_EXPORT void
RRTellChanged (ScreenPtr pScreen);
/*
* Poll the driver for changed information
*/
-Bool
+extern _X_EXPORT Bool
RRGetInfo (ScreenPtr pScreen, Bool force_query);
-Bool RRInit (void);
+extern _X_EXPORT Bool RRInit (void);
-Bool RRScreenInit(ScreenPtr pScreen);
+extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
-RROutputPtr
+extern _X_EXPORT RROutputPtr
RRFirstOutput (ScreenPtr pScreen);
-Rotation
+extern _X_EXPORT Rotation
RRGetRotation (ScreenPtr pScreen);
-CARD16
+extern _X_EXPORT CARD16
RRVerticalRefresh (xRRModeInfo *mode);
#ifdef RANDR_10_INTERFACE
@@ -493,14 +514,15 @@ RRVerticalRefresh (xRRModeInfo *mode);
* Then, register the specific size with the screen
*/
-RRScreenSizePtr
+extern _X_EXPORT RRScreenSizePtr
RRRegisterSize (ScreenPtr pScreen,
short width,
short height,
short mmWidth,
short mmHeight);
-Bool RRRegisterRate (ScreenPtr pScreen,
+extern _X_EXPORT Bool
+RRRegisterRate (ScreenPtr pScreen,
RRScreenSizePtr pSize,
int rate);
@@ -508,23 +530,17 @@ Bool RRRegisterRate (ScreenPtr pScreen,
* Finally, set the current configuration of the screen
*/
-void
+extern _X_EXPORT void
RRSetCurrentConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize);
-Bool RRScreenInit (ScreenPtr pScreen);
+extern _X_EXPORT Bool RRScreenInit (ScreenPtr pScreen);
-Rotation
+extern _X_EXPORT Rotation
RRGetRotation (ScreenPtr pScreen);
-int
-RRSetScreenConfig (ScreenPtr pScreen,
- Rotation rotation,
- int rate,
- RRScreenSizePtr pSize);
-
#endif
/* rrcrtc.c */
@@ -533,32 +549,32 @@ RRSetScreenConfig (ScreenPtr pScreen,
* Notify the CRTC of some change; layoutChanged indicates that
* some position or size element changed
*/
-void
+extern _X_EXPORT void
RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged);
/*
* Create a CRTC
*/
-RRCrtcPtr
+extern _X_EXPORT RRCrtcPtr
RRCrtcCreate (ScreenPtr pScreen, void *devPrivate);
/*
* Set the allowed rotations on a CRTC
*/
-void
+extern _X_EXPORT void
RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations);
/*
* Set whether transforms are allowed on a CRTC
*/
-void
+extern _X_EXPORT void
RRCrtcSetTransformSupport (RRCrtcPtr crtc, Bool transforms);
/*
* Notify the extension that the Crtc has been reconfigured,
* the driver calls this whenever it has updated the mode
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcNotify (RRCrtcPtr crtc,
RRModePtr mode,
int x,
@@ -568,13 +584,13 @@ RRCrtcNotify (RRCrtcPtr crtc,
int numOutputs,
RROutputPtr *outputs);
-void
+extern _X_EXPORT void
RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
/*
* Request that the Crtc be reconfigured
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcSet (RRCrtcPtr crtc,
RRModePtr mode,
int x,
@@ -587,26 +603,34 @@ RRCrtcSet (RRCrtcPtr crtc,
* Request that the Crtc gamma be changed
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcGammaSet (RRCrtcPtr crtc,
CARD16 *red,
CARD16 *green,
CARD16 *blue);
/*
+ * Request current gamma back from the DDX (if possible).
+ * This includes gamma size.
+ */
+
+extern _X_EXPORT Bool
+RRCrtcGammaGet(RRCrtcPtr crtc);
+
+/*
* Notify the extension that the Crtc gamma has been changed
* The driver calls this whenever it has changed the gamma values
* in the RRCrtcRec
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcGammaNotify (RRCrtcPtr crtc);
/*
* Set the size of the gamma table at server startup time
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcGammaSetSize (RRCrtcPtr crtc,
int size);
@@ -615,7 +639,7 @@ RRCrtcGammaSetSize (RRCrtcPtr crtc,
* taking into account the current mode and rotation
*/
-void
+extern _X_EXPORT void
RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
/*
@@ -625,7 +649,7 @@ RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
*
* Return TRUE if the resulting transform is not a simple translation.
*/
-Bool
+extern _X_EXPORT Bool
RRTransformCompute (int x,
int y,
int width,
@@ -640,19 +664,19 @@ RRTransformCompute (int x,
/*
* Return crtc transform
*/
-RRTransformPtr
+extern _X_EXPORT RRTransformPtr
RRCrtcGetTransform (RRCrtcPtr crtc);
/*
* Check whether the pending and current transforms are the same
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcPendingTransform (RRCrtcPtr crtc);
/*
* Destroy a Crtc at shutdown
*/
-void
+extern _X_EXPORT void
RRCrtcDestroy (RRCrtcPtr crtc);
@@ -660,7 +684,7 @@ RRCrtcDestroy (RRCrtcPtr crtc);
* Set the pending CRTC transformation
*/
-int
+extern _X_EXPORT int
RRCrtcTransformSet (RRCrtcPtr crtc,
PictTransformPtr transform,
struct pict_f_transform *f_transform,
@@ -673,32 +697,32 @@ RRCrtcTransformSet (RRCrtcPtr crtc,
/*
* Initialize crtc type
*/
-Bool
+extern _X_EXPORT Bool
RRCrtcInit (void);
/*
* Crtc dispatch
*/
-int
+extern _X_EXPORT int
ProcRRGetCrtcInfo (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRSetCrtcConfig (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetCrtcGammaSize (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetCrtcGamma (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRSetCrtcGamma (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRSetCrtcTransform (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetCrtcTransform (ClientPtr client);
int
@@ -708,7 +732,7 @@ int
ProcRRSetPanning (ClientPtr client);
/* rrdispatch.c */
-Bool
+extern _X_EXPORT Bool
RRClientKnowsRates (ClientPtr pClient);
/* rrmode.c */
@@ -716,42 +740,39 @@ RRClientKnowsRates (ClientPtr pClient);
* Find, and if necessary, create a mode
*/
-RRModePtr
+extern _X_EXPORT RRModePtr
RRModeGet (xRRModeInfo *modeInfo,
const char *name);
-void
-RRModePruneUnused (ScreenPtr pScreen);
-
/*
* Destroy a mode.
*/
-void
+extern _X_EXPORT void
RRModeDestroy (RRModePtr mode);
/*
* Return a list of modes that are valid for some output in pScreen
*/
-RRModePtr *
+extern _X_EXPORT RRModePtr *
RRModesForScreen (ScreenPtr pScreen, int *num_ret);
/*
* Initialize mode type
*/
-Bool
+extern _X_EXPORT Bool
RRModeInit (void);
-int
+extern _X_EXPORT int
ProcRRCreateMode (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRDestroyMode (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRAddOutputMode (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRDeleteOutputMode (ClientPtr client);
/* rroutput.c */
@@ -762,14 +783,14 @@ ProcRRDeleteOutputMode (ClientPtr client);
* has changed, or whether the change was strictly internal
* (which crtc is in use)
*/
-void
+extern _X_EXPORT void
RROutputChanged (RROutputPtr output, Bool configChanged);
/*
* Create an output
*/
-RROutputPtr
+extern _X_EXPORT RROutputPtr
RROutputCreate (ScreenPtr pScreen,
const char *name,
int nameLength,
@@ -778,118 +799,120 @@ RROutputCreate (ScreenPtr pScreen,
/*
* Notify extension that output parameters have been changed
*/
-Bool
+extern _X_EXPORT Bool
RROutputSetClones (RROutputPtr output,
RROutputPtr *clones,
int numClones);
-Bool
+extern _X_EXPORT Bool
RROutputSetModes (RROutputPtr output,
RRModePtr *modes,
int numModes,
int numPreferred);
-int
+extern _X_EXPORT int
RROutputAddUserMode (RROutputPtr output,
RRModePtr mode);
-int
+extern _X_EXPORT int
RROutputDeleteUserMode (RROutputPtr output,
RRModePtr mode);
-Bool
+extern _X_EXPORT Bool
RROutputSetCrtcs (RROutputPtr output,
RRCrtcPtr *crtcs,
int numCrtcs);
-Bool
+extern _X_EXPORT Bool
RROutputSetConnection (RROutputPtr output,
CARD8 connection);
-Bool
+extern _X_EXPORT Bool
RROutputSetSubpixelOrder (RROutputPtr output,
int subpixelOrder);
-Bool
+extern _X_EXPORT Bool
RROutputSetPhysicalSize (RROutputPtr output,
int mmWidth,
int mmHeight);
-void
+extern _X_EXPORT void
RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
-void
+extern _X_EXPORT void
RROutputDestroy (RROutputPtr output);
-int
+extern _X_EXPORT int
ProcRRGetOutputInfo (ClientPtr client);
-extern int
+extern _X_EXPORT int
ProcRRSetOutputPrimary (ClientPtr client);
-extern int
+extern _X_EXPORT int
ProcRRGetOutputPrimary (ClientPtr client);
/*
* Initialize output type
*/
-Bool
+extern _X_EXPORT Bool
RROutputInit (void);
/* rrpointer.c */
-void
+extern _X_EXPORT void
RRPointerMoved (ScreenPtr pScreen, int x, int y);
-void
+extern _X_EXPORT void
RRPointerScreenConfigured (ScreenPtr pScreen);
/* rrproperty.c */
-void
+extern _X_EXPORT void
RRDeleteAllOutputProperties (RROutputPtr output);
-RRPropertyValuePtr
+extern _X_EXPORT RRPropertyValuePtr
RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);
-RRPropertyPtr
+extern _X_EXPORT RRPropertyPtr
RRQueryOutputProperty (RROutputPtr output, Atom property);
-void
+extern _X_EXPORT void
RRDeleteOutputProperty (RROutputPtr output, Atom property);
-Bool
+extern _X_EXPORT Bool
RRPostPendingProperties (RROutputPtr output);
-int
+extern _X_EXPORT int
RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
pointer value, Bool sendevent, Bool pending);
-int
+extern _X_EXPORT int
RRConfigureOutputProperty (RROutputPtr output, Atom property,
Bool pending, Bool range, Bool immutable,
int num_values, INT32 *values);
-int
+extern _X_EXPORT int
ProcRRChangeOutputProperty (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRGetOutputProperty (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRListOutputProperties (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRQueryOutputProperty (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRConfigureOutputProperty (ClientPtr client);
-int
+extern _X_EXPORT int
ProcRRDeleteOutputProperty (ClientPtr client);
/* rrxinerama.c */
-void
+#ifdef XINERAMA
+extern _X_EXPORT void
RRXineramaExtensionInit(void);
+#endif
#endif /* _RANDRSTR_H_ */
diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c
index 8a5738fc5..a9eb2d262 100644
--- a/xserver/randr/rrcrtc.c
+++ b/xserver/randr/rrcrtc.c
@@ -22,7 +22,6 @@
#include "randrstr.h"
#include "swaprep.h"
-#include "registry.h"
RESTYPE RRCrtcType;
@@ -480,6 +479,29 @@ RRCrtcGammaSet (RRCrtcPtr crtc,
}
/*
+ * Request current gamma back from the DDX (if possible).
+ * This includes gamma size.
+ */
+Bool
+RRCrtcGammaGet(RRCrtcPtr crtc)
+{
+ Bool ret = TRUE;
+#if RANDR_12_INTERFACE
+ ScreenPtr pScreen = crtc->pScreen;
+#endif
+
+#if RANDR_12_INTERFACE
+ if (pScreen)
+ {
+ rrScrPriv(pScreen);
+ if (pScrPriv->rrCrtcGetGamma)
+ ret = (*pScrPriv->rrCrtcGetGamma) (pScreen, crtc);
+ }
+#endif
+ return ret;
+}
+
+/*
* Notify the extension that the Crtc gamma has been changed
* The driver calls this whenever it has changed the gamma values
* in the RRCrtcRec
@@ -610,10 +632,9 @@ RRCrtcTransformSet (RRCrtcPtr crtc,
Bool
RRCrtcInit (void)
{
- RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource);
+ RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC");
if (!RRCrtcType)
return FALSE;
- RegisterResourceName (RRCrtcType, "CRTC");
return TRUE;
}
@@ -635,10 +656,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
BoxRec panned_area;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
- crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
-
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
/* All crtcs must be associated with screens before client
* requests are processed
@@ -752,17 +770,13 @@ ProcRRSetCrtcConfig (ClientPtr client)
TimeStamp configTime;
TimeStamp time;
Rotation rotation;
- int i, j;
+ int rc, i, j;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
- numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2));
+ numOutputs = (stuff->length - bytes_to_int32(SIZEOF (xRRSetCrtcConfigReq)));
- crtc = LookupIDByType (stuff->crtc, RRCrtcType);
- if (!crtc)
- {
- client->errorValue = stuff->crtc;
- return RRErrorBase + BadRRCrtc;
- }
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixSetAttrAccess);
+
if (stuff->mode == None)
{
mode = NULL;
@@ -771,12 +785,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
}
else
{
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_MODE(stuff->mode, mode, DixSetAttrAccess);
if (numOutputs == 0)
return BadMatch;
}
@@ -792,13 +801,13 @@ ProcRRSetCrtcConfig (ClientPtr client)
outputIds = (RROutput *) (stuff + 1);
for (i = 0; i < numOutputs; i++)
{
- outputs[i] = (RROutputPtr) LookupIDByType (outputIds[i], RROutputType);
- if (!outputs[i])
+ rc = dixLookupResourceByType((pointer *)(outputs + i), outputIds[i],
+ RROutputType, client, DixSetAttrAccess);
+ if (rc != Success)
{
- client->errorValue = outputIds[i];
if (outputs)
xfree (outputs);
- return RRErrorBase + BadRROutput;
+ return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;
}
/* validate crtc for this output */
for (j = 0; j < outputs[i]->numCrtcs; j++)
@@ -1005,10 +1014,7 @@ ProcRRGetPanning (ClientPtr client)
int n;
REQUEST_SIZE_MATCH(xRRGetPanningReq);
- crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
-
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
/* All crtcs must be associated with screens before client
* requests are processed
@@ -1078,11 +1084,7 @@ ProcRRSetPanning (ClientPtr client)
int n;
REQUEST_SIZE_MATCH(xRRSetPanningReq);
- crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
-
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
-
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
/* All crtcs must be associated with screens before client
* requests are processed
@@ -1155,10 +1157,12 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
- crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
-
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
+
+ /* Gamma retrieval failed, any better error? */
+ if (!RRCrtcGammaGet(crtc))
+ return RRErrorBase + BadRRCrtc;
+
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = 0;
@@ -1183,10 +1187,12 @@ ProcRRGetCrtcGamma (ClientPtr client)
char *extra = NULL;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
- crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
-
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
+
+ /* Gamma retrieval failed, any better error? */
+ if (!RRCrtcGammaGet(crtc))
+ return RRErrorBase + BadRRCrtc;
+
len = crtc->gammaSize * 3 * 2;
if (crtc->gammaSize) {
@@ -1197,7 +1203,7 @@ ProcRRGetCrtcGamma (ClientPtr client)
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
- reply.length = (len + 3) >> 2;
+ reply.length = bytes_to_int32(len);
reply.size = crtc->gammaSize;
if (client->swapped) {
swaps (&reply.sequenceNumber, n);
@@ -1224,11 +1230,9 @@ ProcRRSetCrtcGamma (ClientPtr client)
CARD16 *red, *green, *blue;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
- crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
- len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2);
+ len = client->req_len - bytes_to_int32(sizeof (xRRSetCrtcGammaReq));
if (len < (stuff->size * 3 + 1) >> 1)
return BadLength;
@@ -1259,9 +1263,7 @@ ProcRRSetCrtcTransform (ClientPtr client)
int nparams;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
- crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
PictTransform_from_xRenderTransform (&transform, &stuff->transform);
pixman_f_transform_from_pixman_transform (&f_transform, &transform);
@@ -1270,7 +1272,7 @@ ProcRRSetCrtcTransform (ClientPtr client)
filter = (char *) (stuff + 1);
nbytes = stuff->nbytesFilter;
- params = (xFixed *) (filter + ((nbytes + 3) & ~3));
+ params = (xFixed *) (filter + pad_to_int32(nbytes));
nparams = ((xFixed *) stuff + client->req_len) - params;
if (nparams < 0)
return BadLength;
@@ -1291,7 +1293,7 @@ transform_filter_length (RRTransformPtr transform)
return 0;
nbytes = strlen (transform->filter->name);
nparams = transform->nparams;
- return ((nbytes + 3) & ~3) + (nparams * sizeof (xFixed));
+ return pad_to_int32(nbytes) + (nparams * sizeof (xFixed));
}
static int
@@ -1330,7 +1332,7 @@ transform_encode (ClientPtr client, xRenderTransform *wire, PictTransform *pict)
{
xRenderTransform_from_PictTransform (wire, pict);
if (client->swapped)
- SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform) >> 2);
+ SwapLongs ((CARD32 *) wire, bytes_to_int32(sizeof(xRenderTransform)));
}
int
@@ -1344,9 +1346,7 @@ ProcRRGetCrtcTransform (ClientPtr client)
char *extra;
REQUEST_SIZE_MATCH (xRRGetCrtcTransformReq);
- crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
- if (!crtc)
- return RRErrorBase + BadRRCrtc;
+ VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
pending = &crtc->client_pending_transform;
current = &crtc->client_current_transform;
@@ -1361,7 +1361,7 @@ ProcRRGetCrtcTransform (ClientPtr client)
extra = (char *) (reply + 1);
reply->type = X_Reply;
reply->sequenceNumber = client->sequence;
- reply->length = (CrtcTransformExtra + nextra) >> 2;
+ reply->length = bytes_to_int32(CrtcTransformExtra + nextra);
reply->hasTransforms = crtc->transforms;
diff --git a/xserver/randr/rrdispatch.c b/xserver/randr/rrdispatch.c
index 0925875bf..ffb46a48c 100644
--- a/xserver/randr/rrdispatch.c
+++ b/xserver/randr/rrdispatch.c
@@ -21,9 +21,7 @@
*/
#include "randrstr.h"
-
-#define SERVER_RANDR_MAJOR 1
-#define SERVER_RANDR_MINOR 3
+#include "protocol-versions.h"
Bool
RRClientKnowsRates (ClientPtr pClient)
@@ -48,12 +46,18 @@ ProcRRQueryVersion (ClientPtr client)
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
- /*
- * Report the current version; the current
- * spec says they're all compatible after 1.0
- */
- rep.majorVersion = SERVER_RANDR_MAJOR;
- rep.minorVersion = SERVER_RANDR_MINOR;
+
+ if ((stuff->majorVersion * 1000 + stuff->minorVersion) <
+ (SERVER_RANDR_MAJOR_VERSION * 1000 + SERVER_RANDR_MINOR_VERSION))
+ {
+ rep.majorVersion = stuff->majorVersion;
+ rep.minorVersion = stuff->minorVersion;
+ } else
+ {
+ rep.majorVersion = SERVER_RANDR_MAJOR_VERSION;
+ rep.minorVersion = SERVER_RANDR_MINOR_VERSION;
+ }
+
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
@@ -79,9 +83,10 @@ ProcRRSelectInput (ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
if (rc != Success)
return rc;
- pHead = (RREventPtr *)SecurityLookupIDByType(client,
- pWin->drawable.id, RREventType,
- DixWriteAccess);
+ rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ RREventType, client, DixWriteAccess);
+ if (rc != Success && rc != BadValue)
+ return rc;
if (stuff->enable & (RRScreenChangeNotifyMask|
RRCrtcChangeNotifyMask|
diff --git a/xserver/randr/rrmode.c b/xserver/randr/rrmode.c
index 2fa440385..139619367 100644
--- a/xserver/randr/rrmode.c
+++ b/xserver/randr/rrmode.c
@@ -21,7 +21,6 @@
*/
#include "randrstr.h"
-#include "registry.h"
RESTYPE RRModeType;
@@ -266,10 +265,9 @@ RRModeInit (void)
{
assert (num_modes == 0);
assert (modes == NULL);
- RRModeType = CreateNewResourceType (RRModeDestroyResource);
+ RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
if (!RRModeType)
return FALSE;
- RegisterResourceName (RRModeType, "MODE");
return TRUE;
}
@@ -288,7 +286,7 @@ ProcRRCreateMode (ClientPtr client)
RRModePtr mode;
REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -297,10 +295,10 @@ ProcRRCreateMode (ClientPtr client)
modeInfo = &stuff->modeInfo;
name = (char *) (stuff + 1);
- units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2));
+ units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));
/* check to make sure requested name fits within the data provided */
- if ((int) (modeInfo->nameLength + 3) >> 2 > units_after)
+ if (bytes_to_int32(modeInfo->nameLength) > units_after)
return BadLength;
mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
@@ -332,12 +330,8 @@ ProcRRDestroyMode (ClientPtr client)
RRModePtr mode;
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_MODE(stuff->mode, mode, DixDestroyAccess);
+
if (!mode->userScreen)
return BadMatch;
if (mode->refcnt > 1)
@@ -354,20 +348,8 @@ ProcRRAddOutputMode (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output)
- {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
-
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
return RROutputAddUserMode (output, mode);
}
@@ -380,20 +362,8 @@ ProcRRDeleteOutputMode (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output)
- {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
-
- mode = LookupIDByType (stuff->mode, RRModeType);
- if (!mode)
- {
- client->errorValue = stuff->mode;
- return RRErrorBase + BadRRMode;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
return RROutputDeleteUserMode (output, mode);
}
diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c
index 101dc3ef0..48b557991 100644
--- a/xserver/randr/rroutput.c
+++ b/xserver/randr/rroutput.c
@@ -22,7 +22,6 @@
*/
#include "randrstr.h"
-#include "registry.h"
RESTYPE RROutputType;
@@ -424,10 +423,9 @@ RROutputDestroyResource (pointer value, XID pid)
Bool
RROutputInit (void)
{
- RROutputType = CreateNewResourceType (RROutputDestroyResource);
+ RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
if (!RROutputType)
return FALSE;
- RegisterResourceName (RROutputType, "OUTPUT");
return TRUE;
}
@@ -450,20 +448,14 @@ ProcRRGetOutputInfo (ClientPtr client)
int i, n;
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output)
- {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
pScreen = output->pScreen;
pScrPriv = rrGetScrPriv(pScreen);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = OutputInfoExtra >> 2;
+ rep.length = bytes_to_int32(OutputInfoExtra);
rep.timestamp = pScrPriv->lastSetTime.milliseconds;
rep.crtc = output->crtc ? output->crtc->id : None;
rep.mmWidth = output->mmWidth;
@@ -476,14 +468,14 @@ ProcRRGetOutputInfo (ClientPtr client)
rep.nClones = output->numClones;
rep.nameLength = output->nameLength;
- extraLen = ((output->numCrtcs +
+ extraLen = ((output->numCrtcs +
output->numModes + output->numUserModes +
output->numClones +
- ((rep.nameLength + 3) >> 2)) << 2);
+ bytes_to_int32(rep.nameLength)) << 2);
if (extraLen)
{
- rep.length += extraLen >> 2;
+ rep.length += bytes_to_int32(extraLen);
extra = xalloc (extraLen);
if (!extra)
return BadAlloc;
@@ -540,7 +532,7 @@ ProcRRGetOutputInfo (ClientPtr client)
return client->noClientException;
}
-void
+static void
RRSetPrimaryOutput(ScreenPtr pScreen, rrScrPrivPtr pScrPriv,
RROutputPtr output)
{
@@ -571,24 +563,16 @@ ProcRRSetOutputPrimary(ClientPtr client)
RROutputPtr output = NULL;
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
+ int rc;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
- pWin = SecurityLookupIDByType(client, stuff->window, RT_WINDOW,
- DixReadAccess);
-
- if (!pWin) {
- client->errorValue = stuff->window;
- return BadWindow;
- }
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
if (stuff->output) {
- output = LookupOutput(client, stuff->output, DixReadAccess);
-
- if (!output) {
- client->errorValue = stuff->output;
- return RRErrorBase + BadRROutput;
- }
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
if (output->pScreen != pWin->drawable.pScreen) {
client->errorValue = stuff->window;
@@ -610,16 +594,13 @@ ProcRRGetOutputPrimary(ClientPtr client)
rrScrPrivPtr pScrPriv;
xRRGetOutputPrimaryReply rep;
RROutputPtr primary = NULL;
+ int rc;
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
- pWin = SecurityLookupIDByType(client, stuff->window, RT_WINDOW,
- DixReadAccess);
-
- if (!pWin) {
- client->errorValue = stuff->window;
- return BadWindow;
- }
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
if (pScrPriv)
diff --git a/xserver/randr/rrproperty.c b/xserver/randr/rrproperty.c
index 12923a2c7..12e30e486 100644
--- a/xserver/randr/rrproperty.c
+++ b/xserver/randr/rrproperty.c
@@ -31,7 +31,8 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
RREventPtr *pHead, pRREvent;
ClientPtr client;
- pHead = LookupIDByType(pWin->drawable.id, RREventType);
+ dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ RREventType, serverClient, DixReadAccess);
if (!pHead)
return WT_WALKCHILDREN;
@@ -46,11 +47,6 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
event->sequenceNumber = client->sequence;
event->window = pRREvent->window->drawable.id;
- if (client->swapped) {
- int n;
- swaps(&event->sequenceNumber, n);
- swapl(&event->window, n);
- }
WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
}
@@ -125,6 +121,8 @@ RRDestroyOutputProperty (RRPropertyPtr prop)
xfree(prop->current.data);
if (prop->pending.data)
xfree(prop->pending.data);
+ if (prop->valid_values)
+ xfree(prop->valid_values);
xfree(prop);
}
@@ -419,10 +417,7 @@ ProcRRListOutputProperties (ClientPtr client)
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
- output = LookupOutput (client, stuff->output, DixReadAccess);
-
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
for (prop = output->properties; prop; prop = prop->next)
numProps++;
@@ -431,7 +426,7 @@ ProcRRListOutputProperties (ClientPtr client)
return(BadAlloc);
rep.type = X_Reply;
- rep.length = (numProps * sizeof(Atom)) >> 2;
+ rep.length = bytes_to_int32(numProps * sizeof(Atom));
rep.sequenceNumber = client->sequence;
rep.nAtoms = numProps;
if (client->swapped)
@@ -466,10 +461,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
- output = LookupOutput (client, stuff->output, DixReadAccess);
-
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
prop = RRQueryOutputProperty (output, stuff->property);
if (!prop)
@@ -513,12 +505,9 @@ ProcRRConfigureOutputProperty (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
- output = LookupOutput (client, stuff->output, DixReadAccess);
-
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
- num_valid = stuff->length - (sizeof (xRRConfigureOutputPropertyReq) >> 2);
+ num_valid = stuff->length - bytes_to_int32(sizeof (xRRConfigureOutputPropertyReq));
return RRConfigureOutputProperty (output, stuff->property,
stuff->pending, stuff->range,
FALSE, num_valid,
@@ -552,15 +541,13 @@ ProcRRChangeOutputProperty (ClientPtr client)
return BadValue;
}
len = stuff->nUnits;
- if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2))
+ if (len > bytes_to_int32((0xffffffff - sizeof(xChangePropertyReq))))
return BadLength;
sizeInBytes = format>>3;
totalSize = len * sizeInBytes;
REQUEST_FIXED_SIZE(xRRChangeOutputPropertyReq, totalSize);
- output = LookupOutput (client, stuff->output, DixWriteAccess);
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
if (!ValidAtom(stuff->property))
{
@@ -590,9 +577,7 @@ ProcRRDeleteOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
UpdateCurrentTime();
- output = LookupOutput (client, stuff->output, DixWriteAccess);
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
if (!ValidAtom(stuff->property))
{
@@ -619,11 +604,8 @@ ProcRRGetOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
if (stuff->delete)
UpdateCurrentTime();
- output = LookupOutput (client, stuff->output,
- stuff->delete ? DixWriteAccess :
- DixReadAccess);
- if (!output)
- return RRErrorBase + BadRROutput;
+ VERIFY_RR_OUTPUT(stuff->output, output,
+ stuff->delete ? DixWriteAccess : DixReadAccess);
if (!ValidAtom(stuff->property))
{
@@ -723,7 +705,7 @@ ProcRRGetOutputProperty (ClientPtr client)
}
reply.bytesAfter = n - (ind + len);
reply.format = prop_value->format;
- reply.length = (len + 3) >> 2;
+ reply.length = bytes_to_int32(len);
if (prop_value->format)
reply.nItems = len / (prop_value->format / 8);
else
diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c
index e7eb75cc2..630ff5742 100644
--- a/xserver/randr/rrscreen.c
+++ b/xserver/randr/rrscreen.c
@@ -199,7 +199,7 @@ RRScreenSizeSet (ScreenPtr pScreen,
/*
* Retrieve valid screen size range
*/
-int
+int
ProcRRGetScreenSizeRange (ClientPtr client)
{
REQUEST(xRRGetScreenSizeRangeReq);
@@ -210,7 +210,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
int rc;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -261,7 +261,7 @@ ProcRRSetScreenSize (ClientPtr client)
int i, rc;
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -331,7 +331,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
CARD8 *names;
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -381,8 +381,8 @@ rrGetScreenResources(ClientPtr client, Bool query)
rep.length = (pScrPriv->numCrtcs +
pScrPriv->numOutputs +
- num_modes * (SIZEOF(xRRModeInfo) >> 2) +
- ((rep.nbytesNames + 3) >> 2));
+ num_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
+ bytes_to_int32(rep.nbytesNames));
extraLen = rep.length << 2;
if (extraLen)
@@ -455,7 +455,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
names += mode->mode.nameLength;
}
xfree (modes);
- assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length);
+ assert (bytes_to_int32((char *) names - (char *) extra) == rep.length);
}
if (client->swapped) {
@@ -606,7 +606,7 @@ ProcRRGetScreenInfo (ClientPtr client)
RROutputPtr output;
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -726,7 +726,7 @@ ProcRRGetScreenInfo (ClientPtr client)
if (data8 - (CARD8 *) extra != extraLen)
FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n",
(unsigned long)(data8 - (CARD8 *) extra), extraLen);
- rep.length = (extraLen + 3) >> 2;
+ rep.length = bytes_to_int32(extraLen);
}
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
diff --git a/xserver/randr/rrsdispatch.c b/xserver/randr/rrsdispatch.c
index 9fbf8f0f5..e16090a41 100644
--- a/xserver/randr/rrsdispatch.c
+++ b/xserver/randr/rrsdispatch.c
@@ -375,10 +375,10 @@ SProcRRSetCrtcTransform (ClientPtr client)
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
swaps(&stuff->length, n);
swapl(&stuff->crtc, n);
- SwapLongs((CARD32 *)&stuff->transform, (sizeof(xRenderTransform)) >> 2);
+ SwapLongs((CARD32 *)&stuff->transform, bytes_to_int32(sizeof(xRenderTransform)));
swaps(&stuff->nbytesFilter, n);
filter = (char *)(stuff + 1);
- params = (CARD32 *) (filter + ((stuff->nbytesFilter + 3) & ~3));
+ params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
nparams = ((CARD32 *) stuff + client->req_len) - params;
if (nparams < 0)
return BadLength;
@@ -453,7 +453,7 @@ static int
SProcRRGetOutputPrimary (ClientPtr client)
{
int n;
- REQUEST(xRRSetOutputPrimaryReq);
+ REQUEST(xRRGetOutputPrimaryReq);
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
swaps(&stuff->length, n);
diff --git a/xserver/randr/rrtransform.h b/xserver/randr/rrtransform.h
index 92d3ee7be..561762dfe 100644
--- a/xserver/randr/rrtransform.h
+++ b/xserver/randr/rrtransform.h
@@ -39,16 +39,16 @@ struct _rrTransform {
int height;
};
-void
+extern _X_EXPORT void
RRTransformInit (RRTransformPtr transform);
-void
+extern _X_EXPORT void
RRTransformFini (RRTransformPtr transform);
-Bool
+extern _X_EXPORT Bool
RRTransformEqual (RRTransformPtr a, RRTransformPtr b);
-Bool
+extern _X_EXPORT Bool
RRTransformSetFilter (RRTransformPtr dst,
PictFilterPtr filter,
xFixed *params,
@@ -56,10 +56,10 @@ RRTransformSetFilter (RRTransformPtr dst,
int width,
int height);
-Bool
+extern _X_EXPORT Bool
RRTransformCopy (RRTransformPtr dst, RRTransformPtr src);
-Bool
+extern _X_EXPORT Bool
RRTransformCompute (int x,
int y,
int width,
diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c
index 36135c6c1..94c8e54e5 100644
--- a/xserver/randr/rrxinerama.c
+++ b/xserver/randr/rrxinerama.c
@@ -71,9 +71,7 @@
#include "randrstr.h"
#include "swaprep.h"
#include <X11/extensions/panoramiXproto.h>
-
-#define RR_XINERAMA_MAJOR_VERSION 1
-#define RR_XINERAMA_MINOR_VERSION 1
+#include "protocol-versions.h"
/* Xinerama is not multi-screen capable; just report about screen 0 */
#define RR_XINERAMA_SCREEN 0
@@ -98,8 +96,8 @@ ProcRRXineramaQueryVersion(ClientPtr client)
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
- rep.majorVersion = RR_XINERAMA_MAJOR_VERSION;
- rep.minorVersion = RR_XINERAMA_MINOR_VERSION;
+ rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
+ rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
if(client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
@@ -245,7 +243,8 @@ ProcRRXineramaIsActive(ClientPtr client)
xXineramaIsActiveReply rep;
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
+
+ memset(&rep, 0, sizeof(xXineramaIsActiveReply));
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -312,7 +311,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.number = RRXineramaScreenCount (pScreen);
- rep.length = rep.number * sz_XineramaScreenInfo >> 2;
+ rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
if(client->swapped) {
register int n;
swaps(&rep.sequenceNumber, n);