Well there were a couple of snapshots later than CVS available outside of
Novell, so I've done a crazy merge to try and get them into a workable CVS, I suspect I may have failed.. there is a pre-xgldrop-merge tag if I did.
This commit is contained in:
parent
ade104ce5a
commit
feb735c5bb
@ -1,17 +1,26 @@
|
|||||||
if XGLXSERVER
|
if GLX
|
||||||
|
GLX_SUBDIRS = glxext
|
||||||
|
endif
|
||||||
|
|
||||||
|
if XGLX
|
||||||
XGLX_SUBDIRS = glx
|
XGLX_SUBDIRS = glx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if XEGLSERVER
|
if XEGL
|
||||||
XEGL_SUBDIRS = egl
|
XEGL_SUBDIRS = egl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SUBDIRS = . $(XGLX_SUBDIRS) $(XEGL_SUBDIRS)
|
SUBDIRS = \
|
||||||
|
. \
|
||||||
|
$(GLX_SUBDIRS) \
|
||||||
|
$(XGLX_SUBDIRS) \
|
||||||
|
$(XEGL_SUBDIRS)
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
@XGL_INCS@ \
|
@XGL_INCS@ \
|
||||||
@XSERVER_CFLAGS@ \
|
@XSERVER_CFLAGS@ \
|
||||||
@XGLSERVER_CFLAGS@
|
@XGLSERVER_CFLAGS@ \
|
||||||
|
-DMODULEPATH=\"@MODULEPATH@\"
|
||||||
|
|
||||||
noinst_LIBRARIES = libxgl.a
|
noinst_LIBRARIES = libxgl.a
|
||||||
|
|
||||||
@ -40,4 +49,18 @@ libxgl_a_SOURCES = \
|
|||||||
xglglyph.c \
|
xglglyph.c \
|
||||||
xgltrap.c \
|
xgltrap.c \
|
||||||
xglhash.c \
|
xglhash.c \
|
||||||
|
xglloader.c \
|
||||||
xglglx.c
|
xglglx.c
|
||||||
|
|
||||||
|
if XGLSERVER
|
||||||
|
Xgl_DEPENDENCIES = @XGL_LIBS@
|
||||||
|
Xgl_LDFLAGS = -export-dynamic
|
||||||
|
Xgl_SOURCES = xglinit.c
|
||||||
|
Xgl_LDADD = \
|
||||||
|
@XGL_LIBS@ \
|
||||||
|
@XSERVER_LIBS@ \
|
||||||
|
@XGLSERVER_LIBS@
|
||||||
|
Xgl_programs = Xgl
|
||||||
|
endif
|
||||||
|
|
||||||
|
bin_PROGRAMS = $(Xgl_programs)
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
|
if XGLSERVER
|
||||||
|
MODULE_SUBDIRS = module
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
. \
|
||||||
|
$(MODULE_SUBDIRS)
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
@XGL_INCS@ \
|
@XEGL_INCS@ \
|
||||||
@XSERVER_CFLAGS@ \
|
@XSERVER_CFLAGS@ \
|
||||||
@XGLXSERVER_CFLAGS@
|
@XGLSERVER_CFLAGS@ \
|
||||||
|
@XEGLSERVER_CFLAGS@
|
||||||
|
|
||||||
bin_PROGRAMS = Xegl
|
noinst_LTLIBRARIES = libxegl.la
|
||||||
|
|
||||||
Xegl_SOURCES = \
|
libxegl_la_SOURCES = \
|
||||||
xegl.h \
|
xegl.h \
|
||||||
xegl.c \
|
xegl.c \
|
||||||
xeglinput.c \
|
xeglinput.c \
|
||||||
@ -13,10 +22,16 @@ Xegl_SOURCES = \
|
|||||||
kinput.c \
|
kinput.c \
|
||||||
evdev.c
|
evdev.c
|
||||||
|
|
||||||
|
if XEGLSERVER
|
||||||
|
Xegl_DEPENDENCIES = @XEGL_LIBS@
|
||||||
|
Xegl_LDFLAGS = -export-dynamic
|
||||||
|
Xegl_SOURCES = xeglinit.c
|
||||||
Xegl_LDADD = \
|
Xegl_LDADD = \
|
||||||
@XGL_LIBS@ \
|
@XEGL_LIBS@ \
|
||||||
@XSERVER_LIBS@ \
|
@XSERVER_LIBS@ \
|
||||||
|
@XGLSERVER_LIBS@ \
|
||||||
@XEGLSERVER_LIBS@
|
@XEGLSERVER_LIBS@
|
||||||
|
Xegl_programs = Xegl
|
||||||
|
endif
|
||||||
|
|
||||||
Xegl_DEPENDENCIES = @XGL_LIBS@
|
bin_PROGRAMS = $(Xegl_programs)
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ EvdevRead (int evdevPort, void *closure)
|
|||||||
{
|
{
|
||||||
KdMouseInfo *mi = closure;
|
KdMouseInfo *mi = closure;
|
||||||
Kevdev *ke = mi->driver;
|
Kevdev *ke = mi->driver;
|
||||||
int i, n;
|
int i, n, f = 0;
|
||||||
struct input_event events[NUM_EVENTS];
|
struct input_event events[NUM_EVENTS];
|
||||||
|
|
||||||
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
||||||
@ -131,46 +131,26 @@ EvdevRead (int evdevPort, void *closure)
|
|||||||
ErrorF ("key %d %d\n", events[i].code, events[i].value);
|
ErrorF ("key %d %d\n", events[i].code, events[i].value);
|
||||||
else
|
else
|
||||||
ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
|
ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
|
||||||
|
|
||||||
if (events[i].value==1) {
|
|
||||||
switch (events[i].code) {
|
switch (events[i].code) {
|
||||||
case BTN_LEFT:
|
case BTN_LEFT:
|
||||||
flags |= KD_BUTTON_1;
|
f = KD_BUTTON_1;
|
||||||
break;
|
break;
|
||||||
case BTN_RIGHT:
|
case BTN_RIGHT:
|
||||||
flags |= KD_BUTTON_3;
|
f = KD_BUTTON_2;
|
||||||
break;
|
break;
|
||||||
case BTN_MIDDLE:
|
case BTN_MIDDLE:
|
||||||
flags |= KD_BUTTON_2;
|
f = KD_BUTTON_3;
|
||||||
break;
|
break;
|
||||||
case BTN_FORWARD:
|
case BTN_FORWARD:
|
||||||
flags |= KD_BUTTON_4;
|
f = KD_BUTTON_4;
|
||||||
break;
|
break;
|
||||||
case BTN_BACK:
|
case BTN_BACK:
|
||||||
flags |= KD_BUTTON_5;
|
f = KD_BUTTON_5;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
flags |= f;
|
||||||
else if (events[i].value==0) {
|
|
||||||
switch (events[i].code) {
|
|
||||||
case BTN_LEFT:
|
|
||||||
flags &= ~KD_BUTTON_1;
|
|
||||||
break;
|
|
||||||
case BTN_RIGHT:
|
|
||||||
flags &= ~KD_BUTTON_3;
|
|
||||||
break;
|
|
||||||
case BTN_MIDDLE:
|
|
||||||
flags &= ~KD_BUTTON_2;
|
|
||||||
break;
|
|
||||||
case BTN_FORWARD:
|
|
||||||
flags &= ~KD_BUTTON_4;
|
|
||||||
break;
|
|
||||||
case BTN_BACK:
|
|
||||||
flags &= ~KD_BUTTON_5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
|
KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
|
||||||
|
ErrorF("Flags is %x\n", flags);
|
||||||
break;
|
break;
|
||||||
case EV_REL:
|
case EV_REL:
|
||||||
ke->rel[events[i].code] += events[i].value;
|
ke->rel[events[i].code] += events[i].value;
|
||||||
@ -186,12 +166,12 @@ EvdevRead (int evdevPort, void *closure)
|
|||||||
int EvdevInputType;
|
int EvdevInputType;
|
||||||
|
|
||||||
char *kdefaultEvdev[] = {
|
char *kdefaultEvdev[] = {
|
||||||
// "/dev/input/event0",
|
// "/dev/input/event0",
|
||||||
"/dev/input/event1",
|
// "/dev/input/event1",
|
||||||
// "/dev/input/event2",
|
// "/dev/input/event2",
|
||||||
// "/dev/input/event3",
|
// "/dev/input/event3",
|
||||||
// "/dev/input/event4",
|
// "/dev/input/event4",
|
||||||
// "/dev/input/event5",
|
"/dev/input/event5",
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))
|
#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))
|
||||||
@ -497,12 +477,12 @@ EvdevRead1 (int evdevPort, void *closure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *kdefaultEvdev1[] = {
|
char *kdefaultEvdev1[] = {
|
||||||
"/dev/input/event0",
|
// "/dev/input/event0",
|
||||||
// "/dev/input/event1",
|
// "/dev/input/event1",
|
||||||
// "/dev/input/event2",
|
// "/dev/input/event2",
|
||||||
// "/dev/input/event3",
|
"/dev/input/event3",
|
||||||
// "/dev/input/event4",
|
// "/dev/input/event4",
|
||||||
// "/dev/input/event5",
|
// "/dev/input/event5",
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_DEFAULT_EVDEV1 (sizeof (kdefaultEvdev1) / sizeof (kdefaultEvdev1[0]))
|
#define NUM_DEFAULT_EVDEV1 (sizeof (kdefaultEvdev1) / sizeof (kdefaultEvdev1[0]))
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "xgl.h"
|
|
||||||
#include "xegl.h"
|
#include "xegl.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
@ -348,7 +347,7 @@ KdMouseProc(DeviceIntPtr pDevice, int onoff)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
LegalModifier(unsigned int key, DevicePtr pDev)
|
KdLegalModifier(unsigned int key, DevicePtr pDev)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1518,12 +1517,10 @@ KdBlockHandler (int screen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
KdWakeupHandler (int screen,
|
KdWakeupHandler (pointer data,
|
||||||
pointer data,
|
int result,
|
||||||
unsigned long lresult,
|
|
||||||
pointer readmask)
|
pointer readmask)
|
||||||
{
|
{
|
||||||
int result = (int) lresult;
|
|
||||||
fd_set *pReadmask = (fd_set *) readmask;
|
fd_set *pReadmask = (fd_set *) readmask;
|
||||||
int i;
|
int i;
|
||||||
KdMouseInfo *mi;
|
KdMouseInfo *mi;
|
||||||
@ -1555,7 +1552,7 @@ KdWakeupHandler (int screen,
|
|||||||
// kdProcessSwitch ();
|
// kdProcessSwitch ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin))
|
#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv (pScreen)->origin))
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
||||||
@ -1673,7 +1670,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessInputEvents ()
|
KdProcessInputEvents (void)
|
||||||
{
|
{
|
||||||
mieqProcessInputEvents();
|
mieqProcessInputEvents();
|
||||||
miPointerUpdate();
|
miPointerUpdate();
|
||||||
|
14
hw/xgl/egl/module/Makefile.am
Normal file
14
hw/xgl/egl/module/Makefile.am
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
INCLUDES = \
|
||||||
|
@XEGL_INCS@ \
|
||||||
|
@XSERVER_CFLAGS@ \
|
||||||
|
@XEGLSERVER_CFLAGS@
|
||||||
|
|
||||||
|
libxegl_la_LDFLAGS = -avoid-version
|
||||||
|
libxegl_la_SOURCES = xeglmodule.c
|
||||||
|
libxegl_la_LIBADD = \
|
||||||
|
@XEGL_MOD_LIBS@ \
|
||||||
|
@XEGLSERVER_LIBS@
|
||||||
|
|
||||||
|
moduledir = @MODULEPATH@/xgl
|
||||||
|
|
||||||
|
module_LTLIBRARIES = libxegl.la
|
104
hw/xgl/egl/module/xeglmodule.c
Normal file
104
hw/xgl/egl/module/xeglmodule.c
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xglmodule.h"
|
||||||
|
#include "xegl.h"
|
||||||
|
|
||||||
|
#include <glitz-egl.h>
|
||||||
|
|
||||||
|
char *
|
||||||
|
moduleVersion (void)
|
||||||
|
{
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
moduleInit (const char *module)
|
||||||
|
{
|
||||||
|
glitz_egl_init (module);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xeglInitOutput (pScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return xeglLegalModifier (key, pDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessInputEvents (void)
|
||||||
|
{
|
||||||
|
xeglProcessInputEvents ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitInput (int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xeglInitInput (argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("\nXegl usage:\n");
|
||||||
|
xeglUseMsg ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ddxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
return xeglProcessArgument (argc, argv, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortDDX (void)
|
||||||
|
{
|
||||||
|
xeglAbort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxGiveUp (void)
|
||||||
|
{
|
||||||
|
xeglGiveUp ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OsVendorInit (void)
|
||||||
|
{
|
||||||
|
xeglOsVendorInit ();
|
||||||
|
}
|
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include <glitz-egl.h>
|
#include <glitz-egl.h>
|
||||||
|
|
||||||
#include "xgl.h"
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
@ -55,34 +54,10 @@ int xeglScreenPrivateIndex;
|
|||||||
#define XEGL_SCREEN_PRIV(pScreen) \
|
#define XEGL_SCREEN_PRIV(pScreen) \
|
||||||
xeglScreenPtr pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen)
|
xeglScreenPtr pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen)
|
||||||
|
|
||||||
typedef struct _xeglCursor {
|
static EGLDisplay eDisplay;
|
||||||
Cursor cursor;
|
static EGLScreenMESA eScreen;
|
||||||
} xeglCursorRec, *xeglCursorPtr;
|
static ScreenPtr currentScreen = 0;
|
||||||
|
static Bool softCursor = TRUE;
|
||||||
#define XEGL_GET_CURSOR_PRIV(pCursor, pScreen) \
|
|
||||||
((xeglCursorPtr) (pCursor)->devPriv[(pScreen)->myNum])
|
|
||||||
|
|
||||||
#define XEGL_SET_CURSOR_PRIV(pCursor, pScreen, v) \
|
|
||||||
((pCursor)->devPriv[(pScreen)->myNum] = (pointer) v)
|
|
||||||
|
|
||||||
#define XEGL_CURSOR_PRIV(pCursor, pScreen) \
|
|
||||||
xeglCursorPtr pCursorPriv = XEGL_GET_CURSOR_PRIV (pCursor, pScreen)
|
|
||||||
|
|
||||||
char *xDisplayName = NULL;
|
|
||||||
EGLDisplay xdisplay;
|
|
||||||
EGLScreenMESA xscreen;
|
|
||||||
glitz_format_t *xeglCurrentFormat;
|
|
||||||
CARD32 lastEventTime = 0;
|
|
||||||
ScreenPtr currentScreen = NULL;
|
|
||||||
Bool softCursor = TRUE;
|
|
||||||
xglScreenInfoRec xglScreenInfo = {
|
|
||||||
NULL, 0, 0, 0, 0, FALSE,
|
|
||||||
DEFAULT_GEOMETRY_DATA_TYPE,
|
|
||||||
DEFAULT_GEOMETRY_USAGE,
|
|
||||||
FALSE,
|
|
||||||
XGL_DEFAULT_PBO_MASK,
|
|
||||||
FALSE
|
|
||||||
};
|
|
||||||
|
|
||||||
extern miPointerScreenFuncRec kdPointerScreenFuncs;
|
extern miPointerScreenFuncRec kdPointerScreenFuncs;
|
||||||
|
|
||||||
@ -109,189 +84,6 @@ xeglAllocatePrivates (ScreenPtr pScreen)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
xeglConstrainCursor (ScreenPtr pScreen,
|
|
||||||
BoxPtr pBox)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglCursorLimits (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor,
|
|
||||||
BoxPtr pHotBox,
|
|
||||||
BoxPtr pTopLeftBox)
|
|
||||||
{
|
|
||||||
*pTopLeftBox = *pHotBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglDisplayCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
XEGL_SCREEN_PRIV (pScreen);
|
|
||||||
XEGL_CURSOR_PRIV (pCursor, pScreen);
|
|
||||||
|
|
||||||
XDefineCursor (xdisplay, pScreenPriv->win, pCursorPriv->cursor);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglARGBCursorSupport (void);
|
|
||||||
|
|
||||||
static Cursor
|
|
||||||
xeglCreateARGBCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglRealizeCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
xeglCursorPtr pCursorPriv;
|
|
||||||
XImage *ximage;
|
|
||||||
Pixmap source, mask;
|
|
||||||
XColor fgColor, bgColor;
|
|
||||||
GC xgc;
|
|
||||||
unsigned long valuemask;
|
|
||||||
XGCValues values;
|
|
||||||
|
|
||||||
XEGL_SCREEN_PRIV (pScreen);
|
|
||||||
|
|
||||||
valuemask = GCForeground | GCBackground;
|
|
||||||
|
|
||||||
values.foreground = 1L;
|
|
||||||
values.background = 0L;
|
|
||||||
|
|
||||||
pCursorPriv = xalloc (sizeof (xeglCursorRec));
|
|
||||||
if (!pCursorPriv)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
XEGL_SET_CURSOR_PRIV (pCursor, pScreen, pCursorPriv);
|
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
if (pCursor->bits->argb)
|
|
||||||
{
|
|
||||||
pCursorPriv->cursor = xeglCreateARGBCursor (pScreen, pCursor);
|
|
||||||
if (pCursorPriv->cursor)
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
source = XCreatePixmap (xdisplay,
|
|
||||||
pScreenPriv->win,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
1);
|
|
||||||
|
|
||||||
mask = XCreatePixmap (xdisplay,
|
|
||||||
pScreenPriv->win,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
1);
|
|
||||||
|
|
||||||
xgc = XCreateGC (xdisplay, source, valuemask, &values);
|
|
||||||
|
|
||||||
ximage = XCreateImage (xdisplay,
|
|
||||||
DefaultVisual (xdisplay, xscreen),
|
|
||||||
1, XYBitmap, 0,
|
|
||||||
(char *) pCursor->bits->source,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
BitmapPad (xdisplay), 0);
|
|
||||||
|
|
||||||
XPutImage (xdisplay, source, xgc, ximage,
|
|
||||||
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
|
|
||||||
|
|
||||||
XFree (ximage);
|
|
||||||
|
|
||||||
ximage = XCreateImage (xdisplay,
|
|
||||||
DefaultVisual (xdisplay, xscreen),
|
|
||||||
1, XYBitmap, 0,
|
|
||||||
(char *) pCursor->bits->mask,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
BitmapPad (xdisplay), 0);
|
|
||||||
|
|
||||||
XPutImage (xdisplay, mask, xgc, ximage,
|
|
||||||
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
|
|
||||||
|
|
||||||
XFree (ximage);
|
|
||||||
XFreeGC (xdisplay, xgc);
|
|
||||||
|
|
||||||
fgColor.red = pCursor->foreRed;
|
|
||||||
fgColor.green = pCursor->foreGreen;
|
|
||||||
fgColor.blue = pCursor->foreBlue;
|
|
||||||
|
|
||||||
bgColor.red = pCursor->backRed;
|
|
||||||
bgColor.green = pCursor->backGreen;
|
|
||||||
bgColor.blue = pCursor->backBlue;
|
|
||||||
|
|
||||||
pCursorPriv->cursor =
|
|
||||||
XCreatePixmapCursor (xdisplay, source, mask, &fgColor, &bgColor,
|
|
||||||
pCursor->bits->xhot, pCursor->bits->yhot);
|
|
||||||
|
|
||||||
XFreePixmap (xdisplay, mask);
|
|
||||||
XFreePixmap (xdisplay, source);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglUnrealizeCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
XEGL_CURSOR_PRIV (pCursor, pScreen);
|
|
||||||
|
|
||||||
XFreeCursor (xdisplay, pCursorPriv->cursor);
|
|
||||||
xfree (pCursorPriv);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglRecolorCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor,
|
|
||||||
Bool displayed)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
XColor fgColor, bgColor;
|
|
||||||
|
|
||||||
XEGL_CURSOR_PRIV (pCursor, pScreen);
|
|
||||||
|
|
||||||
fgColor.red = pCursor->foreRed;
|
|
||||||
fgColor.green = pCursor->foreGreen;
|
|
||||||
fgColor.blue = pCursor->foreBlue;
|
|
||||||
|
|
||||||
bgColor.red = pCursor->backRed;
|
|
||||||
bgColor.green = pCursor->backGreen;
|
|
||||||
bgColor.blue = pCursor->backBlue;
|
|
||||||
|
|
||||||
XRecolorCursor (xdisplay, pCursorPriv->cursor, &fgColor, &bgColor);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglSetCursorPosition (ScreenPtr pScreen,
|
|
||||||
int x,
|
|
||||||
int y,
|
|
||||||
Bool generateEvent)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
XEGL_SCREEN_PRIV (pScreen);
|
|
||||||
|
|
||||||
XWarpPointer (xdisplay, pScreenPriv->win, pScreenPriv->win,
|
|
||||||
0, 0, 0, 0, x, y);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xeglCloseScreen (int index,
|
xeglCloseScreen (int index,
|
||||||
ScreenPtr pScreen)
|
ScreenPtr pScreen)
|
||||||
@ -305,126 +97,20 @@ xeglCloseScreen (int index,
|
|||||||
glitz_drawable_destroy (drawable);
|
glitz_drawable_destroy (drawable);
|
||||||
|
|
||||||
xglClearVisualTypes ();
|
xglClearVisualTypes ();
|
||||||
#if 0
|
|
||||||
if (pScreenPriv->win)
|
|
||||||
XDestroyWindow (xdisplay, pScreenPriv->win);
|
|
||||||
|
|
||||||
if (pScreenPriv->colormap)
|
|
||||||
XFreeColormap (xdisplay, pScreenPriv->colormap);
|
|
||||||
#endif
|
|
||||||
XGL_SCREEN_UNWRAP (CloseScreen);
|
XGL_SCREEN_UNWRAP (CloseScreen);
|
||||||
xfree (pScreenPriv);
|
xfree (pScreenPriv);
|
||||||
|
|
||||||
return (*pScreen->CloseScreen) (index, pScreen);
|
return (*pScreen->CloseScreen) (index, pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglCrossScreen (ScreenPtr pScreen, Bool entering)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglWarpCursor (ScreenPtr pScreen, int x, int y)
|
|
||||||
{
|
|
||||||
miPointerWarpCursor (pScreen, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
miPointerScreenFuncRec xeglPointerScreenFuncs = {
|
|
||||||
xeglCursorOffScreen,
|
|
||||||
xeglCrossScreen,
|
|
||||||
xeglWarpCursor
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglMoveCursor(ScreenPtr pScreen, int x, int y)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define FB_CUR_SETIMAGE 0x01
|
|
||||||
#define FB_CUR_SETPOS 0x02
|
|
||||||
#define FB_CUR_SETHOT 0x04
|
|
||||||
#define FB_CUR_SETCMAP 0x08
|
|
||||||
#define FB_CUR_SETSHAPE 0x10
|
|
||||||
#define FB_CUR_SETSIZE 0x20
|
|
||||||
#define FB_CUR_SETALL 0xFF
|
|
||||||
|
|
||||||
struct fbcurpos {
|
|
||||||
unsigned short x, y;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct fb_cmap_user {
|
|
||||||
unsigned long start; /* First entry */
|
|
||||||
unsigned long len; /* Number of entries */
|
|
||||||
unsigned short *red; /* Red values */
|
|
||||||
unsigned short *green;
|
|
||||||
unsigned short *blue;
|
|
||||||
unsigned short *transp; /* transparency, can be NULL */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct fb_image_user {
|
|
||||||
unsigned long dx; /* Where to place image */
|
|
||||||
unsigned long dy;
|
|
||||||
unsigned long width; /* Size of image */
|
|
||||||
unsigned long height;
|
|
||||||
unsigned long fg_color; /* Only used when a mono bitmap */
|
|
||||||
unsigned long bg_color;
|
|
||||||
unsigned char depth; /* Depth of the image */
|
|
||||||
const char *data; /* Pointer to image data */
|
|
||||||
struct fb_cmap_user cmap; /* color map info */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct fb_cursor_user {
|
|
||||||
unsigned short set; /* what to set */
|
|
||||||
unsigned short enable; /* cursor on/off */
|
|
||||||
unsigned short rop; /* bitop operation */
|
|
||||||
const char *mask; /* cursor mask bits */
|
|
||||||
struct fbcurpos hot; /* cursor hot spot */
|
|
||||||
struct fb_image_user image; /* Cursor image */
|
|
||||||
};
|
|
||||||
#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user)
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
int fd, err;
|
|
||||||
struct fb_cursor_user cursor;
|
|
||||||
|
|
||||||
fd = open("/dev/fb0", O_RDWR);
|
|
||||||
memset(&cursor, 0, sizeof(cursor));
|
|
||||||
cursor.set = FB_CUR_SETPOS;
|
|
||||||
cursor.image.dx = 50;
|
|
||||||
cursor.image.dy = 50;
|
|
||||||
cursor.enable = 1;
|
|
||||||
err = ioctl(fd, FBIO_CURSOR, &cursor);
|
|
||||||
err = errno;
|
|
||||||
printf("errno %d\n", err);
|
|
||||||
close(fd);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
miPointerSpriteFuncRec eglPointerSpriteFuncs = {
|
|
||||||
xeglRealizeCursor,
|
|
||||||
xeglUnrealizeCursor,
|
|
||||||
xeglSetCursor,
|
|
||||||
xeglMoveCursor,
|
|
||||||
};
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xeglScreenInit (int index,
|
xeglScreenInit (int index,
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
int argc,
|
int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
EGLSurface screen_surf;
|
EGLSurface eSurface;
|
||||||
EGLModeMESA mode;
|
EGLModeMESA mode;
|
||||||
int count;
|
int count;
|
||||||
xeglScreenPtr pScreenPriv;
|
xeglScreenPtr pScreenPriv;
|
||||||
@ -448,94 +134,54 @@ xeglScreenInit (int index,
|
|||||||
|
|
||||||
pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen);
|
pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen);
|
||||||
|
|
||||||
if (xglScreenInfo.fullscreen)
|
if (xglScreenInfo.width == 0 || xglScreenInfo.height == 0)
|
||||||
{
|
|
||||||
// xglScreenInfo.width = DisplayWidth (xdisplay, xscreen);
|
|
||||||
// xglScreenInfo.height = DisplayHeight (xdisplay, xscreen);
|
|
||||||
// xglScreenInfo.widthMm = DisplayWidthMM (xdisplay, xscreen);
|
|
||||||
// xglScreenInfo.heightMm = DisplayHeightMM (xdisplay, xscreen);
|
|
||||||
}
|
|
||||||
else if (xglScreenInfo.width == 0 || xglScreenInfo.height == 0)
|
|
||||||
{
|
{
|
||||||
xglScreenInfo.width = XEGL_DEFAULT_SCREEN_WIDTH;
|
xglScreenInfo.width = XEGL_DEFAULT_SCREEN_WIDTH;
|
||||||
xglScreenInfo.height = XEGL_DEFAULT_SCREEN_HEIGHT;
|
xglScreenInfo.height = XEGL_DEFAULT_SCREEN_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
eglGetModesMESA(xdisplay, xscreen, &mode, 1, &count);
|
eglGetModesMESA (eDisplay, eScreen, &mode, 1, &count);
|
||||||
screen_surf = eglCreateScreenSurfaceMESA(xdisplay, format->id, screenAttribs);
|
|
||||||
if (screen_surf == EGL_NO_SURFACE) {
|
eSurface = eglCreateScreenSurfaceMESA (eDisplay, format->id, screenAttribs);
|
||||||
printf("failed to create screen surface\n");
|
if (eSurface == EGL_NO_SURFACE)
|
||||||
|
{
|
||||||
|
ErrorF ("failed to create screen surface\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
eglShowSurfaceMESA(xdisplay, xscreen, screen_surf, mode);
|
eglShowSurfaceMESA (eDisplay, eScreen, eSurface, mode);
|
||||||
|
|
||||||
drawable = glitz_egl_create_surface (xdisplay, xscreen, format, screen_surf,
|
drawable = glitz_egl_create_surface (eDisplay, eScreen, format, eSurface,
|
||||||
xglScreenInfo.width, xglScreenInfo.height);
|
xglScreenInfo.width,
|
||||||
|
xglScreenInfo.height);
|
||||||
if (!drawable)
|
if (!drawable)
|
||||||
{
|
{
|
||||||
ErrorF ("[%d] couldn't create glitz drawable for window\n", index);
|
ErrorF ("[%d] couldn't create glitz drawable for window\n", index);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XSelectInput (xdisplay, pScreenPriv->win, ExposureMask);
|
|
||||||
// XMapWindow (xdisplay, pScreenPriv->win);
|
|
||||||
|
|
||||||
if (xglScreenInfo.fullscreen)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
XClientMessageEvent xev;
|
|
||||||
|
|
||||||
memset (&xev, 0, sizeof (xev));
|
|
||||||
|
|
||||||
xev.type = ClientMessage;
|
|
||||||
xev.message_type = XInternAtom (xdisplay, "_NET_WM_STATE", FALSE);
|
|
||||||
xev.display = xdisplay;
|
|
||||||
xev.window = pScreenPriv->win;
|
|
||||||
xev.format = 32;
|
|
||||||
xev.data.l[0] = 1;
|
|
||||||
xev.data.l[1] =
|
|
||||||
XInternAtom (xdisplay, "_NET_WM_STATE_FULLSCREEN", FALSE);
|
|
||||||
|
|
||||||
XSendEvent (xdisplay, root, FALSE, SubstructureRedirectMask,
|
|
||||||
(XEvent *) &xev);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
xglScreenInfo.drawable = drawable;
|
xglScreenInfo.drawable = drawable;
|
||||||
|
|
||||||
if (!xglScreenInit (pScreen, &xglScreenInfo))
|
if (!xglScreenInit (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (!xglInitVisualConfigs (pScreen))
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
XGL_SCREEN_WRAP (CloseScreen, xeglCloseScreen);
|
XGL_SCREEN_WRAP (CloseScreen, xeglCloseScreen);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
miDCInitialize (pScreen, &kdPointerScreenFuncs);
|
||||||
if (!xeglARGBCursorSupport ())
|
|
||||||
softCursor = TRUE;
|
|
||||||
#endif
|
|
||||||
miDCInitialize (pScreen, &xeglPointerScreenFuncs);
|
|
||||||
miCreateDefColormap (pScreen);
|
|
||||||
|
|
||||||
// miPointerInitialize(pScreen, &eglPointerSpriteFuncs,
|
|
||||||
// &kdPointerScreenFuncs, FALSE);
|
|
||||||
|
|
||||||
if (!xglFinishScreenInit (pScreen))
|
if (!xglFinishScreenInit (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// while (XNextEvent (xdisplay, &xevent))
|
|
||||||
// if (xevent.type == Expose)
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// XSelectInput (xdisplay, pScreenPriv->win,
|
|
||||||
// ButtonPressMask | ButtonReleaseMask |
|
|
||||||
// KeyPressMask | KeyReleaseMask | EnterWindowMask |
|
|
||||||
// PointerMotionMask);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitOutput (ScreenInfo *pScreenInfo,
|
xeglInitOutput (ScreenInfo *pScreenInfo,
|
||||||
int argc,
|
int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
@ -545,17 +191,14 @@ InitOutput (ScreenInfo *pScreenInfo,
|
|||||||
|
|
||||||
xglSetPixmapFormats (pScreenInfo);
|
xglSetPixmapFormats (pScreenInfo);
|
||||||
|
|
||||||
if (!xdisplay)
|
if (!eDisplay)
|
||||||
{
|
{
|
||||||
xdisplay = eglGetDisplay(":0");
|
eDisplay = eglGetDisplay ("!fb_dri");
|
||||||
assert(xdisplay);
|
|
||||||
|
|
||||||
if (!eglInitialize(xdisplay, &maj, &min))
|
if (!eglInitialize (eDisplay, &maj, &min))
|
||||||
FatalError ("can't open display");
|
FatalError ("can't open display");
|
||||||
|
|
||||||
eglGetScreensMESA(xdisplay, &xscreen, 1, &count);
|
eglGetScreensMESA (eDisplay, &eScreen, 1, &count);
|
||||||
|
|
||||||
glitz_egl_init (NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
templ.samples = 1;
|
templ.samples = 1;
|
||||||
@ -564,7 +207,7 @@ InitOutput (ScreenInfo *pScreenInfo,
|
|||||||
|
|
||||||
mask = GLITZ_FORMAT_SAMPLES_MASK;
|
mask = GLITZ_FORMAT_SAMPLES_MASK;
|
||||||
|
|
||||||
format = glitz_egl_find_config (xdisplay, xscreen,
|
format = glitz_egl_find_config (eDisplay, eScreen,
|
||||||
mask, &templ, 0);
|
mask, &templ, 0);
|
||||||
|
|
||||||
if (!format)
|
if (!format)
|
||||||
@ -589,105 +232,52 @@ xeglBlockHandler (pointer blockData,
|
|||||||
|
|
||||||
glitz_surface_flush (pScreenPriv->surface);
|
glitz_surface_flush (pScreenPriv->surface);
|
||||||
glitz_drawable_finish (pScreenPriv->drawable);
|
glitz_drawable_finish (pScreenPriv->drawable);
|
||||||
|
|
||||||
// XSync (xdisplay, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
xeglWakeupHandler (pointer blockData,
|
|
||||||
int result,
|
|
||||||
pointer pReadMask)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
ScreenPtr pScreen = currentScreen;
|
|
||||||
XEvent X;
|
|
||||||
xEvent x;
|
|
||||||
|
|
||||||
while (XPending (xdisplay)) {
|
|
||||||
XNextEvent (xdisplay, &X);
|
|
||||||
|
|
||||||
switch (X.type) {
|
|
||||||
case KeyPress:
|
|
||||||
x.u.u.type = KeyPress;
|
|
||||||
x.u.u.detail = X.xkey.keycode;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis ();
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
break;
|
|
||||||
case KeyRelease:
|
|
||||||
x.u.u.type = KeyRelease;
|
|
||||||
x.u.u.detail = X.xkey.keycode;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis ();
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
break;
|
|
||||||
case ButtonPress:
|
|
||||||
x.u.u.type = ButtonPress;
|
|
||||||
x.u.u.detail = X.xbutton.button;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis ();
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
break;
|
|
||||||
case ButtonRelease:
|
|
||||||
x.u.u.type = ButtonRelease;
|
|
||||||
x.u.u.detail = X.xbutton.button;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis ();
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
break;
|
|
||||||
case MotionNotify:
|
|
||||||
x.u.u.type = MotionNotify;
|
|
||||||
x.u.keyButtonPointer.rootX = X.xmotion.x;
|
|
||||||
x.u.keyButtonPointer.rootY = X.xmotion.y;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis ();
|
|
||||||
miPointerAbsoluteCursor (X.xmotion.x, X.xmotion.y, lastEventTime);
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
break;
|
|
||||||
case EnterNotify:
|
|
||||||
if (X.xcrossing.detail != NotifyInferior) {
|
|
||||||
if (pScreen) {
|
|
||||||
NewCurrentScreen (pScreen, X.xcrossing.x, X.xcrossing.y);
|
|
||||||
x.u.u.type = MotionNotify;
|
|
||||||
x.u.keyButtonPointer.rootX = X.xcrossing.x;
|
|
||||||
x.u.keyButtonPointer.rootY = X.xcrossing.y;
|
|
||||||
x.u.keyButtonPointer.time = lastEventTime =
|
|
||||||
GetTimeInMillis ();
|
|
||||||
mieqEnqueue (&x);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitInput (int argc, char **argv)
|
xeglInitInput (int argc,
|
||||||
|
char **argv)
|
||||||
{
|
{
|
||||||
eglInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
|
eglInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
|
||||||
RegisterBlockAndWakeupHandlers (xeglBlockHandler,
|
RegisterBlockAndWakeupHandlers (xeglBlockHandler, KdWakeupHandler, NULL);
|
||||||
KdWakeupHandler,
|
}
|
||||||
NULL);
|
|
||||||
|
Bool
|
||||||
|
xeglLegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return KdLegalModifier (key, pDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ddxUseMsg (void)
|
xeglProcessInputEvents (void)
|
||||||
{
|
{
|
||||||
ErrorF ("\nXegl usage:\n");
|
KdProcessInputEvents ();
|
||||||
ErrorF ("-display string display name of the real server\n");
|
}
|
||||||
ErrorF ("-softcursor force software cursor\n");
|
|
||||||
|
|
||||||
xglUseMsg ();
|
void
|
||||||
|
xeglUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM] "
|
||||||
|
"specify screen characteristics\n");
|
||||||
|
ErrorF ("-softcursor force software cursor\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ddxProcessArgument (int argc, char **argv, int i)
|
xeglProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
{
|
{
|
||||||
if (!strcmp (argv[i], "-display"))
|
if (!strcmp (argv[i], "-screen"))
|
||||||
{
|
{
|
||||||
if (++i < argc) {
|
if ((i + 1) < argc)
|
||||||
xDisplayName = argv[i];
|
{
|
||||||
return 2;
|
xglParseScreen (argv[i + 1]);
|
||||||
}
|
}
|
||||||
return 0;
|
else
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
else if (!strcmp (argv[i], "-softcursor"))
|
else if (!strcmp (argv[i], "-softcursor"))
|
||||||
{
|
{
|
||||||
@ -695,90 +285,21 @@ ddxProcessArgument (int argc, char **argv, int i)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xglProcessArgument (&xglScreenInfo, argc, argv, i);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AbortDDX (void)
|
xeglAbort (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ddxGiveUp ()
|
xeglGiveUp (void)
|
||||||
{
|
{
|
||||||
AbortDDX ();
|
AbortDDX ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OsVendorInit (void)
|
xeglOsVendorInit (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
|
||||||
|
|
||||||
//#include <X11/extensions/Xrender.h>
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xeglARGBCursorSupport (void)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
int renderMajor, renderMinor;
|
|
||||||
|
|
||||||
if (!XRenderQueryVersion (xdisplay, &renderMajor, &renderMinor))
|
|
||||||
renderMajor = renderMinor = -1;
|
|
||||||
|
|
||||||
return (renderMajor > 0 || renderMinor > 4);
|
|
||||||
#endif
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Cursor
|
|
||||||
xeglCreateARGBCursor (ScreenPtr pScreen,
|
|
||||||
CursorPtr pCursor)
|
|
||||||
{
|
|
||||||
Cursor cursor;
|
|
||||||
#if 0
|
|
||||||
Pixmap xpixmap;
|
|
||||||
GC xgc;
|
|
||||||
XImage *ximage;
|
|
||||||
XRenderPictFormat *xformat;
|
|
||||||
Picture xpicture;
|
|
||||||
|
|
||||||
XEGL_SCREEN_PRIV (pScreen);
|
|
||||||
|
|
||||||
xpixmap = XCreatePixmap (xdisplay,
|
|
||||||
pScreenPriv->win,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
32);
|
|
||||||
|
|
||||||
xgc = XCreateGC (xdisplay, xpixmap, 0, NULL);
|
|
||||||
|
|
||||||
ximage = XCreateImage (xdisplay,
|
|
||||||
DefaultVisual (xdisplay, xscreen),
|
|
||||||
32, ZPixmap, 0,
|
|
||||||
(char *) pCursor->bits->argb,
|
|
||||||
pCursor->bits->width,
|
|
||||||
pCursor->bits->height,
|
|
||||||
32, pCursor->bits->width * 4);
|
|
||||||
|
|
||||||
XPutImage (xdisplay, xpixmap, xgc, ximage,
|
|
||||||
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
|
|
||||||
|
|
||||||
XFree (ximage);
|
|
||||||
XFreeGC (xdisplay, xgc);
|
|
||||||
|
|
||||||
xformat = XRenderFindStandardFormat (xdisplay, PictStandardARGB32);
|
|
||||||
xpicture = XRenderCreatePicture (xdisplay, xpixmap, xformat, 0, 0);
|
|
||||||
|
|
||||||
cursor = XRenderCreateCursor (xdisplay, xpicture,
|
|
||||||
pCursor->bits->xhot,
|
|
||||||
pCursor->bits->yhot);
|
|
||||||
|
|
||||||
XRenderFreePicture (xdisplay, xpicture);
|
|
||||||
XFreePixmap (xdisplay, xpixmap);
|
|
||||||
#endif
|
|
||||||
return cursor;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _XEGL_H_
|
||||||
|
#define _XEGL_H_
|
||||||
|
|
||||||
|
#include "xgl.h"
|
||||||
|
|
||||||
#include "randrstr.h"
|
#include "randrstr.h"
|
||||||
|
|
||||||
#define KD_BUTTON_1 0x01
|
#define KD_BUTTON_1 0x01
|
||||||
@ -34,7 +64,7 @@ typedef struct _KdMouseMatrix {
|
|||||||
int matrix[2][3];
|
int matrix[2][3];
|
||||||
} KdMouseMatrix;
|
} KdMouseMatrix;
|
||||||
|
|
||||||
typedef enum _kdMouseState {
|
typedef enum _KdMouseState {
|
||||||
start,
|
start,
|
||||||
button_1_pend,
|
button_1_pend,
|
||||||
button_1_down,
|
button_1_down,
|
||||||
@ -69,63 +99,116 @@ typedef struct _KdMouseInfo {
|
|||||||
Bool transformCoordinates;
|
Bool transformCoordinates;
|
||||||
} KdMouseInfo;
|
} KdMouseInfo;
|
||||||
|
|
||||||
typedef struct _KdScreenInfo {
|
|
||||||
struct _KdScreenInfo *next;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
void *driver;
|
|
||||||
Rotation randr; /* rotation and reflection */
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int rate;
|
|
||||||
int width_mm;
|
|
||||||
int height_mm;
|
|
||||||
int subpixel_order;
|
|
||||||
Bool dumb;
|
|
||||||
Bool softCursor;
|
|
||||||
int mynum;
|
|
||||||
DDXPointRec origin;
|
|
||||||
} KdScreenInfo;
|
|
||||||
|
|
||||||
#define KD_MAX_FB 2
|
|
||||||
#define KD_MAX_PSEUDO_DEPTH 8
|
|
||||||
#define KD_MAX_PSEUDO_SIZE (1 << KD_MAX_PSEUDO_DEPTH)
|
|
||||||
|
|
||||||
typedef struct _xeglScreen {
|
typedef struct _xeglScreen {
|
||||||
Window win;
|
|
||||||
Colormap colormap;
|
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
KdScreenInfo *screen;
|
ScreenPtr pScreen;
|
||||||
ColormapPtr pInstalledmap[KD_MAX_FB]; /* current colormap */
|
DDXPointRec origin;
|
||||||
} xeglScreenRec, *xeglScreenPtr;
|
} xeglScreenRec, *xeglScreenPtr;
|
||||||
|
|
||||||
extern KdMouseInfo *kdMouseInfo;
|
extern KdMouseInfo *kdMouseInfo;
|
||||||
extern KdOsFuncs *kdOsFuncs;
|
extern KdOsFuncs *kdOsFuncs;
|
||||||
extern Bool kdDontZap;
|
extern Bool kdDontZap;
|
||||||
extern Bool kdDisableZaphod;
|
extern Bool kdDisableZaphod;
|
||||||
extern int kdScreenPrivateIndex;
|
extern int xeglScreenPrivateIndex;
|
||||||
extern KdMouseFuncs LinuxEvdevMouseFuncs;
|
extern KdMouseFuncs LinuxEvdevMouseFuncs;
|
||||||
extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs;
|
extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs;
|
||||||
|
|
||||||
#define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
|
#define RR_Rotate_All \
|
||||||
#define RR_Reflect_All (RR_Reflect_X|RR_Reflect_Y)
|
(RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)
|
||||||
|
#define RR_Reflect_All (RR_Reflect_X | RR_Reflect_Y)
|
||||||
|
|
||||||
#define KdGetScreenPriv(pScreen) ((xeglScreenPtr) \
|
#define KdGetScreenPriv(pScreen) \
|
||||||
(pScreen)->devPrivates[kdScreenPrivateIndex].ptr)
|
((xeglScreenPtr) ((pScreen)->devPrivates[xeglScreenPrivateIndex].ptr))
|
||||||
#define KdScreenPriv(pScreen) xeglScreenPtr pScreenPriv = KdGetScreenPriv(pScreen)
|
#define KdScreenPriv(pScreen) \
|
||||||
|
xeglScreenPtr pScreenPriv = KdGetScreenPriv (pScreen)
|
||||||
|
|
||||||
extern void eglInitInput(KdMouseFuncs *pMouseFuncs, KdKeyboardFuncs *pKeyboardFuncs);
|
void
|
||||||
extern void KdParseMouse(char *arg);
|
eglInitInput (KdMouseFuncs *pMouseFuncs,
|
||||||
extern KdMouseInfo *KdMouseInfoAdd(void);
|
KdKeyboardFuncs *pKeyboardFuncs);
|
||||||
extern void KdMouseInfoDispose(KdMouseInfo *mi);
|
|
||||||
extern int KdAllocInputType(void);
|
|
||||||
extern char *KdSaveString (char *str);
|
|
||||||
extern Bool KdRegisterFd(int type, int fd, void (*read) (int fd, void *closure), void *closure);
|
|
||||||
extern void KdUnregisterFds(int type, Bool do_close);
|
|
||||||
extern void KdEnqueueKeyboardEvent(unsigned char scan_code, unsigned char is_up);
|
|
||||||
extern void KdEnqueueMouseEvent(KdMouseInfo *mi, unsigned long flags, int rx, int ry);
|
|
||||||
extern void KdRegisterFdEnableDisable(int fd,
|
|
||||||
int (*enable)(int fd, void *closure),
|
|
||||||
void (*disable)(int fd, void *closure));
|
|
||||||
extern void KdWakeupHandler(int screen, pointer data, unsigned long lresult, pointer readmask);
|
|
||||||
|
|
||||||
|
void
|
||||||
|
KdParseMouse (char *arg);
|
||||||
|
|
||||||
|
KdMouseInfo *
|
||||||
|
KdMouseInfoAdd (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdMouseInfoDispose (KdMouseInfo *mi);
|
||||||
|
|
||||||
|
int
|
||||||
|
KdAllocInputType (void);
|
||||||
|
|
||||||
|
char *
|
||||||
|
KdSaveString (char *str);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
KdRegisterFd (int type,
|
||||||
|
int fd,
|
||||||
|
void (*read) (int fd, void *closure),
|
||||||
|
void *closure);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdUnregisterFds (int type,
|
||||||
|
Bool do_close);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdEnqueueKeyboardEvent (unsigned char scan_code,
|
||||||
|
unsigned char is_up);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdEnqueueMouseEvent (KdMouseInfo *mi,
|
||||||
|
unsigned long flags,
|
||||||
|
int rx,
|
||||||
|
int ry);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdRegisterFdEnableDisable (int fd,
|
||||||
|
int (*enable) (int fd, void *closure),
|
||||||
|
void (*disable) (int fd, void *closure));
|
||||||
|
|
||||||
|
void
|
||||||
|
KdWakeupHandler (pointer data,
|
||||||
|
int result,
|
||||||
|
pointer readmask);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
KdLegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev);
|
||||||
|
|
||||||
|
void
|
||||||
|
KdProcessInputEvents (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglInitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xeglLegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglProcessInputEvents (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglInitInput (int argc,
|
||||||
|
char **argv);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglUseMsg (void);
|
||||||
|
|
||||||
|
int
|
||||||
|
xeglProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglAbort (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglGiveUp (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xeglOsVendorInit (void);
|
||||||
|
|
||||||
|
#endif /* _XEGL_H_ */
|
||||||
|
131
hw/xgl/egl/xeglinit.c
Normal file
131
hw/xgl/egl/xeglinit.c
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2004 David Reveman
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* David Reveman not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* David Reveman makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL DAVID REVEMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||||
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xegl.h"
|
||||||
|
|
||||||
|
static xglScreenInfoRec xglScreenInfo = {
|
||||||
|
NULL, 0, 0, 0, 0,
|
||||||
|
DEFAULT_GEOMETRY_DATA_TYPE,
|
||||||
|
DEFAULT_GEOMETRY_USAGE,
|
||||||
|
FALSE,
|
||||||
|
XGL_DEFAULT_PBO_MASK,
|
||||||
|
FALSE,
|
||||||
|
FALSE
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
static Bool loadGlx = TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
InitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (loadGlx)
|
||||||
|
{
|
||||||
|
if (!xglLoadGLXModules ())
|
||||||
|
FatalError ("No GLX modules loaded");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
xeglInitOutput (pScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return xeglLegalModifier (key, pDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessInputEvents (void)
|
||||||
|
{
|
||||||
|
xeglProcessInputEvents ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitInput (int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xeglInitInput (argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("\nXgl usage:\n");
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
ErrorF ("-noglx don't load glx extension\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
xglUseMsg ();
|
||||||
|
ErrorF ("\nXegl usage:\n");
|
||||||
|
xeglUseMsg ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ddxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
int skip;
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (!strcmp (argv[i], "-noglx"))
|
||||||
|
{
|
||||||
|
loadGlx = FALSE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
skip = xglProcessArgument (argc, argv, i);
|
||||||
|
if (skip)
|
||||||
|
return skip;
|
||||||
|
|
||||||
|
return xeglProcessArgument (argc, argv, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortDDX (void)
|
||||||
|
{
|
||||||
|
xeglAbort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxGiveUp (void)
|
||||||
|
{
|
||||||
|
xeglGiveUp ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OsVendorInit (void)
|
||||||
|
{
|
||||||
|
xeglOsVendorInit ();
|
||||||
|
}
|
@ -1,16 +1,33 @@
|
|||||||
|
if XGLSERVER
|
||||||
|
MODULE_SUBDIRS = module
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
. \
|
||||||
|
$(MODULE_SUBDIRS)
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
@XGL_INCS@ \
|
@XGLX_INCS@ \
|
||||||
@XSERVER_CFLAGS@ \
|
@XSERVER_CFLAGS@ \
|
||||||
|
@XGLSERVER_CFLAGS@ \
|
||||||
@XGLXSERVER_CFLAGS@
|
@XGLXSERVER_CFLAGS@
|
||||||
|
|
||||||
bin_PROGRAMS = Xglx
|
noinst_LTLIBRARIES = libxglx.la
|
||||||
|
|
||||||
Xglx_SOURCES = xglx.c
|
libxglx_la_SOURCES = \
|
||||||
|
xglx.h \
|
||||||
|
xglx.c
|
||||||
|
|
||||||
|
if XGLXSERVER
|
||||||
|
Xglx_DEPENDENCIES = @XGLX_LIBS@
|
||||||
|
Xglx_LDFLAGS = -export-dynamic
|
||||||
|
Xglx_SOURCES = xglxinit.c
|
||||||
Xglx_LDADD = \
|
Xglx_LDADD = \
|
||||||
@XGL_LIBS@ \
|
@XGLX_LIBS@ \
|
||||||
@XSERVER_LIBS@ \
|
@XSERVER_LIBS@ \
|
||||||
|
@XGLSERVER_LIBS@ \
|
||||||
@XGLXSERVER_LIBS@
|
@XGLXSERVER_LIBS@
|
||||||
|
Xglx_programs = Xglx
|
||||||
|
endif
|
||||||
|
|
||||||
Xglx_DEPENDENCIES = @XGL_LIBS@
|
bin_PROGRAMS = $(Xglx_programs)
|
||||||
|
|
||||||
|
14
hw/xgl/glx/module/Makefile.am
Normal file
14
hw/xgl/glx/module/Makefile.am
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
INCLUDES = \
|
||||||
|
@XGLX_INCS@ \
|
||||||
|
@XSERVER_CFLAGS@ \
|
||||||
|
@XGLXSERVER_CFLAGS@
|
||||||
|
|
||||||
|
libxglx_la_LDFLAGS = -avoid-version
|
||||||
|
libxglx_la_SOURCES = xglxmodule.c
|
||||||
|
libxglx_la_LIBADD = \
|
||||||
|
@XGLX_MOD_LIBS@ \
|
||||||
|
@XGLXSERVER_LIBS@
|
||||||
|
|
||||||
|
moduledir = @MODULEPATH@/xgl
|
||||||
|
|
||||||
|
module_LTLIBRARIES = libxglx.la
|
104
hw/xgl/glx/module/xglxmodule.c
Normal file
104
hw/xgl/glx/module/xglxmodule.c
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xglx.h"
|
||||||
|
#include "xglmodule.h"
|
||||||
|
|
||||||
|
#include <glitz-glx.h>
|
||||||
|
|
||||||
|
char *
|
||||||
|
moduleVersion (void)
|
||||||
|
{
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
moduleInit (const char *module)
|
||||||
|
{
|
||||||
|
glitz_glx_init (module);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xglxInitOutput (pScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return xglxLegalModifier (key, pDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessInputEvents (void)
|
||||||
|
{
|
||||||
|
xglxProcessInputEvents ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitInput (int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xglxInitInput (argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("\nXglx usage:\n");
|
||||||
|
xglxUseMsg ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ddxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
return xglxProcessArgument (argc, argv, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortDDX (void)
|
||||||
|
{
|
||||||
|
xglxAbort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxGiveUp (void)
|
||||||
|
{
|
||||||
|
xglxGiveUp ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OsVendorInit (void)
|
||||||
|
{
|
||||||
|
xglxOsVendorInit ();
|
||||||
|
}
|
@ -27,7 +27,12 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <glitz-glx.h>
|
#include <glitz-glx.h>
|
||||||
|
|
||||||
#include "xgl.h"
|
#include "xglx.h"
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
#include "xglglxext.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
@ -72,21 +77,13 @@ typedef struct _xglxCursor {
|
|||||||
#define XGLX_CURSOR_PRIV(pCursor, pScreen) \
|
#define XGLX_CURSOR_PRIV(pCursor, pScreen) \
|
||||||
xglxCursorPtr pCursorPriv = XGLX_GET_CURSOR_PRIV (pCursor, pScreen)
|
xglxCursorPtr pCursorPriv = XGLX_GET_CURSOR_PRIV (pCursor, pScreen)
|
||||||
|
|
||||||
char *xDisplayName = NULL;
|
static char *xDisplayName = 0;
|
||||||
Display *xdisplay = NULL;
|
static Display *xdisplay = 0;
|
||||||
int xscreen;
|
static int xscreen;
|
||||||
glitz_format_t *xglxCurrentFormat;
|
static CARD32 lastEventTime = 0;
|
||||||
CARD32 lastEventTime = 0;
|
static ScreenPtr currentScreen = 0;
|
||||||
ScreenPtr currentScreen = NULL;
|
static Bool softCursor = FALSE;
|
||||||
Bool softCursor = FALSE;
|
static Bool fullscreen = FALSE;
|
||||||
xglScreenInfoRec xglScreenInfo = {
|
|
||||||
NULL, 0, 0, 0, 0, FALSE,
|
|
||||||
DEFAULT_GEOMETRY_DATA_TYPE,
|
|
||||||
DEFAULT_GEOMETRY_USAGE,
|
|
||||||
FALSE,
|
|
||||||
XGL_DEFAULT_PBO_MASK,
|
|
||||||
FALSE
|
|
||||||
};
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xglxAllocatePrivates (ScreenPtr pScreen)
|
xglxAllocatePrivates (ScreenPtr pScreen)
|
||||||
@ -375,7 +372,7 @@ xglxScreenInit (int index,
|
|||||||
pScreenPriv->colormap =
|
pScreenPriv->colormap =
|
||||||
XCreateColormap (xdisplay, root, vinfo->visual, AllocNone);
|
XCreateColormap (xdisplay, root, vinfo->visual, AllocNone);
|
||||||
|
|
||||||
if (xglScreenInfo.fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
xglScreenInfo.width = DisplayWidth (xdisplay, xscreen);
|
xglScreenInfo.width = DisplayWidth (xdisplay, xscreen);
|
||||||
xglScreenInfo.height = DisplayHeight (xdisplay, xscreen);
|
xglScreenInfo.height = DisplayHeight (xdisplay, xscreen);
|
||||||
@ -405,7 +402,7 @@ xglxScreenInit (int index,
|
|||||||
normalHints->max_width = xglScreenInfo.width;
|
normalHints->max_width = xglScreenInfo.width;
|
||||||
normalHints->max_height = xglScreenInfo.height;
|
normalHints->max_height = xglScreenInfo.height;
|
||||||
|
|
||||||
if (xglScreenInfo.fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
normalHints->x = 0;
|
normalHints->x = 0;
|
||||||
normalHints->y = 0;
|
normalHints->y = 0;
|
||||||
@ -444,7 +441,7 @@ xglxScreenInit (int index,
|
|||||||
|
|
||||||
XMapWindow (xdisplay, pScreenPriv->win);
|
XMapWindow (xdisplay, pScreenPriv->win);
|
||||||
|
|
||||||
if (xglScreenInfo.fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
XClientMessageEvent xev;
|
XClientMessageEvent xev;
|
||||||
|
|
||||||
@ -465,9 +462,14 @@ xglxScreenInit (int index,
|
|||||||
|
|
||||||
xglScreenInfo.drawable = drawable;
|
xglScreenInfo.drawable = drawable;
|
||||||
|
|
||||||
if (!xglScreenInit (pScreen, &xglScreenInfo))
|
if (!xglScreenInit (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (!xglInitVisualConfigs (pScreen))
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
XGL_SCREEN_WRAP (CloseScreen, xglxCloseScreen);
|
XGL_SCREEN_WRAP (CloseScreen, xglxCloseScreen);
|
||||||
|
|
||||||
#ifdef ARGB_CURSOR
|
#ifdef ARGB_CURSOR
|
||||||
@ -526,7 +528,7 @@ xglxScreenInit (int index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitOutput (ScreenInfo *pScreenInfo,
|
xglxInitOutput (ScreenInfo *pScreenInfo,
|
||||||
int argc,
|
int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
@ -792,21 +794,22 @@ xglxKeybdProc (DeviceIntPtr pDevice,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
LegalModifier (unsigned int key,
|
xglxLegalModifier (unsigned int key,
|
||||||
DevicePtr pDev)
|
DevicePtr pDev)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessInputEvents ()
|
xglxProcessInputEvents (void)
|
||||||
{
|
{
|
||||||
mieqProcessInputEvents ();
|
mieqProcessInputEvents ();
|
||||||
miPointerUpdate ();
|
miPointerUpdate ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
InitInput (int argc, char **argv)
|
xglxInitInput (int argc,
|
||||||
|
char **argv)
|
||||||
{
|
{
|
||||||
DeviceIntPtr pKeyboard, pPointer;
|
DeviceIntPtr pKeyboard, pPointer;
|
||||||
|
|
||||||
@ -827,18 +830,36 @@ InitInput (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ddxUseMsg (void)
|
xglxUseMsg (void)
|
||||||
{
|
{
|
||||||
ErrorF ("\nXglx usage:\n");
|
ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM] "
|
||||||
|
"specify screen characteristics\n");
|
||||||
|
ErrorF ("-fullscreen run fullscreen\n");
|
||||||
ErrorF ("-display string display name of the real server\n");
|
ErrorF ("-display string display name of the real server\n");
|
||||||
ErrorF ("-softcursor force software cursor\n");
|
ErrorF ("-softcursor force software cursor\n");
|
||||||
|
|
||||||
xglUseMsg ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ddxProcessArgument (int argc, char **argv, int i)
|
xglxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
{
|
{
|
||||||
|
if (!strcmp (argv[i], "-screen"))
|
||||||
|
{
|
||||||
|
if ((i + 1) < argc)
|
||||||
|
{
|
||||||
|
xglParseScreen (argv[i + 1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
else if (!strcmp (argv[i], "-fullscreen"))
|
||||||
|
{
|
||||||
|
fullscreen = TRUE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (!strcmp (argv[i], "-display"))
|
if (!strcmp (argv[i], "-display"))
|
||||||
{
|
{
|
||||||
if (++i < argc) {
|
if (++i < argc) {
|
||||||
@ -853,22 +874,22 @@ ddxProcessArgument (int argc, char **argv, int i)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xglProcessArgument (&xglScreenInfo, argc, argv, i);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AbortDDX (void)
|
xglxAbort (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ddxGiveUp ()
|
xglxGiveUp ()
|
||||||
{
|
{
|
||||||
AbortDDX ();
|
AbortDDX ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OsVendorInit (void)
|
xglxOsVendorInit (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
64
hw/xgl/glx/xglx.h
Normal file
64
hw/xgl/glx/xglx.h
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _XGLX_H_
|
||||||
|
#define _XGLX_H_
|
||||||
|
|
||||||
|
#include "xgl.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxInitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglxLegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxProcessInputEvents (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxInitInput (int argc,
|
||||||
|
char **argv);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxUseMsg (void);
|
||||||
|
|
||||||
|
int
|
||||||
|
xglxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxAbort (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxGiveUp (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglxOsVendorInit (void);
|
||||||
|
|
||||||
|
#endif /* _XGLX_H_ */
|
131
hw/xgl/glx/xglxinit.c
Normal file
131
hw/xgl/glx/xglxinit.c
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2004 David Reveman
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* David Reveman not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* David Reveman makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL DAVID REVEMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||||
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||||
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xglx.h"
|
||||||
|
|
||||||
|
static xglScreenInfoRec xglxScreenInfo = {
|
||||||
|
NULL, 0, 0, 0, 0,
|
||||||
|
DEFAULT_GEOMETRY_DATA_TYPE,
|
||||||
|
DEFAULT_GEOMETRY_USAGE,
|
||||||
|
FALSE,
|
||||||
|
XGL_DEFAULT_PBO_MASK,
|
||||||
|
FALSE,
|
||||||
|
FALSE
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
static Bool loadGlx = TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
InitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (loadGlx)
|
||||||
|
{
|
||||||
|
if (!xglLoadGLXModules ())
|
||||||
|
FatalError ("No GLX modules loaded");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
xglxInitOutput (&xglxScreenInfo, pScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return xglxLegalModifier (key, pDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessInputEvents (void)
|
||||||
|
{
|
||||||
|
xglxProcessInputEvents ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitInput (int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
xglxInitInput (&xglxScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("\nXgl usage:\n");
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
ErrorF ("-noglx don't load glx extension\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
xglUseMsg ();
|
||||||
|
ErrorF ("\nXglx usage:\n");
|
||||||
|
xglxUseMsg ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ddxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
int skip;
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (!strcmp (argv[i], "-noglx"))
|
||||||
|
{
|
||||||
|
loadGlx = FALSE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
skip = xglProcessArgument (&xglxScreenInfo, argc, argv, i);
|
||||||
|
if (skip)
|
||||||
|
return skip;
|
||||||
|
|
||||||
|
return xglxProcessArgument (&xglxScreenInfo, argc, argv, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortDDX (void)
|
||||||
|
{
|
||||||
|
xglxAbort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxGiveUp (void)
|
||||||
|
{
|
||||||
|
xglxGiveUp ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OsVendorInit (void)
|
||||||
|
{
|
||||||
|
xglxOsVendorInit ();
|
||||||
|
}
|
13
hw/xgl/glxext/Makefile.am
Normal file
13
hw/xgl/glxext/Makefile.am
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
SUBDIRS = module
|
||||||
|
|
||||||
|
INCLUDES = \
|
||||||
|
@XGL_INCS@ \
|
||||||
|
@XSERVER_CFLAGS@
|
||||||
|
|
||||||
|
libxglglxext_libraries = libxglglxext.la
|
||||||
|
libxglglxext_la_SOURCES = \
|
||||||
|
xglglxext.h \
|
||||||
|
xglglxext.c
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = $(libxglglxext_libraries)
|
||||||
|
|
19
hw/xgl/glxext/module/Makefile.am
Normal file
19
hw/xgl/glxext/module/Makefile.am
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
INCLUDES = \
|
||||||
|
@XGLX_INCS@ \
|
||||||
|
@XSERVER_CFLAGS@
|
||||||
|
|
||||||
|
libglx_la_LDFLAGS = -avoid-version
|
||||||
|
libglx_la_SOURCES = glxmodule.c
|
||||||
|
libglx_la_LIBADD = $(top_builddir)/GL/glx/libglx.la
|
||||||
|
libglx_modules = libglx.la
|
||||||
|
|
||||||
|
libglcore_la_LDFLAGS = -avoid-version
|
||||||
|
libglcore_la_SOURCES = glcoremodule.c
|
||||||
|
libglcore_la_LIBADD = $(top_builddir)/GL/mesa/libglcore.la
|
||||||
|
libglcore_modules = libglcore.la
|
||||||
|
|
||||||
|
moduledir = @MODULEPATH@/xgl
|
||||||
|
|
||||||
|
module_LTLIBRARIES = \
|
||||||
|
$(libglcore_modules) \
|
||||||
|
$(libglx_modules)
|
38
hw/xgl/glxext/module/glcoremodule.c
Normal file
38
hw/xgl/glxext/module/glcoremodule.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xglmodule.h"
|
||||||
|
|
||||||
|
char *
|
||||||
|
moduleVersion (void)
|
||||||
|
{
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
moduleInit (const char *module)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
38
hw/xgl/glxext/module/glxmodule.c
Normal file
38
hw/xgl/glxext/module/glxmodule.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xglmodule.h"
|
||||||
|
|
||||||
|
char *
|
||||||
|
moduleVersion (void)
|
||||||
|
{
|
||||||
|
return VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
moduleInit (const char *module)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
@ -24,10 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xgl.h"
|
#include "xgl.h"
|
||||||
|
#include "xglglxext.h"
|
||||||
#ifdef GLXEXT
|
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
#include <GL/internal/glcore.h>
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxdrawable.h"
|
#include "glxdrawable.h"
|
||||||
@ -35,6 +36,7 @@
|
|||||||
#include "glxutil.h"
|
#include "glxutil.h"
|
||||||
#include "unpack.h"
|
#include "unpack.h"
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
|
#include "glxext.h"
|
||||||
#include "micmap.h"
|
#include "micmap.h"
|
||||||
|
|
||||||
#define XGL_MAX_TEXTURE_UNITS 8
|
#define XGL_MAX_TEXTURE_UNITS 8
|
||||||
@ -45,33 +47,6 @@
|
|||||||
#define XGL_TEXTURE_RECTANGLE_BIT (1 << 3)
|
#define XGL_TEXTURE_RECTANGLE_BIT (1 << 3)
|
||||||
#define XGL_TEXTURE_CUBE_MAP_BIT (1 << 4)
|
#define XGL_TEXTURE_CUBE_MAP_BIT (1 << 4)
|
||||||
|
|
||||||
extern void
|
|
||||||
GlxSetVisualConfigs (int nconfigs,
|
|
||||||
__GLXvisualConfig *configs,
|
|
||||||
void **privates);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
GlxWrapInitVisuals (miInitVisualsProcPtr *);
|
|
||||||
|
|
||||||
extern int
|
|
||||||
GlxInitVisuals (VisualPtr *visualp,
|
|
||||||
DepthPtr *depthp,
|
|
||||||
int *nvisualp,
|
|
||||||
int *ndepthp,
|
|
||||||
int *rootDepthp,
|
|
||||||
VisualID *defaultVisp,
|
|
||||||
unsigned long sizes,
|
|
||||||
int bitsPerRGB,
|
|
||||||
int preferredVis);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
__glXFlushContextCache (void);
|
|
||||||
|
|
||||||
extern __GLXscreenInfo __glDDXScreenInfo;
|
|
||||||
|
|
||||||
extern __glProcTable __glMesaRenderTable;
|
|
||||||
extern __glProcTableEXT __glMesaRenderTableEXT;
|
|
||||||
|
|
||||||
typedef Bool (*GLXScreenProbeProc) (int screen);
|
typedef Bool (*GLXScreenProbeProc) (int screen);
|
||||||
typedef __GLinterface *(*GLXCreateContextProc) (__GLimports *imports,
|
typedef __GLinterface *(*GLXCreateContextProc) (__GLimports *imports,
|
||||||
__GLcontextModes *modes,
|
__GLcontextModes *modes,
|
||||||
@ -91,6 +66,8 @@ typedef struct _xglGLXScreenInfo {
|
|||||||
|
|
||||||
static xglGLXScreenInfoRec screenInfoPriv;
|
static xglGLXScreenInfoRec screenInfoPriv;
|
||||||
|
|
||||||
|
extern __GLXscreenInfo __glDDXScreenInfo;
|
||||||
|
|
||||||
typedef GLboolean (*GLResizeBuffersProc) (__GLdrawableBuffer *buffer,
|
typedef GLboolean (*GLResizeBuffersProc) (__GLdrawableBuffer *buffer,
|
||||||
GLint x,
|
GLint x,
|
||||||
GLint y,
|
GLint y,
|
||||||
@ -141,11 +118,6 @@ typedef struct _xglGLOp {
|
|||||||
GLenum target;
|
GLenum target;
|
||||||
GLuint texture;
|
GLuint texture;
|
||||||
} bind_texture;
|
} bind_texture;
|
||||||
struct {
|
|
||||||
GLenum target;
|
|
||||||
GLenum pname;
|
|
||||||
GLint params[4];
|
|
||||||
} tex_parameter_iv;
|
|
||||||
struct {
|
struct {
|
||||||
GLenum target;
|
GLenum target;
|
||||||
GLenum pname;
|
GLenum pname;
|
||||||
@ -261,6 +233,7 @@ typedef struct _xglTexObj {
|
|||||||
GLuint key;
|
GLuint key;
|
||||||
GLuint name;
|
GLuint name;
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
glitz_texture_object_t *object;
|
||||||
int refcnt;
|
int refcnt;
|
||||||
} xglTexObjRec, *xglTexObjPtr;
|
} xglTexObjRec, *xglTexObjPtr;
|
||||||
|
|
||||||
@ -295,6 +268,7 @@ typedef struct _xglGLContext {
|
|||||||
Bool needInit;
|
Bool needInit;
|
||||||
xglGLBufferPtr pDrawBuffer;
|
xglGLBufferPtr pDrawBuffer;
|
||||||
xglGLBufferPtr pReadBuffer;
|
xglGLBufferPtr pReadBuffer;
|
||||||
|
GLuint fbo;
|
||||||
int drawXoff, drawYoff;
|
int drawXoff, drawYoff;
|
||||||
char *versionString;
|
char *versionString;
|
||||||
GLenum errorValue;
|
GLenum errorValue;
|
||||||
@ -317,6 +291,8 @@ typedef struct _xglGLContext {
|
|||||||
|
|
||||||
static xglGLContextPtr cctx = NULL;
|
static xglGLContextPtr cctx = NULL;
|
||||||
|
|
||||||
|
//static void
|
||||||
|
//xglSetCurrentContext (xglGLContextPtr pContext, glitz_drawable_t *drawable);
|
||||||
static void
|
static void
|
||||||
xglSetCurrentContext (xglGLContextPtr pContext);
|
xglSetCurrentContext (xglGLContextPtr pContext);
|
||||||
|
|
||||||
@ -721,6 +697,8 @@ xglDeleteTexObj (xglTexObjPtr pTexObj)
|
|||||||
ScreenPtr pScreen = pTexObj->pPixmap->drawable.pScreen;
|
ScreenPtr pScreen = pTexObj->pPixmap->drawable.pScreen;
|
||||||
|
|
||||||
(*pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
(*pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
||||||
|
|
||||||
|
glitz_texture_object_destroy (pTexObj->object);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTexObj->name)
|
if (pTexObj->name)
|
||||||
@ -731,6 +709,7 @@ xglDeleteTexObj (xglTexObjPtr pTexObj)
|
|||||||
pTexObj->key = 0;
|
pTexObj->key = 0;
|
||||||
pTexObj->name = 0;
|
pTexObj->name = 0;
|
||||||
pTexObj->pPixmap = NULL;
|
pTexObj->pPixmap = NULL;
|
||||||
|
pTexObj->object = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1238,6 +1217,7 @@ xglGenTextures (GLsizei n,
|
|||||||
pTexObj->key = name;
|
pTexObj->key = name;
|
||||||
pTexObj->name = *textures;
|
pTexObj->name = *textures;
|
||||||
pTexObj->pPixmap = NULL;
|
pTexObj->pPixmap = NULL;
|
||||||
|
pTexObj->object = NULL;
|
||||||
pTexObj->refcnt = 1;
|
pTexObj->refcnt = 1;
|
||||||
|
|
||||||
xglHashInsert (cctx->shared->texObjects, name, pTexObj);
|
xglHashInsert (cctx->shared->texObjects, name, pTexObj);
|
||||||
@ -1294,6 +1274,7 @@ xglBindTextureProc (xglGLOpPtr pOp)
|
|||||||
|
|
||||||
pTexObj->key = pOp->u.bind_texture.texture;
|
pTexObj->key = pOp->u.bind_texture.texture;
|
||||||
pTexObj->pPixmap = NULL;
|
pTexObj->pPixmap = NULL;
|
||||||
|
pTexObj->object = NULL;
|
||||||
pTexObj->refcnt = 1;
|
pTexObj->refcnt = 1;
|
||||||
|
|
||||||
glGenTextures (1, &pTexObj->name);
|
glGenTextures (1, &pTexObj->name);
|
||||||
@ -1376,15 +1357,16 @@ xglSetupTextures (void)
|
|||||||
{
|
{
|
||||||
if (pTexObj[i])
|
if (pTexObj[i])
|
||||||
{
|
{
|
||||||
XGL_PIXMAP_PRIV (pTexObj[i]->pPixmap);
|
if (i != activeTexUnit)
|
||||||
|
{
|
||||||
activeTexUnit = GL_TEXTURE0_ARB + i;
|
cctx->ActiveTextureARB (GL_TEXTURE0_ARB + i);
|
||||||
cctx->ActiveTextureARB (activeTexUnit);
|
activeTexUnit = i;
|
||||||
glitz_context_bind_texture (cctx->context, pPixmapPriv->surface);
|
}
|
||||||
|
glitz_context_bind_texture (cctx->context, pTexObj[i]->object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cctx->activeTexUnit != activeTexUnit)
|
if (activeTexUnit != cctx->activeTexUnit)
|
||||||
cctx->ActiveTextureARB (cctx->activeTexUnit);
|
cctx->ActiveTextureARB (cctx->activeTexUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1510,6 +1492,36 @@ xglPrioritizeTextures (GLsizei n,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static glitz_texture_filter_t
|
||||||
|
xglTextureFilter (GLenum param)
|
||||||
|
{
|
||||||
|
switch (param) {
|
||||||
|
case GL_LINEAR:
|
||||||
|
return GLITZ_TEXTURE_FILTER_LINEAR;
|
||||||
|
case GL_NEAREST:
|
||||||
|
default:
|
||||||
|
return GLITZ_TEXTURE_FILTER_NEAREST;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static glitz_texture_wrap_t
|
||||||
|
xglTextureWrap (GLenum param)
|
||||||
|
{
|
||||||
|
switch (param) {
|
||||||
|
case GL_CLAMP_TO_EDGE:
|
||||||
|
return GLITZ_TEXTURE_WRAP_CLAMP_TO_EDGE;
|
||||||
|
case GL_CLAMP_TO_BORDER:
|
||||||
|
return GLITZ_TEXTURE_WRAP_CLAMP_TO_BORDER;
|
||||||
|
case GL_REPEAT:
|
||||||
|
return GLITZ_TEXTURE_WRAP_REPEAT;
|
||||||
|
case GL_MIRRORED_REPEAT:
|
||||||
|
return GLITZ_TEXTURE_WRAP_MIRRORED_REPEAT;
|
||||||
|
case GL_CLAMP:
|
||||||
|
default:
|
||||||
|
return GLITZ_TEXTURE_WRAP_CLAMP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xglTexParameterfvProc (xglGLOpPtr pOp)
|
xglTexParameterfvProc (xglGLOpPtr pOp)
|
||||||
{
|
{
|
||||||
@ -1533,17 +1545,42 @@ xglTexParameterfvProc (xglGLOpPtr pOp)
|
|||||||
|
|
||||||
if (pTexObj && pTexObj->pPixmap)
|
if (pTexObj && pTexObj->pPixmap)
|
||||||
{
|
{
|
||||||
XGL_PIXMAP_PRIV (pTexObj->pPixmap);
|
GLfloat *params = pOp->u.tex_parameter_fv.params;
|
||||||
|
|
||||||
/* texture parameters should eventually go into a
|
switch (pOp->u.tex_parameter_fv.pname) {
|
||||||
glitz_texture_object_t */
|
case GL_TEXTURE_MIN_FILTER:
|
||||||
glitz_context_bind_texture (cctx->context, pPixmapPriv->surface);
|
glitz_texture_object_set_filter (pTexObj->object,
|
||||||
|
GLITZ_TEXTURE_FILTER_TYPE_MIN,
|
||||||
|
xglTextureFilter (params[0]));
|
||||||
|
break;
|
||||||
|
case GL_TEXTURE_MAG_FILTER:
|
||||||
|
glitz_texture_object_set_filter (pTexObj->object,
|
||||||
|
GLITZ_TEXTURE_FILTER_TYPE_MAG,
|
||||||
|
xglTextureFilter (params[0]));
|
||||||
|
break;
|
||||||
|
case GL_TEXTURE_WRAP_S:
|
||||||
|
glitz_texture_object_set_wrap (pTexObj->object,
|
||||||
|
GLITZ_TEXTURE_WRAP_TYPE_S,
|
||||||
|
xglTextureWrap (params[0]));
|
||||||
|
break;
|
||||||
|
case GL_TEXTURE_WRAP_T:
|
||||||
|
glitz_texture_object_set_wrap (pTexObj->object,
|
||||||
|
GLITZ_TEXTURE_WRAP_TYPE_T,
|
||||||
|
xglTextureWrap (params[0]));
|
||||||
|
break;
|
||||||
|
case GL_TEXTURE_BORDER_COLOR: {
|
||||||
|
glitz_color_t color;
|
||||||
|
|
||||||
glTexParameterfv (pOp->u.tex_parameter_fv.target,
|
color.red = params[0] * 0xffff;
|
||||||
pOp->u.tex_parameter_fv.pname,
|
color.green = params[1] * 0xffff;
|
||||||
pOp->u.tex_parameter_fv.params);
|
color.blue = params[2] * 0xffff;
|
||||||
|
color.alpha = params[3] * 0xffff;
|
||||||
|
|
||||||
glBindTexture (pOp->u.tex_parameter_fv.target, pTexObj->name);
|
glitz_texture_object_set_border_color (pTexObj->object, &color);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1573,43 +1610,6 @@ xglTexParameterfv (GLenum target,
|
|||||||
xglGLOp (&gl);
|
xglGLOp (&gl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
xglTexParameterivProc (xglGLOpPtr pOp)
|
|
||||||
{
|
|
||||||
xglTexObjPtr pTexObj;
|
|
||||||
|
|
||||||
glTexParameteriv (pOp->u.tex_parameter_iv.target,
|
|
||||||
pOp->u.tex_parameter_iv.pname,
|
|
||||||
pOp->u.tex_parameter_iv.params);
|
|
||||||
|
|
||||||
switch (pOp->u.tex_parameter_iv.target) {
|
|
||||||
case GL_TEXTURE_2D:
|
|
||||||
pTexObj = cctx->attrib.texUnits[cctx->activeTexUnit].p2D;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_RECTANGLE_NV:
|
|
||||||
pTexObj = cctx->attrib.texUnits[cctx->activeTexUnit].pRect;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
pTexObj = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pTexObj && pTexObj->pPixmap)
|
|
||||||
{
|
|
||||||
XGL_PIXMAP_PRIV (pTexObj->pPixmap);
|
|
||||||
|
|
||||||
/* texture parameters should eventually go into a
|
|
||||||
glitz_texture_object_t */
|
|
||||||
glitz_context_bind_texture (cctx->context, pPixmapPriv->surface);
|
|
||||||
|
|
||||||
glTexParameteriv (pOp->u.tex_parameter_iv.target,
|
|
||||||
pOp->u.tex_parameter_iv.pname,
|
|
||||||
pOp->u.tex_parameter_iv.params);
|
|
||||||
|
|
||||||
glBindTexture (pOp->u.tex_parameter_iv.target, pTexObj->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xglTexParameteriv (GLenum target,
|
xglTexParameteriv (GLenum target,
|
||||||
GLenum pname,
|
GLenum pname,
|
||||||
@ -1617,19 +1617,20 @@ xglTexParameteriv (GLenum target,
|
|||||||
{
|
{
|
||||||
xglGLOpRec gl;
|
xglGLOpRec gl;
|
||||||
|
|
||||||
gl.glProc = xglTexParameterivProc;
|
gl.glProc = xglTexParameterfvProc;
|
||||||
|
|
||||||
gl.u.tex_parameter_iv.target = target;
|
gl.u.tex_parameter_fv.target = target;
|
||||||
gl.u.tex_parameter_iv.pname = pname;
|
gl.u.tex_parameter_fv.pname = pname;
|
||||||
|
|
||||||
switch (pname) {
|
switch (pname) {
|
||||||
case GL_TEXTURE_BORDER_COLOR:
|
case GL_TEXTURE_BORDER_COLOR:
|
||||||
gl.u.tex_parameter_iv.params[3] = params[3];
|
gl.u.tex_parameter_fv.params[3] = (GLfloat) params[3] / INT_MAX;
|
||||||
gl.u.tex_parameter_iv.params[2] = params[2];
|
gl.u.tex_parameter_fv.params[2] = (GLfloat) params[2] / INT_MAX;
|
||||||
gl.u.tex_parameter_iv.params[1] = params[1];
|
gl.u.tex_parameter_fv.params[1] = (GLfloat) params[1] / INT_MAX;
|
||||||
/* fall-through */
|
gl.u.tex_parameter_fv.params[0] = (GLfloat) params[0] / INT_MAX;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
gl.u.tex_parameter_iv.params[0] = params[0];
|
gl.u.tex_parameter_fv.params[0] = params[0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1674,12 +1675,9 @@ xglGetTexLevelParameterfv (GLenum target,
|
|||||||
|
|
||||||
if (pTexObj && pTexObj->pPixmap)
|
if (pTexObj && pTexObj->pPixmap)
|
||||||
{
|
{
|
||||||
XGL_PIXMAP_PRIV (pTexObj->pPixmap);
|
glitz_context_bind_texture (cctx->context, pTexObj->object);
|
||||||
|
|
||||||
glitz_context_bind_texture (cctx->context, pPixmapPriv->surface);
|
|
||||||
|
|
||||||
glGetTexLevelParameterfv (target, level, pname, params);
|
glGetTexLevelParameterfv (target, level, pname, params);
|
||||||
|
|
||||||
glBindTexture (target, pTexObj->name);
|
glBindTexture (target, pTexObj->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1708,12 +1706,9 @@ xglGetTexLevelParameteriv (GLenum target,
|
|||||||
|
|
||||||
if (pTexObj && pTexObj->pPixmap)
|
if (pTexObj && pTexObj->pPixmap)
|
||||||
{
|
{
|
||||||
XGL_PIXMAP_PRIV (pTexObj->pPixmap);
|
glitz_context_bind_texture (cctx->context, pTexObj->object);
|
||||||
|
|
||||||
glitz_context_bind_texture (cctx->context, pPixmapPriv->surface);
|
|
||||||
|
|
||||||
glGetTexLevelParameteriv (target, level, pname, params);
|
glGetTexLevelParameteriv (target, level, pname, params);
|
||||||
|
|
||||||
glBindTexture (target, pTexObj->name);
|
glBindTexture (target, pTexObj->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2008,6 +2003,7 @@ xglFlush (void)
|
|||||||
|
|
||||||
if (REGION_NOTEMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage))
|
if (REGION_NOTEMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage))
|
||||||
{
|
{
|
||||||
|
xglAddBitDamage (pBuffer->pDrawable, &pBuffer->damage);
|
||||||
DamageDamageRegion (pBuffer->pDrawable, &pBuffer->damage);
|
DamageDamageRegion (pBuffer->pDrawable, &pBuffer->damage);
|
||||||
REGION_EMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage);
|
REGION_EMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage);
|
||||||
}
|
}
|
||||||
@ -2025,6 +2021,7 @@ xglFinish (void)
|
|||||||
|
|
||||||
if (REGION_NOTEMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage))
|
if (REGION_NOTEMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage))
|
||||||
{
|
{
|
||||||
|
xglAddBitDamage (pBuffer->pDrawable, &pBuffer->damage);
|
||||||
DamageDamageRegion (pBuffer->pDrawable, &pBuffer->damage);
|
DamageDamageRegion (pBuffer->pDrawable, &pBuffer->damage);
|
||||||
REGION_EMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage);
|
REGION_EMPTY (pBuffer->pDrawable->pScreen, &pBuffer->damage);
|
||||||
}
|
}
|
||||||
@ -3394,6 +3391,65 @@ xglNoOpPointParameterivNV (GLenum pname, const GLint *params) {}
|
|||||||
static void
|
static void
|
||||||
xglNoOpActiveStencilFaceEXT (GLenum face) {}
|
xglNoOpActiveStencilFaceEXT (GLenum face) {}
|
||||||
|
|
||||||
|
/* GL_EXT_framebuffer_object */
|
||||||
|
static GLboolean
|
||||||
|
xglNoOpIsRenderbufferEXT (GLuint renderbuffer)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
xglNoOpBindRenderbufferEXT (GLenum target, GLuint renderbuffer) {}
|
||||||
|
static void
|
||||||
|
xglNoOpDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers) {}
|
||||||
|
static void
|
||||||
|
xglNoOpGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers) {}
|
||||||
|
static void
|
||||||
|
xglNoOpRenderbufferStorageEXT (GLenum target, GLenum internalformat,
|
||||||
|
GLsizei width, GLsizei height) {}
|
||||||
|
static void
|
||||||
|
xglNoOpGetRenderbufferParameterivEXT (GLenum target, GLenum pname,
|
||||||
|
GLint *params) {}
|
||||||
|
static GLboolean
|
||||||
|
xglNoOpIsFramebufferEXT (GLuint framebuffer)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
xglNoOpBindFramebufferEXT (GLenum target, GLuint framebuffer) {}
|
||||||
|
static void
|
||||||
|
xglNoOpDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers) {}
|
||||||
|
static void
|
||||||
|
xglNoOpGenFramebuffersEXT (GLsizei n, GLuint *framebuffers) {}
|
||||||
|
static GLenum
|
||||||
|
xglNoOpCheckFramebufferStatusEXT (GLenum target)
|
||||||
|
{
|
||||||
|
return GL_FRAMEBUFFER_UNSUPPORTED_EXT;
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
xglNoOpFramebufferTexture1DEXT (GLenum target, GLenum attachment,
|
||||||
|
GLenum textarget, GLuint texture,
|
||||||
|
GLint level) {}
|
||||||
|
static void
|
||||||
|
xglNoOpFramebufferTexture2DEXT (GLenum target, GLenum attachment,
|
||||||
|
GLenum textarget, GLuint texture,
|
||||||
|
GLint level) {}
|
||||||
|
static void
|
||||||
|
xglNoOpFramebufferTexture3DEXT (GLenum target, GLenum attachment,
|
||||||
|
GLenum textarget, GLuint texture,
|
||||||
|
GLint level, GLint zoffset) {}
|
||||||
|
static void
|
||||||
|
xglNoOpFramebufferRenderbufferEXT (GLenum target, GLenum attachment,
|
||||||
|
GLenum renderbuffertarget,
|
||||||
|
GLuint renderbuffer) {}
|
||||||
|
static void
|
||||||
|
xglNoOpGetFramebufferAttachmentParameterivEXT (GLenum target,
|
||||||
|
GLenum attachment,
|
||||||
|
GLenum pname,
|
||||||
|
GLint *params) {}
|
||||||
|
static void
|
||||||
|
xglNoOpGenerateMipmapEXT (GLenum target) {}
|
||||||
|
|
||||||
|
|
||||||
__glProcTableEXT __glNoOpRenderTableEXT = {
|
__glProcTableEXT __glNoOpRenderTableEXT = {
|
||||||
xglNoOpActiveTextureARB,
|
xglNoOpActiveTextureARB,
|
||||||
xglNoOpClientActiveTextureARB,
|
xglNoOpClientActiveTextureARB,
|
||||||
@ -3437,7 +3493,24 @@ __glProcTableEXT __glNoOpRenderTableEXT = {
|
|||||||
xglNoOpSecondaryColorPointerEXT,
|
xglNoOpSecondaryColorPointerEXT,
|
||||||
xglNoOpPointParameteriNV,
|
xglNoOpPointParameteriNV,
|
||||||
xglNoOpPointParameterivNV,
|
xglNoOpPointParameterivNV,
|
||||||
xglNoOpActiveStencilFaceEXT
|
xglNoOpActiveStencilFaceEXT,
|
||||||
|
xglNoOpIsRenderbufferEXT,
|
||||||
|
xglNoOpBindRenderbufferEXT,
|
||||||
|
xglNoOpDeleteRenderbuffersEXT,
|
||||||
|
xglNoOpGenRenderbuffersEXT,
|
||||||
|
xglNoOpRenderbufferStorageEXT,
|
||||||
|
xglNoOpGetRenderbufferParameterivEXT,
|
||||||
|
xglNoOpIsFramebufferEXT,
|
||||||
|
xglNoOpBindFramebufferEXT,
|
||||||
|
xglNoOpDeleteFramebuffersEXT,
|
||||||
|
xglNoOpGenFramebuffersEXT,
|
||||||
|
xglNoOpCheckFramebufferStatusEXT,
|
||||||
|
xglNoOpFramebufferTexture1DEXT,
|
||||||
|
xglNoOpFramebufferTexture2DEXT,
|
||||||
|
xglNoOpFramebufferTexture3DEXT,
|
||||||
|
xglNoOpFramebufferRenderbufferEXT,
|
||||||
|
xglNoOpGetFramebufferAttachmentParameterivEXT,
|
||||||
|
xglNoOpGenerateMipmapEXT
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3666,6 +3739,79 @@ xglInitExtensions (xglGLContextPtr pContext)
|
|||||||
glitz_context_get_proc_address (pContext->context,
|
glitz_context_get_proc_address (pContext->context,
|
||||||
"glActiveStencilFaceEXT");
|
"glActiveStencilFaceEXT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strstr (extensions, "GL_EXT_framebuffer_object"))
|
||||||
|
{
|
||||||
|
pContext->glRenderTableEXT.IsRenderbufferEXT =
|
||||||
|
(PFNGLISRENDERBUFFEREXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glIsRenderbufferEXT");
|
||||||
|
pContext->glRenderTableEXT.BindRenderbufferEXT =
|
||||||
|
(PFNGLBINDRENDERBUFFEREXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glBindRenderbufferEXT");
|
||||||
|
pContext->glRenderTableEXT.DeleteRenderbuffersEXT =
|
||||||
|
(PFNGLDELETERENDERBUFFERSEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glDeleteRenderbuffersEXT");
|
||||||
|
pContext->glRenderTableEXT.GenRenderbuffersEXT =
|
||||||
|
(PFNGLGENRENDERBUFFERSEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glGenRenderbuffersEXT");
|
||||||
|
pContext->glRenderTableEXT.RenderbufferStorageEXT =
|
||||||
|
(PFNGLRENDERBUFFERSTORAGEEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glRenderbufferStorageEXT");
|
||||||
|
pContext->glRenderTableEXT.GetRenderbufferParameterivEXT =
|
||||||
|
(PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glGetRenderbufferParameterivEXT");
|
||||||
|
pContext->glRenderTableEXT.IsFramebufferEXT =
|
||||||
|
(PFNGLISFRAMEBUFFEREXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glIsFramebufferEXT");
|
||||||
|
pContext->glRenderTableEXT.BindFramebufferEXT =
|
||||||
|
(PFNGLBINDFRAMEBUFFEREXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glBindFramebufferEXT");
|
||||||
|
pContext->glRenderTableEXT.DeleteFramebuffersEXT =
|
||||||
|
(PFNGLDELETEFRAMEBUFFERSEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glDeleteFramebuffersEXT");
|
||||||
|
pContext->glRenderTableEXT.GenFramebuffersEXT =
|
||||||
|
(PFNGLGENFRAMEBUFFERSEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glGenFramebuffersEXT");
|
||||||
|
pContext->glRenderTableEXT.CheckFramebufferStatusEXT =
|
||||||
|
(PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glCheckFramebufferStatusEXT");
|
||||||
|
pContext->glRenderTableEXT.FramebufferTexture1DEXT =
|
||||||
|
(PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glFramebufferTexture1DEXT");
|
||||||
|
pContext->glRenderTableEXT.FramebufferTexture2DEXT =
|
||||||
|
(PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glFramebufferTexture2DEXT");
|
||||||
|
pContext->glRenderTableEXT.FramebufferTexture3DEXT =
|
||||||
|
(PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glFramebufferTexture3DEXT");
|
||||||
|
pContext->glRenderTableEXT.FramebufferRenderbufferEXT =
|
||||||
|
(PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glFramebufferRenderbufferEXT");
|
||||||
|
pContext->glRenderTableEXT.GetFramebufferAttachmentParameterivEXT =
|
||||||
|
(PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glGetFramebufferAttachment"
|
||||||
|
"ParameterivEXT");
|
||||||
|
pContext->glRenderTableEXT.GenerateMipmapEXT =
|
||||||
|
(PFNGLGENERATEMIPMAPEXTPROC)
|
||||||
|
glitz_context_get_proc_address (pContext->context,
|
||||||
|
"glGenerateMipmapEXT");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3676,8 +3822,7 @@ xglSetCurrentContext (xglGLContextPtr pContext)
|
|||||||
|
|
||||||
glitz_context_make_current (cctx->context, pScreenPriv->drawable);
|
glitz_context_make_current (cctx->context, pScreenPriv->drawable);
|
||||||
|
|
||||||
__glRenderTable = &__glNativeRenderTable;
|
GlxSetRenderTables (&__glNativeRenderTable, &cctx->glRenderTableEXT);
|
||||||
__glRenderTableEXT = &cctx->glRenderTableEXT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3781,7 +3926,7 @@ xglLoseCurrent (__GLcontext *gc)
|
|||||||
xglGLContextPtr pContext = (xglGLContextPtr) gc;
|
xglGLContextPtr pContext = (xglGLContextPtr) gc;
|
||||||
__GLinterface *iface = pContext->mIface;
|
__GLinterface *iface = pContext->mIface;
|
||||||
|
|
||||||
__glXFlushContextCache ();
|
GlxFlushContextCache ();
|
||||||
|
|
||||||
if (!iface)
|
if (!iface)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
@ -3921,6 +4066,62 @@ xglCopyContext (__GLcontext *dst,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
xglResizeBuffer (__GLdrawablePrivate *glPriv,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
unsigned int width,
|
||||||
|
unsigned int height)
|
||||||
|
{
|
||||||
|
xglGLBufferPtr pBufferPriv = glPriv->private;
|
||||||
|
DrawablePtr pDrawable = pBufferPriv->pDrawable;
|
||||||
|
|
||||||
|
XGL_SCREEN_PRIV (pDrawable->pScreen);
|
||||||
|
XGL_DRAWABLE_PIXMAP (pBufferPriv->pDrawable);
|
||||||
|
|
||||||
|
if (pPixmap != pScreenPriv->pScreenPixmap)
|
||||||
|
{
|
||||||
|
if (glPriv->modes->doubleBufferMode)
|
||||||
|
{
|
||||||
|
glitz_surface_t *surface = pBufferPriv->backSurface;
|
||||||
|
|
||||||
|
if (!surface ||
|
||||||
|
(glitz_surface_get_width (surface) != width ||
|
||||||
|
glitz_surface_get_height (surface) != height))
|
||||||
|
{
|
||||||
|
glitz_format_t *format;
|
||||||
|
|
||||||
|
format = pScreenPriv->pixmapFormats[pDrawable->depth].format;
|
||||||
|
|
||||||
|
if (surface)
|
||||||
|
glitz_surface_destroy (surface);
|
||||||
|
|
||||||
|
pBufferPriv->backSurface =
|
||||||
|
glitz_surface_create (pScreenPriv->drawable, format,
|
||||||
|
width, height, 0, NULL);
|
||||||
|
if (!pBufferPriv->backSurface)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (glPriv->modes->doubleBufferMode)
|
||||||
|
{
|
||||||
|
if (!pBufferPriv->backSurface)
|
||||||
|
{
|
||||||
|
pBufferPriv->backSurface = pScreenPriv->backSurface;
|
||||||
|
glitz_surface_reference (pScreenPriv->backSurface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ValidateGC (pDrawable, pBufferPriv->pGC);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
xglForceCurrent (__GLcontext *gc)
|
xglForceCurrent (__GLcontext *gc)
|
||||||
{
|
{
|
||||||
@ -3973,29 +4174,39 @@ xglForceCurrent (__GLcontext *gc)
|
|||||||
cctx->pDrawBuffer->yFlip = pDrawable->height;
|
cctx->pDrawBuffer->yFlip = pDrawable->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if buffers have changed */
|
/* draw buffer changed */
|
||||||
if (cctx->pReadBuffer->pPixmap != pReadPixmap ||
|
if (cctx->pDrawBuffer->pPixmap != pDrawPixmap ||
|
||||||
cctx->pDrawBuffer->pPixmap != pDrawPixmap)
|
cctx->pReadBuffer->pPixmap != pReadPixmap)
|
||||||
{
|
{
|
||||||
XGL_SCREEN_PRIV (pDrawable->pScreen);
|
__GLinterface *iface = &pContext->iface;
|
||||||
XGL_PIXMAP_PRIV (pDrawPixmap);
|
__GLdrawablePrivate *drawPriv, *readPriv;
|
||||||
|
|
||||||
if (!xglPrepareTarget (pDrawable))
|
if (!xglPrepareTarget (pDrawable))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* draw buffer is offscreen */
|
drawPriv = iface->imports.getDrawablePrivate (gc);
|
||||||
if (pPixmapPriv->surface != pScreenPriv->surface)
|
readPriv = iface->imports.getReadablePrivate (gc);
|
||||||
{
|
|
||||||
/* NYI: framebuffer object setup */
|
if (!xglResizeBuffer (drawPriv,
|
||||||
FatalError ("NYI: offscreen GL drawable\n");
|
pDrawable->x,
|
||||||
}
|
pDrawable->y,
|
||||||
|
pDrawable->width,
|
||||||
|
pDrawable->height))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!xglResizeBuffer (readPriv,
|
||||||
|
cctx->pReadBuffer->pDrawable->x,
|
||||||
|
cctx->pReadBuffer->pDrawable->y,
|
||||||
|
cctx->pReadBuffer->pDrawable->width,
|
||||||
|
cctx->pReadBuffer->pDrawable->height))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
cctx->pReadBuffer->pPixmap = pReadPixmap;
|
cctx->pReadBuffer->pPixmap = pReadPixmap;
|
||||||
cctx->pDrawBuffer->pPixmap = pDrawPixmap;
|
cctx->pDrawBuffer->pPixmap = pDrawPixmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xglSetCurrentContext (pContext);
|
xglSetCurrentContext (pContext);//, cctx->pDrawBuffer);
|
||||||
|
|
||||||
if (cctx->needInit)
|
if (cctx->needInit)
|
||||||
{
|
{
|
||||||
@ -4051,9 +4262,6 @@ xglForceCurrent (__GLcontext *gc)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
cctx = NULL;
|
cctx = NULL;
|
||||||
__glRenderTable = &__glMesaRenderTable;
|
|
||||||
__glRenderTableEXT = &__glMesaRenderTableEXT;
|
|
||||||
|
|
||||||
status = (*iface->exports.forceCurrent) ((__GLcontext *) iface);
|
status = (*iface->exports.forceCurrent) ((__GLcontext *) iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4128,10 +4336,8 @@ static void
|
|||||||
xglLoseCurrentContext (void *closure)
|
xglLoseCurrentContext (void *closure)
|
||||||
{
|
{
|
||||||
cctx = NULL;
|
cctx = NULL;
|
||||||
__glRenderTable = &__glMesaRenderTable;
|
|
||||||
__glRenderTableEXT = &__glMesaRenderTableEXT;
|
|
||||||
|
|
||||||
__glXFlushContextCache ();
|
GlxFlushContextCache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLinterface *
|
static __GLinterface *
|
||||||
@ -4173,6 +4379,7 @@ xglCreateContext (__GLimports *imports,
|
|||||||
pContext->drawXoff = 0;
|
pContext->drawXoff = 0;
|
||||||
pContext->drawYoff = 0;
|
pContext->drawYoff = 0;
|
||||||
pContext->maxTexUnits = 0;
|
pContext->maxTexUnits = 0;
|
||||||
|
pContext->fbo = 0;
|
||||||
|
|
||||||
if (pContext->doubleBuffer)
|
if (pContext->doubleBuffer)
|
||||||
{
|
{
|
||||||
@ -4294,6 +4501,7 @@ xglSwapBuffers (__GLXdrawablePrivate *glxPriv)
|
|||||||
glitz_surface_set_clip_region (surface, 0, 0, NULL, 0);
|
glitz_surface_set_clip_region (surface, 0, 0, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xglAddBitDamage (pDrawable, pGC->pCompositeClip);
|
||||||
DamageDamageRegion (pDrawable, pGC->pCompositeClip);
|
DamageDamageRegion (pDrawable, pGC->pCompositeClip);
|
||||||
REGION_EMPTY (pGC->pScreen, &pBufferPriv->damage);
|
REGION_EMPTY (pGC->pScreen, &pBufferPriv->damage);
|
||||||
}
|
}
|
||||||
@ -4323,33 +4531,8 @@ xglResizeBuffers (__GLdrawableBuffer *buffer,
|
|||||||
|
|
||||||
if (pDrawable)
|
if (pDrawable)
|
||||||
{
|
{
|
||||||
if (glPriv->modes->doubleBufferMode)
|
if (!xglResizeBuffer (glPriv, x, y, width, height))
|
||||||
{
|
return GL_FALSE;
|
||||||
glitz_surface_t *surface = pBufferPriv->backSurface;
|
|
||||||
|
|
||||||
XGL_SCREEN_PRIV (pDrawable->pScreen);
|
|
||||||
|
|
||||||
/* FIXME: copy color buffer bits, stencil bits and depth bits */
|
|
||||||
|
|
||||||
if (surface != pScreenPriv->backSurface &&
|
|
||||||
(glitz_surface_get_width (surface) != width ||
|
|
||||||
glitz_surface_get_height (surface) != height))
|
|
||||||
{
|
|
||||||
glitz_format_t *format;
|
|
||||||
|
|
||||||
format = pScreenPriv->pixmapFormats[pDrawable->depth].format;
|
|
||||||
|
|
||||||
glitz_surface_destroy (surface);
|
|
||||||
|
|
||||||
pBufferPriv->backSurface =
|
|
||||||
glitz_surface_create (pScreenPriv->drawable, format,
|
|
||||||
width, height, 0, NULL);
|
|
||||||
if (!pBufferPriv->backSurface)
|
|
||||||
status = GL_FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ValidateGC (pDrawable, pBufferPriv->pGC);
|
|
||||||
}
|
}
|
||||||
else if (pBufferPriv->private)
|
else if (pBufferPriv->private)
|
||||||
{
|
{
|
||||||
@ -4383,7 +4566,7 @@ xglBindBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
|
|
||||||
/* Must be a GLXpixmap */
|
/* Must be a GLXpixmap */
|
||||||
if (!glxPriv->pGlxPixmap)
|
if (!glxPriv->pGlxPixmap)
|
||||||
return __glXBadDrawable;
|
return BadDrawable;
|
||||||
|
|
||||||
pDrawable = glxPriv->pGlxPixmap->pDraw;
|
pDrawable = glxPriv->pGlxPixmap->pDraw;
|
||||||
|
|
||||||
@ -4400,18 +4583,29 @@ xglBindBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
|
|
||||||
if (pTexObj)
|
if (pTexObj)
|
||||||
{
|
{
|
||||||
XGL_DRAWABLE_PIXMAP (pDrawable);
|
glitz_texture_object_t *object;
|
||||||
|
|
||||||
|
XGL_DRAWABLE_PIXMAP (pDrawable);
|
||||||
|
XGL_PIXMAP_PRIV (pPixmap);
|
||||||
|
|
||||||
|
object = glitz_texture_object_create (pPixmapPriv->surface);
|
||||||
|
if (object)
|
||||||
|
{
|
||||||
pPixmap->refcnt++;
|
pPixmap->refcnt++;
|
||||||
|
|
||||||
if (pTexObj->pPixmap)
|
if (pTexObj->pPixmap)
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
||||||
|
|
||||||
|
if (pTexObj->object)
|
||||||
|
glitz_texture_object_destroy (pTexObj->object);
|
||||||
|
|
||||||
pTexObj->pPixmap = pPixmap;
|
pTexObj->pPixmap = pPixmap;
|
||||||
|
pTexObj->object = object;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (pBufferPriv->private)
|
else if (pBufferPriv->private)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
@ -4423,7 +4617,7 @@ xglBindBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __glXBadContext;
|
return BadDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -4453,6 +4647,8 @@ xglReleaseBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
{
|
{
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
||||||
pTexObj->pPixmap = NULL;
|
pTexObj->pPixmap = NULL;
|
||||||
|
glitz_texture_object_destroy (pTexObj->object);
|
||||||
|
pTexObj->object = NULL;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
@ -4463,6 +4659,8 @@ xglReleaseBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
{
|
{
|
||||||
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
(*pDrawable->pScreen->DestroyPixmap) (pTexObj->pPixmap);
|
||||||
pTexObj->pPixmap = NULL;
|
pTexObj->pPixmap = NULL;
|
||||||
|
glitz_texture_object_destroy (pTexObj->object);
|
||||||
|
pTexObj->object = NULL;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
@ -4480,7 +4678,7 @@ xglReleaseBuffers (__GLXdrawablePrivate *glxPriv,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __glXBadContext;
|
return BadDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -4533,29 +4731,21 @@ xglCreateBuffer (__GLXdrawablePrivate *glxPriv)
|
|||||||
|
|
||||||
REGION_INIT (pScreen, &pBufferPriv->damage, NullBox, 0);
|
REGION_INIT (pScreen, &pBufferPriv->damage, NullBox, 0);
|
||||||
|
|
||||||
/* use native back buffer for regular windows */
|
if (pScreenPriv->fbo ||
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW
|
((pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
/* this is a root window, can't be redirected */
|
/* this is a root window, can't be redirected */
|
||||||
&& (!((WindowPtr) pDrawable)->parent)
|
&& (!((WindowPtr) pDrawable)->parent)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
)
|
))
|
||||||
{
|
{
|
||||||
pBufferPriv->pDrawable = pDrawable;
|
pBufferPriv->pDrawable = pDrawable;
|
||||||
|
|
||||||
if (glxPriv->pGlxVisual->doubleBuffer)
|
|
||||||
{
|
|
||||||
pBufferPriv->backSurface = pScreenPriv->backSurface;
|
|
||||||
glitz_surface_reference (pScreenPriv->backSurface);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (0) /* pScreenPriv->features &
|
|
||||||
GLITZ_FEATURE_FRAMEBUFFER_OBJECT_MASK) */
|
|
||||||
{
|
|
||||||
pBufferPriv->pDrawable = pDrawable;
|
|
||||||
|
|
||||||
|
/* else if (pScreenPriv->fbo)
|
||||||
|
{
|
||||||
if (glxPriv->pGlxVisual->doubleBuffer)
|
if (glxPriv->pGlxVisual->doubleBuffer)
|
||||||
{
|
{
|
||||||
int depth = pDrawable->depth;
|
int depth = pDrawable->depth;
|
||||||
@ -4565,10 +4755,22 @@ xglCreateBuffer (__GLXdrawablePrivate *glxPriv)
|
|||||||
pScreenPriv->pixmapFormats[depth].format,
|
pScreenPriv->pixmapFormats[depth].format,
|
||||||
pDrawable->width, pDrawable->height,
|
pDrawable->width, pDrawable->height,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
if (!pBufferPriv->backSurface)
|
if (pBufferPriv->backSurface)
|
||||||
FatalError ("xglCreateBuffer: glitz_surface_create\n");
|
{
|
||||||
|
if (glitz_surface_valid_target (pBufferPriv->backSurface))
|
||||||
|
{
|
||||||
|
pBufferPriv->pDrawable = pDrawable;
|
||||||
|
ErrorF ("Backbuffer created\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glitz_surface_destroy (pBufferPriv->backSurface);
|
||||||
|
pBufferPriv->backSurface = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(*screenInfoPriv.createBuffer) (glxPriv);
|
(*screenInfoPriv.createBuffer) (glxPriv);
|
||||||
@ -4595,29 +4797,27 @@ xglCreateBuffer (__GLXdrawablePrivate *glxPriv)
|
|||||||
GLX_RENDER_TEXTURE_RGBA is set to TRUE. */
|
GLX_RENDER_TEXTURE_RGBA is set to TRUE. */
|
||||||
if (pDrawable->type != DRAWABLE_WINDOW)
|
if (pDrawable->type != DRAWABLE_WINDOW)
|
||||||
{
|
{
|
||||||
/* GL_ARB_texture_rectangle is required for sane texture coordinates.
|
|
||||||
GL_ARB_texture_border_clamp is required right now as glitz will
|
|
||||||
emulate it when missing, which means a 1 pixel translucent black
|
|
||||||
border inside textures, that cannot be exposed to clients. */
|
|
||||||
if (pScreenPriv->features &
|
|
||||||
(GLITZ_FEATURE_TEXTURE_BORDER_CLAMP_MASK |
|
|
||||||
GLITZ_FEATURE_TEXTURE_RECTANGLE_MASK))
|
|
||||||
{
|
|
||||||
glitz_point_fixed_t point = { 1 << 16 , 1 << 16 };
|
|
||||||
|
|
||||||
XGL_DRAWABLE_PIXMAP (pDrawable);
|
XGL_DRAWABLE_PIXMAP (pDrawable);
|
||||||
|
|
||||||
if (xglCreatePixmapSurface (pPixmap))
|
if (xglCreatePixmapSurface (pPixmap))
|
||||||
{
|
{
|
||||||
|
glitz_texture_object_t *texture;
|
||||||
|
|
||||||
XGL_PIXMAP_PRIV (pPixmap);
|
XGL_PIXMAP_PRIV (pPixmap);
|
||||||
|
|
||||||
/* FIXME: doesn't work for 1x1 textures */
|
texture = glitz_texture_object_create (pPixmapPriv->surface);
|
||||||
glitz_surface_translate_point (pPixmapPriv->surface,
|
if (texture)
|
||||||
&point, &point);
|
{
|
||||||
if (point.x > (1 << 16) || point.y > (1 << 16))
|
switch (glitz_texture_object_get_target (texture)) {
|
||||||
glxPriv->texTarget = GLX_TEXTURE_RECTANGLE_EXT;
|
case GLITZ_TEXTURE_TARGET_2D:
|
||||||
else
|
|
||||||
glxPriv->texTarget = GLX_TEXTURE_2D_EXT;
|
glxPriv->texTarget = GLX_TEXTURE_2D_EXT;
|
||||||
|
break;
|
||||||
|
case GLITZ_TEXTURE_TARGET_RECT:
|
||||||
|
glxPriv->texTarget = GLX_TEXTURE_RECTANGLE_EXT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
glitz_texture_object_destroy (texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4657,44 +4857,6 @@ xglScreenProbe (int screen)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
xglXWaitX (__GLXclientState *cl, GLbyte *pc)
|
|
||||||
{
|
|
||||||
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
|
|
||||||
__GLXcontext *cx;
|
|
||||||
|
|
||||||
cx = (__GLXcontext *) __glXLookupContextByTag (cl, req->contextTag);
|
|
||||||
if (cx)
|
|
||||||
{
|
|
||||||
xglGLContextPtr pContext = (xglGLContextPtr) cx->gc;
|
|
||||||
__GLXcontext *glxCtx = (__GLXcontext *)
|
|
||||||
pContext->iface.imports.other;
|
|
||||||
|
|
||||||
XGL_SCREEN_PRIV (glxCtx->pScreen);
|
|
||||||
|
|
||||||
glitz_drawable_finish (pScreenPriv->drawable);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cl->client->errorValue = req->contextTag;
|
|
||||||
return __glXBadContextTag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
xglXSwapWaitX (__GLXclientState *cl, GLbyte *pc)
|
|
||||||
{
|
|
||||||
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
|
|
||||||
__GLX_DECLARE_SWAP_VARIABLES;
|
|
||||||
|
|
||||||
__GLX_SWAP_SHORT (&req->length);
|
|
||||||
__GLX_SWAP_INT (&req->contextTag);
|
|
||||||
|
|
||||||
return xglXWaitX (cl, pc);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xglDestroyWindow (WindowPtr pWin)
|
xglDestroyWindow (WindowPtr pWin)
|
||||||
{
|
{
|
||||||
@ -4861,9 +5023,6 @@ xglInitVisualConfigs (ScreenPtr pScreen)
|
|||||||
{
|
{
|
||||||
screenInfoPriv.screenProbe = __glDDXScreenInfo.screenProbe;
|
screenInfoPriv.screenProbe = __glDDXScreenInfo.screenProbe;
|
||||||
__glDDXScreenInfo.screenProbe = xglScreenProbe;
|
__glDDXScreenInfo.screenProbe = xglScreenProbe;
|
||||||
|
|
||||||
__glXSingleTable[9] = xglXWaitX;
|
|
||||||
__glXSwapSingleTable[9] = xglXSwapWaitX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
visuals = pScreen->visuals;
|
visuals = pScreen->visuals;
|
||||||
@ -4907,5 +5066,3 @@ xglInitVisualConfigs (ScreenPtr pScreen)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GLXEXT */
|
|
38
hw/xgl/glxext/xglglxext.h
Normal file
38
hw/xgl/glxext/xglglxext.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _XGL_GLXEXT_H_
|
||||||
|
#define _XGL_GLXEXT_H_
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "scrnintstr.h"
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglInitVisualConfigs (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
#endif /* _XGL_GLXEXT_H_ */
|
62
hw/xgl/xgl.h
62
hw/xgl/xgl.h
@ -55,7 +55,7 @@ typedef struct _GCFuncs *GCFuncsPtr;
|
|||||||
|
|
||||||
extern WindowPtr *WindowTable;
|
extern WindowPtr *WindowTable;
|
||||||
|
|
||||||
#define XGL_DEFAULT_PBO_MASK 0 /* don't use PBO as default */
|
#define XGL_DEFAULT_PBO_MASK 0
|
||||||
|
|
||||||
typedef struct _xglScreenInfo {
|
typedef struct _xglScreenInfo {
|
||||||
glitz_drawable_t *drawable;
|
glitz_drawable_t *drawable;
|
||||||
@ -63,14 +63,16 @@ typedef struct _xglScreenInfo {
|
|||||||
unsigned int height;
|
unsigned int height;
|
||||||
unsigned int widthMm;
|
unsigned int widthMm;
|
||||||
unsigned int heightMm;
|
unsigned int heightMm;
|
||||||
Bool fullscreen;
|
|
||||||
int geometryDataType;
|
int geometryDataType;
|
||||||
int geometryUsage;
|
int geometryUsage;
|
||||||
Bool yInverted;
|
Bool yInverted;
|
||||||
int pboMask;
|
int pboMask;
|
||||||
Bool lines;
|
Bool lines;
|
||||||
|
Bool fbo;
|
||||||
} xglScreenInfoRec, *xglScreenInfoPtr;
|
} xglScreenInfoRec, *xglScreenInfoPtr;
|
||||||
|
|
||||||
|
extern xglScreenInfoRec xglScreenInfo;
|
||||||
|
|
||||||
typedef struct _xglPixelFormat {
|
typedef struct _xglPixelFormat {
|
||||||
CARD8 depth, bitsPerRGB;
|
CARD8 depth, bitsPerRGB;
|
||||||
glitz_pixel_masks_t masks;
|
glitz_pixel_masks_t masks;
|
||||||
@ -213,6 +215,7 @@ typedef struct _xglScreen {
|
|||||||
Bool yInverted;
|
Bool yInverted;
|
||||||
int pboMask;
|
int pboMask;
|
||||||
Bool lines;
|
Bool lines;
|
||||||
|
Bool fbo;
|
||||||
xglGeometryRec scratchGeometry;
|
xglGeometryRec scratchGeometry;
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
@ -489,15 +492,13 @@ xglParseFindNext (char *cur,
|
|||||||
char *last);
|
char *last);
|
||||||
|
|
||||||
void
|
void
|
||||||
xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
xglParseScreen (char *arg);
|
||||||
char *arg);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xglUseMsg (void);
|
xglUseMsg (void);
|
||||||
|
|
||||||
int
|
int
|
||||||
xglProcessArgument (xglScreenInfoPtr pScreenInfo,
|
xglProcessArgument (int argc,
|
||||||
int argc,
|
|
||||||
char **argv,
|
char **argv,
|
||||||
int i);
|
int i);
|
||||||
|
|
||||||
@ -505,8 +506,7 @@ xglProcessArgument (xglScreenInfoPtr pScreenInfo,
|
|||||||
/* xglscreen.c */
|
/* xglscreen.c */
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xglScreenInit (ScreenPtr pScreen,
|
xglScreenInit (ScreenPtr pScreen);
|
||||||
xglScreenInfoPtr pScreenInfo);
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xglFinishScreenInit (ScreenPtr pScreen);
|
xglFinishScreenInit (ScreenPtr pScreen);
|
||||||
@ -871,6 +871,10 @@ xglAddSurfaceDamage (DrawablePtr pDrawable,
|
|||||||
void
|
void
|
||||||
xglAddCurrentSurfaceDamage (DrawablePtr pDrawable);
|
xglAddCurrentSurfaceDamage (DrawablePtr pDrawable);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglAddBitDamage (DrawablePtr pDrawable,
|
||||||
|
RegionPtr pRegion);
|
||||||
|
|
||||||
void
|
void
|
||||||
xglAddCurrentBitDamage (DrawablePtr pDrawable);
|
xglAddCurrentBitDamage (DrawablePtr pDrawable);
|
||||||
|
|
||||||
@ -1327,10 +1331,47 @@ xglAddTraps (PicturePtr pDst,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XLOADABLE
|
||||||
|
|
||||||
|
/* xglloader.c */
|
||||||
|
|
||||||
|
typedef struct _xglSymbol {
|
||||||
|
void **ptr;
|
||||||
|
const char *name;
|
||||||
|
} xglSymbolRec, *xglSymbolPtr;
|
||||||
|
|
||||||
|
void *
|
||||||
|
xglLoadModule (const char *name);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglUnloadModule (void *handle);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglLookupSymbols (void *handle,
|
||||||
|
xglSymbolPtr sym,
|
||||||
|
int nSym);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GLXEXT
|
#ifdef GLXEXT
|
||||||
|
|
||||||
|
/* xglglx.c */
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglLoadGLXModules (void);
|
||||||
|
|
||||||
|
void
|
||||||
|
xglUnloadGLXModules (void);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* xglhash.c */
|
||||||
|
|
||||||
typedef struct _xglHashTable *xglHashTablePtr;
|
typedef struct _xglHashTable *xglHashTablePtr;
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglLoadHashFuncs (void *handle);
|
||||||
|
|
||||||
xglHashTablePtr
|
xglHashTablePtr
|
||||||
xglNewHashTable (void);
|
xglNewHashTable (void);
|
||||||
|
|
||||||
@ -1361,9 +1402,4 @@ unsigned int
|
|||||||
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
||||||
unsigned int numKeys);
|
unsigned int numKeys);
|
||||||
|
|
||||||
Bool
|
|
||||||
xglInitVisualConfigs (ScreenPtr pScreen);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _XGL_H_ */
|
#endif /* _XGL_H_ */
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
* Author: David Reveman <davidr@novell.com>
|
* Author: David Reveman <davidr@novell.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include "xgl.h"
|
#include "xgl.h"
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
#include "micmap.h"
|
#include "micmap.h"
|
||||||
@ -147,7 +148,6 @@ xglSetVisualTypesAndMasks (ScreenInfo *pScreenInfo,
|
|||||||
nxglVisuals++;
|
nxglVisuals++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,58 +25,77 @@
|
|||||||
|
|
||||||
#include "xgl.h"
|
#include "xgl.h"
|
||||||
|
|
||||||
#ifdef GLXEXT
|
#define SYM(ptr, name) { (void **) &(ptr), (name) }
|
||||||
|
|
||||||
/* This is just a wrapper around Mesa's hash functions. */
|
typedef struct _xglHashFunc {
|
||||||
|
xglHashTablePtr (*NewHashTable) (void);
|
||||||
extern struct _mesa_HashTable *
|
void (*DeleteHashTable) (xglHashTablePtr pTable);
|
||||||
_mesa_NewHashTable (void);
|
void *(*HashLookup) (const xglHashTablePtr pTable,
|
||||||
|
|
||||||
extern void
|
|
||||||
_mesa_DeleteHashTable (struct _mesa_HashTable *table);
|
|
||||||
|
|
||||||
extern void *
|
|
||||||
_mesa_HashLookup (const struct _mesa_HashTable *table,
|
|
||||||
unsigned int key);
|
unsigned int key);
|
||||||
|
void (*HashInsert) (xglHashTablePtr pTable,
|
||||||
extern void
|
|
||||||
_mesa_HashInsert (struct _mesa_HashTable *table,
|
|
||||||
unsigned int key,
|
unsigned int key,
|
||||||
void *data);
|
void *data);
|
||||||
|
void (*HashRemove) (xglHashTablePtr pTable,
|
||||||
extern void
|
|
||||||
_mesa_HashRemove (struct _mesa_HashTable *table,
|
|
||||||
unsigned int key);
|
unsigned int key);
|
||||||
|
unsigned int (*HashFirstEntry) (xglHashTablePtr pTable);
|
||||||
extern unsigned int
|
unsigned int (*HashNextEntry) (const xglHashTablePtr pTable,
|
||||||
_mesa_HashFirstEntry (struct _mesa_HashTable *table);
|
|
||||||
|
|
||||||
extern unsigned int
|
|
||||||
_mesa_HashNextEntry (const struct _mesa_HashTable *table,
|
|
||||||
unsigned int key);
|
unsigned int key);
|
||||||
|
unsigned int (*HashFindFreeKeyBlock) (xglHashTablePtr pTable,
|
||||||
extern unsigned int
|
|
||||||
_mesa_HashFindFreeKeyBlock (struct _mesa_HashTable *table,
|
|
||||||
unsigned int numKeys);
|
unsigned int numKeys);
|
||||||
|
} xglHashFuncRec;
|
||||||
|
|
||||||
|
static xglHashFuncRec __hashFunc;
|
||||||
|
|
||||||
|
static void *hashHandle = 0;
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglLoadHashFuncs (void *handle)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef XLOADABLE
|
||||||
|
xglSymbolRec sym[] = {
|
||||||
|
SYM (__hashFunc.NewHashTable, "_mesa_NewHashTable"),
|
||||||
|
SYM (__hashFunc.DeleteHashTable, "_mesa_DeleteHashTable"),
|
||||||
|
SYM (__hashFunc.HashLookup, "_mesa_HashLookup"),
|
||||||
|
SYM (__hashFunc.HashInsert, "_mesa_HashInsert"),
|
||||||
|
SYM (__hashFunc.HashRemove, "_mesa_HashRemove"),
|
||||||
|
SYM (__hashFunc.HashFirstEntry, "_mesa_HashFirstEntry"),
|
||||||
|
SYM (__hashFunc.HashNextEntry, "_mesa_HashNextEntry"),
|
||||||
|
SYM (__hashFunc.HashFindFreeKeyBlock, "_mesa_HashFindFreeKeyBlock")
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!xglLookupSymbols (handle, sym, sizeof (sym) / sizeof (sym[0])))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
hashHandle = handle;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
xglHashTablePtr
|
xglHashTablePtr
|
||||||
xglNewHashTable (void)
|
xglNewHashTable (void)
|
||||||
{
|
{
|
||||||
return (xglHashTablePtr) _mesa_NewHashTable ();
|
if (!hashHandle)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (*__hashFunc.NewHashTable) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xglDeleteHashTable (xglHashTablePtr pTable)
|
xglDeleteHashTable (xglHashTablePtr pTable)
|
||||||
{
|
{
|
||||||
_mesa_DeleteHashTable ((struct _mesa_HashTable *) pTable);
|
(*__hashFunc.DeleteHashTable) (pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
xglHashLookup (const xglHashTablePtr pTable,
|
xglHashLookup (const xglHashTablePtr pTable,
|
||||||
unsigned int key)
|
unsigned int key)
|
||||||
{
|
{
|
||||||
return _mesa_HashLookup ((struct _mesa_HashTable *) pTable, key);
|
return (*__hashFunc.HashLookup) (pTable, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -84,35 +103,32 @@ xglHashInsert (xglHashTablePtr pTable,
|
|||||||
unsigned int key,
|
unsigned int key,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
_mesa_HashInsert ((struct _mesa_HashTable *) pTable, key, data);
|
(*__hashFunc.HashInsert) (pTable, key, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xglHashRemove (xglHashTablePtr pTable,
|
xglHashRemove (xglHashTablePtr pTable,
|
||||||
unsigned int key)
|
unsigned int key)
|
||||||
{
|
{
|
||||||
_mesa_HashRemove ((struct _mesa_HashTable *) pTable, key);
|
(*__hashFunc.HashRemove) (pTable, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
xglHashFirstEntry (xglHashTablePtr pTable)
|
xglHashFirstEntry (xglHashTablePtr pTable)
|
||||||
{
|
{
|
||||||
return _mesa_HashFirstEntry ((struct _mesa_HashTable *) pTable);
|
return (*__hashFunc.HashFirstEntry) (pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
xglHashNextEntry (const xglHashTablePtr pTable,
|
xglHashNextEntry (const xglHashTablePtr pTable,
|
||||||
unsigned int key)
|
unsigned int key)
|
||||||
{
|
{
|
||||||
return _mesa_HashNextEntry ((struct _mesa_HashTable *) pTable, key);
|
return (*__hashFunc.HashNextEntry) (pTable, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
||||||
unsigned int numKeys)
|
unsigned int numKeys)
|
||||||
{
|
{
|
||||||
return _mesa_HashFindFreeKeyBlock ((struct _mesa_HashTable *) pTable,
|
return (*__hashFunc.HashFindFreeKeyBlock) (pTable, numKeys);
|
||||||
numKeys);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
287
hw/xgl/xglinit.c
Normal file
287
hw/xgl/xglinit.c
Normal file
@ -0,0 +1,287 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xgl.h"
|
||||||
|
#include "micmap.h"
|
||||||
|
#include "mipointer.h"
|
||||||
|
#include "fb.h"
|
||||||
|
|
||||||
|
#define DEAFULT_DDX_MODULE_NAME "xglx"
|
||||||
|
|
||||||
|
static char *ddxModuleName = DEAFULT_DDX_MODULE_NAME;
|
||||||
|
|
||||||
|
xglScreenInfoRec xglScreenInfo = {
|
||||||
|
NULL, 0, 0, 0, 0,
|
||||||
|
DEFAULT_GEOMETRY_DATA_TYPE,
|
||||||
|
DEFAULT_GEOMETRY_USAGE,
|
||||||
|
FALSE,
|
||||||
|
XGL_DEFAULT_PBO_MASK,
|
||||||
|
FALSE,
|
||||||
|
FALSE
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
static Bool loadGlx = TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _xglDDXFunc {
|
||||||
|
void (*initOutput) (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv);
|
||||||
|
void (*initInput) (int argc,
|
||||||
|
char **argv);
|
||||||
|
Bool (*legalModifier) (unsigned int key,
|
||||||
|
DevicePtr pDev);
|
||||||
|
void (*processInputEvents) (void);
|
||||||
|
void (*useMsg) (void);
|
||||||
|
int (*processArgument) (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i);
|
||||||
|
void (*abort) (void);
|
||||||
|
void (*giveUp) (void);
|
||||||
|
void (*osVendorInit) (void);
|
||||||
|
} xglDDXFuncRec;
|
||||||
|
|
||||||
|
static xglDDXFuncRec __ddxFunc;
|
||||||
|
|
||||||
|
#define SYMFUNC(name) ((void *) (name))
|
||||||
|
#define SYMVAR(name) ((void *) &(name))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following table is used to make sure that all symbols required by
|
||||||
|
* dynamically loaded modules are present in the main program. Add more symbols
|
||||||
|
* as needed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void *symTab[] = {
|
||||||
|
SYMFUNC (xglKbdCtrl),
|
||||||
|
SYMFUNC (xglSetPixmapFormats),
|
||||||
|
SYMVAR (xglVisuals),
|
||||||
|
|
||||||
|
SYMFUNC (mieqEnqueue),
|
||||||
|
SYMFUNC (mieqInit),
|
||||||
|
SYMFUNC (mieqProcessInputEvents),
|
||||||
|
SYMFUNC (miPointerAbsoluteCursor),
|
||||||
|
SYMFUNC (miRegisterPointerDevice),
|
||||||
|
SYMFUNC (miPointerWarpCursor),
|
||||||
|
SYMFUNC (miDCInitialize),
|
||||||
|
SYMFUNC (miPointerAbsoluteCursor),
|
||||||
|
SYMFUNC (miPointerUpdate),
|
||||||
|
SYMFUNC (miRegisterRedirectBorderClipProc)
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SYM(ptr, name) { (void **) &(ptr), (name) }
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
xglEnsureDDXModule (void)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef XLOADABLE
|
||||||
|
static void *ddxHandle = 0;
|
||||||
|
static Bool status = TRUE;
|
||||||
|
|
||||||
|
if (!status)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!ddxHandle)
|
||||||
|
{
|
||||||
|
xglSymbolRec sym[] = {
|
||||||
|
SYM (__ddxFunc.initOutput, "InitOutput"),
|
||||||
|
SYM (__ddxFunc.initInput, "InitInput"),
|
||||||
|
SYM (__ddxFunc.legalModifier, "LegalModifier"),
|
||||||
|
SYM (__ddxFunc.processInputEvents, "ProcessInputEvents"),
|
||||||
|
SYM (__ddxFunc.useMsg, "ddxUseMsg"),
|
||||||
|
SYM (__ddxFunc.processArgument, "ddxProcessArgument"),
|
||||||
|
SYM (__ddxFunc.abort, "AbortDDX"),
|
||||||
|
SYM (__ddxFunc.giveUp, "ddxGiveUp"),
|
||||||
|
SYM (__ddxFunc.osVendorInit, "OsVendorInit")
|
||||||
|
};
|
||||||
|
|
||||||
|
ddxHandle = xglLoadModule (ddxModuleName);
|
||||||
|
if (!ddxHandle)
|
||||||
|
return (status = FALSE);
|
||||||
|
|
||||||
|
if (!xglLookupSymbols (ddxHandle, sym, sizeof (sym) / sizeof (sym[0])))
|
||||||
|
{
|
||||||
|
xglUnloadModule (ddxHandle);
|
||||||
|
ddxHandle = 0;
|
||||||
|
|
||||||
|
return (status = FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitOutput (ScreenInfo *pScreenInfo,
|
||||||
|
int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
(void) symTab;
|
||||||
|
|
||||||
|
if (!xglEnsureDDXModule ())
|
||||||
|
FatalError ("No DDX module loaded");
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
if (loadGlx)
|
||||||
|
{
|
||||||
|
if (!xglLoadGLXModules ())
|
||||||
|
FatalError ("No GLX modules loaded");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
(*__ddxFunc.initOutput) (pScreenInfo, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
LegalModifier (unsigned int key,
|
||||||
|
DevicePtr pDev)
|
||||||
|
{
|
||||||
|
return (*__ddxFunc.legalModifier) (key, pDev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessInputEvents (void)
|
||||||
|
{
|
||||||
|
(*__ddxFunc.processInputEvents) ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
InitInput (int argc,
|
||||||
|
char **argv)
|
||||||
|
{
|
||||||
|
if (!xglEnsureDDXModule ())
|
||||||
|
FatalError ("No DDX module loaded");
|
||||||
|
|
||||||
|
(*__ddxFunc.initInput) (argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxUseMsg (void)
|
||||||
|
{
|
||||||
|
ErrorF ("\nXgl usage:\n");
|
||||||
|
ErrorF ("-ddx module specify ddx module\n");
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
ErrorF ("-noglx don't load glx extension\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (xglEnsureDDXModule ())
|
||||||
|
(*__ddxFunc.useMsg) ();
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LOPT(s, l) { (s), (l) }
|
||||||
|
#define OPT(s) LOPT (s, 0)
|
||||||
|
|
||||||
|
int
|
||||||
|
ddxProcessArgument (int argc,
|
||||||
|
char **argv,
|
||||||
|
int i)
|
||||||
|
{
|
||||||
|
struct _option {
|
||||||
|
char *name;
|
||||||
|
int length;
|
||||||
|
} commonOption[] = {
|
||||||
|
LOPT (":", 1), OPT ("-a"), OPT ("-ac"), OPT ("-audit"), OPT ("-auth"),
|
||||||
|
OPT ("bc"), OPT ("-br"), OPT ("+bs"), OPT ("-bs"), OPT ("c"), OPT ("-c"),
|
||||||
|
OPT ("-cc"), OPT ("-co"), OPT ("-core"), OPT ("-dpi"),
|
||||||
|
OPT ("-deferglyphs"), OPT ("-f"), OPT ("-fc"), OPT ("-fn"), OPT ("-fp"),
|
||||||
|
OPT ("-help"), OPT ("-nolisten"), OPT ("-noreset"), OPT ("-p"),
|
||||||
|
OPT ("-pn"), OPT ("-nopn"), OPT ("r"), OPT ("-r"), OPT ("-s"),
|
||||||
|
OPT ("-su"), OPT ("-t"), OPT ("-terminate"), OPT ("-to"), OPT ("-tst"),
|
||||||
|
OPT ("v"), OPT ("-v"), OPT ("-wm"), OPT ("-x"), OPT ("-I"),
|
||||||
|
LOPT ("tty", 3)
|
||||||
|
};
|
||||||
|
int skip, j;
|
||||||
|
|
||||||
|
for (j = 0; j < sizeof (commonOption) / sizeof (commonOption[0]); j++)
|
||||||
|
{
|
||||||
|
if (commonOption[j].length)
|
||||||
|
{
|
||||||
|
if (!strncmp (argv[i], commonOption[j].name, commonOption[j].length))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!strcmp (argv[i], commonOption[j].name))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp (argv[i], "-ddx"))
|
||||||
|
{
|
||||||
|
if ((i + 1) < argc)
|
||||||
|
{
|
||||||
|
ddxModuleName = argv[i + 1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef GLXEXT
|
||||||
|
else if (!strcmp (argv[i], "-noglx"))
|
||||||
|
{
|
||||||
|
loadGlx = FALSE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
skip = xglProcessArgument (argc, argv, i);
|
||||||
|
if (skip)
|
||||||
|
return skip;
|
||||||
|
|
||||||
|
if (xglEnsureDDXModule ())
|
||||||
|
return (*__ddxFunc.processArgument) (argc, argv, i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortDDX (void)
|
||||||
|
{
|
||||||
|
if (xglEnsureDDXModule ())
|
||||||
|
(*__ddxFunc.abort) ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ddxGiveUp (void)
|
||||||
|
{
|
||||||
|
if (xglEnsureDDXModule ())
|
||||||
|
(*__ddxFunc.giveUp) ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
OsVendorInit (void)
|
||||||
|
{
|
||||||
|
if (xglEnsureDDXModule ())
|
||||||
|
(*__ddxFunc.osVendorInit) ();
|
||||||
|
}
|
129
hw/xgl/xglloader.c
Normal file
129
hw/xgl/xglloader.c
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "xgl.h"
|
||||||
|
#include "xglmodule.h"
|
||||||
|
|
||||||
|
#ifdef XLOADABLE
|
||||||
|
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
#define SYM(ptr, name) { (void **) &(ptr), (name) }
|
||||||
|
|
||||||
|
void *
|
||||||
|
xglLoadModule (const char *name)
|
||||||
|
{
|
||||||
|
ModuleVersionProcPtr moduleVersion;
|
||||||
|
ModuleInitProcPtr moduleInit;
|
||||||
|
void *handle = 0;
|
||||||
|
char *module;
|
||||||
|
xglSymbolRec mSym[] = {
|
||||||
|
SYM (moduleVersion, "moduleVersion"),
|
||||||
|
SYM (moduleInit, "moduleInit")
|
||||||
|
};
|
||||||
|
|
||||||
|
module = malloc (strlen (MODULEPATH "/xgl/lib.so") + strlen (name) + 1);
|
||||||
|
if (!module)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
sprintf (module, MODULEPATH "/xgl/lib%s.so", name);
|
||||||
|
|
||||||
|
handle = dlopen (module, RTLD_NOW);
|
||||||
|
if (handle)
|
||||||
|
{
|
||||||
|
if (xglLookupSymbols (handle, mSym, sizeof (mSym) / sizeof (mSym[0])))
|
||||||
|
{
|
||||||
|
const char *version;
|
||||||
|
|
||||||
|
version = (*moduleVersion) ();
|
||||||
|
if (strcmp (VERSION, version) == 0)
|
||||||
|
{
|
||||||
|
if (!(*moduleInit) (module))
|
||||||
|
{
|
||||||
|
dlclose (handle);
|
||||||
|
handle = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ErrorF ("Module version mismatch. "
|
||||||
|
"%s is %s Xserver is" VERSION "\n",
|
||||||
|
module, version);
|
||||||
|
|
||||||
|
dlclose (handle);
|
||||||
|
handle = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dlclose (handle);
|
||||||
|
handle = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ErrorF ("dlopen: %s\n", dlerror ());
|
||||||
|
|
||||||
|
free (module);
|
||||||
|
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xglUnloadModule (void *handle)
|
||||||
|
{
|
||||||
|
dlclose (handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xglLookupSymbols (void *handle,
|
||||||
|
xglSymbolPtr sym,
|
||||||
|
int nSym)
|
||||||
|
{
|
||||||
|
void *symbol;
|
||||||
|
char *error;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* avoid previous error */
|
||||||
|
dlerror ();
|
||||||
|
|
||||||
|
for (i = 0; i < nSym; i++)
|
||||||
|
{
|
||||||
|
symbol = dlsym (handle, sym[i].name);
|
||||||
|
if (!symbol)
|
||||||
|
{
|
||||||
|
error = dlerror ();
|
||||||
|
if (error != 0)
|
||||||
|
ErrorF ("dlsym: %s: %s\n", sym[i].name, error);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*(sym[i].ptr) = symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
45
hw/xgl/xglmodule.h
Normal file
45
hw/xgl/xglmodule.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2005 Novell, 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
|
||||||
|
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||||
|
* distribution of the software without specific, written prior permission.
|
||||||
|
* Novell, Inc. makes no representations about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*
|
||||||
|
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL NOVELL, 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.
|
||||||
|
*
|
||||||
|
* Author: David Reveman <davidr@novell.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _XGL_MODULE_H_
|
||||||
|
#define _XGL_MODULE_H_
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <X11/Xdefs.h>
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
typedef const char *(*ModuleVersionProcPtr) (void);
|
||||||
|
typedef Bool (*ModuleInitProcPtr) (const char *module);
|
||||||
|
|
||||||
|
char *
|
||||||
|
moduleVersion (void);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
moduleInit (const char *module);
|
||||||
|
|
||||||
|
#endif /* _XGL_MODULE_H_ */
|
@ -44,17 +44,16 @@ xglParseFindNext (char *cur,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
xglParseScreen (char *arg)
|
||||||
char *arg)
|
|
||||||
{
|
{
|
||||||
char delim;
|
char delim;
|
||||||
char save[1024];
|
char save[1024];
|
||||||
int i, pixels, mm;
|
int i, pixels, mm;
|
||||||
|
|
||||||
pScreenInfo->width = 0;
|
xglScreenInfo.width = 0;
|
||||||
pScreenInfo->height = 0;
|
xglScreenInfo.height = 0;
|
||||||
pScreenInfo->widthMm = 0;
|
xglScreenInfo.widthMm = 0;
|
||||||
pScreenInfo->heightMm = 0;
|
xglScreenInfo.heightMm = 0;
|
||||||
|
|
||||||
if (!arg)
|
if (!arg)
|
||||||
return;
|
return;
|
||||||
@ -82,13 +81,13 @@ xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
|||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
pScreenInfo->width = pixels;
|
xglScreenInfo.width = pixels;
|
||||||
pScreenInfo->widthMm = mm;
|
xglScreenInfo.widthMm = mm;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pScreenInfo->height = pixels;
|
xglScreenInfo.height = pixels;
|
||||||
pScreenInfo->heightMm = mm;
|
xglScreenInfo.heightMm = mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delim != 'x')
|
if (delim != 'x')
|
||||||
@ -99,79 +98,66 @@ xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
|||||||
void
|
void
|
||||||
xglUseMsg (void)
|
xglUseMsg (void)
|
||||||
{
|
{
|
||||||
ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM] "
|
|
||||||
"specify screen characteristics\n");
|
|
||||||
ErrorF ("-fullscreen run fullscreen\n");
|
|
||||||
ErrorF ("-vertextype [short|float] set vertex data type\n");
|
ErrorF ("-vertextype [short|float] set vertex data type\n");
|
||||||
ErrorF ("-vbostream "
|
|
||||||
"use vertex buffer objects for streaming of vertex data\n");
|
|
||||||
ErrorF ("-yinverted Y is upside-down\n");
|
ErrorF ("-yinverted Y is upside-down\n");
|
||||||
ErrorF ("-pbomask [1|4|8|16|32] "
|
|
||||||
"set bpp's to use with pixel buffer objects\n");
|
|
||||||
ErrorF ("-lines "
|
ErrorF ("-lines "
|
||||||
"accelerate lines that are not vertical or horizontal\n");
|
"accelerate lines that are not vertical or horizontal\n");
|
||||||
|
ErrorF ("-vbo "
|
||||||
|
"use vertex buffer objects for streaming of vertex data\n");
|
||||||
|
ErrorF ("-pbomask [1|4|8|16|32] "
|
||||||
|
"set bpp's to use with pixel buffer objects\n");
|
||||||
|
ErrorF ("-fbo "
|
||||||
|
"use frame buffer objects for accelerate offscreen drawing\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xglProcessArgument (xglScreenInfoPtr pScreenInfo,
|
xglProcessArgument (int argc,
|
||||||
int argc,
|
|
||||||
char **argv,
|
char **argv,
|
||||||
int i)
|
int i)
|
||||||
{
|
{
|
||||||
if (!strcmp (argv[i], "-screen"))
|
if (!strcmp (argv[i], "-vertextype"))
|
||||||
{
|
|
||||||
if ((i + 1) < argc)
|
|
||||||
{
|
|
||||||
xglParseScreen (pScreenInfo, argv[i + 1]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
else if (!strcmp (argv[i], "-fullscreen"))
|
|
||||||
{
|
|
||||||
pScreenInfo->fullscreen = TRUE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else if (!strcmp (argv[i], "-vertextype"))
|
|
||||||
{
|
{
|
||||||
if ((i + 1) < argc)
|
if ((i + 1) < argc)
|
||||||
{
|
{
|
||||||
if (!strcasecmp (argv[i + 1], "short"))
|
if (!strcasecmp (argv[i + 1], "short"))
|
||||||
pScreenInfo->geometryDataType = GEOMETRY_DATA_TYPE_SHORT;
|
xglScreenInfo.geometryDataType = GEOMETRY_DATA_TYPE_SHORT;
|
||||||
else if (!strcasecmp (argv[i + 1], "float"))
|
else if (!strcasecmp (argv[i + 1], "float"))
|
||||||
pScreenInfo->geometryDataType = GEOMETRY_DATA_TYPE_FLOAT;
|
xglScreenInfo.geometryDataType = GEOMETRY_DATA_TYPE_FLOAT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
else if (!strcmp (argv[i], "-vbostream"))
|
|
||||||
{
|
|
||||||
pScreenInfo->geometryUsage = GEOMETRY_USAGE_STREAM;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else if (!strcmp (argv[i], "-yinverted"))
|
else if (!strcmp (argv[i], "-yinverted"))
|
||||||
{
|
{
|
||||||
pScreenInfo->yInverted = TRUE;
|
xglScreenInfo.yInverted = TRUE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (!strcmp (argv[i], "-lines"))
|
||||||
|
{
|
||||||
|
xglScreenInfo.lines = TRUE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (!strcmp (argv[i], "-vbo"))
|
||||||
|
{
|
||||||
|
xglScreenInfo.geometryUsage = GEOMETRY_USAGE_STREAM;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (!strcmp (argv[i], "-pbomask"))
|
else if (!strcmp (argv[i], "-pbomask"))
|
||||||
{
|
{
|
||||||
if ((i + 1) < argc)
|
if ((i + 1) < argc)
|
||||||
{
|
{
|
||||||
pScreenInfo->pboMask = atoi (argv[i + 1]);
|
xglScreenInfo.pboMask = atoi (argv[i + 1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
else if (!strcmp (argv[i], "-lines"))
|
else if (!strcmp (argv[i], "-fbo"))
|
||||||
{
|
{
|
||||||
pScreenInfo->lines = TRUE;
|
xglScreenInfo.fbo = TRUE;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +114,8 @@ xglPixmapSurfaceInit (PixmapPtr pPixmap,
|
|||||||
|
|
||||||
if (width && height)
|
if (width && height)
|
||||||
{
|
{
|
||||||
|
XGL_SCREEN_PRIV (pPixmap->drawable.pScreen);
|
||||||
|
|
||||||
if (width == 1 && height == 1)
|
if (width == 1 && height == 1)
|
||||||
{
|
{
|
||||||
pPixmapPriv->acceleratedTile = TRUE;
|
pPixmapPriv->acceleratedTile = TRUE;
|
||||||
@ -125,6 +127,11 @@ xglPixmapSurfaceInit (PixmapPtr pPixmap,
|
|||||||
pPixmapPriv->acceleratedTile = TRUE;
|
pPixmapPriv->acceleratedTile = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Accelerated drawing to pixmaps when using FBOs
|
||||||
|
*/
|
||||||
|
if (pScreenPriv->fbo)
|
||||||
|
{
|
||||||
pPixmapPriv->target = xglPixmapTargetOut;
|
pPixmapPriv->target = xglPixmapTargetOut;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -139,6 +146,9 @@ xglPixmapSurfaceInit (PixmapPtr pPixmap,
|
|||||||
if (width < 8 && height < 8)
|
if (width < 8 && height < 8)
|
||||||
pPixmapPriv->target = xglPixmapTargetNo;
|
pPixmapPriv->target = xglPixmapTargetNo;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
pPixmapPriv->target = xglPixmapTargetNo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -134,8 +134,7 @@ xglAllocatePrivates (ScreenPtr pScreen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xglScreenInit (ScreenPtr pScreen,
|
xglScreenInit (ScreenPtr pScreen)
|
||||||
xglScreenInfoPtr pScreenInfo)
|
|
||||||
{
|
{
|
||||||
xglScreenPtr pScreenPriv;
|
xglScreenPtr pScreenPriv;
|
||||||
int depth, bpp;
|
int depth, bpp;
|
||||||
@ -152,9 +151,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
pScreenPriv->pScreenPixmap = NULL;
|
pScreenPriv->pScreenPixmap = NULL;
|
||||||
|
|
||||||
pScreenPriv->pVisual = &xglVisuals[0];
|
pScreenPriv->pVisual = &xglVisuals[0];
|
||||||
pScreenPriv->drawable = pScreenInfo->drawable;
|
pScreenPriv->drawable = xglScreenInfo.drawable;
|
||||||
pScreenPriv->features =
|
pScreenPriv->features =
|
||||||
glitz_drawable_get_features (pScreenInfo->drawable);
|
glitz_drawable_get_features (xglScreenInfo.drawable);
|
||||||
|
|
||||||
depth = pScreenPriv->pVisual->pPixel->depth;
|
depth = pScreenPriv->pVisual->pPixel->depth;
|
||||||
bpp = pScreenPriv->pVisual->pPixel->masks.bpp;
|
bpp = pScreenPriv->pVisual->pPixel->masks.bpp;
|
||||||
@ -163,11 +162,12 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
if (!pScreenPriv->pixmapFormats[depth].format)
|
if (!pScreenPriv->pixmapFormats[depth].format)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pScreenPriv->geometryDataType = pScreenInfo->geometryDataType;
|
pScreenPriv->geometryDataType = xglScreenInfo.geometryDataType;
|
||||||
pScreenPriv->geometryUsage = pScreenInfo->geometryUsage;
|
pScreenPriv->geometryUsage = xglScreenInfo.geometryUsage;
|
||||||
pScreenPriv->yInverted = pScreenInfo->yInverted;
|
pScreenPriv->yInverted = xglScreenInfo.yInverted;
|
||||||
pScreenPriv->pboMask = pScreenInfo->pboMask;
|
pScreenPriv->pboMask = xglScreenInfo.pboMask;
|
||||||
pScreenPriv->lines = pScreenInfo->lines;
|
pScreenPriv->lines = xglScreenInfo.lines;
|
||||||
|
pScreenPriv->fbo = xglScreenInfo.fbo;
|
||||||
|
|
||||||
GEOMETRY_INIT (pScreen, &pScreenPriv->scratchGeometry,
|
GEOMETRY_INIT (pScreen, &pScreenPriv->scratchGeometry,
|
||||||
GLITZ_GEOMETRY_TYPE_VERTEX,
|
GLITZ_GEOMETRY_TYPE_VERTEX,
|
||||||
@ -176,7 +176,7 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
pScreenPriv->surface =
|
pScreenPriv->surface =
|
||||||
glitz_surface_create (pScreenPriv->drawable,
|
glitz_surface_create (pScreenPriv->drawable,
|
||||||
pScreenPriv->pixmapFormats[depth].format,
|
pScreenPriv->pixmapFormats[depth].format,
|
||||||
pScreenInfo->width, pScreenInfo->height,
|
xglScreenInfo.width, xglScreenInfo.height,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
if (!pScreenPriv->surface)
|
if (!pScreenPriv->surface)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -191,9 +191,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
monitorResolution = XGL_DEFAULT_DPI;
|
monitorResolution = XGL_DEFAULT_DPI;
|
||||||
|
|
||||||
if (!fbSetupScreen (pScreen, NULL,
|
if (!fbSetupScreen (pScreen, NULL,
|
||||||
pScreenInfo->width, pScreenInfo->height,
|
xglScreenInfo.width, xglScreenInfo.height,
|
||||||
monitorResolution, monitorResolution,
|
monitorResolution, monitorResolution,
|
||||||
pScreenInfo->width, bpp))
|
xglScreenInfo.width, bpp))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pScreen->SaveScreen = xglSaveScreen;
|
pScreen->SaveScreen = xglSaveScreen;
|
||||||
@ -202,9 +202,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
pScreen->DestroyPixmap = xglDestroyPixmap;
|
pScreen->DestroyPixmap = xglDestroyPixmap;
|
||||||
|
|
||||||
if (!fbFinishScreenInit (pScreen, NULL,
|
if (!fbFinishScreenInit (pScreen, NULL,
|
||||||
pScreenInfo->width, pScreenInfo->height,
|
xglScreenInfo.width, xglScreenInfo.height,
|
||||||
monitorResolution, monitorResolution,
|
monitorResolution, monitorResolution,
|
||||||
pScreenInfo->width, bpp))
|
xglScreenInfo.width, bpp))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
@ -276,11 +276,6 @@ xglScreenInit (ScreenPtr pScreen,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLXEXT
|
|
||||||
if (!xglInitVisualConfigs (pScreen))
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Damage is required */
|
/* Damage is required */
|
||||||
DamageSetup (pScreen);
|
DamageSetup (pScreen);
|
||||||
|
|
||||||
|
@ -293,7 +293,13 @@ xglPrepareTarget (DrawablePtr pDrawable)
|
|||||||
|
|
||||||
switch (pPixmapPriv->target) {
|
switch (pPixmapPriv->target) {
|
||||||
case xglPixmapTargetNo:
|
case xglPixmapTargetNo:
|
||||||
|
break;
|
||||||
case xglPixmapTargetOut:
|
case xglPixmapTargetOut:
|
||||||
|
if (xglSyncSurface (pDrawable))
|
||||||
|
{
|
||||||
|
pPixmapPriv->target = xglPixmapTargetIn;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case xglPixmapTargetIn:
|
case xglPixmapTargetIn:
|
||||||
if (xglSyncSurface (pDrawable))
|
if (xglSyncSurface (pDrawable))
|
||||||
@ -358,13 +364,48 @@ xglAddCurrentSurfaceDamage (DrawablePtr pDrawable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xglAddBitDamage (DrawablePtr pDrawable,
|
||||||
|
RegionPtr pRegion)
|
||||||
|
{
|
||||||
|
BoxPtr pBox;
|
||||||
|
BoxPtr pExt;
|
||||||
|
int nBox;
|
||||||
|
|
||||||
|
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
|
||||||
|
|
||||||
|
pBox = REGION_RECTS (pRegion);
|
||||||
|
pExt = REGION_EXTENTS (pDrawable->pScreen, pRegion);
|
||||||
|
nBox = REGION_NUM_RECTS (pRegion);
|
||||||
|
|
||||||
|
if (pExt->x1 < pPixmapPriv->bitBox.x2 &&
|
||||||
|
pExt->y1 < pPixmapPriv->bitBox.y2 &&
|
||||||
|
pExt->x2 > pPixmapPriv->bitBox.x1 &&
|
||||||
|
pExt->y2 > pPixmapPriv->bitBox.y1)
|
||||||
|
{
|
||||||
|
while (nBox--)
|
||||||
|
{
|
||||||
|
if (pBox->x1 < pPixmapPriv->bitBox.x2 &&
|
||||||
|
pBox->y1 < pPixmapPriv->bitBox.y2 &&
|
||||||
|
pBox->x2 > pPixmapPriv->bitBox.x1 &&
|
||||||
|
pBox->y2 > pPixmapPriv->bitBox.y1)
|
||||||
|
{
|
||||||
|
pPixmapPriv->bitBox = miEmptyBox;
|
||||||
|
pPixmapPriv->allBits = FALSE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBox++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xglAddCurrentBitDamage (DrawablePtr pDrawable)
|
xglAddCurrentBitDamage (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
|
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
|
||||||
|
|
||||||
if (pPixmapPriv->target == xglPixmapTargetIn &&
|
if (pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
|
||||||
pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
|
|
||||||
pPixmapPriv->damageBox.y1 < pPixmapPriv->bitBox.y2 &&
|
pPixmapPriv->damageBox.y1 < pPixmapPriv->bitBox.y2 &&
|
||||||
pPixmapPriv->damageBox.x2 > pPixmapPriv->bitBox.x1 &&
|
pPixmapPriv->damageBox.x2 > pPixmapPriv->bitBox.x1 &&
|
||||||
pPixmapPriv->damageBox.y2 > pPixmapPriv->bitBox.y1)
|
pPixmapPriv->damageBox.y2 > pPixmapPriv->bitBox.y1)
|
||||||
|
@ -173,7 +173,7 @@ xglTrapezoids (CARD8 op,
|
|||||||
target = xglPrepareTarget (pDst->pDrawable);
|
target = xglPrepareTarget (pDst->pDrawable);
|
||||||
|
|
||||||
if (nTrap > 1 && op != PictOpAdd && maskFormat &&
|
if (nTrap > 1 && op != PictOpAdd && maskFormat &&
|
||||||
(overlap || op != PictOpOver))
|
(!target || overlap || op != PictOpOver))
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
|
Loading…
Reference in New Issue
Block a user