mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-12 22:58:39 +02:00
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into glucose-2
Conflicts: hw/xfree86/Makefile.am hw/xfree86/dri/dri.c hw/xfree86/dri/dristruct.h hw/xgl/glx/xglx.c hw/xgl/xglscreen.c render/picture.c
This commit is contained in:
commit
8689f7e348
672 changed files with 18323 additions and 35527 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -9,6 +9,8 @@ Makefile.in
|
|||
*.o
|
||||
*~
|
||||
.*.swp
|
||||
*.pbxuser
|
||||
*.mode1v3
|
||||
obj*
|
||||
build*
|
||||
aclocal.m4
|
||||
|
|
@ -25,6 +27,8 @@ install-sh
|
|||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
TAGS
|
||||
tags
|
||||
ylwrap
|
||||
xorg-server.pc
|
||||
stamp-h?
|
||||
|
|
@ -95,8 +99,6 @@ cfb32/cfbzerarcG.c
|
|||
cfb32/cfbzerarcX.c
|
||||
doc/Xserver.1x
|
||||
doc/Xserver.man
|
||||
doc/SecurityPolicy.5
|
||||
doc/SecurityPolicy.man
|
||||
hw/dmx/Xdmx
|
||||
hw/dmx/Xdmx.1x
|
||||
hw/dmx/config/dmxtodmx
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ AM_CPPFLAGS = \
|
|||
-I$(top_srcdir)/GL/glx \
|
||||
-I$(top_srcdir)/GL/include \
|
||||
-I$(top_srcdir)/GL/mesa/glapi \
|
||||
-I$(top_srcdir)/hw/darwin/quartz \
|
||||
-I$(top_srcdir)/hw/darwin/quartz/cr \
|
||||
-I$(top_srcdir)/hw/xquartz \
|
||||
-I$(top_srcdir)/hw/xquartz/xpr \
|
||||
-I$(top_srcdir)/miext/damage
|
||||
|
||||
if HAVE_AGL_FRAMEWORK
|
||||
|
|
@ -17,3 +17,8 @@ libAGLcore_a_SOURCES = aglGlx.c \
|
|||
$(top_srcdir)/hw/darwin/quartz/xpr/x-hash.h \
|
||||
$(top_srcdir)/hw/dmx/glxProxy/compsize.c
|
||||
endif
|
||||
|
||||
#noinst_LIBRARIES = libCGLcore.a
|
||||
#libCGLcore_a_SOURCES = \
|
||||
# indirect.c \
|
||||
# $(top_srcdir)/hw/dmx/glxProxy/compsize.c
|
||||
|
|
|
|||
12
GL/glx/.gitignore
vendored
12
GL/glx/.gitignore
vendored
|
|
@ -1,5 +1,13 @@
|
|||
indirect_size.h
|
||||
glapi.c
|
||||
glcontextmodes.c
|
||||
glcontextmodes.h
|
||||
glapi.c
|
||||
glthread.c
|
||||
indirect_dispatch.c
|
||||
indirect_dispatch.h
|
||||
indirect_dispatch_swap.c
|
||||
indirect_reqsize.c
|
||||
indirect_reqsize.h
|
||||
indirect_size.h
|
||||
indirect_size_get.c
|
||||
indirect_size_get.h
|
||||
indirect_table.c
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ AM_CFLAGS = \
|
|||
-I@MESA_SOURCE@/src/mesa/glapi \
|
||||
-I@MESA_SOURCE@/src/mesa/main \
|
||||
-DXFree86Server \
|
||||
@GLX_DEFINES@
|
||||
@GLX_DEFINES@ \
|
||||
@GLX_ARCH_DEFINES@
|
||||
|
||||
# none yet
|
||||
#sdk_HEADERS =
|
||||
|
|
@ -24,6 +25,7 @@ INCLUDES = \
|
|||
-I$(top_srcdir)/hw/xfree86/os-support/bus \
|
||||
-I$(top_srcdir)/hw/xfree86/common \
|
||||
-I$(top_srcdir)/hw/xfree86/dri \
|
||||
-I$(top_srcdir)/hw/xfree86/dri2 \
|
||||
-I$(top_srcdir)/mi
|
||||
|
||||
|
||||
|
|
@ -31,10 +33,19 @@ nodist_libglx_la_SOURCES = indirect_size.h \
|
|||
glapi.c \
|
||||
glcontextmodes.c \
|
||||
glcontextmode.h \
|
||||
glthread.c
|
||||
glthread.c \
|
||||
indirect_dispatch.c \
|
||||
indirect_dispatch.h \
|
||||
indirect_dispatch_swap.c \
|
||||
indirect_reqsize.c \
|
||||
indirect_reqsize.h \
|
||||
indirect_size_get.c \
|
||||
indirect_size_get.h \
|
||||
indirect_table.c
|
||||
|
||||
libglxdri_la_SOURCES = \
|
||||
glxdri.c \
|
||||
glxdri2.c \
|
||||
extension_string.c \
|
||||
extension_string.h
|
||||
|
||||
|
|
@ -53,15 +64,7 @@ libglx_la_SOURCES = \
|
|||
glxserver.h \
|
||||
glxutil.c \
|
||||
glxutil.h \
|
||||
indirect_dispatch.c \
|
||||
indirect_dispatch.h \
|
||||
indirect_dispatch_swap.c \
|
||||
indirect_program.c \
|
||||
indirect_reqsize.c \
|
||||
indirect_reqsize.h \
|
||||
indirect_size_get.c \
|
||||
indirect_size_get.h \
|
||||
indirect_table.c \
|
||||
indirect_table.h \
|
||||
indirect_texture_compression.c \
|
||||
indirect_util.c \
|
||||
|
|
|
|||
184
GL/glx/glxdri.c
184
GL/glx/glxdri.c
|
|
@ -47,6 +47,8 @@
|
|||
#include <xf86.h>
|
||||
#include <dri.h>
|
||||
|
||||
#include "servermd.h"
|
||||
|
||||
#define DRI_NEW_INTERFACE_ONLY
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
|
|
@ -178,11 +180,54 @@ __glXDRIenterServer(GLboolean rendering)
|
|||
DRIWakeupHandler(NULL, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
__glXDRIdoReleaseTexImage(__GLXDRIscreen *screen, __GLXDRIdrawable *drawable)
|
||||
{
|
||||
GLuint lastOverride = screen->lastTexOffsetOverride;
|
||||
|
||||
if (lastOverride) {
|
||||
__GLXDRIdrawable **texOffsetOverride = screen->texOffsetOverride;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lastOverride; i++) {
|
||||
if (texOffsetOverride[i] == drawable) {
|
||||
|
||||
texOffsetOverride[i] = NULL;
|
||||
|
||||
if (i + 1 == lastOverride) {
|
||||
lastOverride = 0;
|
||||
|
||||
while (i--) {
|
||||
if (texOffsetOverride[i]) {
|
||||
lastOverride = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
screen->lastTexOffsetOverride = lastOverride;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
__glXDRIdoReleaseTexImage((__GLXDRIscreen *)
|
||||
glxGetScreen(screenInfo.screens[i]),
|
||||
private);
|
||||
}
|
||||
|
||||
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
|
||||
|
||||
/* If the X window was destroyed, the dri DestroyWindow hook will
|
||||
|
|
@ -308,18 +353,20 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
|
|||
}
|
||||
|
||||
static void
|
||||
glxFillAlphaChannel (PixmapPtr pixmap, int x, int y, int width, int height)
|
||||
glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height)
|
||||
{
|
||||
int i;
|
||||
CARD32 *p, *end, *pixels = (CARD32 *)pixmap->devPrivate.ptr;
|
||||
CARD32 rowstride = pixmap->devKind / 4;
|
||||
CARD32 *p, *end;
|
||||
|
||||
rowstride /= 4;
|
||||
|
||||
for (i = y; i < y + height; i++)
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
p = &pixels[i * rowstride + x];
|
||||
p = pixels;
|
||||
end = p + width;
|
||||
while (p < end)
|
||||
*p++ |= 0xFF000000;
|
||||
pixels += rowstride;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -430,22 +477,31 @@ nooverride:
|
|||
type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
}
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
|
||||
pixmap->devKind / bpp) );
|
||||
|
||||
if (pRegion == NULL)
|
||||
{
|
||||
if (!override && pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(pixmap,
|
||||
pixmap->drawable.x,
|
||||
pixmap->drawable.y,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height);
|
||||
void *data = NULL;
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS,
|
||||
pixmap->drawable.x) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS,
|
||||
pixmap->drawable.y) );
|
||||
if (!override) {
|
||||
unsigned pitch = PixmapBytePad(pixmap->drawable.width,
|
||||
pixmap->drawable.depth);
|
||||
|
||||
data = xalloc(pitch * pixmap->drawable.height);
|
||||
|
||||
pScreen->GetImage(&pixmap->drawable, 0 /*pixmap->drawable.x*/,
|
||||
0 /*pixmap->drawable.y*/, pixmap->drawable.width,
|
||||
pixmap->drawable.height, ZPixmap, ~0, data);
|
||||
|
||||
if (pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(data,
|
||||
pitch,
|
||||
pixmap->drawable.width,
|
||||
pixmap->drawable.height);
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
|
||||
pitch / bpp) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
|
||||
}
|
||||
|
||||
CALL_TexImage2D( GET_DISPATCH(),
|
||||
(glxPixmap->target,
|
||||
|
|
@ -456,26 +512,37 @@ nooverride:
|
|||
0,
|
||||
format,
|
||||
type,
|
||||
override ? NULL : pixmap->devPrivate.ptr) );
|
||||
data) );
|
||||
|
||||
xfree(data);
|
||||
} else if (!override) {
|
||||
int i, numRects;
|
||||
BoxPtr p;
|
||||
|
||||
numRects = REGION_NUM_RECTS (pRegion);
|
||||
p = REGION_RECTS (pRegion);
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
|
||||
|
||||
for (i = 0; i < numRects; i++)
|
||||
{
|
||||
unsigned pitch = PixmapBytePad(p[i].x2 - p[i].x1,
|
||||
pixmap->drawable.depth);
|
||||
void *data = xalloc(pitch * (p[i].y2 - p[i].y1));
|
||||
|
||||
pScreen->GetImage(&pixmap->drawable, /*pixmap->drawable.x +*/ p[i].x1,
|
||||
/*pixmap->drawable.y*/ + p[i].y1, p[i].x2 - p[i].x1,
|
||||
p[i].y2 - p[i].y1, ZPixmap, ~0, data);
|
||||
|
||||
if (pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(pixmap,
|
||||
pixmap->drawable.x + p[i].x1,
|
||||
pixmap->drawable.y + p[i].y1,
|
||||
glxFillAlphaChannel(data,
|
||||
pitch,
|
||||
p[i].x2 - p[i].x1,
|
||||
p[i].y2 - p[i].y1);
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS,
|
||||
pixmap->drawable.x + p[i].x1) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS,
|
||||
pixmap->drawable.y + p[i].y1) );
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
|
||||
pitch / bpp) );
|
||||
|
||||
CALL_TexSubImage2D( GET_DISPATCH(),
|
||||
(glxPixmap->target,
|
||||
|
|
@ -484,7 +551,9 @@ nooverride:
|
|||
p[i].x2 - p[i].x1, p[i].y2 - p[i].y1,
|
||||
format,
|
||||
type,
|
||||
pixmap->devPrivate.ptr) );
|
||||
data) );
|
||||
|
||||
xfree(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -499,41 +568,9 @@ __glXDRIreleaseTexImage(__GLXcontext *baseContext,
|
|||
int buffer,
|
||||
__GLXdrawable *pixmap)
|
||||
{
|
||||
ScreenPtr pScreen = pixmap->pDraw->pScreen;
|
||||
__GLXDRIdrawable *driDraw =
|
||||
containerOf(pixmap, __GLXDRIdrawable, base);
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) glxGetScreen(pScreen);
|
||||
GLuint lastOverride = screen->lastTexOffsetOverride;
|
||||
|
||||
if (lastOverride) {
|
||||
__GLXDRIdrawable **texOffsetOverride = screen->texOffsetOverride;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lastOverride; i++) {
|
||||
if (texOffsetOverride[i] == driDraw) {
|
||||
if (screen->texOffsetFinish)
|
||||
screen->texOffsetFinish((PixmapPtr)pixmap->pDraw);
|
||||
|
||||
texOffsetOverride[i] = NULL;
|
||||
|
||||
if (i + 1 == lastOverride) {
|
||||
lastOverride = 0;
|
||||
|
||||
while (i--) {
|
||||
if (texOffsetOverride[i]) {
|
||||
lastOverride = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
screen->lastTexOffsetOverride = lastOverride;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
__glXDRIdoReleaseTexImage((__GLXDRIscreen *)
|
||||
glxGetScreen(pixmap->pDraw->pScreen),
|
||||
containerOf(pixmap, __GLXDRIdrawable, base));
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -577,6 +614,9 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
|||
else
|
||||
driShare = NULL;
|
||||
|
||||
if (baseShareContext && baseShareContext->isDirect)
|
||||
return NULL;
|
||||
|
||||
context = xalloc(sizeof *context);
|
||||
if (context == NULL)
|
||||
return NULL;
|
||||
|
|
@ -612,6 +652,14 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
|||
hwContext,
|
||||
&context->driContext);
|
||||
|
||||
if (context->driContext.private == NULL) {
|
||||
__glXenterServer(GL_FALSE);
|
||||
retval = DRIDestroyContext(baseScreen->pScreen, context->hwContextID);
|
||||
__glXleaveServer(GL_FALSE);
|
||||
xfree(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &context->base;
|
||||
}
|
||||
|
||||
|
|
@ -658,6 +706,14 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
|||
&private->driDrawable,
|
||||
hwDrawable, 0, NULL);
|
||||
|
||||
if (private->driDrawable.private == NULL) {
|
||||
__glXenterServer(GL_FALSE);
|
||||
DRIDestroyDrawable(screen->pScreen, serverClient, pDraw);
|
||||
__glXleaveServer(GL_FALSE);
|
||||
xfree(private);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &private->base;
|
||||
}
|
||||
|
||||
|
|
@ -761,10 +817,14 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
|
|||
DrawablePtr pDraw = drawable->base.pDraw;
|
||||
RegionRec region;
|
||||
|
||||
__glXenterServer(GL_FALSE);
|
||||
|
||||
REGION_INIT(pDraw->pScreen, ®ion, (BoxPtr) rects, num_rects);
|
||||
REGION_TRANSLATE(pScreen, ®ion, pDraw->x, pDraw->y);
|
||||
DamageDamageRegion(pDraw, ®ion);
|
||||
REGION_UNINIT(pDraw->pScreen, ®ion);
|
||||
|
||||
__glXleaveServer(GL_FALSE);
|
||||
}
|
||||
|
||||
/* Table of functions that we export to the driver. */
|
||||
|
|
|
|||
633
GL/glx/glxdri2.c
Normal file
633
GL/glx/glxdri2.c
Normal file
|
|
@ -0,0 +1,633 @@
|
|||
/*
|
||||
* Copyright © 2007 Red Hat, Inc
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation, and that the name of Red Hat,
|
||||
* Inc not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior
|
||||
* permission. Red Hat, Inc makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* RED HAT, INC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL RED HAT, INC BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <drm.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
#include <windowstr.h>
|
||||
#include <os.h>
|
||||
|
||||
#define _XF86DRI_SERVER_
|
||||
#include <xf86drm.h>
|
||||
#include <xf86dristr.h>
|
||||
#include <xf86str.h>
|
||||
#include <xf86.h>
|
||||
#include <dri2.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
#include "g_disptab.h"
|
||||
#include "glapitable.h"
|
||||
#include "glapi.h"
|
||||
#include "glthread.h"
|
||||
#include "dispatch.h"
|
||||
#include "extension_string.h"
|
||||
|
||||
#define containerOf(ptr, type, member) \
|
||||
(type *)( (char *)ptr - offsetof(type,member) )
|
||||
|
||||
typedef struct __GLXDRIscreen __GLXDRIscreen;
|
||||
typedef struct __GLXDRIcontext __GLXDRIcontext;
|
||||
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
|
||||
|
||||
struct __GLXDRIscreen {
|
||||
__GLXscreen base;
|
||||
__DRIscreen driScreen;
|
||||
void *driver;
|
||||
int fd;
|
||||
|
||||
xf86EnterVTProc *enterVT;
|
||||
xf86LeaveVTProc *leaveVT;
|
||||
|
||||
__DRIcopySubBufferExtension *copySubBuffer;
|
||||
__DRIswapControlExtension *swapControl;
|
||||
__DRItexBufferExtension *texBuffer;
|
||||
|
||||
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
|
||||
};
|
||||
|
||||
struct __GLXDRIcontext {
|
||||
__GLXcontext base;
|
||||
__DRIcontext driContext;
|
||||
drm_context_t hwContext;
|
||||
};
|
||||
|
||||
struct __GLXDRIdrawable {
|
||||
__GLXdrawable base;
|
||||
__DRIdrawable driDrawable;
|
||||
};
|
||||
|
||||
static const char CREATE_NEW_SCREEN_FUNC[] = __DRI2_CREATE_NEW_SCREEN_STRING;
|
||||
|
||||
static void
|
||||
__glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||
|
||||
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
|
||||
|
||||
/* If the X window was destroyed, the dri DestroyWindow hook will
|
||||
* aready have taken care of this, so only call if pDraw isn't NULL. */
|
||||
if (drawable->pDraw != NULL)
|
||||
DRI2DestroyDrawable(drawable->pDraw->pScreen, drawable->pDraw);
|
||||
|
||||
xfree(private);
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
__glXDRIdrawableResize(__GLXdrawable *glxPriv)
|
||||
{
|
||||
/* Nothing to do here, the DRI driver asks the server for drawable
|
||||
* geometry when it sess the SAREA timestamps change.*/
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
__glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
|
||||
|
||||
(*private->driDrawable.swapBuffers)(&private->driDrawable);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
__glXDRIdrawableSwapInterval(__GLXdrawable *baseDrawable, int interval)
|
||||
{
|
||||
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseDrawable;
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
||||
glxGetScreen(baseDrawable->pDraw->pScreen);
|
||||
|
||||
if (screen->swapControl)
|
||||
screen->swapControl->setSwapInterval(&draw->driDrawable, interval);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
__glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
||||
glxGetScreen(basePrivate->pDraw->pScreen);
|
||||
|
||||
if (screen->copySubBuffer)
|
||||
screen->copySubBuffer->copySubBuffer(&private->driDrawable,
|
||||
x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
__glXDRIcontextDestroy(__GLXcontext *baseContext)
|
||||
{
|
||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseContext->pGlxScreen;
|
||||
|
||||
context->driContext.destroyContext(&context->driContext);
|
||||
drmDestroyContext(screen->fd, context->hwContext);
|
||||
__glXContextDestroy(&context->base);
|
||||
xfree(context);
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIcontextMakeCurrent(__GLXcontext *baseContext)
|
||||
{
|
||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
|
||||
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
|
||||
|
||||
return (*context->driContext.bindContext)(&context->driContext,
|
||||
&draw->driDrawable,
|
||||
&read->driDrawable);
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIcontextLoseCurrent(__GLXcontext *baseContext)
|
||||
{
|
||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||
|
||||
return (*context->driContext.unbindContext)(&context->driContext);
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
|
||||
unsigned long mask)
|
||||
{
|
||||
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
|
||||
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
|
||||
|
||||
/* FIXME: We will need to add DRIcontext::copyContext for this. */
|
||||
|
||||
(void) dst;
|
||||
(void) src;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
|
||||
{
|
||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
|
||||
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
|
||||
|
||||
return (*context->driContext.bindContext)(&context->driContext,
|
||||
&draw->driDrawable,
|
||||
&read->driDrawable);
|
||||
}
|
||||
|
||||
#ifdef __DRI_TEX_BUFFER
|
||||
|
||||
#define isPowerOfTwo(n) (((n) & ((n) - 1 )) == 0)
|
||||
|
||||
static int
|
||||
__glXDRIbindTexImage(__GLXcontext *baseContext,
|
||||
int buffer,
|
||||
__GLXdrawable *glxPixmap)
|
||||
{
|
||||
ScreenPtr pScreen = glxPixmap->pDraw->pScreen;
|
||||
__GLXDRIscreen * const screen = (__GLXDRIscreen *) glxGetScreen(pScreen);
|
||||
PixmapPtr pixmap;
|
||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||
unsigned int flags;
|
||||
int w, h, target;
|
||||
|
||||
if (screen->texBuffer == NULL)
|
||||
return Success;
|
||||
|
||||
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
||||
w = pixmap->drawable.width;
|
||||
h = pixmap->drawable.height;
|
||||
|
||||
if (!isPowerOfTwo(w) || !isPowerOfTwo(h))
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
else
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
screen->texBuffer->setTexBuffer(&context->driContext,
|
||||
target,
|
||||
DRI2GetPixmapHandle(pixmap, &flags),
|
||||
pixmap->drawable.depth,
|
||||
pixmap->devKind,
|
||||
h);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
|
||||
int buffer,
|
||||
__GLXdrawable *pixmap)
|
||||
{
|
||||
/* FIXME: Just unbind the texture? */
|
||||
return Success;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int
|
||||
__glXDRIbindTexImage(__GLXcontext *baseContext,
|
||||
int buffer,
|
||||
__GLXdrawable *glxPixmap)
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
__glXDRIreleaseTexImage(__GLXcontext *baseContext,
|
||||
int buffer,
|
||||
__GLXdrawable *pixmap)
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
||||
__glXDRIbindTexImage,
|
||||
__glXDRIreleaseTexImage
|
||||
};
|
||||
|
||||
static void
|
||||
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
|
||||
{
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
|
||||
screen->driScreen.destroyScreen(&screen->driScreen);
|
||||
|
||||
dlclose(screen->driver);
|
||||
|
||||
__glXScreenDestroy(baseScreen);
|
||||
|
||||
xfree(screen);
|
||||
}
|
||||
|
||||
static __GLXcontext *
|
||||
__glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
||||
__GLcontextModes *modes,
|
||||
__GLXcontext *baseShareContext)
|
||||
{
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
||||
__GLXDRIcontext *context, *shareContext;
|
||||
__DRIcontext *driShare;
|
||||
|
||||
shareContext = (__GLXDRIcontext *) baseShareContext;
|
||||
if (shareContext)
|
||||
driShare = &shareContext->driContext;
|
||||
else
|
||||
driShare = NULL;
|
||||
|
||||
context = xalloc(sizeof *context);
|
||||
if (context == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(context, 0, sizeof *context);
|
||||
context->base.destroy = __glXDRIcontextDestroy;
|
||||
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
||||
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
||||
context->base.copy = __glXDRIcontextCopy;
|
||||
context->base.forceCurrent = __glXDRIcontextForceCurrent;
|
||||
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
|
||||
|
||||
if (drmCreateContext(screen->fd, &context->hwContext))
|
||||
return GL_FALSE;
|
||||
|
||||
context->driContext.private =
|
||||
screen->driScreen.createNewContext(&screen->driScreen,
|
||||
modes,
|
||||
0, /* render type */
|
||||
driShare,
|
||||
context->hwContext,
|
||||
&context->driContext);
|
||||
|
||||
return &context->base;
|
||||
}
|
||||
|
||||
static __GLXdrawable *
|
||||
__glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
||||
DrawablePtr pDraw,
|
||||
int type,
|
||||
XID drawId,
|
||||
__GLcontextModes *modes)
|
||||
{
|
||||
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
||||
__GLXDRIdrawable *private;
|
||||
GLboolean retval;
|
||||
drm_drawable_t hwDrawable;
|
||||
|
||||
private = xalloc(sizeof *private);
|
||||
if (private == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(private, 0, sizeof *private);
|
||||
|
||||
if (!__glXDrawableInit(&private->base, screen,
|
||||
pDraw, type, drawId, modes)) {
|
||||
xfree(private);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
private->base.destroy = __glXDRIdrawableDestroy;
|
||||
private->base.resize = __glXDRIdrawableResize;
|
||||
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
||||
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
||||
|
||||
retval = DRI2CreateDrawable(screen->pScreen, pDraw, &hwDrawable);
|
||||
|
||||
private->driDrawable.private =
|
||||
(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
|
||||
modes,
|
||||
&private->driDrawable,
|
||||
hwDrawable, 0, NULL);
|
||||
|
||||
return &private->base;
|
||||
}
|
||||
|
||||
static int
|
||||
getUST(int64_t *ust)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (ust == NULL)
|
||||
return -EFAULT;
|
||||
|
||||
if (gettimeofday(&tv, NULL) == 0) {
|
||||
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
|
||||
return 0;
|
||||
} else {
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
static void __glXReportDamage(__DRIdrawable *driDraw,
|
||||
int x, int y,
|
||||
drm_clip_rect_t *rects, int num_rects,
|
||||
GLboolean front_buffer)
|
||||
{
|
||||
__GLXDRIdrawable *drawable =
|
||||
containerOf(driDraw, __GLXDRIdrawable, driDrawable);
|
||||
DrawablePtr pDraw = drawable->base.pDraw;
|
||||
RegionRec region;
|
||||
|
||||
REGION_INIT(pDraw->pScreen, ®ion, (BoxPtr) rects, num_rects);
|
||||
REGION_TRANSLATE(pScreen, ®ion, pDraw->x, pDraw->y);
|
||||
DamageDamageRegion(pDraw, ®ion);
|
||||
REGION_UNINIT(pDraw->pScreen, ®ion);
|
||||
}
|
||||
|
||||
/* Table of functions that we export to the driver. */
|
||||
static const __DRIinterfaceMethods interface_methods = {
|
||||
_gl_context_modes_create,
|
||||
_gl_context_modes_destroy,
|
||||
|
||||
NULL,
|
||||
|
||||
getUST,
|
||||
NULL,
|
||||
|
||||
__glXReportDamage,
|
||||
};
|
||||
|
||||
static const char dri_driver_path[] = DRI_DRIVER_PATH;
|
||||
|
||||
static Bool
|
||||
glxDRIEnterVT (int index, int flags)
|
||||
{
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
||||
glxGetScreen(screenInfo.screens[index]);
|
||||
|
||||
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
|
||||
|
||||
if (!(*screen->enterVT) (index, flags))
|
||||
return FALSE;
|
||||
|
||||
glxResumeClients();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
glxDRILeaveVT (int index, int flags)
|
||||
{
|
||||
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
||||
glxGetScreen(screenInfo.screens[index]);
|
||||
|
||||
LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
|
||||
|
||||
glxSuspendClients();
|
||||
|
||||
return (*screen->leaveVT) (index, flags);
|
||||
}
|
||||
|
||||
static void
|
||||
initializeExtensions(__GLXDRIscreen *screen)
|
||||
{
|
||||
const __DRIextension **extensions;
|
||||
int i;
|
||||
|
||||
extensions = screen->driScreen.getExtensions(&screen->driScreen);
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
#ifdef __DRI_COPY_SUB_BUFFER
|
||||
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
|
||||
screen->copySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
|
||||
__glXEnableExtension(screen->glx_enable_bits,
|
||||
"GLX_MESA_copy_sub_buffer");
|
||||
|
||||
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __DRI_SWAP_CONTROL
|
||||
if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
|
||||
screen->swapControl = (__DRIswapControlExtension *) extensions[i];
|
||||
__glXEnableExtension(screen->glx_enable_bits,
|
||||
"GLX_SGI_swap_control");
|
||||
__glXEnableExtension(screen->glx_enable_bits,
|
||||
"GLX_MESA_swap_control");
|
||||
|
||||
LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __DRI_TEX_BUFFER
|
||||
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
|
||||
screen->texBuffer = (__DRItexBufferExtension *) extensions[i];
|
||||
/* GLX_EXT_texture_from_pixmap is always enabled. */
|
||||
LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
|
||||
}
|
||||
#endif
|
||||
/* Ignore unknown extensions */
|
||||
}
|
||||
}
|
||||
|
||||
static __GLXscreen *
|
||||
__glXDRIscreenProbe(ScreenPtr pScreen)
|
||||
{
|
||||
__DRI2_CREATE_NEW_SCREEN_FUNC *createNewScreen;
|
||||
__DRIversion ddx_version;
|
||||
__DRIversion dri_version;
|
||||
__DRIversion drm_version;
|
||||
drmVersionPtr version;
|
||||
const char *driverName;
|
||||
__GLXDRIscreen *screen;
|
||||
char filename[128];
|
||||
size_t buffer_size;
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
unsigned int sareaHandle;
|
||||
|
||||
screen = xalloc(sizeof *screen);
|
||||
if (screen == NULL)
|
||||
return NULL;
|
||||
memset(screen, 0, sizeof *screen);
|
||||
|
||||
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
|
||||
!DRI2Connect(pScreen,
|
||||
&screen->fd,
|
||||
&driverName,
|
||||
&ddx_version.major,
|
||||
&ddx_version.minor,
|
||||
&ddx_version.patch,
|
||||
&sareaHandle)) {
|
||||
LogMessage(X_INFO,
|
||||
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
screen->base.destroy = __glXDRIscreenDestroy;
|
||||
screen->base.createContext = __glXDRIscreenCreateContext;
|
||||
screen->base.createDrawable = __glXDRIscreenCreateDrawable;
|
||||
screen->base.swapInterval = __glXDRIdrawableSwapInterval;
|
||||
screen->base.pScreen = pScreen;
|
||||
|
||||
__glXInitExtensionEnableBits(screen->glx_enable_bits);
|
||||
|
||||
/* DRI protocol version. */
|
||||
dri_version.major = XF86DRI_MAJOR_VERSION;
|
||||
dri_version.minor = XF86DRI_MINOR_VERSION;
|
||||
dri_version.patch = XF86DRI_PATCH_VERSION;
|
||||
|
||||
version = drmGetVersion(screen->fd);
|
||||
if (version) {
|
||||
drm_version.major = version->version_major;
|
||||
drm_version.minor = version->version_minor;
|
||||
drm_version.patch = version->version_patchlevel;
|
||||
drmFreeVersion(version);
|
||||
}
|
||||
else {
|
||||
drm_version.major = -1;
|
||||
drm_version.minor = -1;
|
||||
drm_version.patch = -1;
|
||||
}
|
||||
|
||||
snprintf(filename, sizeof filename, "%s/%s_dri.so",
|
||||
dri_driver_path, driverName);
|
||||
|
||||
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
|
||||
if (screen->driver == NULL) {
|
||||
LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
|
||||
filename, dlerror());
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
createNewScreen = dlsym(screen->driver, CREATE_NEW_SCREEN_FUNC);
|
||||
if (createNewScreen == NULL) {
|
||||
LogMessage(X_ERROR, "AIGLX error: dlsym for %s failed (%s)\n",
|
||||
CREATE_NEW_SCREEN_FUNC, dlerror());
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
screen->driScreen.private =
|
||||
(*createNewScreen)(pScreen->myNum,
|
||||
&screen->driScreen,
|
||||
&ddx_version,
|
||||
&dri_version,
|
||||
&drm_version,
|
||||
screen->fd,
|
||||
sareaHandle,
|
||||
&interface_methods,
|
||||
&screen->base.fbconfigs);
|
||||
|
||||
if (screen->driScreen.private == NULL) {
|
||||
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
initializeExtensions(screen);
|
||||
|
||||
__glXScreenInit(&screen->base, pScreen);
|
||||
|
||||
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
|
||||
if (buffer_size > 0) {
|
||||
if (screen->base.GLXextensions != NULL) {
|
||||
xfree(screen->base.GLXextensions);
|
||||
}
|
||||
|
||||
screen->base.GLXextensions = xnfalloc(buffer_size);
|
||||
(void) __glXGetExtensionString(screen->glx_enable_bits,
|
||||
screen->base.GLXextensions);
|
||||
}
|
||||
|
||||
screen->enterVT = pScrn->EnterVT;
|
||||
pScrn->EnterVT = glxDRIEnterVT;
|
||||
screen->leaveVT = pScrn->LeaveVT;
|
||||
pScrn->LeaveVT = glxDRILeaveVT;
|
||||
|
||||
LogMessage(X_INFO,
|
||||
"AIGLX: Loaded and initialized %s\n", filename);
|
||||
|
||||
return &screen->base;
|
||||
|
||||
handle_error:
|
||||
if (screen->driver)
|
||||
dlclose(screen->driver);
|
||||
|
||||
xfree(screen);
|
||||
|
||||
LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__GLXprovider __glXDRI2Provider = {
|
||||
__glXDRIscreenProbe,
|
||||
"DRI2",
|
||||
NULL
|
||||
};
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
#include "glxserver.h"
|
||||
#include <windowstr.h>
|
||||
#include <propertyst.h>
|
||||
#include "privates.h"
|
||||
#include <os.h>
|
||||
#include "g_disptab.h"
|
||||
#include "unpack.h"
|
||||
|
|
@ -53,7 +54,7 @@ RESTYPE __glXSwapBarrierRes;
|
|||
*/
|
||||
xGLXSingleReply __glXReply;
|
||||
|
||||
static int glxClientPrivateIndex;
|
||||
static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKey;
|
||||
|
||||
/*
|
||||
** Client that called into GLX dispatch.
|
||||
|
|
@ -204,7 +205,7 @@ int __glXError(int error)
|
|||
__GLXclientState *
|
||||
glxGetClient(ClientPtr pClient)
|
||||
{
|
||||
return (__GLXclientState *) pClient->devPrivates[glxClientPrivateIndex].ptr;
|
||||
return dixLookupPrivate(&pClient->devPrivates, glxClientPrivateKey);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -274,9 +275,7 @@ void GlxExtensionInit(void)
|
|||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
||||
|
||||
glxClientPrivateIndex = AllocateClientPrivateIndex ();
|
||||
if (!AllocateClientPrivate (glxClientPrivateIndex,
|
||||
sizeof (__GLXclientState)))
|
||||
if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
|
||||
return;
|
||||
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -42,12 +42,13 @@
|
|||
#include <os.h>
|
||||
#include <colormapst.h>
|
||||
|
||||
#include "privates.h"
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
static int glxScreenPrivateIndex;
|
||||
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
|
||||
|
||||
const char GLServerVersion[] = "1.4";
|
||||
static const char GLServerExtensions[] =
|
||||
|
|
@ -174,7 +175,7 @@ static char GLXServerExtensions[] =
|
|||
"GLX_EXT_texture_from_pixmap "
|
||||
"GLX_OML_swap_method "
|
||||
"GLX_SGI_make_current_read "
|
||||
#ifndef __DARWIN__
|
||||
#ifndef __APPLE__
|
||||
"GLX_SGIS_multisample "
|
||||
"GLX_SGIX_hyperpipe "
|
||||
"GLX_SGIX_swap_barrier "
|
||||
|
|
@ -269,7 +270,7 @@ glxCloseScreen (int index, ScreenPtr pScreen)
|
|||
__GLXscreen *
|
||||
glxGetScreen(ScreenPtr pScreen)
|
||||
{
|
||||
return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
|
||||
return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
|
||||
}
|
||||
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
|
|
@ -279,6 +280,30 @@ void GlxSetVisualConfigs(int nconfigs,
|
|||
* call it. */
|
||||
}
|
||||
|
||||
static void
|
||||
filterOutNativeConfigs(__GLXscreen *pGlxScreen)
|
||||
{
|
||||
__GLcontextModes *m, *next, *native_modes, **last;
|
||||
ScreenPtr pScreen = pGlxScreen->pScreen;
|
||||
int i, depth;
|
||||
|
||||
last = &pGlxScreen->fbconfigs;
|
||||
for (m = pGlxScreen->fbconfigs; m != NULL; m = next) {
|
||||
next = m->next;
|
||||
depth = m->redBits + m->blueBits + m->greenBits;
|
||||
|
||||
for (i = 0; i < pScreen->numVisuals; i++) {
|
||||
if (pScreen->visuals[i].nplanes == depth) {
|
||||
*last = m;
|
||||
last = &m->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*last = NULL;
|
||||
}
|
||||
|
||||
static XID
|
||||
findVisualForConfig(ScreenPtr pScreen, __GLcontextModes *m)
|
||||
{
|
||||
|
|
@ -497,19 +522,9 @@ void GlxSetVisualConfig(int config)
|
|||
|
||||
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
||||
{
|
||||
static int glxGeneration;
|
||||
__GLcontextModes *m;
|
||||
int i;
|
||||
|
||||
if (glxGeneration != serverGeneration)
|
||||
{
|
||||
glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
||||
if (glxScreenPrivateIndex == -1)
|
||||
return;
|
||||
|
||||
glxGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
pGlxScreen->pScreen = pScreen;
|
||||
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
|
||||
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
|
||||
|
|
@ -522,6 +537,8 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
|||
pGlxScreen->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = glxCloseScreen;
|
||||
|
||||
filterOutNativeConfigs(pGlxScreen);
|
||||
|
||||
i = 0;
|
||||
for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) {
|
||||
m->fbconfigID = FakeClientID(0);
|
||||
|
|
@ -548,9 +565,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
|
|||
break;
|
||||
}
|
||||
|
||||
pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) pGlxScreen;
|
||||
dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen);
|
||||
}
|
||||
|
||||
|
||||
void __glXScreenDestroy(__GLXscreen *screen)
|
||||
{
|
||||
xfree(screen->GLXvendor);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,832 +0,0 @@
|
|||
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corporation 2005
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* IBM,
|
||||
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include "glxserver.h"
|
||||
#include "glxbyteorder.h"
|
||||
#include "indirect_size.h"
|
||||
#include "indirect_reqsize.h"
|
||||
|
||||
#define __GLX_PAD(x) (((x) + 3) & ~3)
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# undef HAVE_ALIAS
|
||||
#endif
|
||||
#ifdef HAVE_ALIAS
|
||||
# define ALIAS2(from,to) \
|
||||
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
|
||||
__attribute__ ((alias( # to )));
|
||||
# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
|
||||
#else
|
||||
# define ALIAS(from,to) \
|
||||
GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
|
||||
{ return __glX ## to ## ReqSize( pc, swap ); }
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
__glXCallListsReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 0);
|
||||
GLenum type = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
compsize = __glCallLists_size(type);
|
||||
return __GLX_PAD((compsize * n));
|
||||
}
|
||||
|
||||
int
|
||||
__glXBitmapReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLsizei width = *(GLsizei *) (pc + 20);
|
||||
GLsizei height = *(GLsizei *) (pc + 24);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
}
|
||||
|
||||
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXFogfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 0);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glFogfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXLightfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glLightfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXLightModelfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 0);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glLightModelfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXMaterialfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glMaterialfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXPolygonStippleReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
}
|
||||
|
||||
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexParameterfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glTexParameterfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexImage1DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 32);
|
||||
GLenum format = *(GLenum *) (pc + 44);
|
||||
GLenum type = *(GLenum *) (pc + 48);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, 1, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexImage2DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 32);
|
||||
GLsizei height = *(GLsizei *) (pc + 36);
|
||||
GLenum format = *(GLenum *) (pc + 44);
|
||||
GLenum type = *(GLenum *) (pc + 48);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, height, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexEnvfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glTexEnvfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexGendvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glTexGendv_size(pname);
|
||||
return __GLX_PAD((compsize * 8));
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexGenfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glTexGenfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXPixelMapfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
mapsize = bswap_32(mapsize);
|
||||
}
|
||||
|
||||
return __GLX_PAD((mapsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXPixelMapusvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei mapsize = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
mapsize = bswap_32(mapsize);
|
||||
}
|
||||
|
||||
return __GLX_PAD((mapsize * 2));
|
||||
}
|
||||
|
||||
int
|
||||
__glXDrawPixelsReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLsizei width = *(GLsizei *) (pc + 20);
|
||||
GLsizei height = *(GLsizei *) (pc + 24);
|
||||
GLenum format = *(GLenum *) (pc + 28);
|
||||
GLenum type = *(GLenum *) (pc + 32);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, 0, width, height, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 0);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 4) + (n * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 36);
|
||||
GLenum format = *(GLenum *) (pc + 44);
|
||||
GLenum type = *(GLenum *) (pc + 48);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, 1, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 36);
|
||||
GLsizei height = *(GLsizei *) (pc + 40);
|
||||
GLenum format = *(GLenum *) (pc + 44);
|
||||
GLenum type = *(GLenum *) (pc + 48);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, height, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXColorTableReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 28);
|
||||
GLenum format = *(GLenum *) (pc + 32);
|
||||
GLenum type = *(GLenum *) (pc + 36);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, 1, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glColorTableParameterfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXColorSubTableReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei count = *(GLsizei *) (pc + 28);
|
||||
GLenum format = *(GLenum *) (pc + 32);
|
||||
GLenum type = *(GLenum *) (pc + 36);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
count = bswap_32(count);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, count, 1, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 28);
|
||||
GLenum format = *(GLenum *) (pc + 36);
|
||||
GLenum type = *(GLenum *) (pc + 40);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, 1, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = 0;
|
||||
GLint skip_images = 0;
|
||||
GLint skip_rows = *(GLint *) (pc + 8);
|
||||
GLint alignment = *(GLint *) (pc + 16);
|
||||
GLenum target = *(GLenum *) (pc + 20);
|
||||
GLsizei width = *(GLsizei *) (pc + 28);
|
||||
GLsizei height = *(GLsizei *) (pc + 32);
|
||||
GLenum format = *(GLenum *) (pc + 36);
|
||||
GLenum type = *(GLenum *) (pc + 40);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, height, 1,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 4);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glConvolutionParameterfv_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexImage3DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = *(GLint *) (pc + 8);
|
||||
GLint skip_rows = *(GLint *) (pc + 16);
|
||||
GLint skip_images = *(GLint *) (pc + 20);
|
||||
GLint alignment = *(GLint *) (pc + 32);
|
||||
GLenum target = *(GLenum *) (pc + 36);
|
||||
GLsizei width = *(GLsizei *) (pc + 48);
|
||||
GLsizei height = *(GLsizei *) (pc + 52);
|
||||
GLsizei depth = *(GLsizei *) (pc + 56);
|
||||
GLenum format = *(GLenum *) (pc + 68);
|
||||
GLenum type = *(GLenum *) (pc + 72);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
image_height = bswap_32(image_height);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
skip_images = bswap_32(skip_images);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
depth = bswap_32(depth);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, height, depth,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLint row_length = *(GLint *) (pc + 4);
|
||||
GLint image_height = *(GLint *) (pc + 8);
|
||||
GLint skip_rows = *(GLint *) (pc + 16);
|
||||
GLint skip_images = *(GLint *) (pc + 20);
|
||||
GLint alignment = *(GLint *) (pc + 32);
|
||||
GLenum target = *(GLenum *) (pc + 36);
|
||||
GLsizei width = *(GLsizei *) (pc + 60);
|
||||
GLsizei height = *(GLsizei *) (pc + 64);
|
||||
GLsizei depth = *(GLsizei *) (pc + 68);
|
||||
GLenum format = *(GLenum *) (pc + 76);
|
||||
GLenum type = *(GLenum *) (pc + 80);
|
||||
|
||||
if (swap) {
|
||||
row_length = bswap_32(row_length);
|
||||
image_height = bswap_32(image_height);
|
||||
skip_rows = bswap_32(skip_rows);
|
||||
skip_images = bswap_32(skip_images);
|
||||
alignment = bswap_32(alignment);
|
||||
target = bswap_32(target);
|
||||
width = bswap_32(width);
|
||||
height = bswap_32(height);
|
||||
depth = bswap_32(depth);
|
||||
format = bswap_32(format);
|
||||
type = bswap_32(type);
|
||||
}
|
||||
|
||||
return __glXImageSize(format, type, target, width, height, depth,
|
||||
image_height, row_length, skip_images,
|
||||
skip_rows, alignment);
|
||||
}
|
||||
|
||||
int
|
||||
__glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei imageSize = *(GLsizei *) (pc + 20);
|
||||
|
||||
if (swap) {
|
||||
imageSize = bswap_32(imageSize);
|
||||
}
|
||||
|
||||
return __GLX_PAD(imageSize);
|
||||
}
|
||||
|
||||
int
|
||||
__glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei imageSize = *(GLsizei *) (pc + 24);
|
||||
|
||||
if (swap) {
|
||||
imageSize = bswap_32(imageSize);
|
||||
}
|
||||
|
||||
return __GLX_PAD(imageSize);
|
||||
}
|
||||
|
||||
int
|
||||
__glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei imageSize = *(GLsizei *) (pc + 28);
|
||||
|
||||
if (swap) {
|
||||
imageSize = bswap_32(imageSize);
|
||||
}
|
||||
|
||||
return __GLX_PAD(imageSize);
|
||||
}
|
||||
|
||||
int
|
||||
__glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei imageSize = *(GLsizei *) (pc + 36);
|
||||
|
||||
if (swap) {
|
||||
imageSize = bswap_32(imageSize);
|
||||
}
|
||||
|
||||
return __GLX_PAD(imageSize);
|
||||
}
|
||||
|
||||
int
|
||||
__glXProgramStringARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei len = *(GLsizei *) (pc + 8);
|
||||
|
||||
if (swap) {
|
||||
len = bswap_32(len);
|
||||
}
|
||||
|
||||
return __GLX_PAD(len);
|
||||
}
|
||||
|
||||
int
|
||||
__glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 0);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLenum pname = *(GLenum *) (pc + 0);
|
||||
GLsizei compsize;
|
||||
|
||||
if (swap) {
|
||||
pname = bswap_32(pname);
|
||||
}
|
||||
|
||||
compsize = __glPointParameterfvEXT_size(pname);
|
||||
return __GLX_PAD((compsize * 4));
|
||||
}
|
||||
|
||||
int
|
||||
__glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLuint num = *(GLuint *) (pc + 8);
|
||||
|
||||
if (swap) {
|
||||
num = bswap_32(num);
|
||||
}
|
||||
|
||||
return __GLX_PAD((num * 32));
|
||||
}
|
||||
|
||||
int
|
||||
__glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLuint num = *(GLuint *) (pc + 8);
|
||||
|
||||
if (swap) {
|
||||
num = bswap_32(num);
|
||||
}
|
||||
|
||||
return __GLX_PAD((num * 16));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 8));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 16));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 24));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 12));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 6));
|
||||
}
|
||||
|
||||
int
|
||||
__glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei n = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
n = bswap_32(n);
|
||||
}
|
||||
|
||||
return __GLX_PAD((n * 32));
|
||||
}
|
||||
|
||||
int
|
||||
__glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap)
|
||||
{
|
||||
GLsizei len = *(GLsizei *) (pc + 4);
|
||||
|
||||
if (swap) {
|
||||
len = bswap_32(len);
|
||||
}
|
||||
|
||||
return __GLX_PAD(len);
|
||||
}
|
||||
|
||||
ALIAS(Fogiv, Fogfv)
|
||||
ALIAS(Lightiv, Lightfv)
|
||||
ALIAS(LightModeliv, LightModelfv)
|
||||
ALIAS(Materialiv, Materialfv)
|
||||
ALIAS(TexParameteriv, TexParameterfv)
|
||||
ALIAS(TexEnviv, TexEnvfv)
|
||||
ALIAS(TexGeniv, TexGenfv)
|
||||
ALIAS(PixelMapuiv, PixelMapfv)
|
||||
ALIAS(ColorTableParameteriv, ColorTableParameterfv)
|
||||
ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
|
||||
ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB)
|
||||
ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB)
|
||||
ALIAS(LoadProgramNV, ProgramStringARB)
|
||||
ALIAS(RequestResidentProgramsNV, DrawBuffersARB)
|
||||
ALIAS(VertexAttribs1fvNV, PixelMapfv)
|
||||
ALIAS(VertexAttribs1svNV, PixelMapusv)
|
||||
ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV)
|
||||
ALIAS(VertexAttribs2svNV, PixelMapfv)
|
||||
ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV)
|
||||
ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV)
|
||||
ALIAS(VertexAttribs4ubvNV, PixelMapfv)
|
||||
ALIAS(PointParameterivNV, PointParameterfvEXT)
|
||||
ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB)
|
||||
ALIAS(DeleteFramebuffersEXT, DrawBuffersARB)
|
||||
ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB)
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corporation 2005
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* IBM,
|
||||
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined( _INDIRECT_REQSIZE_H_ )
|
||||
# define _INDIRECT_REQSIZE_H_
|
||||
|
||||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
|
||||
# define HIDDEN __attribute__((visibility("hidden")))
|
||||
# else
|
||||
# define HIDDEN
|
||||
# endif
|
||||
|
||||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define PURE __attribute__((pure))
|
||||
# else
|
||||
# define PURE
|
||||
# endif
|
||||
|
||||
extern PURE HIDDEN int __glXCallListsReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXBitmapReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXFogfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXFogivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXLightfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXLightivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXLightModelfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXLightModelivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMaterialfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMaterialivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPolygonStippleReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexParameterfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexParameterivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexImage1DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexImage2DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexEnvfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexEnvivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexGendvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexGenfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexGenivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMap1dReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMap1fReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMap2dReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXMap2fReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPixelMapfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPixelMapuivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPixelMapusvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXDrawPixelsReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXDrawArraysReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXColorTableReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXColorTableParameterivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXColorSubTableReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXRequestResidentProgramsNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs1fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs1svNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs2fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs2svNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap);
|
||||
extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap);
|
||||
|
||||
# undef HIDDEN
|
||||
# undef PURE
|
||||
|
||||
#endif /* !defined( _INDIRECT_REQSIZE_H_ ) */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,102 +0,0 @@
|
|||
/* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corporation 2004
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* IBM,
|
||||
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined( _INDIRECT_SIZE_GET_H_ )
|
||||
# define _INDIRECT_SIZE_GET_H_
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Prototypes for functions used to determine the number of data elements in
|
||||
* various GLX protocol messages.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define PURE __attribute__((pure))
|
||||
# else
|
||||
# define PURE
|
||||
# endif
|
||||
|
||||
# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
|
||||
# define FASTCALL __attribute__((fastcall))
|
||||
# else
|
||||
# define FASTCALL
|
||||
# endif
|
||||
|
||||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
|
||||
# define INTERNAL __attribute__((visibility("internal")))
|
||||
# else
|
||||
# define INTERNAL
|
||||
# endif
|
||||
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetBooleanv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetDoublev_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetFloatv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetIntegerv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetLightfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetLightiv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetMaterialfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetMaterialiv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexEnvfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexEnviv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexGendv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexGenfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexGeniv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetTexLevelParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint
|
||||
__glGetConvolutionParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint
|
||||
__glGetConvolutionParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetHistogramParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameterfv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivNV_size(GLenum);
|
||||
extern INTERNAL PURE FASTCALL GLint
|
||||
__glGetFramebufferAttachmentParameterivEXT_size(GLenum);
|
||||
|
||||
# undef PURE
|
||||
# undef FASTCALL
|
||||
# undef INTERNAL
|
||||
|
||||
#endif /* !defined( _INDIRECT_SIZE_GET_H_ ) */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -229,6 +229,14 @@ symlink_glx() {
|
|||
action indirect_size.h
|
||||
action glcontextmodes.c
|
||||
action glcontextmodes.h
|
||||
action indirect_dispatch.c
|
||||
action indirect_dispatch.h
|
||||
action indirect_dispatch_swap.c
|
||||
action indirect_reqsize.c
|
||||
action indirect_reqsize.h
|
||||
action indirect_size_get.c
|
||||
action indirect_size_get.h
|
||||
action indirect_table.c
|
||||
|
||||
src_dir src/mesa/glapi
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ SOFTWARE.
|
|||
#define NEED_REPLIES
|
||||
#define NEED_EVENTS
|
||||
#include <X11/X.h> /* From library include environment */
|
||||
#include "input.h" /* From server include env. (must be before Xlib.h!) */
|
||||
#include "inputstr.h" /* From server include env. (must be before Xlib.h!) */
|
||||
#ifdef PC
|
||||
# include "scrintst.h" /* Screen struct */
|
||||
# include "extnsist.h"
|
||||
|
|
@ -96,8 +96,8 @@ int XETrapSimulateXEvent(register xXTrapInputReq *request,
|
|||
xEvent xev;
|
||||
register int x = request->input.x;
|
||||
register int y = request->input.y;
|
||||
DevicePtr keydev = LookupKeyboardDevice();
|
||||
DevicePtr ptrdev = LookupPointerDevice();
|
||||
DevicePtr keydev = (DevicePtr)inputInfo.keyboard;
|
||||
DevicePtr ptrdev = (DevicePtr)inputInfo.pointer;
|
||||
|
||||
if (request->input.screen < screenInfo.numScreens)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/Xos.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include "input.h" /* Server DevicePtr definitions */
|
||||
#include "inputstr.h" /* Server DevicePtr definitions */
|
||||
#include "misc.h" /* Server swapping macros */
|
||||
#include "dixstruct.h" /* Server ClientRec definitions */
|
||||
#include "resource.h" /* Used with the MakeAtom call */
|
||||
|
|
@ -277,7 +277,7 @@ Bool XETrapRedirectDevices()
|
|||
/* Do we need to redirect the keyboard device? */
|
||||
if (XETrapKbdDev == NULL)
|
||||
{
|
||||
if ((XETrapKbdDev = LookupKeyboardDevice()) == NULL)
|
||||
if ((XETrapKbdDev = (DevicePtr)inputInfo.keyboard) == NULL)
|
||||
{
|
||||
retval = False;
|
||||
}
|
||||
|
|
@ -302,7 +302,7 @@ Bool XETrapRedirectDevices()
|
|||
#ifndef VECTORED_EVENTS
|
||||
if (XETrapPtrDev == NULL)
|
||||
{
|
||||
if ((XETrapPtrDev = LookupPointerDevice()) == 0L)
|
||||
if ((XETrapPtrDev = (DevicePtr)inputInfo.pointer) == 0L)
|
||||
{
|
||||
retval = False;
|
||||
}
|
||||
|
|
|
|||
15
Xext/EVI.c
15
Xext/EVI.c
|
|
@ -34,6 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XEVIstr.h>
|
||||
#include "EVIstruct.h"
|
||||
#include "modinit.h"
|
||||
#include "scrnintstr.h"
|
||||
|
||||
static EviPrivPtr eviPriv;
|
||||
|
||||
|
|
@ -84,10 +85,22 @@ ProcEVIGetVisualInfo(ClientPtr client)
|
|||
{
|
||||
REQUEST(xEVIGetVisualInfoReq);
|
||||
xEVIGetVisualInfoReply rep;
|
||||
int n, n_conflict, n_info, sz_info, sz_conflict;
|
||||
int i, n, n_conflict, n_info, sz_info, sz_conflict;
|
||||
VisualID32 *conflict;
|
||||
unsigned int total_visuals = 0;
|
||||
xExtendedVisualInfo *eviInfo;
|
||||
int status;
|
||||
|
||||
/*
|
||||
* do this first, otherwise REQUEST_FIXED_SIZE can overflow. we assume
|
||||
* here that you don't have more than 2^32 visuals over all your screens;
|
||||
* this seems like a safe assumption.
|
||||
*/
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
total_visuals += screenInfo.screens[i]->numVisuals;
|
||||
if (stuff->n_visual > total_visuals)
|
||||
return BadValue;
|
||||
|
||||
REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual * sz_VisualID32);
|
||||
status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual,
|
||||
&eviInfo, &n_info, &conflict, &n_conflict);
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@ MODULE_SRCS = \
|
|||
sync.c \
|
||||
xcmisc.c
|
||||
|
||||
# Extra configuration files ship with some extensions
|
||||
SERVERCONFIG_DATA =
|
||||
|
||||
# Optional sources included if extension enabled by configure.ac rules
|
||||
|
||||
# MIT Shared Memory extension
|
||||
|
|
@ -75,13 +72,17 @@ if XACE
|
|||
BUILTIN_SRCS += $(XACE_SRCS)
|
||||
endif
|
||||
|
||||
# SELinux extension: provides SELinux policy support for X objects
|
||||
# requires X-ACE extension
|
||||
XSELINUX_SRCS = xselinux.c xselinux.h
|
||||
if XSELINUX
|
||||
MODULE_SRCS += $(XSELINUX_SRCS)
|
||||
endif
|
||||
|
||||
# Security extension: multi-level security to protect clients from each other
|
||||
XCSECURITY_SRCS = security.c securitysrv.h
|
||||
if XCSECURITY
|
||||
BUILTIN_SRCS += $(XCSECURITY_SRCS)
|
||||
|
||||
SERVERCONFIG_DATA += SecurityPolicy
|
||||
AM_CFLAGS += -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGdir)/SecurityPolicy\"
|
||||
endif
|
||||
|
||||
XCALIBRATE_SRCS = xcalibrate.c
|
||||
|
|
@ -159,7 +160,6 @@ libXextmodule_la_SOURCES = $(MODULE_SRCS)
|
|||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(SERVERCONFIG_DATA) \
|
||||
$(MITSHM_SRCS) \
|
||||
$(XV_SRCS) \
|
||||
$(RES_SRCS) \
|
||||
|
|
|
|||
|
|
@ -1,88 +0,0 @@
|
|||
version-1
|
||||
|
||||
# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
|
||||
|
||||
# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
|
||||
# authorization protocol. The values are arbitrary and site-specific.
|
||||
# Refer to the Security Extension Specification for the usage of the policies.
|
||||
#sitepolicy A
|
||||
#sitepolicy B
|
||||
#sitepolicy C
|
||||
|
||||
# Property access rules:
|
||||
# property <property> <window> <permissions>
|
||||
# <window> ::= any | root | <propertyselector>
|
||||
# <propertyselector> ::= <property> | <property>=<value>
|
||||
# <permissions> :== [ <operation> | <action> | <space> ]*
|
||||
# <operation> :== r | w | d
|
||||
# r read
|
||||
# w write
|
||||
# d delete
|
||||
# <action> :== a | i | e
|
||||
# a allow
|
||||
# i ignore
|
||||
# e error
|
||||
|
||||
# Allow reading of application resources, but not writing.
|
||||
property RESOURCE_MANAGER root ar iw
|
||||
property SCREEN_RESOURCES root ar iw
|
||||
|
||||
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
|
||||
# and allowing access may give away too much information.
|
||||
property CUT_BUFFER0 root irw
|
||||
property CUT_BUFFER1 root irw
|
||||
property CUT_BUFFER2 root irw
|
||||
property CUT_BUFFER3 root irw
|
||||
property CUT_BUFFER4 root irw
|
||||
property CUT_BUFFER5 root irw
|
||||
property CUT_BUFFER6 root irw
|
||||
property CUT_BUFFER7 root irw
|
||||
|
||||
# If you are using Motif, you probably want these.
|
||||
property _MOTIF_DEFAULT_BINDINGS root ar iw
|
||||
property _MOTIF_DRAG_WINDOW root ar iw
|
||||
property _MOTIF_DRAG_TARGETS any ar iw
|
||||
property _MOTIF_DRAG_ATOMS any ar iw
|
||||
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
|
||||
|
||||
# If you are running CDE you also need these
|
||||
property _MOTIF_WM_INFO root arw
|
||||
property TT_SESSION root irw
|
||||
property WM_ICON_SIZE root irw
|
||||
property "SDT Pixel Set" any irw
|
||||
|
||||
# The next two rules let xwininfo -tree work when untrusted.
|
||||
property WM_NAME any ar
|
||||
|
||||
# Allow read of WM_CLASS, but only for windows with WM_NAME.
|
||||
# This might be more restrictive than necessary, but demonstrates
|
||||
# the <required property> facility, and is also an attempt to
|
||||
# say "top level windows only."
|
||||
property WM_CLASS WM_NAME ar
|
||||
|
||||
# These next three let xlsclients work untrusted. Think carefully
|
||||
# before including these; giving away the client machine name and command
|
||||
# may be exposing too much.
|
||||
property WM_STATE WM_NAME ar
|
||||
property WM_CLIENT_MACHINE WM_NAME ar
|
||||
property WM_COMMAND WM_NAME ar
|
||||
|
||||
# To let untrusted clients use the standard colormaps created by
|
||||
# xstdcmap, include these lines.
|
||||
property RGB_DEFAULT_MAP root ar
|
||||
property RGB_BEST_MAP root ar
|
||||
property RGB_RED_MAP root ar
|
||||
property RGB_GREEN_MAP root ar
|
||||
property RGB_BLUE_MAP root ar
|
||||
property RGB_GRAY_MAP root ar
|
||||
|
||||
# To let untrusted clients use the color management database created
|
||||
# by xcmsdb, include these lines.
|
||||
property XDCCC_LINEAR_RGB_CORRECTION root ar
|
||||
property XDCCC_LINEAR_RGB_MATRICES root ar
|
||||
property XDCCC_GRAY_SCREENWHITEPOINT root ar
|
||||
property XDCCC_GRAY_CORRECTION root ar
|
||||
|
||||
# To let untrusted clients use the overlay visuals that many vendors
|
||||
# support, include this line.
|
||||
property SERVER_OVERLAY_VISUALS root ar
|
||||
|
|
@ -345,7 +345,7 @@ int AttrValidate(
|
|||
ColormapPtr pColormap;
|
||||
|
||||
rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
|
@ -367,8 +367,10 @@ int AttrValidate(
|
|||
}
|
||||
if (pAppGrp->default_colormap) {
|
||||
|
||||
pColormap = (ColormapPtr)LookupIDByType (pAppGrp->default_colormap, RT_COLORMAP);
|
||||
/* XXX check that pColormap is not NULL */
|
||||
rc = dixLookupResource((pointer *)&pColormap, pAppGrp->default_colormap,
|
||||
RT_COLORMAP, client, DixUseAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (pColormap->pScreen != pScreen)
|
||||
return BadColor;
|
||||
if (pColormap->pVisual->vid != (pAppGrp->root_visual ? pAppGrp->root_visual : pScreen->rootVisual))
|
||||
|
|
@ -470,7 +472,7 @@ int ProcXagQuery(
|
|||
int n, rc;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXagQueryReq);
|
||||
rc = dixLookupClient(&pClient, stuff->resource, client, DixUnknownAccess);
|
||||
rc = dixLookupClient(&pClient, stuff->resource, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,11 +50,9 @@ static DISPATCH_PROC(ProcBigReqDispatch);
|
|||
void
|
||||
BigReqExtensionInit(INITARGS)
|
||||
{
|
||||
(void) AddExtension(XBigReqExtensionName, 0, 0,
|
||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
||||
BigReqResetProc, StandardMinorOpcode);
|
||||
|
||||
DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
|
||||
AddExtension(XBigReqExtensionName, 0, 0,
|
||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
||||
BigReqResetProc, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
|
|||
12
Xext/cup.c
12
Xext/cup.c
|
|
@ -176,6 +176,9 @@ int ProcGetReservedColormapEntries(
|
|||
|
||||
REQUEST_SIZE_MATCH (xXcupGetReservedColormapEntriesReq);
|
||||
|
||||
if (stuff->screen >= screenInfo.numScreens)
|
||||
return BadValue;
|
||||
|
||||
#ifndef HAVE_SPECIAL_DESKTOP_COLORS
|
||||
citems[CUP_BLACK_PIXEL].pixel =
|
||||
screenInfo.screens[stuff->screen]->blackPixel;
|
||||
|
|
@ -204,12 +207,13 @@ int ProcStoreColors(
|
|||
{
|
||||
REQUEST (xXcupStoreColorsReq);
|
||||
ColormapPtr pcmp;
|
||||
int rc;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
|
||||
pcmp = (ColormapPtr) SecurityLookupIDByType (client, stuff->cmap,
|
||||
RT_COLORMAP, DixWriteAccess);
|
||||
rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP,
|
||||
client, DixAddAccess);
|
||||
|
||||
if (pcmp) {
|
||||
if (rc == Success) {
|
||||
int ncolors, n;
|
||||
xXcupStoreColorsReply rep;
|
||||
xColorItem* cptr;
|
||||
|
|
@ -253,7 +257,7 @@ int ProcStoreColors(
|
|||
return client->noClientException;
|
||||
} else {
|
||||
client->errorValue = stuff->cmap;
|
||||
return BadColor;
|
||||
return (rc == BadValue) ? BadColor : rc;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
10
Xext/dpms.c
10
Xext/dpms.c
|
|
@ -73,9 +73,9 @@ static void DPMSResetProc(ExtensionEntry* extEntry);
|
|||
void
|
||||
DPMSExtensionInit(INITARGS)
|
||||
{
|
||||
(void) AddExtension(DPMSExtensionName, 0, 0,
|
||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||
DPMSResetProc, StandardMinorOpcode);
|
||||
AddExtension(DPMSExtensionName, 0, 0,
|
||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
||||
DPMSResetProc, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
@ -206,7 +206,7 @@ ProcDPMSDisable(client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
||||
|
||||
DPMSSet(DPMSModeOn);
|
||||
DPMSSet(client, DPMSModeOn);
|
||||
|
||||
DPMSEnabled = FALSE;
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ ProcDPMSForceLevel(client)
|
|||
return BadValue;
|
||||
}
|
||||
|
||||
DPMSSet(stuff->level);
|
||||
DPMSSet(client, stuff->level);
|
||||
|
||||
return(client->noClientException);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
#ifndef _DPMSPROC_H_
|
||||
#define _DPMSPROC_H_
|
||||
|
||||
void DPMSSet(int level);
|
||||
#include "dixstruct.h"
|
||||
|
||||
int DPMSSet(ClientPtr client, int level);
|
||||
int DPMSGet(int *plevel);
|
||||
Bool DPMSSupported(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ Equipment Corporation.
|
|||
|
||||
******************************************************************/
|
||||
|
||||
typedef int Bool;
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
|
@ -46,7 +44,7 @@ int DPMSGet(int *plevel)
|
|||
return -1;
|
||||
}
|
||||
|
||||
void DPMSSet(int level)
|
||||
int DPMSSet(ClientPtr client, int level)
|
||||
{
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
|
|||
42
Xext/mbuf.c
42
Xext/mbuf.c
|
|
@ -61,8 +61,8 @@ in this Software without prior written authorization from The Open Group.
|
|||
|
||||
static int MultibufferEventBase;
|
||||
static int MultibufferErrorBase;
|
||||
int MultibufferScreenIndex = -1;
|
||||
int MultibufferWindowIndex = -1;
|
||||
static DevPrivateKey MultibufferScreenPrivKey = &MultibufferScreenPrivKey;
|
||||
static DevPrivateKey MultibufferWindowPrivKey = &MultibufferWindowPrivKey;
|
||||
|
||||
static void PerformDisplayRequest (
|
||||
MultibuffersPtr * /* ppMultibuffers */,
|
||||
|
|
@ -200,27 +200,16 @@ MultibufferExtensionInit()
|
|||
ScreenPtr pScreen;
|
||||
MultibufferScreenPtr pMultibufferScreen;
|
||||
|
||||
/*
|
||||
* allocate private pointers in windows and screens. Allocating
|
||||
* window privates may seem like an unnecessary expense, but every
|
||||
* PositionWindow call must check to see if the window is
|
||||
* multi-buffered; a resource lookup is too expensive.
|
||||
*/
|
||||
MultibufferScreenIndex = AllocateScreenPrivateIndex ();
|
||||
if (MultibufferScreenIndex < 0)
|
||||
return;
|
||||
MultibufferWindowIndex = AllocateWindowPrivateIndex ();
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
pScreen = screenInfo.screens[i];
|
||||
if (!AllocateWindowPrivate (pScreen, MultibufferWindowIndex, 0) ||
|
||||
!(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
|
||||
if (!(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
|
||||
{
|
||||
for (j = 0; j < i; j++)
|
||||
xfree (screenInfo.screens[j]->devPrivates[MultibufferScreenIndex].ptr);
|
||||
xfree (dixLookupPrivate(&screenInfo.screens[j]->devPrivates, MultibufferScreenPrivKey));
|
||||
return;
|
||||
}
|
||||
pScreen->devPrivates[MultibufferScreenIndex].ptr = (pointer) pMultibufferScreen;
|
||||
dixSetPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey, pMultibufferScreen);
|
||||
/*
|
||||
* wrap PositionWindow to resize the pixmap when the window
|
||||
* changes size
|
||||
|
|
@ -232,7 +221,7 @@ MultibufferExtensionInit()
|
|||
* create the resource types
|
||||
*/
|
||||
MultibufferDrawableResType =
|
||||
CreateNewResourceType(MultibufferDrawableDelete)|RC_CACHED|RC_DRAWABLE;
|
||||
CreateNewResourceType(MultibufferDrawableDelete)|RC_DRAWABLE;
|
||||
MultibufferResType = CreateNewResourceType(MultibufferDelete);
|
||||
MultibuffersResType = CreateNewResourceType(MultibuffersDelete);
|
||||
OtherClientResType = CreateNewResourceType(OtherClientDelete);
|
||||
|
|
@ -260,14 +249,11 @@ ExtensionEntry *extEntry;
|
|||
ScreenPtr pScreen;
|
||||
MultibufferScreenPtr pMultibufferScreen;
|
||||
|
||||
if (MultibufferScreenIndex < 0)
|
||||
return;
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
pScreen = screenInfo.screens[i];
|
||||
if (pScreen->devPrivates[MultibufferScreenIndex].ptr)
|
||||
if ((pMultibufferScreen = (MultibufferScreenPtr)dixLookupPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey)))
|
||||
{
|
||||
pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr;
|
||||
pScreen->PositionWindow = pMultibufferScreen->PositionWindow;
|
||||
xfree (pMultibufferScreen);
|
||||
}
|
||||
|
|
@ -427,7 +413,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint)
|
|||
pMultibuffers->lastUpdate.milliseconds = 0;
|
||||
pMultibuffers->width = width;
|
||||
pMultibuffers->height = height;
|
||||
pWin->devPrivates[MultibufferWindowIndex].ptr = (pointer) pMultibuffers;
|
||||
dixSetPrivate(&pWin->devPrivates, MultibufferWindowPrivKey, pMultibuffers);
|
||||
if (pClearGC) FreeScratchGC(pClearGC);
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -487,7 +473,7 @@ ProcCreateImageBuffers (client)
|
|||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.numberBuffer = ((MultibuffersPtr) (pWin->devPrivates[MultibufferWindowIndex].ptr))->numMultibuffer;
|
||||
rep.numberBuffer = ((MultibuffersPtr) (dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))->numMultibuffer;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
|
|
@ -1236,7 +1222,7 @@ GetBufferPointer (pWin, i)
|
|||
{
|
||||
MultibuffersPtr pMultibuffers;
|
||||
|
||||
if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr))
|
||||
if (!(pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))
|
||||
return NULL;
|
||||
return (DrawablePtr) pMultibuffers->buffers[i].pPixmap;
|
||||
}
|
||||
|
|
@ -1475,7 +1461,7 @@ DestroyImageBuffers (pWin)
|
|||
{
|
||||
FreeResourceByType (pWin->drawable.id, MultibuffersResType, FALSE);
|
||||
/* Zero out the window's pointer to the buffers so they won't be reused */
|
||||
pWin->devPrivates[MultibufferWindowIndex].ptr = NULL;
|
||||
dixSetPrivate(&pWin->devPrivates, MultibufferWindowPrivKey, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1503,11 +1489,11 @@ MultibufferPositionWindow (pWin, x, y)
|
|||
Bool clear;
|
||||
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr;
|
||||
pMultibufferScreen = (MultibufferScreenPtr) dixLookupPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey);
|
||||
(*pMultibufferScreen->PositionWindow) (pWin, x, y);
|
||||
|
||||
/* if this window is not multibuffered, we're done */
|
||||
if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr))
|
||||
if (!(pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))
|
||||
return TRUE;
|
||||
|
||||
/* if new size is same as old, we're done */
|
||||
|
|
@ -1620,7 +1606,7 @@ MultibufferDrawableDelete (value, id)
|
|||
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||
{
|
||||
pWin = (WindowPtr) pDrawable;
|
||||
pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr;
|
||||
pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey);
|
||||
pPixmap = pMultibuffers->buffers[pMultibuffers->displayedMultibuffer].pPixmap;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ static DISPATCH_PROC(SProcMITSetBugMode);
|
|||
void
|
||||
MITMiscExtensionInit(INITARGS)
|
||||
{
|
||||
(void) AddExtension(MITMISCNAME, 0, 0,
|
||||
ProcMITDispatch, SProcMITDispatch,
|
||||
MITResetProc, StandardMinorOpcode);
|
||||
AddExtension(MITMISCNAME, 0, 0,
|
||||
ProcMITDispatch, SProcMITDispatch,
|
||||
MITResetProc, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
|
|||
303
Xext/panoramiX.c
303
Xext/panoramiX.c
|
|
@ -81,9 +81,6 @@ static DepthPtr PanoramiXDepths;
|
|||
static int PanoramiXNumVisuals;
|
||||
static VisualPtr PanoramiXVisuals;
|
||||
|
||||
/* We support at most 256 visuals */
|
||||
_X_EXPORT XID *PanoramiXVisualTable = NULL;
|
||||
|
||||
_X_EXPORT unsigned long XRC_DRAWABLE;
|
||||
_X_EXPORT unsigned long XRT_WINDOW;
|
||||
_X_EXPORT unsigned long XRT_PIXMAP;
|
||||
|
|
@ -107,8 +104,8 @@ static void PanoramiXResetProc(ExtensionEntry*);
|
|||
|
||||
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
|
||||
|
||||
static int PanoramiXGCIndex = -1;
|
||||
static int PanoramiXScreenIndex = -1;
|
||||
static DevPrivateKey PanoramiXGCKey = &PanoramiXGCKey;
|
||||
static DevPrivateKey PanoramiXScreenKey = &PanoramiXScreenKey;
|
||||
|
||||
typedef struct {
|
||||
DDXPointRec clipOrg;
|
||||
|
|
@ -137,8 +134,8 @@ static GCFuncs XineramaGCFuncs = {
|
|||
};
|
||||
|
||||
#define Xinerama_GC_FUNC_PROLOGUE(pGC)\
|
||||
PanoramiXGCPtr pGCPriv = \
|
||||
(PanoramiXGCPtr) (pGC)->devPrivates[PanoramiXGCIndex].ptr;\
|
||||
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr) \
|
||||
dixLookupPrivate(&(pGC)->devPrivates, PanoramiXGCKey); \
|
||||
(pGC)->funcs = pGCPriv->wrapFuncs;
|
||||
|
||||
#define Xinerama_GC_FUNC_EPILOGUE(pGC)\
|
||||
|
|
@ -149,8 +146,8 @@ static GCFuncs XineramaGCFuncs = {
|
|||
static Bool
|
||||
XineramaCloseScreen (int i, ScreenPtr pScreen)
|
||||
{
|
||||
PanoramiXScreenPtr pScreenPriv =
|
||||
(PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
|
||||
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
||||
|
||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||
pScreen->CreateGC = pScreenPriv->CreateGC;
|
||||
|
|
@ -168,14 +165,14 @@ static Bool
|
|||
XineramaCreateGC(GCPtr pGC)
|
||||
{
|
||||
ScreenPtr pScreen = pGC->pScreen;
|
||||
PanoramiXScreenPtr pScreenPriv =
|
||||
(PanoramiXScreenPtr) pScreen->devPrivates[PanoramiXScreenIndex].ptr;
|
||||
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
||||
Bool ret;
|
||||
|
||||
pScreen->CreateGC = pScreenPriv->CreateGC;
|
||||
if((ret = (*pScreen->CreateGC)(pGC))) {
|
||||
PanoramiXGCPtr pGCPriv =
|
||||
(PanoramiXGCPtr) pGC->devPrivates[PanoramiXGCIndex].ptr;
|
||||
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr)
|
||||
dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey);
|
||||
|
||||
pGCPriv->wrapFuncs = pGC->funcs;
|
||||
pGC->funcs = &XineramaGCFuncs;
|
||||
|
|
@ -281,8 +278,8 @@ XineramaCopyGC (
|
|||
unsigned long mask,
|
||||
GCPtr pGCDst
|
||||
){
|
||||
PanoramiXGCPtr pSrcPriv =
|
||||
(PanoramiXGCPtr) pGCSrc->devPrivates[PanoramiXGCIndex].ptr;
|
||||
PanoramiXGCPtr pSrcPriv = (PanoramiXGCPtr)
|
||||
dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey);
|
||||
Xinerama_GC_FUNC_PROLOGUE (pGCDst);
|
||||
|
||||
if(mask & GCTileStipXOrigin)
|
||||
|
|
@ -463,10 +460,8 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
|||
ProcPanoramiXDispatch,
|
||||
SProcPanoramiXDispatch, PanoramiXResetProc,
|
||||
StandardMinorOpcode);
|
||||
if (!extEntry) {
|
||||
ErrorF("PanoramiXExtensionInit(): failed to AddExtension\n");
|
||||
if (!extEntry)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* First make sure all the basic allocations succeed. If not,
|
||||
|
|
@ -477,20 +472,17 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
|||
xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
|
||||
|
||||
BREAK_IF(!panoramiXdataPtr);
|
||||
BREAK_IF((PanoramiXGCIndex = AllocateGCPrivateIndex()) < 0);
|
||||
BREAK_IF((PanoramiXScreenIndex = AllocateScreenPrivateIndex()) < 0);
|
||||
|
||||
if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
|
||||
noPanoramiXExtension = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < PanoramiXNumScreens; i++) {
|
||||
pScreen = screenInfo.screens[i];
|
||||
if(!AllocateGCPrivate(pScreen, PanoramiXGCIndex,
|
||||
sizeof(PanoramiXGCRec))) {
|
||||
noPanoramiXExtension = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
pScreenPriv = xalloc(sizeof(PanoramiXScreenRec));
|
||||
pScreen->devPrivates[PanoramiXScreenIndex].ptr =
|
||||
(pointer)pScreenPriv;
|
||||
dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
|
||||
pScreenPriv);
|
||||
if(!pScreenPriv) {
|
||||
noPanoramiXExtension = TRUE;
|
||||
return;
|
||||
|
|
@ -517,7 +509,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
|
|||
|
||||
if (!success) {
|
||||
noPanoramiXExtension = TRUE;
|
||||
ErrorF("%s Extension failed to initialize\n", PANORAMIX_PROTOCOL_NAME);
|
||||
ErrorF(PANORAMIX_PROTOCOL_NAME " extension failed to initialize\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -607,14 +599,14 @@ Bool PanoramiXCreateConnectionBlock(void)
|
|||
*/
|
||||
|
||||
if(!PanoramiXNumDepths) {
|
||||
ErrorF("PanoramiX error: Incompatible screens. No common visuals\n");
|
||||
ErrorF("Xinerama error: No common visuals\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for(i = 1; i < screenInfo.numScreens; i++) {
|
||||
pScreen = screenInfo.screens[i];
|
||||
if(pScreen->rootDepth != screenInfo.screens[0]->rootDepth) {
|
||||
ErrorF("PanoramiX error: Incompatible screens. Root window depths differ\n");
|
||||
ErrorF("Xinerama error: Root window depths differ\n");
|
||||
return FALSE;
|
||||
}
|
||||
if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport)
|
||||
|
|
@ -707,143 +699,133 @@ Bool PanoramiXCreateConnectionBlock(void)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
extern
|
||||
void PanoramiXConsolidate(void)
|
||||
/*
|
||||
* This isn't just memcmp(), bitsPerRGBValue is skipped. markv made that
|
||||
* change way back before xf86 4.0, but the comment for _why_ is a bit
|
||||
* opaque, so I'm not going to question it for now.
|
||||
*
|
||||
* This is probably better done as a screen hook so DBE/EVI/GLX can add
|
||||
* their own tests, and adding privates to VisualRec so they don't have to
|
||||
* do their own back-mapping.
|
||||
*/
|
||||
static Bool
|
||||
VisualsEqual(VisualPtr a, VisualPtr b)
|
||||
{
|
||||
int i, j, k;
|
||||
VisualPtr pVisual, pVisual2;
|
||||
ScreenPtr pScreen, pScreen2;
|
||||
DepthPtr pDepth, pDepth2;
|
||||
PanoramiXRes *root, *defmap, *saver;
|
||||
Bool foundDepth, missingDepth;
|
||||
return ((a->class == b->class) &&
|
||||
(a->ColormapEntries == b->ColormapEntries) &&
|
||||
(a->nplanes == b->nplanes) &&
|
||||
(a->redMask == b->redMask) &&
|
||||
(a->greenMask == b->greenMask) &&
|
||||
(a->blueMask == b->blueMask) &&
|
||||
(a->offsetRed == b->offsetRed) &&
|
||||
(a->offsetGreen == b->offsetGreen) &&
|
||||
(a->offsetBlue == b->offsetBlue));
|
||||
}
|
||||
|
||||
if(!PanoramiXVisualTable)
|
||||
PanoramiXVisualTable = xcalloc(256 * MAXSCREENS, sizeof(XID));
|
||||
static void
|
||||
PanoramiXMaybeAddDepth(DepthPtr pDepth)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
int j, k;
|
||||
Bool found = FALSE;
|
||||
|
||||
pScreen = screenInfo.screens[0];
|
||||
pVisual = pScreen->visuals;
|
||||
pDepth = pScreen->allowedDepths;
|
||||
|
||||
PanoramiXNumDepths = 0;
|
||||
PanoramiXDepths = xcalloc(pScreen->numDepths,sizeof(DepthRec));
|
||||
PanoramiXNumVisuals = 0;
|
||||
PanoramiXVisuals = xcalloc(pScreen->numVisuals,sizeof(VisualRec));
|
||||
|
||||
for (i = 0; i < pScreen->numDepths; i++, pDepth++) {
|
||||
missingDepth = FALSE;
|
||||
for (j = 1; j < PanoramiXNumScreens; j++) {
|
||||
pScreen2 = screenInfo.screens[j];
|
||||
pDepth2 = pScreen2->allowedDepths;
|
||||
|
||||
foundDepth = FALSE;
|
||||
for (k = 0; k < pScreen2->numDepths; k++, pDepth2++) {
|
||||
if(pDepth2->depth == pDepth->depth) {
|
||||
foundDepth = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!foundDepth) {
|
||||
missingDepth = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!missingDepth) {
|
||||
PanoramiXDepths[PanoramiXNumDepths].depth = pDepth->depth;
|
||||
PanoramiXDepths[PanoramiXNumDepths].numVids = 0;
|
||||
if(pDepth->numVids)
|
||||
PanoramiXDepths[PanoramiXNumDepths].vids =
|
||||
xalloc(sizeof(VisualID) * pDepth->numVids);
|
||||
else
|
||||
PanoramiXDepths[PanoramiXNumDepths].vids = NULL;
|
||||
PanoramiXNumDepths++;
|
||||
}
|
||||
for (j = 1; j < PanoramiXNumScreens; j++) {
|
||||
pScreen = screenInfo.screens[j];
|
||||
for (k = 0; k < pScreen->numDepths; k++) {
|
||||
if (pScreen->allowedDepths[k].depth == pDepth->depth) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
|
||||
PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = pVisual->vid;
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
/* check if the visual exists on all screens */
|
||||
for (j = 1; j < PanoramiXNumScreens; j++) {
|
||||
pScreen2 = screenInfo.screens[j];
|
||||
j = PanoramiXNumDepths;
|
||||
PanoramiXNumDepths++;
|
||||
PanoramiXDepths = xrealloc(PanoramiXDepths,
|
||||
PanoramiXNumDepths * sizeof(DepthRec));
|
||||
PanoramiXDepths[j].depth = pDepth->depth;
|
||||
PanoramiXDepths[j].numVids = 0;
|
||||
/* XXX suboptimal, should grow these dynamically */
|
||||
if(pDepth->numVids)
|
||||
PanoramiXDepths[j].vids = xalloc(sizeof(VisualID) * pDepth->numVids);
|
||||
else
|
||||
PanoramiXDepths[j].vids = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
PanoramiXMaybeAddVisual(VisualPtr pVisual)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
VisualPtr candidate = NULL;
|
||||
int j, k;
|
||||
Bool found = FALSE;
|
||||
|
||||
for (j = 1; j < PanoramiXNumScreens; j++) {
|
||||
pScreen = screenInfo.screens[j];
|
||||
found = FALSE;
|
||||
|
||||
candidate = pScreen->visuals;
|
||||
for (k = 0; k < pScreen->numVisuals; k++) {
|
||||
candidate++;
|
||||
if (VisualsEqual(pVisual, candidate)
|
||||
#ifdef GLXPROXY
|
||||
pVisual2 = glxMatchVisual(pScreen, pVisual, pScreen2);
|
||||
if (pVisual2) {
|
||||
PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] =
|
||||
pVisual2->vid;
|
||||
continue;
|
||||
} else if (glxMatchVisual(pScreen, pVisual, pScreen)) {
|
||||
PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] = 0;
|
||||
break;
|
||||
}
|
||||
&& glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
|
||||
#endif
|
||||
pVisual2 = pScreen2->visuals;
|
||||
|
||||
for (k = 0; k < pScreen2->numVisuals; k++, pVisual2++) {
|
||||
if ((pVisual->class == pVisual2->class) &&
|
||||
(pVisual->ColormapEntries == pVisual2->ColormapEntries) &&
|
||||
(pVisual->nplanes == pVisual2->nplanes) &&
|
||||
(pVisual->redMask == pVisual2->redMask) &&
|
||||
(pVisual->greenMask == pVisual2->greenMask) &&
|
||||
(pVisual->blueMask == pVisual2->blueMask) &&
|
||||
(pVisual->offsetRed == pVisual2->offsetRed) &&
|
||||
(pVisual->offsetGreen == pVisual2->offsetGreen) &&
|
||||
(pVisual->offsetBlue == pVisual2->offsetBlue))
|
||||
{
|
||||
/* We merely assign the first visual that matches. OpenGL
|
||||
will need to get involved at some point if you want
|
||||
match GLX visuals */
|
||||
PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] =
|
||||
pVisual2->vid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if it doesn't exist on all screens we can't use it */
|
||||
for (j = 0; j < PanoramiXNumScreens; j++) {
|
||||
if (!PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j]) {
|
||||
PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = 0;
|
||||
) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* if it does, make sure it's in the list of supported depths and visuals */
|
||||
if(PanoramiXVisualTable[pVisual->vid * MAXSCREENS]) {
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].vid = pVisual->vid;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].class = pVisual->class;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].bitsPerRGBValue = pVisual->bitsPerRGBValue;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].ColormapEntries = pVisual->ColormapEntries;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].nplanes = pVisual->nplanes;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].redMask = pVisual->redMask;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].greenMask = pVisual->greenMask;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].blueMask = pVisual->blueMask;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].offsetRed = pVisual->offsetRed;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].offsetGreen = pVisual->offsetGreen;
|
||||
PanoramiXVisuals[PanoramiXNumVisuals].offsetBlue = pVisual->offsetBlue;
|
||||
PanoramiXNumVisuals++;
|
||||
if (!found)
|
||||
return;
|
||||
}
|
||||
|
||||
for (j = 0; j < PanoramiXNumDepths; j++) {
|
||||
if (PanoramiXDepths[j].depth == pVisual->nplanes) {
|
||||
PanoramiXDepths[j].vids[PanoramiXDepths[j].numVids] = pVisual->vid;
|
||||
PanoramiXDepths[j].numVids++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* found a matching visual on all screens, add it to the subset list */
|
||||
j = PanoramiXNumVisuals;
|
||||
PanoramiXNumVisuals++;
|
||||
PanoramiXVisuals = xrealloc(PanoramiXVisuals,
|
||||
PanoramiXNumVisuals * sizeof(VisualRec));
|
||||
|
||||
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
|
||||
|
||||
root = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
|
||||
for (k = 0; k < PanoramiXNumDepths; k++) {
|
||||
if (PanoramiXDepths[k].depth == pVisual->nplanes) {
|
||||
PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
|
||||
PanoramiXDepths[k].numVids++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
PanoramiXConsolidate(void)
|
||||
{
|
||||
int i;
|
||||
PanoramiXRes *root, *defmap, *saver;
|
||||
ScreenPtr pScreen = screenInfo.screens[0];
|
||||
DepthPtr pDepth = pScreen->allowedDepths;
|
||||
VisualPtr pVisual = pScreen->visuals;
|
||||
|
||||
PanoramiXNumDepths = 0;
|
||||
PanoramiXNumVisuals = 0;
|
||||
|
||||
for (i = 0; i < pScreen->numDepths; i++)
|
||||
PanoramiXMaybeAddDepth(pDepth++);
|
||||
|
||||
for (i = 0; i < pScreen->numVisuals; i++)
|
||||
PanoramiXMaybeAddVisual(pVisual++);
|
||||
|
||||
root = xalloc(sizeof(PanoramiXRes));
|
||||
root->type = XRT_WINDOW;
|
||||
defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
|
||||
defmap = xalloc(sizeof(PanoramiXRes));
|
||||
defmap->type = XRT_COLORMAP;
|
||||
saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
|
||||
saver = xalloc(sizeof(PanoramiXRes));
|
||||
saver->type = XRT_WINDOW;
|
||||
|
||||
|
||||
for (i = 0; i < PanoramiXNumScreens; i++) {
|
||||
root->info[i].id = WindowTable[i]->drawable.id;
|
||||
root->u.win.class = InputOutput;
|
||||
|
|
@ -859,6 +841,31 @@ void PanoramiXConsolidate(void)
|
|||
AddResource(defmap->info[0].id, XRT_COLORMAP, defmap);
|
||||
}
|
||||
|
||||
_X_EXPORT VisualID
|
||||
PanoramiXTranslateVisualID(int screen, VisualID orig)
|
||||
{
|
||||
VisualPtr pVisual = NULL;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < PanoramiXNumVisuals; i++) {
|
||||
if (orig == PanoramiXVisuals[i].vid) {
|
||||
pVisual = &PanoramiXVisuals[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pVisual)
|
||||
return 0;
|
||||
|
||||
/* found the original, now translate it relative to the backend screen */
|
||||
for (i = 0; i < PanoramiXNumScreens; i++)
|
||||
for (j = 0; j < screenInfo.screens[i]->numVisuals; j++)
|
||||
if (VisualsEqual(pVisual, &screenInfo.screens[i]->visuals[j]))
|
||||
return screenInfo.screens[i]->visuals[j].vid;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PanoramiXResetProc()
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ SProcPanoramiXGetState(ClientPtr client)
|
|||
|
||||
swaps (&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
||||
swapl (&stuff->window, n);
|
||||
return ProcPanoramiXGetState(client);
|
||||
}
|
||||
|
||||
|
|
@ -77,6 +78,7 @@ SProcPanoramiXGetScreenCount(ClientPtr client)
|
|||
|
||||
swaps (&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
||||
swapl (&stuff->window, n);
|
||||
return ProcPanoramiXGetScreenCount(client);
|
||||
}
|
||||
|
||||
|
|
@ -88,6 +90,8 @@ SProcPanoramiXGetScreenSize(ClientPtr client)
|
|||
|
||||
swaps (&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
||||
swapl (&stuff->window, n);
|
||||
swapl (&stuff->screen, n);
|
||||
return ProcPanoramiXGetScreenSize(client);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ int PanoramiXCreateWindow(ClientPtr client)
|
|||
if (cmap)
|
||||
*((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
|
||||
if ( orig_visual != CopyFromParent )
|
||||
stuff->visual = PanoramiXVisualTable[(orig_visual*MAXSCREENS) + j];
|
||||
stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
|
||||
result = (*SavedProcVector[X_CreateWindow])(client);
|
||||
if(result != Success) break;
|
||||
}
|
||||
|
|
@ -1039,8 +1039,7 @@ int PanoramiXCopyArea(ClientPtr client)
|
|||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
stuff->gc = gc->info[j].id;
|
||||
VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, pGC, client);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess);
|
||||
if(drawables[0]->depth != pDst->depth) {
|
||||
client->errorValue = stuff->dstDrawable;
|
||||
xfree(data);
|
||||
|
|
@ -1076,7 +1075,8 @@ int PanoramiXCopyArea(ClientPtr client)
|
|||
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
||||
}
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
|
||||
|
||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||
rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
|
||||
DixReadAccess);
|
||||
|
|
@ -1185,7 +1185,7 @@ int PanoramiXCopyPlane(ClientPtr client)
|
|||
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
||||
}
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
|
||||
if (stuff->dstDrawable != stuff->srcDrawable) {
|
||||
rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
|
||||
DixReadAccess);
|
||||
|
|
@ -2077,9 +2077,6 @@ int PanoramiXCreateColormap(ClientPtr client)
|
|||
client, stuff->window, XRT_WINDOW, DixReadAccess)))
|
||||
return BadWindow;
|
||||
|
||||
if(!stuff->visual || (stuff->visual > 255))
|
||||
return BadValue;
|
||||
|
||||
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
||||
return BadAlloc;
|
||||
|
||||
|
|
@ -2092,7 +2089,7 @@ int PanoramiXCreateColormap(ClientPtr client)
|
|||
FOR_NSCREENS_BACKWARD(j){
|
||||
stuff->mid = newCmap->info[j].id;
|
||||
stuff->window = win->info[j].id;
|
||||
stuff->visual = PanoramiXVisualTable[(orig_visual * MAXSCREENS) + j];
|
||||
stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
|
||||
result = (* SavedProcVector[X_CreateColormap])(client);
|
||||
if(result != Success) break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ extern int PanoramiXNumScreens;
|
|||
extern PanoramiXData *panoramiXdataPtr;
|
||||
extern int PanoramiXPixWidth;
|
||||
extern int PanoramiXPixHeight;
|
||||
extern XID *PanoramiXVisualTable;
|
||||
|
||||
extern VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
|
||||
extern void PanoramiXConsolidate(void);
|
||||
extern Bool PanoramiXCreateConnectionBlock(void);
|
||||
extern PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <X11/extensions/XEVIstr.h>
|
||||
#include "EVIstruct.h"
|
||||
#include "scrnintstr.h"
|
||||
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#elif !defined(UINT32_MAX)
|
||||
#define UINT32_MAX 0xffffffffU
|
||||
#endif
|
||||
|
||||
static int sampleGetVisualInfo(
|
||||
VisualID32 *visual,
|
||||
int n_visual,
|
||||
|
|
@ -42,24 +49,36 @@ static int sampleGetVisualInfo(
|
|||
VisualID32 **conflict_rn,
|
||||
int *n_conflict_rn)
|
||||
{
|
||||
int max_sz_evi = n_visual * sz_xExtendedVisualInfo * screenInfo.numScreens;
|
||||
unsigned int max_sz_evi;
|
||||
VisualID32 *temp_conflict;
|
||||
xExtendedVisualInfo *evi;
|
||||
int max_visuals = 0, max_sz_conflict, sz_conflict = 0;
|
||||
unsigned int max_visuals = 0, max_sz_conflict, sz_conflict = 0;
|
||||
register int visualI, scrI, sz_evi = 0, conflictI, n_conflict;
|
||||
*evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);
|
||||
if (!*evi_rn)
|
||||
return BadAlloc;
|
||||
|
||||
if (n_visual > UINT32_MAX/(sz_xExtendedVisualInfo * screenInfo.numScreens))
|
||||
return BadAlloc;
|
||||
max_sz_evi = n_visual * sz_xExtendedVisualInfo * screenInfo.numScreens;
|
||||
|
||||
for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
|
||||
if (screenInfo.screens[scrI]->numVisuals > max_visuals)
|
||||
max_visuals = screenInfo.screens[scrI]->numVisuals;
|
||||
}
|
||||
|
||||
if (n_visual > UINT32_MAX/(sz_VisualID32 * screenInfo.numScreens
|
||||
* max_visuals))
|
||||
return BadAlloc;
|
||||
max_sz_conflict = n_visual * sz_VisualID32 * screenInfo.numScreens * max_visuals;
|
||||
|
||||
*evi_rn = evi = (xExtendedVisualInfo *)xalloc(max_sz_evi);
|
||||
if (!*evi_rn)
|
||||
return BadAlloc;
|
||||
|
||||
temp_conflict = (VisualID32 *)xalloc(max_sz_conflict);
|
||||
if (!temp_conflict) {
|
||||
xfree(*evi_rn);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
for (scrI = 0; scrI < screenInfo.numScreens; scrI++) {
|
||||
for (visualI = 0; visualI < n_visual; visualI++) {
|
||||
evi[sz_evi].core_visual_id = visual[visualI];
|
||||
|
|
|
|||
69
Xext/saver.c
69
Xext/saver.c
|
|
@ -48,6 +48,7 @@ in this Software without prior written authorization from the X Consortium.
|
|||
#include "gcstruct.h"
|
||||
#include "cursorstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "xace.h"
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
|
|
@ -231,10 +232,12 @@ MakeScreenPrivate (
|
|||
ScreenPtr /* pScreen */
|
||||
);
|
||||
|
||||
static int ScreenPrivateIndex;
|
||||
static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKey;
|
||||
|
||||
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr)
|
||||
#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v);
|
||||
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
|
||||
dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
|
||||
#define SetScreenPrivate(s,v) \
|
||||
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
|
||||
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
|
||||
|
||||
#define New(t) ((t *) xalloc (sizeof (t)))
|
||||
|
|
@ -257,14 +260,13 @@ ScreenSaverExtensionInit(INITARGS)
|
|||
AttrType = CreateNewResourceType(ScreenSaverFreeAttr);
|
||||
EventType = CreateNewResourceType(ScreenSaverFreeEvents);
|
||||
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend);
|
||||
ScreenPrivateIndex = AllocateScreenPrivateIndex ();
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
pScreen = screenInfo.screens[i];
|
||||
SetScreenPrivate (pScreen, NULL);
|
||||
}
|
||||
if (AttrType && EventType && SuspendType && ScreenPrivateIndex != -1 &&
|
||||
if (AttrType && EventType && SuspendType &&
|
||||
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
||||
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
||||
ScreenSaverResetProc, StandardMinorOpcode)))
|
||||
|
|
@ -448,8 +450,8 @@ ScreenSaverFreeAttr (value, id)
|
|||
pPriv->attr = NULL;
|
||||
if (pPriv->hasWindow)
|
||||
{
|
||||
SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverReset);
|
||||
SaveScreens (SCREEN_SAVER_FORCER, ScreenSaverActive);
|
||||
dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
|
||||
dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
|
||||
}
|
||||
CheckScreenPrivate (pScreen);
|
||||
return TRUE;
|
||||
|
|
@ -782,7 +784,11 @@ ProcScreenSaverQueryInfo (client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -851,9 +857,15 @@ ProcScreenSaverSelectInput (client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
|
||||
rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
|
||||
DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
|
||||
return BadAlloc;
|
||||
return Success;
|
||||
|
|
@ -887,12 +899,16 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
|
||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
pScreen = pDraw->pScreen;
|
||||
pParent = WindowTable[pScreen->myNum];
|
||||
|
||||
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
|
||||
if (Ones(stuff->mask) != len)
|
||||
return BadLength;
|
||||
|
|
@ -1048,8 +1064,9 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
}
|
||||
else
|
||||
{
|
||||
pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
|
||||
if (pPixmap != (PixmapPtr) NULL)
|
||||
ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||
client, DixReadAccess);
|
||||
if (ret == Success)
|
||||
{
|
||||
if ((pPixmap->drawable.depth != depth) ||
|
||||
(pPixmap->drawable.pScreen != pScreen))
|
||||
|
|
@ -1063,7 +1080,7 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = BadPixmap;
|
||||
ret = (ret == BadValue) ? BadPixmap : ret;
|
||||
client->errorValue = pixID;
|
||||
goto PatchUp;
|
||||
}
|
||||
|
|
@ -1085,8 +1102,9 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
}
|
||||
else
|
||||
{
|
||||
pPixmap = (PixmapPtr)LookupIDByType(pixID, RT_PIXMAP);
|
||||
if (pPixmap)
|
||||
ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
|
||||
client, DixReadAccess);
|
||||
if (ret == Success)
|
||||
{
|
||||
if ((pPixmap->drawable.depth != depth) ||
|
||||
(pPixmap->drawable.pScreen != pScreen))
|
||||
|
|
@ -1100,7 +1118,7 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
}
|
||||
else
|
||||
{
|
||||
ret = BadPixmap;
|
||||
ret = (ret == BadValue) ? BadPixmap : ret;
|
||||
client->errorValue = pixID;
|
||||
goto PatchUp;
|
||||
}
|
||||
|
|
@ -1178,10 +1196,11 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
break;
|
||||
case CWColormap:
|
||||
cmap = (Colormap) *pVlist;
|
||||
pCmap = (ColormapPtr)LookupIDByType(cmap, RT_COLORMAP);
|
||||
if (!pCmap)
|
||||
ret = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP,
|
||||
client, DixUseAccess);
|
||||
if (ret != Success)
|
||||
{
|
||||
ret = BadColor;
|
||||
ret = (ret == BadValue) ? BadColor : ret;
|
||||
client->errorValue = cmap;
|
||||
goto PatchUp;
|
||||
}
|
||||
|
|
@ -1201,10 +1220,11 @@ ScreenSaverSetAttributes (ClientPtr client)
|
|||
}
|
||||
else
|
||||
{
|
||||
pCursor = (CursorPtr)LookupIDByType(cursorID, RT_CURSOR);
|
||||
if (!pCursor)
|
||||
ret = dixLookupResource((pointer *)&pCursor, cursorID,
|
||||
RT_CURSOR, client, DixUseAccess);
|
||||
if (ret != Success)
|
||||
{
|
||||
ret = BadCursor;
|
||||
ret = (ret == BadValue) ? BadCursor : ret;
|
||||
client->errorValue = cursorID;
|
||||
goto PatchUp;
|
||||
}
|
||||
|
|
@ -1246,7 +1266,7 @@ ScreenSaverUnsetAttributes (ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pPriv = GetScreenPrivate (pDraw->pScreen);
|
||||
|
|
@ -1326,8 +1346,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
|
|||
*((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
|
||||
|
||||
if (orig_visual != CopyFromParent)
|
||||
stuff->visualID =
|
||||
PanoramiXVisualTable[(orig_visual*MAXSCREENS) + i];
|
||||
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
||||
|
||||
status = ScreenSaverSetAttributes(client);
|
||||
}
|
||||
|
|
|
|||
1492
Xext/security.c
1492
Xext/security.c
File diff suppressed because it is too large
Load diff
|
|
@ -77,13 +77,7 @@ typedef struct {
|
|||
Bool valid; /* did anyone recognize it? if so, set to TRUE */
|
||||
} SecurityValidateGroupInfoRec;
|
||||
|
||||
extern int XSecurityOptions(int argc, char **argv, int i);
|
||||
|
||||
/* Give this value or higher to the -audit option to get security messages */
|
||||
#define SECURITY_AUDIT_LEVEL 4
|
||||
|
||||
#define SECURITY_POLICY_FILE_VERSION "version-1"
|
||||
|
||||
extern char **SecurityGetSitePolicyStrings(int *n);
|
||||
|
||||
#endif /* _SECURITY_SRV_H */
|
||||
|
|
|
|||
26
Xext/shape.c
26
Xext/shape.c
|
|
@ -317,7 +317,7 @@ ProcShapeRectangles (client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
|
||||
UpdateCurrentTime();
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
switch (stuff->destKind) {
|
||||
|
|
@ -417,7 +417,7 @@ ProcShapeMask (client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xShapeMaskReq);
|
||||
UpdateCurrentTime();
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixWriteAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
switch (stuff->destKind) {
|
||||
|
|
@ -438,10 +438,10 @@ ProcShapeMask (client)
|
|||
if (stuff->src == None)
|
||||
srcRgn = 0;
|
||||
else {
|
||||
pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src,
|
||||
RT_PIXMAP, DixReadAccess);
|
||||
if (!pPixmap)
|
||||
return BadPixmap;
|
||||
rc = dixLookupResource((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
|
||||
client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return (rc == BadValue) ? BadPixmap : rc;
|
||||
if (pPixmap->drawable.pScreen != pScreen ||
|
||||
pPixmap->drawable.depth != 1)
|
||||
return BadMatch;
|
||||
|
|
@ -525,7 +525,7 @@ ProcShapeCombine (client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xShapeCombineReq);
|
||||
UpdateCurrentTime();
|
||||
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (!pDestWin->optional)
|
||||
|
|
@ -546,7 +546,7 @@ ProcShapeCombine (client)
|
|||
}
|
||||
pScreen = pDestWin->drawable.pScreen;
|
||||
|
||||
rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
switch (stuff->srcKind) {
|
||||
|
|
@ -645,7 +645,7 @@ ProcShapeOffset (client)
|
|||
|
||||
REQUEST_SIZE_MATCH (xShapeOffsetReq);
|
||||
UpdateCurrentTime();
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
switch (stuff->destKind) {
|
||||
|
|
@ -710,7 +710,7 @@ ProcShapeQueryExtents (client)
|
|||
RegionPtr region;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
rep.type = X_Reply;
|
||||
|
|
@ -820,7 +820,7 @@ ProcShapeSelectInput (client)
|
|||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeSelectInputReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pHead = (ShapeEventPtr *)SecurityLookupIDByType(client,
|
||||
|
|
@ -993,7 +993,7 @@ ProcShapeInputSelected (client)
|
|||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
pHead = (ShapeEventPtr *) SecurityLookupIDByType(client,
|
||||
|
|
@ -1035,7 +1035,7 @@ ProcShapeGetRectangles (client)
|
|||
register int n;
|
||||
|
||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
switch (stuff->kind) {
|
||||
|
|
|
|||
82
Xext/shm.c
82
Xext/shm.c
|
|
@ -58,6 +58,7 @@ in this Software without prior written authorization from The Open Group.
|
|||
#include "extnsionst.h"
|
||||
#include "servermd.h"
|
||||
#include "shmint.h"
|
||||
#include "xace.h"
|
||||
#define _XSHM_SERVER_
|
||||
#include <X11/extensions/shmstr.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
|
@ -146,7 +147,7 @@ static int pixmapFormat;
|
|||
static int shmPixFormat[MAXSCREENS];
|
||||
static ShmFuncsPtr shmFuncs[MAXSCREENS];
|
||||
static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
|
||||
static int shmPixmapPrivate;
|
||||
static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate;
|
||||
static ShmFuncs miFuncs = {NULL, miShmPutImage};
|
||||
static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
|
||||
|
||||
|
|
@ -256,20 +257,11 @@ ShmExtensionInit(INITARGS)
|
|||
if (!pixmapFormat)
|
||||
pixmapFormat = ZPixmap;
|
||||
if (sharedPixmaps)
|
||||
{
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
|
||||
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
||||
}
|
||||
shmPixmapPrivate = AllocatePixmapPrivateIndex();
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
{
|
||||
if (!AllocatePixmapPrivate(screenInfo.screens[i],
|
||||
shmPixmapPrivate, 0))
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
ShmSegType = CreateNewResourceType(ShmDetachSegment);
|
||||
if (ShmSegType &&
|
||||
|
|
@ -322,7 +314,8 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
|
|||
if (pPixmap->refcnt == 1)
|
||||
{
|
||||
ShmDescPtr shmdesc;
|
||||
shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr;
|
||||
shmdesc = (ShmDescPtr)dixLookupPrivate(&pPixmap->devPrivates,
|
||||
shmPixmapPrivate);
|
||||
if (shmdesc)
|
||||
ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
|
||||
}
|
||||
|
|
@ -764,6 +757,8 @@ ProcPanoramiXShmCreatePixmap(
|
|||
int i, j, result, rc;
|
||||
ShmDescPtr shmdesc;
|
||||
REQUEST(xShmCreatePixmapReq);
|
||||
unsigned int width, height, depth;
|
||||
unsigned long size;
|
||||
PanoramiXRes *newPix;
|
||||
|
||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
||||
|
|
@ -777,11 +772,18 @@ ProcPanoramiXShmCreatePixmap(
|
|||
return rc;
|
||||
|
||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||
if (!stuff->width || !stuff->height)
|
||||
|
||||
width = stuff->width;
|
||||
height = stuff->height;
|
||||
depth = stuff->depth;
|
||||
if (!width || !height || !depth)
|
||||
{
|
||||
client->errorValue = 0;
|
||||
return BadValue;
|
||||
}
|
||||
if (width > 32767 || height > 32767)
|
||||
return BadAlloc;
|
||||
|
||||
if (stuff->depth != 1)
|
||||
{
|
||||
pDepth = pDraw->pScreen->allowedDepths;
|
||||
|
|
@ -791,10 +793,18 @@ ProcPanoramiXShmCreatePixmap(
|
|||
client->errorValue = stuff->depth;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
CreatePmap:
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset,
|
||||
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
|
||||
client);
|
||||
size = PixmapBytePad(width, depth) * height;
|
||||
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
|
||||
if (size < width * height)
|
||||
return BadAlloc;
|
||||
}
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
|
||||
|
||||
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
||||
return BadAlloc;
|
||||
|
|
@ -815,7 +825,7 @@ CreatePmap:
|
|||
shmdesc->addr + stuff->offset);
|
||||
|
||||
if (pMap) {
|
||||
pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
|
||||
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
|
||||
shmdesc->refcnt++;
|
||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||
pMap->drawable.id = newPix->info[j].id;
|
||||
|
|
@ -855,7 +865,7 @@ ProcShmPutImage(client)
|
|||
REQUEST(xShmPutImageReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
||||
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
||||
return BadValue;
|
||||
|
|
@ -968,7 +978,7 @@ ProcShmGetImage(client)
|
|||
return(BadValue);
|
||||
}
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||
DixUnknownAccess);
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||
|
|
@ -1093,6 +1103,8 @@ ProcShmCreatePixmap(client)
|
|||
register int i, rc;
|
||||
ShmDescPtr shmdesc;
|
||||
REQUEST(xShmCreatePixmapReq);
|
||||
unsigned int width, height, depth;
|
||||
unsigned long size;
|
||||
|
||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
||||
client->errorValue = stuff->pid;
|
||||
|
|
@ -1100,16 +1112,23 @@ ProcShmCreatePixmap(client)
|
|||
return BadImplementation;
|
||||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||
if (!stuff->width || !stuff->height)
|
||||
|
||||
width = stuff->width;
|
||||
height = stuff->height;
|
||||
depth = stuff->depth;
|
||||
if (!width || !height || !depth)
|
||||
{
|
||||
client->errorValue = 0;
|
||||
return BadValue;
|
||||
}
|
||||
if (width > 32767 || height > 32767)
|
||||
return BadAlloc;
|
||||
|
||||
if (stuff->depth != 1)
|
||||
{
|
||||
pDepth = pDraw->pScreen->allowedDepths;
|
||||
|
|
@ -1119,17 +1138,31 @@ ProcShmCreatePixmap(client)
|
|||
client->errorValue = stuff->depth;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
CreatePmap:
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset,
|
||||
PixmapBytePad(stuff->width, stuff->depth) * stuff->height,
|
||||
client);
|
||||
size = PixmapBytePad(width, depth) * height;
|
||||
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
|
||||
if (size < width * height)
|
||||
return BadAlloc;
|
||||
}
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
|
||||
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
|
||||
pDraw->pScreen, stuff->width,
|
||||
stuff->height, stuff->depth,
|
||||
shmdesc->addr + stuff->offset);
|
||||
if (pMap)
|
||||
{
|
||||
pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
|
||||
pMap, RT_NONE, NULL, DixCreateAccess);
|
||||
if (rc != Success) {
|
||||
pDraw->pScreen->DestroyPixmap(pMap);
|
||||
return rc;
|
||||
}
|
||||
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
|
||||
shmdesc->refcnt++;
|
||||
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||
pMap->drawable.id = stuff->pid;
|
||||
|
|
@ -1137,6 +1170,7 @@ CreatePmap:
|
|||
{
|
||||
return(client->noClientException);
|
||||
}
|
||||
pDraw->pScreen->DestroyPixmap(pMap);
|
||||
}
|
||||
return (BadAlloc);
|
||||
}
|
||||
|
|
|
|||
16
Xext/sync.c
16
Xext/sync.c
|
|
@ -433,18 +433,18 @@ SyncInitTrigger(client, pTrigger, counter, changes)
|
|||
Mask changes;
|
||||
{
|
||||
SyncCounter *pCounter = pTrigger->pCounter;
|
||||
int status;
|
||||
int rc;
|
||||
Bool newcounter = FALSE;
|
||||
|
||||
if (changes & XSyncCACounter)
|
||||
{
|
||||
if (counter == None)
|
||||
pCounter = NULL;
|
||||
else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType(
|
||||
client, counter, RTCounter, DixReadAccess)))
|
||||
else if (Success != (rc = dixLookupResource((pointer *)&pCounter,
|
||||
counter, RTCounter, client, DixReadAccess)))
|
||||
{
|
||||
client->errorValue = counter;
|
||||
return SyncErrorBase + XSyncBadCounter;
|
||||
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc;
|
||||
}
|
||||
if (pCounter != pTrigger->pCounter)
|
||||
{ /* new counter for trigger */
|
||||
|
|
@ -526,8 +526,8 @@ SyncInitTrigger(client, pTrigger, counter, changes)
|
|||
*/
|
||||
if (newcounter)
|
||||
{
|
||||
if ((status = SyncAddTriggerToCounter(pTrigger)) != Success)
|
||||
return status;
|
||||
if ((rc = SyncAddTriggerToCounter(pTrigger)) != Success)
|
||||
return rc;
|
||||
}
|
||||
else if (IsSystemCounter(pCounter))
|
||||
{
|
||||
|
|
@ -1465,7 +1465,7 @@ ProcSyncSetPriority(client)
|
|||
priorityclient = client;
|
||||
else {
|
||||
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
||||
DixUnknownAccess);
|
||||
DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1502,7 +1502,7 @@ ProcSyncGetPriority(client)
|
|||
priorityclient = client;
|
||||
else {
|
||||
rc = dixLookupClient(&priorityclient, stuff->id, client,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
323
Xext/xace.c
323
Xext/xace.c
|
|
@ -22,35 +22,52 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "windowstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "extnsionst.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "regionstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "xacestr.h"
|
||||
#include "modinit.h"
|
||||
|
||||
CallbackListPtr XaceHooks[XACE_NUM_HOOKS] = {0};
|
||||
|
||||
/* Proc vectors for untrusted clients, swapped and unswapped versions.
|
||||
* These are the same as the normal proc vectors except that extensions
|
||||
* that haven't declared themselves secure will have ProcBadRequest plugged
|
||||
* in for their major opcode dispatcher. This prevents untrusted clients
|
||||
* from guessing extension major opcodes and using the extension even though
|
||||
* the extension can't be listed or queried.
|
||||
*/
|
||||
static int (*UntrustedProcVector[256])(
|
||||
ClientPtr /*client*/
|
||||
);
|
||||
static int (*SwappedUntrustedProcVector[256])(
|
||||
ClientPtr /*client*/
|
||||
);
|
||||
|
||||
/* Special-cased hook functions. Called by Xserver.
|
||||
*/
|
||||
void XaceHookAuditBegin(ClientPtr ptr)
|
||||
int XaceHookDispatch(ClientPtr client, int major)
|
||||
{
|
||||
XaceAuditRec rec = { ptr, 0 };
|
||||
/* call callbacks, there is no return value. */
|
||||
/* Call the audit begin callback, there is no return value. */
|
||||
XaceAuditRec rec = { client, 0 };
|
||||
CallCallbacks(&XaceHooks[XACE_AUDIT_BEGIN], &rec);
|
||||
|
||||
if (major < 128) {
|
||||
/* Call the core dispatch hook */
|
||||
XaceCoreDispatchRec rec = { client, Success /* default allow */ };
|
||||
CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
|
||||
return rec.status;
|
||||
} else {
|
||||
/* Call the extension dispatch hook */
|
||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||
XaceExtAccessRec rec = { client, ext, DixUseAccess, Success };
|
||||
if (ext)
|
||||
CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec);
|
||||
/* On error, pretend extension doesn't exist */
|
||||
return (rec.status == Success) ? Success : BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
int XaceHookPropertyAccess(ClientPtr client, WindowPtr pWin,
|
||||
PropertyPtr pProp, Mask access_mode)
|
||||
{
|
||||
XacePropertyAccessRec rec = { client, pWin, pProp, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_PROPERTY_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
|
||||
int XaceHookSelectionAccess(ClientPtr client, Atom name, Mask access_mode)
|
||||
{
|
||||
XaceSelectionAccessRec rec = { client, name, access_mode, Success };
|
||||
CallCallbacks(&XaceHooks[XACE_SELECTION_ACCESS], &rec);
|
||||
return rec.status;
|
||||
}
|
||||
|
||||
void XaceHookAuditEnd(ClientPtr ptr, int result)
|
||||
|
|
@ -81,95 +98,94 @@ int XaceHook(int hook, ...)
|
|||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, XID),
|
||||
va_arg(ap, RESTYPE),
|
||||
va_arg(ap, Mask),
|
||||
va_arg(ap, pointer),
|
||||
TRUE /* default allow */
|
||||
va_arg(ap, RESTYPE),
|
||||
va_arg(ap, pointer),
|
||||
va_arg(ap, Mask),
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_DEVICE_ACCESS: {
|
||||
XaceDeviceAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, DeviceIntPtr),
|
||||
va_arg(ap, Bool),
|
||||
TRUE /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
break;
|
||||
}
|
||||
case XACE_PROPERTY_ACCESS: {
|
||||
XacePropertyAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, WindowPtr),
|
||||
va_arg(ap, Atom),
|
||||
va_arg(ap, Mask),
|
||||
XaceAllowOperation /* default allow */
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_DRAWABLE_ACCESS: {
|
||||
XaceDrawableAccessRec rec = {
|
||||
case XACE_SEND_ACCESS: {
|
||||
XaceSendAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, DrawablePtr),
|
||||
TRUE /* default allow */
|
||||
va_arg(ap, DeviceIntPtr),
|
||||
va_arg(ap, WindowPtr),
|
||||
va_arg(ap, xEventPtr),
|
||||
va_arg(ap, int),
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_MAP_ACCESS:
|
||||
case XACE_BACKGRND_ACCESS: {
|
||||
XaceMapAccessRec rec = {
|
||||
case XACE_RECEIVE_ACCESS: {
|
||||
XaceReceiveAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, WindowPtr),
|
||||
TRUE /* default allow */
|
||||
va_arg(ap, xEventPtr),
|
||||
va_arg(ap, int),
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_CLIENT_ACCESS: {
|
||||
XaceClientAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, Mask),
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_EXT_DISPATCH:
|
||||
case XACE_EXT_ACCESS: {
|
||||
XaceExtAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, ExtensionEntry*),
|
||||
TRUE /* default allow */
|
||||
DixGetAttrAccess,
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_HOSTLIST_ACCESS: {
|
||||
XaceHostlistAccessRec rec = {
|
||||
case XACE_SERVER_ACCESS: {
|
||||
XaceServerAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, Mask),
|
||||
TRUE /* default allow */
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_SITE_POLICY: {
|
||||
XaceSitePolicyRec rec = {
|
||||
va_arg(ap, char*),
|
||||
va_arg(ap, int),
|
||||
FALSE /* default unrecognized */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.rval;
|
||||
break;
|
||||
}
|
||||
case XACE_DECLARE_EXT_SECURE: {
|
||||
XaceDeclareExtSecureRec rec = {
|
||||
va_arg(ap, ExtensionEntry*),
|
||||
va_arg(ap, Bool)
|
||||
case XACE_SCREEN_ACCESS:
|
||||
case XACE_SCREENSAVER_ACCESS: {
|
||||
XaceScreenAccessRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, ScreenPtr),
|
||||
va_arg(ap, Mask),
|
||||
Success /* default allow */
|
||||
};
|
||||
calldata = &rec;
|
||||
prv = &rec.status;
|
||||
break;
|
||||
}
|
||||
case XACE_AUTH_AVAIL: {
|
||||
|
|
@ -189,14 +205,6 @@ int XaceHook(int hook, ...)
|
|||
calldata = &rec;
|
||||
break;
|
||||
}
|
||||
case XACE_WINDOW_INIT: {
|
||||
XaceWindowRec rec = {
|
||||
va_arg(ap, ClientPtr),
|
||||
va_arg(ap, WindowPtr)
|
||||
};
|
||||
calldata = &rec;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
va_end(ap);
|
||||
return 0; /* unimplemented hook number */
|
||||
|
|
@ -206,168 +214,7 @@ int XaceHook(int hook, ...)
|
|||
|
||||
/* call callbacks and return result, if any. */
|
||||
CallCallbacks(&XaceHooks[hook], calldata);
|
||||
return prv ? *prv : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXaceDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
switch (stuff->data)
|
||||
{
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
} /* ProcXaceDispatch */
|
||||
|
||||
static int
|
||||
SProcXaceDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
switch (stuff->data)
|
||||
{
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
} /* SProcXaceDispatch */
|
||||
|
||||
|
||||
/* XaceResetProc
|
||||
*
|
||||
* Arguments:
|
||||
* extEntry is the extension information for the XACE extension.
|
||||
*
|
||||
* Returns: nothing.
|
||||
*
|
||||
* Side Effects:
|
||||
* Performs any cleanup needed by XACE at server shutdown time.
|
||||
*/
|
||||
static void
|
||||
XaceResetProc(ExtensionEntry *extEntry)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<XACE_NUM_HOOKS; i++)
|
||||
{
|
||||
DeleteCallbackList(&XaceHooks[i]);
|
||||
XaceHooks[i] = NULL;
|
||||
}
|
||||
} /* XaceResetProc */
|
||||
|
||||
|
||||
static int
|
||||
XaceCatchDispatchProc(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
int major = stuff->reqType;
|
||||
XaceCoreDispatchRec rec = { client, TRUE /* default allow */ };
|
||||
|
||||
if (!ProcVector[major])
|
||||
return (BadRequest);
|
||||
|
||||
/* call callbacks and return result, if any. */
|
||||
CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
|
||||
|
||||
if (!rec.rval)
|
||||
return (BadAccess);
|
||||
|
||||
return client->swapped ?
|
||||
(* SwappedProcVector[major])(client) :
|
||||
(* ProcVector[major])(client);
|
||||
}
|
||||
|
||||
static int
|
||||
XaceCatchExtProc(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
int major = stuff->reqType;
|
||||
ExtensionEntry *ext = GetExtensionEntry(major);
|
||||
|
||||
if (!ext || !ProcVector[major])
|
||||
return (BadRequest);
|
||||
|
||||
if (!XaceHook(XACE_EXT_DISPATCH, client, ext))
|
||||
return (BadRequest); /* pretend extension doesn't exist */
|
||||
|
||||
return client->swapped ?
|
||||
(* SwappedProcVector[major])(client) :
|
||||
(* ProcVector[major])(client);
|
||||
}
|
||||
|
||||
|
||||
/* SecurityClientStateCallback
|
||||
*
|
||||
* Arguments:
|
||||
* pcbl is &ClientStateCallback.
|
||||
* nullata is NULL.
|
||||
* calldata is a pointer to a NewClientInfoRec (include/dixstruct.h)
|
||||
* which contains information about client state changes.
|
||||
*
|
||||
* Returns: nothing.
|
||||
*
|
||||
* Side Effects:
|
||||
*
|
||||
* If a new client is connecting, its authorization ID is copied to
|
||||
* client->authID. If this is a generated authorization, its reference
|
||||
* count is bumped, its timer is cancelled if it was running, and its
|
||||
* trustlevel is copied to TRUSTLEVEL(client).
|
||||
*
|
||||
* If a client is disconnecting and the client was using a generated
|
||||
* authorization, the authorization's reference count is decremented, and
|
||||
* if it is now zero, the timer for this authorization is started.
|
||||
*/
|
||||
|
||||
static void
|
||||
XaceClientStateCallback(
|
||||
CallbackListPtr *pcbl,
|
||||
pointer nulldata,
|
||||
pointer calldata)
|
||||
{
|
||||
NewClientInfoRec *pci = (NewClientInfoRec *)calldata;
|
||||
ClientPtr client = pci->client;
|
||||
|
||||
switch (client->clientState)
|
||||
{
|
||||
case ClientStateRunning:
|
||||
{
|
||||
client->requestVector = client->swapped ?
|
||||
SwappedUntrustedProcVector : UntrustedProcVector;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
} /* XaceClientStateCallback */
|
||||
|
||||
/* XaceExtensionInit
|
||||
*
|
||||
* Initialize the XACE Extension
|
||||
*/
|
||||
void XaceExtensionInit(INITARGS)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
int i;
|
||||
|
||||
if (!AddCallback(&ClientStateCallback, XaceClientStateCallback, NULL))
|
||||
return;
|
||||
|
||||
extEntry = AddExtension(XACE_EXTENSION_NAME,
|
||||
XaceNumberEvents, XaceNumberErrors,
|
||||
ProcXaceDispatch, SProcXaceDispatch,
|
||||
XaceResetProc, StandardMinorOpcode);
|
||||
|
||||
/* initialize dispatching intercept functions */
|
||||
for (i = 0; i < 128; i++)
|
||||
{
|
||||
UntrustedProcVector[i] = XaceCatchDispatchProc;
|
||||
SwappedUntrustedProcVector[i] = XaceCatchDispatchProc;
|
||||
}
|
||||
for (i = 128; i < 256; i++)
|
||||
{
|
||||
UntrustedProcVector[i] = XaceCatchExtProc;
|
||||
SwappedUntrustedProcVector[i] = XaceCatchExtProc;
|
||||
}
|
||||
return prv ? *prv : Success;
|
||||
}
|
||||
|
||||
/* XaceCensorImage
|
||||
|
|
@ -432,7 +279,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
|
|||
|
||||
/* convert region to list-of-rectangles for PolyFillRect */
|
||||
|
||||
pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle *));
|
||||
pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle));
|
||||
if (!pRects)
|
||||
{
|
||||
failed = TRUE;
|
||||
|
|
|
|||
57
Xext/xace.h
57
Xext/xace.h
|
|
@ -20,22 +20,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifndef _XACE_H
|
||||
#define _XACE_H
|
||||
|
||||
/* Hook return codes */
|
||||
#define XaceErrorOperation 0
|
||||
#define XaceAllowOperation 1
|
||||
#define XaceIgnoreOperation 2
|
||||
|
||||
#ifdef XACE
|
||||
|
||||
#define XACE_EXTENSION_NAME "XAccessControlExtension"
|
||||
#define XACE_MAJOR_VERSION 1
|
||||
#define XACE_MAJOR_VERSION 2
|
||||
#define XACE_MINOR_VERSION 0
|
||||
|
||||
#include "pixmap.h" /* for DrawablePtr */
|
||||
#include "regionstr.h" /* for RegionPtr */
|
||||
#include "pixmap.h"
|
||||
#include "region.h"
|
||||
#include "window.h"
|
||||
#include "property.h"
|
||||
|
||||
#define XaceNumberEvents 0
|
||||
#define XaceNumberErrors 0
|
||||
/* Default window background */
|
||||
#define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None)
|
||||
|
||||
/* security hooks */
|
||||
/* Constants used to identify the available security hooks
|
||||
|
|
@ -45,16 +41,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define XACE_RESOURCE_ACCESS 2
|
||||
#define XACE_DEVICE_ACCESS 3
|
||||
#define XACE_PROPERTY_ACCESS 4
|
||||
#define XACE_DRAWABLE_ACCESS 5
|
||||
#define XACE_MAP_ACCESS 6
|
||||
#define XACE_BACKGRND_ACCESS 7
|
||||
#define XACE_SEND_ACCESS 5
|
||||
#define XACE_RECEIVE_ACCESS 6
|
||||
#define XACE_CLIENT_ACCESS 7
|
||||
#define XACE_EXT_ACCESS 8
|
||||
#define XACE_HOSTLIST_ACCESS 9
|
||||
#define XACE_SITE_POLICY 10
|
||||
#define XACE_DECLARE_EXT_SECURE 11
|
||||
#define XACE_AUTH_AVAIL 12
|
||||
#define XACE_KEY_AVAIL 13
|
||||
#define XACE_WINDOW_INIT 14
|
||||
#define XACE_SERVER_ACCESS 9
|
||||
#define XACE_SELECTION_ACCESS 10
|
||||
#define XACE_SCREEN_ACCESS 11
|
||||
#define XACE_SCREENSAVER_ACCESS 12
|
||||
#define XACE_AUTH_AVAIL 13
|
||||
#define XACE_KEY_AVAIL 14
|
||||
#define XACE_AUDIT_BEGIN 15
|
||||
#define XACE_AUDIT_END 16
|
||||
#define XACE_NUM_HOOKS 17
|
||||
|
|
@ -70,8 +66,12 @@ extern int XaceHook(
|
|||
|
||||
/* Special-cased hook functions
|
||||
*/
|
||||
extern int XaceHookDispatch(ClientPtr ptr, int major);
|
||||
extern int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
|
||||
PropertyPtr pProp, Mask access_mode);
|
||||
extern int XaceHookSelectionAccess(ClientPtr ptr, Atom name,
|
||||
Mask access_mode);
|
||||
extern void XaceHookAuditEnd(ClientPtr ptr, int result);
|
||||
extern void XaceHookAuditBegin(ClientPtr ptr);
|
||||
|
||||
/* Register a callback for a given hook.
|
||||
*/
|
||||
|
|
@ -99,17 +99,24 @@ extern void XaceCensorImage(
|
|||
|
||||
#else /* XACE */
|
||||
|
||||
/* Default window background */
|
||||
#define XaceBackgroundNoneState(w) None
|
||||
|
||||
/* Define calls away when XACE is not being built. */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define XaceHook(args...) XaceAllowOperation
|
||||
#define XaceHook(args...) Success
|
||||
#define XaceHookDispatch(args...) Success
|
||||
#define XaceHookPropertyAccess(args...) Success
|
||||
#define XaceHookSelectionAccess(args...) Success
|
||||
#define XaceHookAuditEnd(args...) { ; }
|
||||
#define XaceHookAuditBegin(args...) { ; }
|
||||
#define XaceCensorImage(args...) { ; }
|
||||
#else
|
||||
#define XaceHook(...) XaceAllowOperation
|
||||
#define XaceHook(...) Success
|
||||
#define XaceHookDispatch(...) Success
|
||||
#define XaceHookPropertyAccess(...) Success
|
||||
#define XaceHookSelectionAccess(...) Success
|
||||
#define XaceHookAuditEnd(...) { ; }
|
||||
#define XaceHookAuditBegin(...) { ; }
|
||||
#define XaceCensorImage(...) { ; }
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -20,91 +20,109 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifndef _XACESTR_H
|
||||
#define _XACESTR_H
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include "dixstruct.h"
|
||||
#include "dix.h"
|
||||
#include "resource.h"
|
||||
#include "extnsionst.h"
|
||||
#include "gcstruct.h"
|
||||
#include "windowstr.h"
|
||||
#include "inputstr.h"
|
||||
#include "window.h"
|
||||
#include "input.h"
|
||||
#include "property.h"
|
||||
#include "selection.h"
|
||||
#include "xace.h"
|
||||
|
||||
/* XACE_CORE_DISPATCH */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
int rval;
|
||||
int status;
|
||||
} XaceCoreDispatchRec;
|
||||
|
||||
/* XACE_RESOURCE_ACCESS */
|
||||
/* XACE_RESOURCE_CREATE */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
XID id;
|
||||
RESTYPE rtype;
|
||||
Mask access_mode;
|
||||
pointer res;
|
||||
int rval;
|
||||
RESTYPE ptype;
|
||||
pointer parent;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceResourceAccessRec;
|
||||
|
||||
/* XACE_DEVICE_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
DeviceIntPtr dev;
|
||||
Bool fromRequest;
|
||||
int rval;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceDeviceAccessRec;
|
||||
|
||||
/* XACE_PROPERTY_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
WindowPtr pWin;
|
||||
Atom propertyName;
|
||||
PropertyPtr pProp;
|
||||
Mask access_mode;
|
||||
int rval;
|
||||
int status;
|
||||
} XacePropertyAccessRec;
|
||||
|
||||
/* XACE_DRAWABLE_ACCESS */
|
||||
/* XACE_SEND_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
DrawablePtr pDraw;
|
||||
int rval;
|
||||
} XaceDrawableAccessRec;
|
||||
DeviceIntPtr dev;
|
||||
WindowPtr pWin;
|
||||
xEventPtr events;
|
||||
int count;
|
||||
int status;
|
||||
} XaceSendAccessRec;
|
||||
|
||||
/* XACE_MAP_ACCESS */
|
||||
/* XACE_BACKGRND_ACCESS */
|
||||
/* XACE_RECEIVE_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
WindowPtr pWin;
|
||||
int rval;
|
||||
} XaceMapAccessRec;
|
||||
xEventPtr events;
|
||||
int count;
|
||||
int status;
|
||||
} XaceReceiveAccessRec;
|
||||
|
||||
/* XACE_EXT_DISPATCH_ACCESS */
|
||||
/* XACE_CLIENT_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
ClientPtr target;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceClientAccessRec;
|
||||
|
||||
/* XACE_EXT_DISPATCH */
|
||||
/* XACE_EXT_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
ExtensionEntry *ext;
|
||||
int rval;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceExtAccessRec;
|
||||
|
||||
/* XACE_HOSTLIST_ACCESS */
|
||||
/* XACE_SERVER_ACCESS */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
Mask access_mode;
|
||||
int rval;
|
||||
} XaceHostlistAccessRec;
|
||||
int status;
|
||||
} XaceServerAccessRec;
|
||||
|
||||
/* XACE_SITE_POLICY */
|
||||
/* XACE_SELECTION_ACCESS */
|
||||
typedef struct {
|
||||
char *policyString;
|
||||
int len;
|
||||
int rval;
|
||||
} XaceSitePolicyRec;
|
||||
ClientPtr client;
|
||||
Atom name;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceSelectionAccessRec;
|
||||
|
||||
/* XACE_DECLARE_EXT_SECURE */
|
||||
/* XACE_SCREEN_ACCESS */
|
||||
/* XACE_SCREENSAVER_ACCESS */
|
||||
typedef struct {
|
||||
ExtensionEntry *ext;
|
||||
Bool secure;
|
||||
} XaceDeclareExtSecureRec;
|
||||
ClientPtr client;
|
||||
ScreenPtr screen;
|
||||
Mask access_mode;
|
||||
int status;
|
||||
} XaceScreenAccessRec;
|
||||
|
||||
/* XACE_AUTH_AVAIL */
|
||||
typedef struct {
|
||||
|
|
@ -119,12 +137,6 @@ typedef struct {
|
|||
int count;
|
||||
} XaceKeyAvailRec;
|
||||
|
||||
/* XACE_WINDOW_INIT */
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
WindowPtr pWin;
|
||||
} XaceWindowRec;
|
||||
|
||||
/* XACE_AUDIT_BEGIN */
|
||||
/* XACE_AUDIT_END */
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@ ProcXCalibrateSetRawMode (ClientPtr client)
|
|||
return (client->noClientException);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
SProcXCalibrateSetRawMode (ClientPtr client)
|
||||
{
|
||||
|
|
@ -178,6 +177,47 @@ SProcXCalibrateSetRawMode (ClientPtr client)
|
|||
return ProcXCalibrateSetRawMode(client);
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXCalibrateScreenToCoord (ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCalibrateScreenToCoordReq);
|
||||
xXCalibrateScreenToCoordReply rep;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
|
||||
|
||||
memset (&rep, 0, sizeof (rep));
|
||||
rep.type = X_Reply;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.x = stuff->x;
|
||||
rep.y = stuff->y;
|
||||
|
||||
KdScreenToPointerCoords(&rep.x, &rep.y);
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
|
||||
swaps (&rep.x, n);
|
||||
swaps (&rep.y, n);
|
||||
}
|
||||
WriteToClient(client, sizeof (rep), (char *) &rep);
|
||||
return (client->noClientException);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXCalibrateScreenToCoord (ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCalibrateScreenToCoordReq);
|
||||
int n;
|
||||
|
||||
REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
|
||||
|
||||
swaps(&stuff->x, n);
|
||||
swaps(&stuff->y, n);
|
||||
|
||||
return ProcXCalibrateScreenToCoord(client);
|
||||
}
|
||||
|
||||
static void
|
||||
XCalibrateResetProc (ExtensionEntry *extEntry)
|
||||
{
|
||||
|
|
@ -192,6 +232,9 @@ ProcXCalibrateDispatch (ClientPtr client)
|
|||
return ProcXCalibrateQueryVersion(client);
|
||||
case X_XCalibrateRawMode:
|
||||
return ProcXCalibrateSetRawMode(client);
|
||||
case X_XCalibrateScreenToCoord:
|
||||
return ProcXCalibrateScreenToCoord(client);
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +254,8 @@ SProcXCalibrateDispatch (ClientPtr client)
|
|||
return SProcXCalibrateQueryVersion(client);
|
||||
case X_XCalibrateRawMode:
|
||||
return SProcXCalibrateSetRawMode(client);
|
||||
case X_XCalibrateScreenToCoord:
|
||||
return SProcXCalibrateScreenToCoord(client);
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,9 @@ static DISPATCH_PROC(SProcXCMiscGetXIDRange);
|
|||
void
|
||||
XCMiscExtensionInit(INITARGS)
|
||||
{
|
||||
(void) AddExtension(XCMiscExtensionName, 0, 0,
|
||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
||||
XCMiscResetProc, StandardMinorOpcode);
|
||||
|
||||
DeclareExtensionSecurity(XCMiscExtensionName, TRUE);
|
||||
AddExtension(XCMiscExtensionName, 0, 0,
|
||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
||||
XCMiscResetProc, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
|
|||
21
Xext/xevie.c
21
Xext/xevie.c
|
|
@ -76,11 +76,11 @@ DeviceIntPtr xeviemouse = NULL;
|
|||
Mask xevieMask = 0;
|
||||
int xevieEventSent = 0;
|
||||
int xevieKBEventSent = 0;
|
||||
static unsigned int xevieServerGeneration;
|
||||
static int xevieDevicePrivateIndex;
|
||||
static DevPrivateKey xevieDevicePrivateKey = &xevieDevicePrivateKey;
|
||||
static Bool xevieModifiersOn = FALSE;
|
||||
|
||||
#define XEVIEINFO(dev) ((xevieDeviceInfoPtr)dev->devPrivates[xevieDevicePrivateIndex].ptr)
|
||||
#define XEVIEINFO(dev) ((xevieDeviceInfoPtr) \
|
||||
dixLookupPrivate(&(dev)->devPrivates, xevieDevicePrivateKey))
|
||||
|
||||
Mask xevieFilters[128] =
|
||||
{
|
||||
|
|
@ -134,12 +134,6 @@ XevieExtensionInit (void)
|
|||
{
|
||||
ExtensionEntry* extEntry;
|
||||
|
||||
if (serverGeneration != xevieServerGeneration) {
|
||||
if ((xevieDevicePrivateIndex = AllocateDevicePrivateIndex()) == -1)
|
||||
return;
|
||||
xevieServerGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
if (!AddCallback(&ServerGrabCallback,XevieServerGrabStateCallback,NULL))
|
||||
return;
|
||||
|
||||
|
|
@ -374,7 +368,7 @@ int SProcSelectInput (ClientPtr client)
|
|||
|
||||
REQUEST (xXevieSelectInputReq);
|
||||
swaps (&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE (xXevieSendReq);
|
||||
REQUEST_AT_LEAST_SIZE (xXevieSelectInputReq);
|
||||
swapl(&stuff->event_mask, n);
|
||||
return ProcSelectInput (client);
|
||||
}
|
||||
|
|
@ -618,14 +612,11 @@ XevieAdd(DeviceIntPtr device, void* data)
|
|||
{
|
||||
xevieDeviceInfoPtr xeviep;
|
||||
|
||||
if (!AllocateDevicePrivate(device, xevieDevicePrivateIndex))
|
||||
return FALSE;
|
||||
|
||||
xeviep = xalloc (sizeof (xevieDeviceInfoRec));
|
||||
if (!xeviep)
|
||||
return FALSE;
|
||||
|
||||
device->devPrivates[xevieDevicePrivateIndex].ptr = xeviep;
|
||||
dixSetPrivate(&device->devPrivates, xevieDevicePrivateKey, xeviep);
|
||||
XevieUnwrapAdd(device, data);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -642,7 +633,7 @@ XevieRemove(DeviceIntPtr device,pointer data)
|
|||
UNWRAP_UNWRAPPROC(device,xeviep->unwrapProc);
|
||||
|
||||
xfree(xeviep);
|
||||
device->devPrivates[xevieDevicePrivateIndex].ptr = NULL;
|
||||
dixSetPrivate(&device->devPrivates, xevieDevicePrivateKey, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -236,15 +236,15 @@ shmalloc(
|
|||
size = (size + pagesize-1) & -pagesize;
|
||||
shmid = shmget(IPC_PRIVATE, size, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
|
||||
if (shmid == -1) {
|
||||
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n",
|
||||
size, errno);
|
||||
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, %s\n",
|
||||
size, strerror(errno));
|
||||
xfree(pDesc);
|
||||
return (ShmDescPtr) NULL;
|
||||
}
|
||||
|
||||
if ((addr = shmat(shmid, 0, 0)) == (char *)-1) {
|
||||
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n",
|
||||
size, errno);
|
||||
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, %s\n",
|
||||
size, strerror(errno));
|
||||
shmctl(shmid, IPC_RMID, (void *) 0);
|
||||
xfree(pDesc);
|
||||
return (ShmDescPtr) NULL;
|
||||
|
|
@ -428,10 +428,10 @@ ProcXF86BigfontQueryFont(
|
|||
#endif
|
||||
client->errorValue = stuff->id; /* EITHER font or gc */
|
||||
pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
|
||||
DixReadAccess);
|
||||
DixGetAttrAccess);
|
||||
if (!pFont) {
|
||||
GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
|
||||
DixReadAccess);
|
||||
DixGetAttrAccess);
|
||||
if (!pGC) {
|
||||
client->errorValue = stuff->id;
|
||||
return BadFont; /* procotol spec says only error is BadFont */
|
||||
|
|
|
|||
172
Xext/xprint.c
172
Xext/xprint.c
|
|
@ -153,8 +153,6 @@ static int XpFreePage(pointer, XID);
|
|||
static Bool XpCloseScreen(int, ScreenPtr);
|
||||
static CARD32 GetAllEventMasks(XpContextPtr);
|
||||
static struct _XpClient *CreateXpClient(ClientPtr);
|
||||
static void InitContextPrivates(XpContextPtr);
|
||||
static void ResetContextPrivates(void);
|
||||
static struct _XpClient *FindClient(XpContextPtr, ClientPtr);
|
||||
static struct _XpClient *AcquireClient(XpContextPtr, ClientPtr);
|
||||
|
||||
|
|
@ -233,21 +231,12 @@ static XpScreenPtr XpScreens[MAXSCREENS];
|
|||
static unsigned char XpReqCode;
|
||||
static int XpEventBase;
|
||||
static int XpErrorBase;
|
||||
static unsigned long XpGeneration = 0;
|
||||
static int XpClientPrivateIndex;
|
||||
static DevPrivateKey XpClientPrivateKey = &XpClientPrivateKey;
|
||||
|
||||
/* Variables for the context private machinery.
|
||||
* These must be initialized at compile time because
|
||||
* main() calls InitOutput before InitExtensions, and the
|
||||
* output drivers are likely to call AllocateContextPrivate.
|
||||
* These variables are reset at CloseScreen time. CloseScreen
|
||||
* is used because it occurs after FreeAllResources, and before
|
||||
* the next InitOutput cycle.
|
||||
*/
|
||||
static int contextPrivateCount = 0;
|
||||
static int contextPrivateLen = 0;
|
||||
static unsigned *contextPrivateSizes = (unsigned *)NULL;
|
||||
static unsigned totalContextSize = sizeof(XpContextRec);
|
||||
#define XP_GETPRIV(pClient) ((XpContextPtr) \
|
||||
dixLookupPrivate(&(pClient)->devPrivates, XpClientPrivateKey))
|
||||
#define XP_SETPRIV(pClient, p) \
|
||||
dixSetPrivate(&(pClient)->devPrivates, XpClientPrivateKey, p)
|
||||
|
||||
/*
|
||||
* There are three types of resources involved. One is the resource associated
|
||||
|
|
@ -305,20 +294,6 @@ XpExtensionInit(INITARGS)
|
|||
EventSwapVector[XpEventBase+1] = (EventSwapPtr) SwapXpAttributeEvent;
|
||||
}
|
||||
|
||||
if(XpGeneration != serverGeneration)
|
||||
{
|
||||
XpClientPrivateIndex = AllocateClientPrivateIndex();
|
||||
/*
|
||||
* We allocate 0 length & simply stuff a pointer to the
|
||||
* ContextRec in the DevUnion.
|
||||
*/
|
||||
if(AllocateClientPrivate(XpClientPrivateIndex, 0) != TRUE)
|
||||
{
|
||||
/* we can't alloc a client private, should we bail??? XXX */
|
||||
}
|
||||
XpGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
for(i = 0; i < MAXSCREENS; i++)
|
||||
{
|
||||
/*
|
||||
|
|
@ -335,7 +310,6 @@ XpExtensionInit(INITARGS)
|
|||
screenInfo.screens[i]->CloseScreen = XpCloseScreen;
|
||||
}
|
||||
}
|
||||
DeclareExtensionSecurity(XP_PRINTNAME, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -378,14 +352,6 @@ XpCloseScreen(int index, ScreenPtr pScreen)
|
|||
}
|
||||
XpScreens[index] = (XpScreenPtr)NULL;
|
||||
|
||||
/*
|
||||
* It's wasteful to call ResetContextPrivates() at every CloseScreen,
|
||||
* but it's the best we know how to do for now. We do this because we
|
||||
* have to wait until after all resources have been freed (so we know
|
||||
* how to free the ContextRecs), and before the next InitOutput cycle.
|
||||
* See dix/main.c for the order of initialization and reset.
|
||||
*/
|
||||
ResetContextPrivates();
|
||||
return (*CloseScreen)(index, pScreen);
|
||||
}
|
||||
|
||||
|
|
@ -938,12 +904,10 @@ ProcXpCreateContext(ClientPtr client)
|
|||
/*
|
||||
* Allocate and add the context resource.
|
||||
*/
|
||||
if((pContext = (XpContextPtr) xalloc(totalContextSize)) ==
|
||||
if((pContext = (XpContextPtr) xalloc(sizeof(XpContextRec))) ==
|
||||
(XpContextPtr) NULL)
|
||||
return BadAlloc;
|
||||
|
||||
InitContextPrivates(pContext);
|
||||
|
||||
if(AddResource(stuff->contextID, RTcontext, (pointer) pContext)
|
||||
!= TRUE)
|
||||
{
|
||||
|
|
@ -957,6 +921,7 @@ ProcXpCreateContext(ClientPtr client)
|
|||
pContext->state = 0;
|
||||
pContext->clientSlept = (ClientPtr)NULL;
|
||||
pContext->imageRes = 0;
|
||||
pContext->devPrivates = NULL;
|
||||
|
||||
pContext->funcs.DestroyContext = 0;
|
||||
pContext->funcs.StartJob = 0;
|
||||
|
|
@ -1023,8 +988,7 @@ ProcXpSetContext(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xPrintSetContextReq);
|
||||
|
||||
if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) !=
|
||||
(pointer)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) != (pointer)NULL)
|
||||
{
|
||||
/*
|
||||
* Erase this client's knowledge of its old context, if any.
|
||||
|
|
@ -1037,7 +1001,7 @@ ProcXpSetContext(ClientPtr client)
|
|||
FreeXpClient(pPrintClient, TRUE);
|
||||
}
|
||||
|
||||
client->devPrivates[XpClientPrivateIndex].ptr = (pointer)NULL;
|
||||
XP_SETPRIV(client, NULL);
|
||||
}
|
||||
if(stuff->printContext == None)
|
||||
return Success;
|
||||
|
|
@ -1059,7 +1023,7 @@ ProcXpSetContext(ClientPtr client)
|
|||
if((pPrintClient = AcquireClient(pContext, client)) == (XpClientPtr)NULL)
|
||||
return BadAlloc;
|
||||
|
||||
client->devPrivates[XpClientPrivateIndex].ptr = pContext;
|
||||
XP_SETPRIV(client, pContext);
|
||||
|
||||
XpSetFontResFunc(client);
|
||||
|
||||
|
|
@ -1072,7 +1036,7 @@ ProcXpSetContext(ClientPtr client)
|
|||
XpContextPtr
|
||||
XpGetPrintContext(ClientPtr client)
|
||||
{
|
||||
return (client->devPrivates[XpClientPrivateIndex].ptr);
|
||||
return XP_GETPRIV(client);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1087,8 +1051,7 @@ ProcXpGetContext(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintGetContextReq);
|
||||
|
||||
if((pContext = client->devPrivates[XpClientPrivateIndex].ptr) ==
|
||||
(pointer)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (pointer)NULL)
|
||||
rep.printContext = None;
|
||||
else
|
||||
rep.printContext = pContext->contextID;
|
||||
|
|
@ -1231,6 +1194,7 @@ XpFreeContext(pointer data, XID id)
|
|||
}
|
||||
|
||||
xfree(pContext->printerName);
|
||||
dixFreePrivates(pContext->devPrivates);
|
||||
xfree(pContext);
|
||||
return Success; /* ??? */
|
||||
}
|
||||
|
|
@ -1266,11 +1230,9 @@ FreeXpClient(XpClientPtr pXpClient, Bool freeResource)
|
|||
* If we're freeing the clientRec associated with the context tied
|
||||
* to the client's devPrivates, then we need to clear the devPrivates.
|
||||
*/
|
||||
if(pXpClient->client->devPrivates[XpClientPrivateIndex].ptr ==
|
||||
pXpClient->context)
|
||||
if(XP_GETPRIV(pXpClient->client) == pXpClient->context)
|
||||
{
|
||||
pXpClient->client->devPrivates[XpClientPrivateIndex].ptr =
|
||||
(pointer)NULL;
|
||||
XP_SETPRIV(pXpClient->client, NULL);
|
||||
}
|
||||
|
||||
for(pPrev = (XpClientPtr)NULL, pCurrent = pContext->clientHead;
|
||||
|
|
@ -1354,87 +1316,6 @@ XpFreePage(pointer data, XID id)
|
|||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* ContextPrivate machinery.
|
||||
* Context privates are intended for use by the drivers, allowing the
|
||||
* drivers to maintain context-specific data. The driver should free
|
||||
* the associated data at DestroyContext time.
|
||||
*/
|
||||
|
||||
static void
|
||||
InitContextPrivates(XpContextPtr context)
|
||||
{
|
||||
register char *ptr;
|
||||
DevUnion *ppriv;
|
||||
register unsigned *sizes;
|
||||
register unsigned size;
|
||||
register int i;
|
||||
|
||||
if (totalContextSize == sizeof(XpContextRec))
|
||||
ppriv = (DevUnion *)NULL;
|
||||
else
|
||||
ppriv = (DevUnion *)(context + 1);
|
||||
|
||||
context->devPrivates = ppriv;
|
||||
sizes = contextPrivateSizes;
|
||||
ptr = (char *)(ppriv + contextPrivateLen);
|
||||
for (i = contextPrivateLen; --i >= 0; ppriv++, sizes++)
|
||||
{
|
||||
if ( (size = *sizes) )
|
||||
{
|
||||
ppriv->ptr = (pointer)ptr;
|
||||
ptr += size;
|
||||
}
|
||||
else
|
||||
ppriv->ptr = (pointer)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ResetContextPrivates(void)
|
||||
{
|
||||
contextPrivateCount = 0;
|
||||
contextPrivateLen = 0;
|
||||
xfree(contextPrivateSizes);
|
||||
contextPrivateSizes = (unsigned *)NULL;
|
||||
totalContextSize = sizeof(XpContextRec);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
XpAllocateContextPrivateIndex(void)
|
||||
{
|
||||
return contextPrivateCount++;
|
||||
}
|
||||
|
||||
Bool
|
||||
XpAllocateContextPrivate(int index, unsigned amount)
|
||||
{
|
||||
unsigned oldamount;
|
||||
|
||||
if (index >= contextPrivateLen)
|
||||
{
|
||||
unsigned *nsizes;
|
||||
nsizes = (unsigned *)xrealloc(contextPrivateSizes,
|
||||
(index + 1) * sizeof(unsigned));
|
||||
if (!nsizes)
|
||||
return FALSE;
|
||||
while (contextPrivateLen <= index)
|
||||
{
|
||||
nsizes[contextPrivateLen++] = 0;
|
||||
totalContextSize += sizeof(DevUnion);
|
||||
}
|
||||
contextPrivateSizes = nsizes;
|
||||
}
|
||||
oldamount = contextPrivateSizes[index];
|
||||
if (amount > oldamount)
|
||||
{
|
||||
contextPrivateSizes[index] = amount;
|
||||
totalContextSize += (amount - oldamount);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static XpClientPtr
|
||||
AcquireClient(XpContextPtr pContext, ClientPtr client)
|
||||
{
|
||||
|
|
@ -1483,8 +1364,7 @@ ProcXpStartJob(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xPrintStartJobReq);
|
||||
|
||||
/* Check to see that a context has been established by this client. */
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadContext;
|
||||
|
||||
if(pContext->state != 0)
|
||||
|
|
@ -1524,8 +1404,7 @@ ProcXpEndJob(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintEndJobReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & JOB_STARTED))
|
||||
|
|
@ -1630,8 +1509,7 @@ ProcXpStartDoc(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintStartDocReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & JOB_STARTED) ||
|
||||
|
|
@ -1666,8 +1544,7 @@ ProcXpEndDoc(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintEndDocReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & DOC_RAW_STARTED) &&
|
||||
|
|
@ -1819,8 +1696,7 @@ ProcXpStartPage(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintStartPageReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & JOB_STARTED))
|
||||
|
|
@ -1864,8 +1740,7 @@ ProcXpEndPage(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xPrintEndPageReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & PAGE_STARTED))
|
||||
|
|
@ -1914,8 +1789,7 @@ ProcXpPutDocumentData(ClientPtr client)
|
|||
|
||||
REQUEST_AT_LEAST_SIZE(xPrintPutDocumentDataReq);
|
||||
|
||||
if((pContext = (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr)
|
||||
== (XpContextPtr)NULL)
|
||||
if((pContext = XP_GETPRIV(client)) == (XpContextPtr)NULL)
|
||||
return XpErrorBase+XPBadSequence;
|
||||
|
||||
if(!(pContext->state & DOC_RAW_STARTED) &&
|
||||
|
|
@ -2425,7 +2299,7 @@ GetAllEventMasks(XpContextPtr pContext)
|
|||
XpContextPtr
|
||||
XpContextOfClient(ClientPtr client)
|
||||
{
|
||||
return (XpContextPtr)client->devPrivates[XpClientPrivateIndex].ptr;
|
||||
return XP_GETPRIV(client);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
31
Xext/xres.c
31
Xext/xres.c
|
|
@ -17,6 +17,7 @@
|
|||
#include "dixstruct.h"
|
||||
#include "extnsionst.h"
|
||||
#include "swaprep.h"
|
||||
#include "registry.h"
|
||||
#include <X11/extensions/XResproto.h>
|
||||
#include "pixmapstr.h"
|
||||
#include "windowstr.h"
|
||||
|
|
@ -66,7 +67,7 @@ ProcXResQueryClients (ClientPtr client)
|
|||
current_clients = xalloc((currentMaxClients - 1) * sizeof(int));
|
||||
|
||||
num_clients = 0;
|
||||
for(i = 1; i < currentMaxClients; i++) {
|
||||
for(i = 0; i < currentMaxClients; i++) {
|
||||
if(clients[i]) {
|
||||
current_clients[num_clients] = i;
|
||||
num_clients++;
|
||||
|
|
@ -127,9 +128,7 @@ ProcXResQueryClientResources (ClientPtr client)
|
|||
|
||||
clientID = CLIENT_ID(stuff->xid);
|
||||
|
||||
/* we could remove the (clientID == 0) check if we wanted to allow
|
||||
probing the X-server's resource usage */
|
||||
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
|
||||
if((clientID >= currentMaxClients) || !clients[clientID]) {
|
||||
client->errorValue = stuff->xid;
|
||||
return BadValue;
|
||||
}
|
||||
|
|
@ -161,17 +160,20 @@ ProcXResQueryClientResources (ClientPtr client)
|
|||
|
||||
if(num_types) {
|
||||
xXResType scratch;
|
||||
char *name;
|
||||
|
||||
for(i = 0; i < lastResourceType; i++) {
|
||||
if(!counts[i]) continue;
|
||||
|
||||
if(!ResourceNames[i + 1]) {
|
||||
name = (char *)LookupResourceName(i + 1);
|
||||
if (strcmp(name, XREGISTRY_UNKNOWN))
|
||||
scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
|
||||
else {
|
||||
char buf[40];
|
||||
snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
|
||||
RegisterResourceName(i + 1, buf);
|
||||
scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
|
||||
}
|
||||
|
||||
scratch.resource_type = ResourceNames[i + 1];
|
||||
scratch.count = counts[i];
|
||||
|
||||
if(client->swapped) {
|
||||
|
|
@ -250,9 +252,7 @@ ProcXResQueryClientPixmapBytes (ClientPtr client)
|
|||
|
||||
clientID = CLIENT_ID(stuff->xid);
|
||||
|
||||
/* we could remove the (clientID == 0) check if we wanted to allow
|
||||
probing the X-server's resource usage */
|
||||
if(!clientID || (clientID >= currentMaxClients) || !clients[clientID]) {
|
||||
if((clientID >= currentMaxClients) || !clients[clientID]) {
|
||||
client->errorValue = stuff->xid;
|
||||
return BadValue;
|
||||
}
|
||||
|
|
@ -387,15 +387,4 @@ ResExtensionInit(INITARGS)
|
|||
(void) AddExtension(XRES_NAME, 0, 0,
|
||||
ProcResDispatch, SProcResDispatch,
|
||||
ResResetProc, StandardMinorOpcode);
|
||||
|
||||
RegisterResourceName(RT_NONE, "NONE");
|
||||
RegisterResourceName(RT_WINDOW, "WINDOW");
|
||||
RegisterResourceName(RT_PIXMAP, "PIXMAP");
|
||||
RegisterResourceName(RT_GC, "GC");
|
||||
RegisterResourceName(RT_FONT, "FONT");
|
||||
RegisterResourceName(RT_CURSOR, "CURSOR");
|
||||
RegisterResourceName(RT_COLORMAP, "COLORMAP");
|
||||
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
|
||||
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
|
||||
RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
|
||||
}
|
||||
|
|
|
|||
1654
Xext/xselinux.c
Normal file
1654
Xext/xselinux.c
Normal file
File diff suppressed because it is too large
Load diff
184
Xext/xselinux.h
Normal file
184
Xext/xselinux.h
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
/************************************************************
|
||||
|
||||
Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
this permission notice appear in supporting documentation. This permission
|
||||
notice shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#ifndef _XSELINUX_H
|
||||
#define _XSELINUX_H
|
||||
|
||||
#include "dixaccess.h"
|
||||
|
||||
/* Extension info */
|
||||
#define SELINUX_EXTENSION_NAME "SELinux"
|
||||
#define SELINUX_MAJOR_VERSION 1
|
||||
#define SELINUX_MINOR_VERSION 0
|
||||
#define SELinuxNumberEvents 0
|
||||
#define SELinuxNumberErrors 0
|
||||
|
||||
/* Extension protocol */
|
||||
#define X_SELinuxQueryVersion 0
|
||||
#define X_SELinuxSetSecurityManager 1
|
||||
#define X_SELinuxGetSecurityManager 2
|
||||
#define X_SELinuxSetDeviceCreateContext 3
|
||||
#define X_SELinuxGetDeviceCreateContext 4
|
||||
#define X_SELinuxSetDeviceContext 5
|
||||
#define X_SELinuxGetDeviceContext 6
|
||||
#define X_SELinuxSetPropertyCreateContext 7
|
||||
#define X_SELinuxGetPropertyCreateContext 8
|
||||
#define X_SELinuxGetPropertyContext 9
|
||||
#define X_SELinuxSetWindowCreateContext 10
|
||||
#define X_SELinuxGetWindowCreateContext 11
|
||||
#define X_SELinuxGetWindowContext 12
|
||||
#define X_SELinuxSetSelectionCreateContext 13
|
||||
#define X_SELinuxGetSelectionCreateContext 14
|
||||
#define X_SELinuxGetSelectionContext 15
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD8 client_major;
|
||||
CARD8 client_minor;
|
||||
CARD16 unused;
|
||||
} SELinuxQueryVersionReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 type;
|
||||
CARD8 pad1;
|
||||
CARD16 sequenceNumber;
|
||||
CARD32 length;
|
||||
CARD16 server_major;
|
||||
CARD16 server_minor;
|
||||
CARD32 pad2;
|
||||
CARD32 pad3;
|
||||
CARD32 pad4;
|
||||
CARD32 pad5;
|
||||
CARD32 pad6;
|
||||
} SELinuxQueryVersionReply;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD32 window;
|
||||
} SELinuxSetSecurityManagerReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
} SELinuxGetSecurityManagerReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 type;
|
||||
CARD8 pad1;
|
||||
CARD16 sequenceNumber;
|
||||
CARD32 length;
|
||||
CARD32 window;
|
||||
CARD32 pad2;
|
||||
CARD32 pad3;
|
||||
CARD32 pad4;
|
||||
CARD32 pad5;
|
||||
CARD32 pad6;
|
||||
} SELinuxGetSecurityManagerReply;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD8 permanent;
|
||||
CARD8 unused;
|
||||
CARD16 context_len;
|
||||
} SELinuxSetCreateContextReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
} SELinuxGetCreateContextReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 type;
|
||||
CARD8 permanent;
|
||||
CARD16 sequenceNumber;
|
||||
CARD32 length;
|
||||
CARD16 context_len;
|
||||
CARD16 pad1;
|
||||
CARD32 pad2;
|
||||
CARD32 pad3;
|
||||
CARD32 pad4;
|
||||
CARD32 pad5;
|
||||
CARD32 pad6;
|
||||
} SELinuxGetCreateContextReply;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD32 id;
|
||||
CARD16 unused;
|
||||
CARD16 context_len;
|
||||
} SELinuxSetContextReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD32 id;
|
||||
} SELinuxGetContextReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 reqType;
|
||||
CARD8 SELinuxReqType;
|
||||
CARD16 length;
|
||||
CARD32 window;
|
||||
CARD32 property;
|
||||
} SELinuxGetPropertyContextReq;
|
||||
|
||||
typedef struct {
|
||||
CARD8 type;
|
||||
CARD8 pad1;
|
||||
CARD16 sequenceNumber;
|
||||
CARD32 length;
|
||||
CARD16 context_len;
|
||||
CARD16 pad2;
|
||||
CARD32 pad3;
|
||||
CARD32 pad4;
|
||||
CARD32 pad5;
|
||||
CARD32 pad6;
|
||||
CARD32 pad7;
|
||||
} SELinuxGetContextReply;
|
||||
|
||||
|
||||
/* Private Flask definitions */
|
||||
#define SECCLASS_X_DRAWABLE 1
|
||||
#define SECCLASS_X_SCREEN 2
|
||||
#define SECCLASS_X_GC 3
|
||||
#define SECCLASS_X_FONT 4
|
||||
#define SECCLASS_X_COLORMAP 5
|
||||
#define SECCLASS_X_PROPERTY 6
|
||||
#define SECCLASS_X_SELECTION 7
|
||||
#define SECCLASS_X_CURSOR 8
|
||||
#define SECCLASS_X_CLIENT 9
|
||||
#define SECCLASS_X_DEVICE 10
|
||||
#define SECCLASS_X_SERVER 11
|
||||
#define SECCLASS_X_EXTENSION 12
|
||||
#define SECCLASS_X_EVENT 13
|
||||
#define SECCLASS_X_FAKEEVENT 14
|
||||
#define SECCLASS_X_RESOURCE 15
|
||||
|
||||
#endif /* _XSELINUX_H */
|
||||
33
Xext/xtest.c
33
Xext/xtest.c
|
|
@ -49,7 +49,6 @@ from The Open Group.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#define EXTENSION_EVENT_BASE 64
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#endif /* XINPUT */
|
||||
|
||||
#include "modinit.h"
|
||||
|
|
@ -85,9 +84,9 @@ static DISPATCH_PROC(SProcXTestGrabControl);
|
|||
void
|
||||
XTestExtensionInit(INITARGS)
|
||||
{
|
||||
(void) AddExtension(XTestExtensionName, 0, 0,
|
||||
ProcXTestDispatch, SProcXTestDispatch,
|
||||
XTestResetProc, StandardMinorOpcode);
|
||||
AddExtension(XTestExtensionName, 0, 0,
|
||||
ProcXTestDispatch, SProcXTestDispatch,
|
||||
XTestResetProc, StandardMinorOpcode);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
@ -129,7 +128,7 @@ ProcXTestCompareCursor(client)
|
|||
register int n, rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (stuff->cursor == None)
|
||||
|
|
@ -137,11 +136,12 @@ ProcXTestCompareCursor(client)
|
|||
else if (stuff->cursor == XTestCurrentCursor)
|
||||
pCursor = GetSpriteCursor();
|
||||
else {
|
||||
pCursor = (CursorPtr)LookupIDByType(stuff->cursor, RT_CURSOR);
|
||||
if (!pCursor)
|
||||
rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR,
|
||||
client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
client->errorValue = stuff->cursor;
|
||||
return (BadCursor);
|
||||
return (rc == BadValue) ? BadCursor : rc;
|
||||
}
|
||||
}
|
||||
rep.type = X_Reply;
|
||||
|
|
@ -273,11 +273,12 @@ ProcXTestFakeInput(client)
|
|||
#ifdef XINPUT
|
||||
if (extension)
|
||||
{
|
||||
dev = LookupDeviceIntRec(stuff->deviceid & 0177);
|
||||
if (!dev)
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid & 0177, client,
|
||||
DixWriteAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
client->errorValue = stuff->deviceid & 0177;
|
||||
return BadValue;
|
||||
return rc;
|
||||
}
|
||||
if (nev > 1)
|
||||
{
|
||||
|
|
@ -303,7 +304,7 @@ ProcXTestFakeInput(client)
|
|||
#ifdef XINPUT
|
||||
if (!extension)
|
||||
#endif /* XINPUT */
|
||||
dev = (DeviceIntPtr)LookupKeyboardDevice();
|
||||
dev = inputInfo.keyboard;
|
||||
if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
|
||||
ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
|
||||
{
|
||||
|
|
@ -347,13 +348,13 @@ ProcXTestFakeInput(client)
|
|||
break;
|
||||
}
|
||||
#endif /* XINPUT */
|
||||
dev = (DeviceIntPtr)LookupPointerDevice();
|
||||
dev = inputInfo.pointer;
|
||||
if (ev->u.keyButtonPointer.root == None)
|
||||
root = GetCurrentRootWindow();
|
||||
else
|
||||
{
|
||||
rc = dixLookupWindow(&root, ev->u.keyButtonPointer.root, client,
|
||||
DixUnknownAccess);
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (root->parent)
|
||||
|
|
@ -436,7 +437,7 @@ ProcXTestFakeInput(client)
|
|||
#ifdef XINPUT
|
||||
if (!extension)
|
||||
#endif /* XINPUT */
|
||||
dev = (DeviceIntPtr)LookupPointerDevice();
|
||||
dev = inputInfo.pointer;
|
||||
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
|
||||
{
|
||||
client->errorValue = ev->u.u.detail;
|
||||
|
|
@ -445,7 +446,7 @@ ProcXTestFakeInput(client)
|
|||
break;
|
||||
}
|
||||
if (screenIsSaved == SCREEN_SAVER_ON)
|
||||
SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset);
|
||||
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
|
||||
ev->u.keyButtonPointer.time = currentTime.milliseconds;
|
||||
(*dev->public.processInputProc)(ev, dev, nev);
|
||||
return client->noClientException;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ SWriteQueryExtensionReply(
|
|||
swaps(&rep->version, n);
|
||||
swaps(&rep->revision, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ SWriteQueryAdaptorsReply(
|
|||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_adaptors, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ SWriteQueryEncodingsReply(
|
|||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_encodings, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -204,7 +204,7 @@ SWriteGrabPortReply(
|
|||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ SWriteGetPortAttributeReply(
|
|||
swapl(&rep->length, n);
|
||||
swapl(&rep->value, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ SWriteQueryBestSizeReply(
|
|||
swaps(&rep->actual_width, n);
|
||||
swaps(&rep->actual_height, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ SWriteQueryPortAttributesReply(
|
|||
swapl(&rep->num_attributes, n);
|
||||
swapl(&rep->text_size, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -273,7 +273,7 @@ SWriteQueryImageAttributesReply(
|
|||
swaps(&rep->width, n);
|
||||
swaps(&rep->height, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ SWriteListImageFormatsReply(
|
|||
swapl(&rep->length, n);
|
||||
swapl(&rep->num_formats, n);
|
||||
|
||||
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep);
|
||||
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -378,6 +378,7 @@ ProcXvQueryAdaptors(ClientPtr client)
|
|||
xvAdaptorInfo ainfo;
|
||||
xvQueryAdaptorsReply rep;
|
||||
int totalSize, na, nf, rc;
|
||||
int nameSize;
|
||||
XvAdaptorPtr pa;
|
||||
XvFormatPtr pf;
|
||||
WindowPtr pWin;
|
||||
|
|
@ -387,13 +388,13 @@ ProcXvQueryAdaptors(ClientPtr client)
|
|||
REQUEST(xvQueryAdaptorsReq);
|
||||
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
||||
|
||||
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
XvGetScreenKey());
|
||||
if (!pxvs)
|
||||
{
|
||||
rep.type = X_Reply;
|
||||
|
|
@ -439,12 +440,12 @@ ProcXvQueryAdaptors(ClientPtr client)
|
|||
ainfo.base_id = pa->base_id;
|
||||
ainfo.num_ports = pa->nPorts;
|
||||
ainfo.type = pa->type;
|
||||
ainfo.name_size = strlen(pa->name);
|
||||
ainfo.name_size = nameSize = strlen(pa->name);
|
||||
ainfo.num_formats = pa->nFormats;
|
||||
|
||||
_WriteAdaptorInfo(client, &ainfo);
|
||||
|
||||
WriteToClient(client, ainfo.name_size, pa->name);
|
||||
WriteToClient(client, nameSize, pa->name);
|
||||
|
||||
nf = pa->nFormats;
|
||||
pf = pa->pFormats;
|
||||
|
|
@ -469,6 +470,7 @@ ProcXvQueryEncodings(ClientPtr client)
|
|||
xvEncodingInfo einfo;
|
||||
xvQueryEncodingsReply rep;
|
||||
int totalSize;
|
||||
int nameSize;
|
||||
XvPortPtr pPort;
|
||||
int ne;
|
||||
XvEncodingPtr pe;
|
||||
|
|
@ -513,13 +515,13 @@ ProcXvQueryEncodings(ClientPtr client)
|
|||
while (ne--)
|
||||
{
|
||||
einfo.encoding = pe->id;
|
||||
einfo.name_size = strlen(pe->name);
|
||||
einfo.name_size = nameSize = strlen(pe->name);
|
||||
einfo.width = pe->width;
|
||||
einfo.height = pe->height;
|
||||
einfo.rate.numerator = pe->rate.numerator;
|
||||
einfo.rate.denominator = pe->rate.denominator;
|
||||
_WriteEncodingInfo(client, &einfo);
|
||||
WriteToClient(client, einfo.name_size, pe->name);
|
||||
WriteToClient(client, nameSize, pe->name);
|
||||
pe++;
|
||||
}
|
||||
|
||||
|
|
@ -537,7 +539,7 @@ ProcXvPutVideo(ClientPtr client)
|
|||
REQUEST(xvPutVideoReq);
|
||||
REQUEST_SIZE_MATCH(xvPutVideoReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -582,7 +584,7 @@ ProcXvPutStill(ClientPtr client)
|
|||
REQUEST(xvPutStillReq);
|
||||
REQUEST_SIZE_MATCH(xvPutStillReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -627,7 +629,7 @@ ProcXvGetVideo(ClientPtr client)
|
|||
REQUEST(xvGetVideoReq);
|
||||
REQUEST_SIZE_MATCH(xvGetVideoReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -672,7 +674,7 @@ ProcXvGetStill(ClientPtr client)
|
|||
REQUEST(xvGetStillReq);
|
||||
REQUEST_SIZE_MATCH(xvGetStillReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -714,7 +716,7 @@ ProcXvSelectVideoNotify(ClientPtr client)
|
|||
REQUEST(xvSelectVideoNotifyReq);
|
||||
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
|
||||
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixUnknownAccess);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReceiveAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -826,7 +828,7 @@ ProcXvStopVideo(ClientPtr client)
|
|||
return (status);
|
||||
}
|
||||
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixUnknownAccess);
|
||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -984,18 +986,19 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
|||
rep.text_size = 0;
|
||||
|
||||
for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
||||
i < rep.num_attributes; i++, pAtt++)
|
||||
i < pPort->pAdaptor->nAttributes; i++, pAtt++)
|
||||
{
|
||||
rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L;
|
||||
}
|
||||
|
||||
rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size;
|
||||
rep.length = (pPort->pAdaptor->nAttributes * sz_xvAttributeInfo)
|
||||
+ rep.text_size;
|
||||
rep.length >>= 2;
|
||||
|
||||
_WriteQueryPortAttributesReply(client, &rep);
|
||||
|
||||
for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
||||
i < rep.num_attributes; i++, pAtt++)
|
||||
i < pPort->pAdaptor->nAttributes; i++, pAtt++)
|
||||
{
|
||||
size = strlen(pAtt->name) + 1; /* pass the NULL */
|
||||
Info.flags = pAtt->flags;
|
||||
|
|
@ -1024,7 +1027,7 @@ ProcXvPutImage(ClientPtr client)
|
|||
REQUEST(xvPutImageReq);
|
||||
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -1112,7 +1115,7 @@ ProcXvShmPutImage(ClientPtr client)
|
|||
REQUEST(xvShmPutImageReq);
|
||||
REQUEST_SIZE_MATCH(xvShmPutImageReq);
|
||||
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, pGC, client);
|
||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||
|
||||
if(!(pPort = LOOKUP_PORT(stuff->port, client) ))
|
||||
{
|
||||
|
|
@ -1211,6 +1214,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
|||
XvPortPtr pPort;
|
||||
int *offsets;
|
||||
int *pitches;
|
||||
int planeLength;
|
||||
REQUEST(xvQueryImageAttributesReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
|
||||
|
|
@ -1250,7 +1254,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
|||
|
||||
rep.type = X_Reply;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.length = num_planes << 1;
|
||||
rep.length = planeLength = num_planes << 1;
|
||||
rep.num_planes = num_planes;
|
||||
rep.width = width;
|
||||
rep.height = height;
|
||||
|
|
@ -1258,8 +1262,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
|||
|
||||
_WriteQueryImageAttributesReply(client, &rep);
|
||||
if(client->swapped)
|
||||
SwapLongs((CARD32*)offsets, rep.length);
|
||||
WriteToClient(client, rep.length << 2, (char*)offsets);
|
||||
SwapLongs((CARD32*)offsets, planeLength);
|
||||
WriteToClient(client, planeLength << 2, (char*)offsets);
|
||||
|
||||
xfree(offsets);
|
||||
|
||||
|
|
@ -1287,13 +1291,13 @@ ProcXvListImageFormats(ClientPtr client)
|
|||
rep.type = X_Reply;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.num_formats = pPort->pAdaptor->nImages;
|
||||
rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2;
|
||||
rep.length = pPort->pAdaptor->nImages * sz_xvImageFormatInfo >> 2;
|
||||
|
||||
_WriteListImageFormatsReply(client, &rep);
|
||||
|
||||
pImage = pPort->pAdaptor->pImages;
|
||||
|
||||
for(i = 0; i < rep.num_formats; i++, pImage++) {
|
||||
for(i = 0; i < pPort->pAdaptor->nImages; i++, pImage++) {
|
||||
info.id = pImage->id;
|
||||
info.type = pImage->type;
|
||||
info.byte_order = pImage->byte_order;
|
||||
|
|
@ -1528,6 +1532,7 @@ SProcXvShmPutImage(ClientPtr client)
|
|||
swapl(&stuff->gc, n);
|
||||
swapl(&stuff->shmseg, n);
|
||||
swapl(&stuff->id, n);
|
||||
swapl(&stuff->offset, n);
|
||||
swaps(&stuff->src_x, n);
|
||||
swaps(&stuff->src_y, n);
|
||||
swaps(&stuff->src_w, n);
|
||||
|
|
@ -1536,7 +1541,6 @@ SProcXvShmPutImage(ClientPtr client)
|
|||
swaps(&stuff->drw_y, n);
|
||||
swaps(&stuff->drw_w, n);
|
||||
swaps(&stuff->drw_h, n);
|
||||
swaps(&stuff->offset, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
return XvProcVector[xv_ShmPutImage](client);
|
||||
|
|
@ -1584,6 +1588,7 @@ SProcXvSetPortAttribute(ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->attribute, n);
|
||||
swapl(&stuff->value, n);
|
||||
return XvProcVector[xv_SetPortAttribute](client);
|
||||
}
|
||||
|
||||
|
|
@ -1628,9 +1633,10 @@ SProcXvQueryImageAttributes(ClientPtr client)
|
|||
char n;
|
||||
REQUEST(xvQueryImageAttributesReq);
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->port, n);
|
||||
swapl(&stuff->id, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->width, n);
|
||||
swaps(&stuff->height, n);
|
||||
return XvProcVector[xv_QueryImageAttributes](client);
|
||||
}
|
||||
|
||||
|
|
@ -1921,7 +1927,8 @@ XineramaXvPutStill(ClientPtr client)
|
|||
void XineramifyXv(void)
|
||||
{
|
||||
ScreenPtr pScreen, screen0 = screenInfo.screens[0];
|
||||
XvScreenPtr xvsp0 = (XvScreenPtr)screen0->devPrivates[XvScreenIndex].ptr;
|
||||
XvScreenPtr xvsp0 = (XvScreenPtr)dixLookupPrivate(&screen0->devPrivates,
|
||||
XvGetScreenKey());
|
||||
XvAdaptorPtr refAdapt, pAdapt;
|
||||
XvAttributePtr pAttr;
|
||||
XvScreenPtr xvsp;
|
||||
|
|
@ -1954,8 +1961,8 @@ void XineramifyXv(void)
|
|||
|
||||
for(j = 1; j < PanoramiXNumScreens; j++) {
|
||||
pScreen = screenInfo.screens[j];
|
||||
xvsp = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
||||
|
||||
xvsp = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
XvGetScreenKey());
|
||||
/* Do not try to go on if xv is not supported on this screen */
|
||||
if (xvsp==NULL) continue ;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ SOFTWARE.
|
|||
#include "scrnintstr.h"
|
||||
#include <X11/extensions/Xvproto.h>
|
||||
|
||||
extern int XvScreenIndex;
|
||||
extern unsigned long XvExtensionGeneration;
|
||||
extern unsigned long XvScreenGeneration;
|
||||
extern unsigned long XvResourceGeneration;
|
||||
|
|
@ -224,10 +223,8 @@ typedef struct {
|
|||
DevUnion devPriv;
|
||||
} XvScreenRec, *XvScreenPtr;
|
||||
|
||||
#define SCREEN_PROLOGUE(pScreen, field)\
|
||||
((pScreen)->field = \
|
||||
((XvScreenPtr) \
|
||||
(pScreen)->devPrivates[XvScreenIndex].ptr)->field)
|
||||
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, XvScreenKey))->field)
|
||||
|
||||
#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
||||
((pScreen)->field = wrapper)
|
||||
|
|
@ -242,7 +239,7 @@ extern int SProcXvDispatch(ClientPtr);
|
|||
|
||||
extern void XvExtensionInit(void);
|
||||
extern int XvScreenInit(ScreenPtr);
|
||||
extern int XvGetScreenIndex(void);
|
||||
extern DevPrivateKey XvGetScreenKey(void);
|
||||
extern unsigned long XvGetRTPort(void);
|
||||
extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
||||
extern int XvdiVideoStopped(XvPortPtr, int);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ SOFTWARE.
|
|||
#endif
|
||||
#include "xvdisp.h"
|
||||
|
||||
int XvScreenIndex = -1;
|
||||
static DevPrivateKey XvScreenKey = &XvScreenKey;
|
||||
unsigned long XvExtensionGeneration = 0;
|
||||
unsigned long XvScreenGeneration = 0;
|
||||
unsigned long XvResourceGeneration = 0;
|
||||
|
|
@ -166,12 +166,6 @@ XvExtensionInit(void)
|
|||
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
|
||||
return;
|
||||
}
|
||||
XvScreenIndex = AllocateScreenPrivateIndex ();
|
||||
if (XvScreenIndex < 0)
|
||||
{
|
||||
ErrorF("XvExtensionInit: Unable to allocate screen private index\n");
|
||||
return;
|
||||
}
|
||||
#ifdef PANORAMIX
|
||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||
#endif
|
||||
|
|
@ -265,19 +259,13 @@ XvScreenInit(ScreenPtr pScreen)
|
|||
ErrorF("XvScreenInit: Unable to allocate resource types\n");
|
||||
return BadAlloc;
|
||||
}
|
||||
XvScreenIndex = AllocateScreenPrivateIndex ();
|
||||
if (XvScreenIndex < 0)
|
||||
{
|
||||
ErrorF("XvScreenInit: Unable to allocate screen private index\n");
|
||||
return BadAlloc;
|
||||
}
|
||||
#ifdef PANORAMIX
|
||||
XineramaRegisterConnectionBlockCallback(XineramifyXv);
|
||||
#endif
|
||||
XvScreenGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
if (pScreen->devPrivates[XvScreenIndex].ptr)
|
||||
if (dixLookupPrivate(&pScreen->devPrivates, XvScreenKey))
|
||||
{
|
||||
ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
|
||||
}
|
||||
|
|
@ -291,7 +279,7 @@ XvScreenInit(ScreenPtr pScreen)
|
|||
return BadAlloc;
|
||||
}
|
||||
|
||||
pScreen->devPrivates[XvScreenIndex].ptr = (pointer)pxvs;
|
||||
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
|
||||
|
||||
|
||||
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
|
||||
|
|
@ -313,7 +301,7 @@ XvCloseScreen(
|
|||
|
||||
XvScreenPtr pxvs;
|
||||
|
||||
pxvs = (XvScreenPtr) pScreen->devPrivates[XvScreenIndex].ptr;
|
||||
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||
|
||||
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
|
||||
pScreen->DestroyWindow = pxvs->DestroyWindow;
|
||||
|
|
@ -323,7 +311,7 @@ XvCloseScreen(
|
|||
|
||||
xfree(pxvs);
|
||||
|
||||
pScreen->devPrivates[XvScreenIndex].ptr = (pointer)NULL;
|
||||
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
||||
|
||||
return (*pScreen->CloseScreen)(ii, pScreen);
|
||||
}
|
||||
|
|
@ -334,10 +322,10 @@ XvResetProc(ExtensionEntry* extEntry)
|
|||
XvResetProcVector();
|
||||
}
|
||||
|
||||
_X_EXPORT int
|
||||
XvGetScreenIndex(void)
|
||||
_X_EXPORT DevPrivateKey
|
||||
XvGetScreenKey(void)
|
||||
{
|
||||
return XvScreenIndex;
|
||||
return XvScreenKey;
|
||||
}
|
||||
|
||||
_X_EXPORT unsigned long
|
||||
|
|
@ -361,7 +349,7 @@ XvDestroyPixmap(PixmapPtr pPix)
|
|||
|
||||
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
|
||||
|
||||
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
||||
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||
|
||||
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||
|
||||
|
|
@ -413,7 +401,7 @@ XvDestroyWindow(WindowPtr pWin)
|
|||
|
||||
SCREEN_PROLOGUE(pScreen, DestroyWindow);
|
||||
|
||||
pxvs = (XvScreenPtr)pScreen->devPrivates[XvScreenIndex].ptr;
|
||||
pxvs = (XvScreenPtr)dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
|
||||
|
||||
/* CHECK TO SEE IF THIS PORT IS IN USE */
|
||||
|
||||
|
|
|
|||
23
Xext/xvmc.c
23
Xext/xvmc.c
|
|
@ -39,7 +39,7 @@
|
|||
#define DR_CLIENT_DRIVER_NAME_SIZE 48
|
||||
#define DR_BUSID_SIZE 48
|
||||
|
||||
int XvMCScreenIndex = -1;
|
||||
static DevPrivateKey XvMCScreenKey = NULL;
|
||||
|
||||
unsigned long XvMCGeneration = 0;
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ typedef struct {
|
|||
} XvMCScreenRec, *XvMCScreenPtr;
|
||||
|
||||
#define XVMC_GET_PRIVATE(pScreen) \
|
||||
(XvMCScreenPtr)((pScreen)->devPrivates[XvMCScreenIndex].ptr)
|
||||
(XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey))
|
||||
|
||||
|
||||
static int
|
||||
|
|
@ -153,7 +153,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
|||
return _XvBadPort;
|
||||
}
|
||||
|
||||
if(XvMCScreenIndex >= 0) { /* any adaptors at all */
|
||||
if(XvMCScreenKey) { /* any adaptors at all */
|
||||
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
||||
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
||||
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
|
||||
|
|
@ -211,7 +211,7 @@ ProcXvMCCreateContext(ClientPtr client)
|
|||
|
||||
pScreen = pPort->pAdaptor->pScreen;
|
||||
|
||||
if(XvMCScreenIndex < 0) /* no XvMC adaptors */
|
||||
if(XvMCScreenKey == NULL) /* no XvMC adaptors */
|
||||
return BadMatch;
|
||||
|
||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
|
||||
|
|
@ -494,7 +494,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
|||
|
||||
pScreen = pPort->pAdaptor->pScreen;
|
||||
|
||||
if(XvMCScreenIndex < 0) /* No XvMC adaptors */
|
||||
if(XvMCScreenKey == NULL) /* No XvMC adaptors */
|
||||
return BadMatch;
|
||||
|
||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||
|
|
@ -679,7 +679,7 @@ XvMCExtensionInit(void)
|
|||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
||||
if(XvMCScreenIndex < 0) /* nobody supports it */
|
||||
if(XvMCScreenKey == NULL) /* nobody supports it */
|
||||
return;
|
||||
|
||||
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
|
||||
|
|
@ -720,17 +720,12 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
|
|||
{
|
||||
XvMCScreenPtr pScreenPriv;
|
||||
|
||||
if(XvMCGeneration != serverGeneration) {
|
||||
if((XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
|
||||
return BadAlloc;
|
||||
|
||||
XvMCGeneration = serverGeneration;
|
||||
}
|
||||
XvMCScreenKey = &XvMCScreenKey;
|
||||
|
||||
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
|
||||
return BadAlloc;
|
||||
|
||||
pScreen->devPrivates[XvMCScreenIndex].ptr = (pointer)pScreenPriv;
|
||||
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
||||
|
||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = XvMCCloseScreen;
|
||||
|
|
@ -754,7 +749,7 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
|
|||
XvMCAdaptorPtr adaptor = NULL;
|
||||
int i;
|
||||
|
||||
if(XvMCScreenIndex < 0) return NULL;
|
||||
if(XvMCScreenKey == NULL) return NULL;
|
||||
|
||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "allowev.h"
|
||||
|
|
@ -95,13 +94,14 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
|||
{
|
||||
TimeStamp time;
|
||||
DeviceIntPtr thisdev;
|
||||
int rc;
|
||||
|
||||
REQUEST(xAllowDeviceEventsReq);
|
||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||
|
||||
thisdev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (thisdev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
|
||||
switch (stuff->mode) {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
#include "XIstubs.h"
|
||||
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "exevents.h"
|
||||
|
||||
|
|
@ -112,11 +111,9 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||
|
||||
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
ret = BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
goto out;
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_ChangeDeviceControl;
|
||||
|
|
|
|||
15
Xi/chgfctl.c
15
Xi/chgfctl.c
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "chgfctl.h"
|
||||
|
|
@ -303,18 +302,13 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
xStringFeedbackCtl * f)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i, j;
|
||||
KeySym *syms, *sup_syms;
|
||||
|
||||
syms = (KeySym *) (f + 1);
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n); /* swapped num_keysyms in calling proc */
|
||||
p = (long *)(syms);
|
||||
for (i = 0; i < f->num_keysyms; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
SwapLongs((CARD32 *) syms, f->num_keysyms);
|
||||
}
|
||||
|
||||
if (f->num_keysyms > s->ctrl.max_symbols)
|
||||
|
|
@ -444,14 +438,15 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
StringFeedbackPtr s;
|
||||
BellFeedbackPtr b;
|
||||
LedFeedbackPtr l;
|
||||
int rc;
|
||||
|
||||
REQUEST(xChangeFeedbackControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
switch (stuff->feedbackid) {
|
||||
case KbdFeedbackClass:
|
||||
|
|
|
|||
21
Xi/chgkmap.c
21
Xi/chgkmap.c
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
|
@ -76,18 +75,14 @@ int
|
|||
SProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i, count;
|
||||
unsigned int count;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
p = (long *)&stuff[1];
|
||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||
for (i = 0; i < count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), count);
|
||||
return (ProcXChangeDeviceKeyMapping(client));
|
||||
}
|
||||
|
||||
|
|
@ -103,13 +98,17 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
|||
int ret;
|
||||
unsigned len;
|
||||
DeviceIntPtr dev;
|
||||
unsigned int count;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
||||
|
||||
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||
|
|
|
|||
13
Xi/chgprop.c
13
Xi/chgprop.c
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "windowstr.h"
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
|
@ -78,19 +77,15 @@ int
|
|||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
|
||||
stuff->count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
||||
return (ProcXChangeDeviceDontPropagateList(client));
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +110,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
|||
stuff->count)
|
||||
return BadLength;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
|
||||
#include "dixevents.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "closedev.h"
|
||||
|
|
@ -140,16 +139,16 @@ DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
|||
int
|
||||
ProcXCloseDevice(ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
int rc, i;
|
||||
WindowPtr pWin, p1;
|
||||
DeviceIntPtr d;
|
||||
|
||||
REQUEST(xCloseDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||
|
||||
d = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (d == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (d->grab && SameClient(d->grab, client))
|
||||
(*d->DeactivateGrab) (d); /* release active grab */
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "devbell.h"
|
||||
|
|
@ -93,7 +92,7 @@ ProcXDeviceBell(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
BellFeedbackPtr b;
|
||||
int base;
|
||||
int rc, base;
|
||||
int newpercent;
|
||||
CARD8 class;
|
||||
pointer ctrl;
|
||||
|
|
@ -102,10 +101,10 @@ ProcXDeviceBell(ClientPtr client)
|
|||
REQUEST(xDeviceBellReq);
|
||||
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
|
||||
if (rc != Success) {
|
||||
client->errorValue = stuff->deviceid;
|
||||
return BadDevice;
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (stuff->percent < -100 || stuff->percent > 100) {
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ SOFTWARE.
|
|||
#include "region.h"
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixevents.h" /* DeliverFocusedEvent */
|
||||
#include "dixgrabs.h" /* CreateGrab() */
|
||||
#include "scrnintstr.h"
|
||||
#include "xace.h"
|
||||
|
||||
#ifdef XKB
|
||||
#include "xkbsrv.h"
|
||||
|
|
@ -244,7 +244,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
|
|||
other->valuator->motionHintWindow = NullWindow;
|
||||
b->buttonsDown++;
|
||||
b->motionMask = DeviceButtonMotionMask;
|
||||
xE->u.u.detail = b->map[key];
|
||||
xE->u.u.detail = key;
|
||||
if (xE->u.u.detail == 0)
|
||||
return;
|
||||
if (xE->u.u.detail <= 5)
|
||||
|
|
@ -266,7 +266,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
|
|||
other->valuator->motionHintWindow = NullWindow;
|
||||
if (b->buttonsDown >= 1 && !--b->buttonsDown)
|
||||
b->motionMask = 0;
|
||||
xE->u.u.detail = b->map[key];
|
||||
xE->u.u.detail = key;
|
||||
if (xE->u.u.detail == 0)
|
||||
return;
|
||||
if (xE->u.u.detail <= 5)
|
||||
|
|
@ -511,6 +511,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
WindowPtr pWin, confineTo;
|
||||
CursorPtr cursor;
|
||||
GrabPtr grab;
|
||||
Mask access_mode = DixGrabAccess;
|
||||
int rc;
|
||||
|
||||
if ((this_device_mode != GrabModeSync) &&
|
||||
|
|
@ -531,25 +532,33 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
client->errorValue = ownerEvents;
|
||||
return BadValue;
|
||||
}
|
||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (rconfineTo == None)
|
||||
confineTo = NullWindow;
|
||||
else {
|
||||
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&confineTo, rconfineTo, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
if (rcursor == None)
|
||||
cursor = NullCursor;
|
||||
else {
|
||||
cursor = (CursorPtr) LookupIDByType(rcursor, RT_CURSOR);
|
||||
if (!cursor) {
|
||||
rc = dixLookupResource((pointer *)&cursor, rcursor, RT_CURSOR,
|
||||
client, DixUseAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
client->errorValue = rcursor;
|
||||
return BadCursor;
|
||||
return (rc == BadValue) ? BadCursor : rc;
|
||||
}
|
||||
access_mode |= DixForceAccess;
|
||||
}
|
||||
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||
access_mode |= DixFreezeAccess;
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
grab = CreateGrab(client->index, dev, pWin, eventMask,
|
||||
(Bool) ownerEvents, (Bool) this_device_mode,
|
||||
|
|
@ -557,7 +566,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
DeviceButtonPress, button, confineTo, cursor);
|
||||
if (!grab)
|
||||
return BadAlloc;
|
||||
return AddPassiveGrabToList(grab);
|
||||
return AddPassiveGrabToList(client, grab);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -569,6 +578,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
WindowPtr pWin;
|
||||
GrabPtr grab;
|
||||
KeyClassPtr k = dev->key;
|
||||
Mask access_mode = DixGrabAccess;
|
||||
int rc;
|
||||
|
||||
if (k == NULL)
|
||||
|
|
@ -596,7 +606,12 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
client->errorValue = ownerEvents;
|
||||
return BadValue;
|
||||
}
|
||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, grabWindow, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (this_device_mode == GrabModeSync || other_devices_mode == GrabModeSync)
|
||||
access_mode |= DixFreezeAccess;
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, access_mode);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
@ -606,7 +621,7 @@ GrabKey(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
|
|||
NullWindow, NullCursor);
|
||||
if (!grab)
|
||||
return BadAlloc;
|
||||
return AddPassiveGrabToList(grab);
|
||||
return AddPassiveGrabToList(client, grab);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -837,7 +852,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, Bool propagate,
|
|||
if (!mask)
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else if (!XaceHook(XACE_SEND_ACCESS, client, NULL, pWin, ev, count))
|
||||
(void)(DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, d->id));
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -1101,7 +1116,8 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
|
|||
{
|
||||
DeviceIntPtr dev;
|
||||
|
||||
dev = LookupDeviceIntRec(pEvents->deviceid & DEVICE_BITS);
|
||||
dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient,
|
||||
DixReadAccess);
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1125,7 +1141,8 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
|
|||
{
|
||||
DeviceIntPtr dev;
|
||||
|
||||
dev = LookupDeviceIntRec(xE->deviceid & DEVICE_BITS);
|
||||
dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient,
|
||||
DixReadAccess);
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
|
|
|
|||
25
Xi/extinit.c
25
Xi/extinit.c
|
|
@ -69,6 +69,7 @@ SOFTWARE.
|
|||
#include "extinit.h"
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
#include "registry.h"
|
||||
|
||||
/* modules local to Xi */
|
||||
#include "allowev.h"
|
||||
|
|
@ -856,29 +857,6 @@ MakeDeviceTypeAtoms(void)
|
|||
MakeAtom(dev_type[i].name, strlen(dev_type[i].name), 1);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Return a DeviceIntPtr corresponding to a specified device id.
|
||||
*
|
||||
*/
|
||||
|
||||
DeviceIntPtr
|
||||
LookupDeviceIntRec(CARD8 id)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||
if (dev->id == id)
|
||||
return dev;
|
||||
}
|
||||
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next) {
|
||||
if (dev->id == id)
|
||||
return dev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* SEventIDispatch
|
||||
|
|
@ -959,6 +937,7 @@ XInputExtensionInit(void)
|
|||
AllExtensionVersions[IReqCode - 128] = thisversion;
|
||||
MakeDeviceTypeAtoms();
|
||||
RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
|
||||
RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT");
|
||||
FixExtensionEvents(extEntry);
|
||||
ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
|
||||
EventSwapVector[DeviceValuator] = SEventIDispatch;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getbmap.h"
|
||||
|
|
@ -92,6 +91,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
xGetDeviceButtonMappingReply rep;
|
||||
ButtonClassPtr b;
|
||||
int rc;
|
||||
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||
|
|
@ -102,9 +102,9 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
b = dev->button;
|
||||
if (b == NULL)
|
||||
|
|
|
|||
17
Xi/getdctl.c
17
Xi/getdctl.c
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getdctl.h"
|
||||
|
|
@ -238,7 +237,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
|||
int
|
||||
ProcXGetDeviceControl(ClientPtr client)
|
||||
{
|
||||
int total_length = 0;
|
||||
int rc, total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceControlReply rep;
|
||||
|
|
@ -246,9 +245,9 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
REQUEST(xGetDeviceControlReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetDeviceControl;
|
||||
|
|
@ -266,19 +265,19 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
if (!dev->absolute)
|
||||
return BadMatch;
|
||||
|
||||
total_length = sizeof(xDeviceAbsCalibCtl);
|
||||
total_length = sizeof(xDeviceAbsCalibState);
|
||||
break;
|
||||
case DEVICE_ABS_AREA:
|
||||
if (!dev->absolute)
|
||||
return BadMatch;
|
||||
|
||||
total_length = sizeof(xDeviceAbsAreaCtl);
|
||||
total_length = sizeof(xDeviceAbsAreaState);
|
||||
break;
|
||||
case DEVICE_CORE:
|
||||
total_length = sizeof(xDeviceCoreCtl);
|
||||
total_length = sizeof(xDeviceCoreState);
|
||||
break;
|
||||
case DEVICE_ENABLE:
|
||||
total_length = sizeof(xDeviceEnableCtl);
|
||||
total_length = sizeof(xDeviceEnableState);
|
||||
break;
|
||||
default:
|
||||
return BadValue;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getfctl.h"
|
||||
|
|
@ -290,7 +289,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size,
|
|||
int
|
||||
ProcXGetFeedbackControl(ClientPtr client)
|
||||
{
|
||||
int total_length = 0;
|
||||
int rc, total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
|
|
@ -304,9 +303,9 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
REQUEST(xGetFeedbackControlReq);
|
||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetFeedbackControl;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getfocus.h"
|
||||
|
|
@ -93,12 +92,15 @@ ProcXGetDeviceFocus(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
FocusClassPtr focus;
|
||||
xGetDeviceFocusReply rep;
|
||||
int rc;
|
||||
|
||||
REQUEST(xGetDeviceFocusReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL || !dev->focus)
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (!dev->focus)
|
||||
return BadDevice;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
|
|
@ -94,13 +93,14 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
|||
xGetDeviceKeyMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
KeySymsPtr k;
|
||||
int rc;
|
||||
|
||||
REQUEST(xGetDeviceKeyMappingReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (dev->key == NULL)
|
||||
return BadMatch;
|
||||
k = &dev->key->curKeySyms;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getmmap.h"
|
||||
|
|
@ -94,13 +93,14 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
xGetDeviceModifierMappingReply rep;
|
||||
KeyClassPtr kp;
|
||||
int rc;
|
||||
|
||||
REQUEST(xGetDeviceModifierMappingReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
kp = dev->key;
|
||||
if (kp == NULL)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structs */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
|
|
@ -112,7 +111,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.count = 0;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h>
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window struct */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
|
|
@ -114,7 +113,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
|||
rep.this_client_count = 0;
|
||||
rep.all_clients_count = 0;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getvers.h"
|
||||
|
|
|
|||
27
Xi/grabdev.c
27
Xi/grabdev.c
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixevents.h" /* GrabDevice */
|
||||
|
||||
|
|
@ -79,8 +78,6 @@ int
|
|||
SProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
@ -88,11 +85,11 @@ SProcXGrabDevice(ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
|
||||
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
|
||||
return (ProcXGrabDevice(client));
|
||||
}
|
||||
|
|
@ -122,9 +119,9 @@ ProcXGrabDevice(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.length = 0;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->event_count, tmp, dev,
|
||||
|
|
@ -153,7 +150,7 @@ int
|
|||
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||
struct tmask *mask, DeviceIntPtr dev, int req)
|
||||
{
|
||||
int i, j;
|
||||
int rc, i, j;
|
||||
int device;
|
||||
DeviceIntPtr tdev;
|
||||
|
||||
|
|
@ -167,8 +164,10 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
|||
if (device > 255)
|
||||
return BadClass;
|
||||
|
||||
tdev = LookupDeviceIntRec(device);
|
||||
if (tdev == NULL || (dev != NULL && tdev != dev))
|
||||
rc = dixLookupDevice(&tdev, device, client, DixReadAccess);
|
||||
if (rc != BadDevice && rc != Success)
|
||||
return rc;
|
||||
if (rc == BadDevice || (dev != NULL && tdev != dev))
|
||||
return BadClass;
|
||||
|
||||
for (j = 0; j < ExtEventIndex; j++)
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "xace.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "grabdevb.h"
|
||||
|
|
@ -77,8 +77,6 @@ int
|
|||
SProcXGrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceButtonReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
@ -86,11 +84,9 @@ SProcXGrabDeviceButton(ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
|
||||
stuff->event_count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
|
||||
return (ProcXGrabDeviceButton(client));
|
||||
}
|
||||
|
|
@ -117,18 +113,23 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||
DixReadAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
} else {
|
||||
mdev = inputInfo.keyboard;
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
}
|
||||
|
||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "xace.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
#include "grabdevk.h"
|
||||
|
|
@ -77,8 +77,6 @@ int
|
|||
SProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
swaps(&stuff->length, n);
|
||||
|
|
@ -86,11 +84,8 @@ SProcXGrabDeviceKey(ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
return (ProcXGrabDeviceKey(client));
|
||||
}
|
||||
|
||||
|
|
@ -115,18 +110,23 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||
DixReadAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
} else {
|
||||
mdev = inputInfo.keyboard;
|
||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
}
|
||||
|
||||
class = (XEventClass *) (&stuff[1]); /* first word of values */
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
|
@ -96,7 +95,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
INT32 *coords = NULL, *bufptr;
|
||||
xGetDeviceMotionEventsReply rep;
|
||||
unsigned long i;
|
||||
int num_events, axes, size = 0, tsize;
|
||||
int rc, num_events, axes, size = 0, tsize;
|
||||
unsigned long nEvents;
|
||||
DeviceIntPtr dev;
|
||||
TimeStamp start, stop;
|
||||
|
|
@ -106,9 +105,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
REQUEST(xGetDeviceMotionEventsReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
v = dev->valuator;
|
||||
if (v == NULL || v->numAxes == 0)
|
||||
return BadMatch;
|
||||
|
|
|
|||
10
Xi/listdev.c
10
Xi/listdev.c
|
|
@ -63,8 +63,8 @@ SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h" /* FIXME */
|
||||
#include "xace.h"
|
||||
|
||||
#include "listdev.h"
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ ProcXListInputDevices(ClientPtr client)
|
|||
xListInputDevicesReply rep;
|
||||
int numdevs = 0;
|
||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||
int size = 0;
|
||||
int rc, size = 0;
|
||||
int total_length;
|
||||
char *devbuf;
|
||||
char *classbuf;
|
||||
|
|
@ -329,10 +329,16 @@ ProcXListInputDevices(ClientPtr client)
|
|||
AddOtherInputDevices();
|
||||
|
||||
for (d = inputInfo.devices; d; d = d->next) {
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
SizeDeviceInfo(d, &namesize, &size);
|
||||
numdevs++;
|
||||
}
|
||||
for (d = inputInfo.off_devices; d; d = d->next) {
|
||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
SizeDeviceInfo(d, &namesize, &size);
|
||||
numdevs++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "opendev.h"
|
||||
|
|
@ -107,13 +106,15 @@ ProcXOpenDevice(ClientPtr client)
|
|||
stuff->deviceid == inputInfo.keyboard->id)
|
||||
return BadDevice;
|
||||
|
||||
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
|
||||
status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
|
||||
if (status == BadDevice) { /* not open */
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||
if (dev->id == stuff->deviceid)
|
||||
break;
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
}
|
||||
} else if (status != Success)
|
||||
return status;
|
||||
|
||||
OpenInputDevice(dev, client, &status);
|
||||
if (status != Success)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ from The Open Group.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ int
|
|||
ProcXQueryDeviceState(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
int rc, i;
|
||||
int num_classes = 0;
|
||||
int total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
|
|
@ -96,9 +95,9 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
v = dev->valuator;
|
||||
if (v != NULL && v->motionHintWindow != NULL)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
|
@ -128,19 +127,16 @@ int
|
|||
SProcXSelectExtensionEvent(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
int i;
|
||||
|
||||
REQUEST(xSelectExtensionEventReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
|
||||
stuff->count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
||||
|
||||
return (ProcXSelectExtensionEvent(client));
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +160,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
|||
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
||||
return BadLength;
|
||||
|
||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ SOFTWARE.
|
|||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* Window */
|
||||
#include "extnsionst.h" /* EventSwapPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ int
|
|||
SProcXSendExtensionEvent(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
long *p;
|
||||
CARD32 *p;
|
||||
int i;
|
||||
xEvent eventT;
|
||||
xEvent *eventP;
|
||||
|
|
@ -91,6 +91,11 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
swapl(&stuff->destination, n);
|
||||
swaps(&stuff->count, n);
|
||||
|
||||
if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
|
||||
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
||||
return BadLength;
|
||||
|
||||
eventP = (xEvent *) & stuff[1];
|
||||
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||
|
|
@ -100,11 +105,8 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
*eventP = eventT;
|
||||
}
|
||||
|
||||
p = (long *)(((xEvent *) & stuff[1]) + stuff->num_events);
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
|
||||
SwapLongs(p, stuff->count);
|
||||
return (ProcXSendExtensionEvent(client));
|
||||
}
|
||||
|
||||
|
|
@ -131,9 +133,9 @@ ProcXSendExtensionEvent(ClientPtr client)
|
|||
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
/* The client's event type must be one defined by an extension. */
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setbmap.h"
|
||||
|
|
@ -110,9 +109,9 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.status = MappingSuccess;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setdval.h"
|
||||
|
|
@ -92,6 +91,7 @@ ProcXSetDeviceValuators(ClientPtr client)
|
|||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceValuatorsReply rep;
|
||||
int rc;
|
||||
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||
|
|
@ -106,9 +106,9 @@ ProcXSetDeviceValuators(ClientPtr client)
|
|||
stuff->num_valuators)
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (dev->valuator == NULL)
|
||||
return BadMatch;
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ SOFTWARE.
|
|||
|
||||
#include "dixevents.h"
|
||||
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setfocus.h"
|
||||
|
|
@ -102,8 +101,10 @@ ProcXSetDeviceFocus(ClientPtr client)
|
|||
REQUEST(xSetDeviceFocusReq);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->device);
|
||||
if (dev == NULL || !dev->focus)
|
||||
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
if (!dev->focus)
|
||||
return BadDevice;
|
||||
|
||||
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmmap.h"
|
||||
|
|
@ -99,9 +98,9 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceModifierMapping;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmode.h"
|
||||
|
|
@ -92,6 +91,7 @@ ProcXSetDeviceMode(ClientPtr client)
|
|||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceModeReply rep;
|
||||
int rc;
|
||||
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||
|
|
@ -101,9 +101,9 @@ ProcXSetDeviceMode(ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (dev->valuator == NULL)
|
||||
return BadMatch;
|
||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ SOFTWARE.
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "xace.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
|
@ -153,6 +154,7 @@ AddOtherInputDevices(void)
|
|||
void
|
||||
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
||||
{
|
||||
*status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ SOFTWARE.
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "ungrdev.h"
|
||||
|
|
@ -94,13 +93,14 @@ ProcXUngrabDevice(ClientPtr client)
|
|||
DeviceIntPtr dev;
|
||||
GrabPtr grab;
|
||||
TimeStamp time;
|
||||
int rc;
|
||||
|
||||
REQUEST(xUngrabDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
grab = dev->grab;
|
||||
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
||||
|
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
|||
REQUEST(xUngrabDeviceButtonReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (dev->button == NULL)
|
||||
return BadMatch;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = inputInfo.keyboard;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
||||
|
|
@ -107,22 +106,23 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
|||
REQUEST(xUngrabDeviceKeyReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (dev->key == NULL)
|
||||
return BadMatch;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
mdev = inputInfo.keyboard;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
|
|
|
|||
19
afb/afb.h
19
afb/afb.h
|
|
@ -55,11 +55,11 @@ SOFTWARE.
|
|||
#include "gc.h"
|
||||
#include "colormap.h"
|
||||
#include "regionstr.h"
|
||||
#include "privates.h"
|
||||
#include "mibstore.h"
|
||||
#include "mfb.h"
|
||||
|
||||
extern int afbInverseAlu[];
|
||||
extern int afbScreenPrivateIndex;
|
||||
/* warning: PixelType definition duplicated in maskbits.h */
|
||||
#ifndef PixelType
|
||||
#define PixelType CARD32
|
||||
|
|
@ -731,20 +731,21 @@ typedef struct {
|
|||
} afbPrivGC;
|
||||
typedef afbPrivGC *afbPrivGCPtr;
|
||||
|
||||
extern int afbGCPrivateIndex; /* index into GC private array */
|
||||
extern int afbWindowPrivateIndex; /* index into Window private array */
|
||||
extern DevPrivateKey afbScreenPrivateKey;
|
||||
extern DevPrivateKey afbGCPrivateKey;
|
||||
extern DevPrivateKey afbWindowPrivateKey;
|
||||
#ifdef PIXMAP_PER_WINDOW
|
||||
extern int frameWindowPrivateIndex; /* index into Window private array */
|
||||
extern DevPrivateKey frameWindowPrivateKey;
|
||||
#endif
|
||||
|
||||
#define afbGetGCPrivate(pGC) \
|
||||
((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
|
||||
((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey))
|
||||
|
||||
/* Common macros for extracting drawing information */
|
||||
|
||||
#define afbGetTypedWidth(pDrawable,wtype)( \
|
||||
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
|
||||
(int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
|
||||
(int)(((PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey)->devKind) : \
|
||||
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
|
||||
|
||||
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
|
||||
|
|
@ -754,7 +755,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
|||
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
|
||||
PixmapPtr _pPix; \
|
||||
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
||||
_pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
||||
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
|
||||
else \
|
||||
_pPix = (PixmapPtr)(pDrawable); \
|
||||
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
||||
|
|
@ -764,7 +765,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
|||
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
|
||||
PixmapPtr _pPix; \
|
||||
if ((pDrawable)->type == DRAWABLE_WINDOW) \
|
||||
_pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
||||
_pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
|
||||
else \
|
||||
_pPix = (PixmapPtr)(pDrawable); \
|
||||
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
|
||||
|
|
@ -780,7 +781,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
|
|||
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
|
||||
|
||||
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
|
||||
PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
|
||||
PixmapPtr _pPix = (PixmapPtr)dixLookupPrivate(&(pWin)->drawable.pScreen->devPrivates, afbScreenPrivateKey); \
|
||||
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
|
||||
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
|
||||
}
|
||||
|
|
|
|||
|
|
@ -321,7 +321,8 @@ afbPolyFillArcSolid(register DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parc
|
|||
RegionPtr cclip;
|
||||
unsigned char *rrops;
|
||||
|
||||
priv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr;
|
||||
priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey);
|
||||
rrops = priv->rrops;
|
||||
cclip = pGC->pCompositeClip;
|
||||
for (arc = parcs, i = narcs; --i >= 0; arc++) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,8 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
|
|||
unsigned char *rrops;
|
||||
unsigned char *rropsOS;
|
||||
|
||||
priv = (afbPrivGC *)pGC->devPrivates[afbGCPrivateIndex].ptr;
|
||||
priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey);
|
||||
prgnClip = pGC->pCompositeClip;
|
||||
rrops = priv->rrops;
|
||||
rropsOS = priv->rropOS;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
|||
|
||||
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
|
||||
pBase);
|
||||
rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
|
||||
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey))->rrops;
|
||||
while (n--) {
|
||||
addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
|
||||
|
||||
|
|
@ -238,8 +239,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
|||
tileHeight = pStipple->drawable.height;
|
||||
psrc = (PixelType *)(pStipple->devPrivate.ptr);
|
||||
|
||||
rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
|
||||
|
||||
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey))->rrops;
|
||||
while (n--) {
|
||||
src = psrc[ppt->y % tileHeight];
|
||||
addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
|
||||
|
|
@ -484,8 +485,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
|||
tileHeight = pTile->drawable.height;
|
||||
psrc = (PixelType *)(pTile->devPrivate.ptr);
|
||||
rop = pGC->alu;
|
||||
rropsOS = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rropOS;
|
||||
|
||||
rropsOS = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey))->rropOS;
|
||||
switch(rop) {
|
||||
case GXcopy:
|
||||
while (n--) {
|
||||
|
|
@ -793,8 +794,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
|
|||
|
||||
tileWidth = pTile->drawable.width;
|
||||
tileHeight = pTile->drawable.height;
|
||||
rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
|
||||
|
||||
rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey))->rrops;
|
||||
/* this replaces rotating the stipple. Instead, we just adjust the offset
|
||||
* at which we start grabbing bits from the stipple.
|
||||
* Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ afbCreateGC(pGC)
|
|||
/* afb wants to translate before scan convesion */
|
||||
pGC->miTranslate = 1;
|
||||
|
||||
pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
|
||||
pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey);
|
||||
afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
|
||||
pPriv->rrops);
|
||||
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
|
||||
|
|
@ -295,8 +296,8 @@ afbValidateGC(pGC, changes, pDrawable)
|
|||
(oldOrg.y != pGC->lastWinOrg.y);
|
||||
|
||||
|
||||
devPriv = ((afbPrivGCPtr)(pGC->devPrivates[afbGCPrivateIndex].ptr));
|
||||
|
||||
devPriv = (afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey);
|
||||
|
||||
/*
|
||||
if the client clip is different or moved OR
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
|
|||
register int nFirst;/* bits of glyph in current longword */
|
||||
PixelType *pdstSave;
|
||||
int oldFill;
|
||||
afbPrivGC *pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
|
||||
|
||||
afbPrivGC *pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
|
||||
afbGCPrivateKey);
|
||||
xorg = pDrawable->x;
|
||||
yorg = pDrawable->y;
|
||||
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue