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
|
||||
endif
|
||||
|
||||
if XEGLSERVER
|
||||
if XEGL
|
||||
XEGL_SUBDIRS = egl
|
||||
endif
|
||||
|
||||
SUBDIRS = . $(XGLX_SUBDIRS) $(XEGL_SUBDIRS)
|
||||
SUBDIRS = \
|
||||
. \
|
||||
$(GLX_SUBDIRS) \
|
||||
$(XGLX_SUBDIRS) \
|
||||
$(XEGL_SUBDIRS)
|
||||
|
||||
INCLUDES = \
|
||||
@XGL_INCS@ \
|
||||
@XSERVER_CFLAGS@ \
|
||||
@XGLSERVER_CFLAGS@
|
||||
@XGLSERVER_CFLAGS@ \
|
||||
-DMODULEPATH=\"@MODULEPATH@\"
|
||||
|
||||
noinst_LIBRARIES = libxgl.a
|
||||
|
||||
|
@ -40,4 +49,18 @@ libxgl_a_SOURCES = \
|
|||
xglglyph.c \
|
||||
xgltrap.c \
|
||||
xglhash.c \
|
||||
xglloader.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,22 +1,37 @@
|
|||
if XGLSERVER
|
||||
MODULE_SUBDIRS = module
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
. \
|
||||
$(MODULE_SUBDIRS)
|
||||
|
||||
INCLUDES = \
|
||||
@XGL_INCS@ \
|
||||
@XEGL_INCS@ \
|
||||
@XSERVER_CFLAGS@ \
|
||||
@XGLXSERVER_CFLAGS@
|
||||
@XGLSERVER_CFLAGS@ \
|
||||
@XEGLSERVER_CFLAGS@
|
||||
|
||||
bin_PROGRAMS = Xegl
|
||||
noinst_LTLIBRARIES = libxegl.la
|
||||
|
||||
Xegl_SOURCES = \
|
||||
xegl.h \
|
||||
xegl.c \
|
||||
xeglinput.c \
|
||||
kkeymap.h \
|
||||
kinput.c \
|
||||
libxegl_la_SOURCES = \
|
||||
xegl.h \
|
||||
xegl.c \
|
||||
xeglinput.c \
|
||||
kkeymap.h \
|
||||
kinput.c \
|
||||
evdev.c
|
||||
|
||||
Xegl_LDADD = \
|
||||
@XGL_LIBS@ \
|
||||
@XSERVER_LIBS@ \
|
||||
if XEGLSERVER
|
||||
Xegl_DEPENDENCIES = @XEGL_LIBS@
|
||||
Xegl_LDFLAGS = -export-dynamic
|
||||
Xegl_SOURCES = xeglinit.c
|
||||
Xegl_LDADD = \
|
||||
@XEGL_LIBS@ \
|
||||
@XSERVER_LIBS@ \
|
||||
@XGLSERVER_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;
|
||||
Kevdev *ke = mi->driver;
|
||||
int i, n;
|
||||
int i, n, f = 0;
|
||||
struct input_event events[NUM_EVENTS];
|
||||
|
||||
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);
|
||||
else
|
||||
ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
|
||||
|
||||
if (events[i].value==1) {
|
||||
switch (events[i].code) {
|
||||
case BTN_LEFT:
|
||||
flags |= KD_BUTTON_1;
|
||||
switch (events[i].code) {
|
||||
case BTN_LEFT:
|
||||
f = KD_BUTTON_1;
|
||||
break;
|
||||
case BTN_RIGHT:
|
||||
flags |= KD_BUTTON_3;
|
||||
case BTN_RIGHT:
|
||||
f = KD_BUTTON_2;
|
||||
break;
|
||||
case BTN_MIDDLE:
|
||||
flags |= KD_BUTTON_2;
|
||||
case BTN_MIDDLE:
|
||||
f = KD_BUTTON_3;
|
||||
break;
|
||||
case BTN_FORWARD:
|
||||
flags |= KD_BUTTON_4;
|
||||
case BTN_FORWARD:
|
||||
f = KD_BUTTON_4;
|
||||
break;
|
||||
case BTN_BACK:
|
||||
flags |= KD_BUTTON_5;
|
||||
case BTN_BACK:
|
||||
f = KD_BUTTON_5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
flags |= f;
|
||||
KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
|
||||
ErrorF("Flags is %x\n", flags);
|
||||
break;
|
||||
case EV_REL:
|
||||
ke->rel[events[i].code] += events[i].value;
|
||||
|
@ -186,12 +166,12 @@ EvdevRead (int evdevPort, void *closure)
|
|||
int EvdevInputType;
|
||||
|
||||
char *kdefaultEvdev[] = {
|
||||
// "/dev/input/event0",
|
||||
"/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
// "/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
// "/dev/input/event5",
|
||||
// "/dev/input/event0",
|
||||
// "/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
// "/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
"/dev/input/event5",
|
||||
};
|
||||
|
||||
#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))
|
||||
|
@ -497,12 +477,12 @@ EvdevRead1 (int evdevPort, void *closure)
|
|||
}
|
||||
|
||||
char *kdefaultEvdev1[] = {
|
||||
"/dev/input/event0",
|
||||
// "/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
// "/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
// "/dev/input/event5",
|
||||
// "/dev/input/event0",
|
||||
// "/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
"/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
// "/dev/input/event5",
|
||||
};
|
||||
|
||||
#define NUM_DEFAULT_EVDEV1 (sizeof (kdefaultEvdev1) / sizeof (kdefaultEvdev1[0]))
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "xgl.h"
|
||||
#include "xegl.h"
|
||||
#include "mipointer.h"
|
||||
#include "inputstr.h"
|
||||
|
@ -348,7 +347,7 @@ KdMouseProc(DeviceIntPtr pDevice, int onoff)
|
|||
}
|
||||
|
||||
Bool
|
||||
LegalModifier(unsigned int key, DevicePtr pDev)
|
||||
KdLegalModifier(unsigned int key, DevicePtr pDev)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1518,12 +1517,10 @@ KdBlockHandler (int screen,
|
|||
}
|
||||
|
||||
void
|
||||
KdWakeupHandler (int screen,
|
||||
pointer data,
|
||||
unsigned long lresult,
|
||||
pointer readmask)
|
||||
KdWakeupHandler (pointer data,
|
||||
int result,
|
||||
pointer readmask)
|
||||
{
|
||||
int result = (int) lresult;
|
||||
fd_set *pReadmask = (fd_set *) readmask;
|
||||
int i;
|
||||
KdMouseInfo *mi;
|
||||
|
@ -1555,7 +1552,7 @@ KdWakeupHandler (int screen,
|
|||
// kdProcessSwitch ();
|
||||
}
|
||||
|
||||
#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv(pScreen)->screen->origin))
|
||||
#define KdScreenOrigin(pScreen) (&(KdGetScreenPriv (pScreen)->origin))
|
||||
|
||||
static Bool
|
||||
KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
||||
|
@ -1673,7 +1670,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
|
|||
};
|
||||
|
||||
void
|
||||
ProcessInputEvents ()
|
||||
KdProcessInputEvents (void)
|
||||
{
|
||||
mieqProcessInputEvents();
|
||||
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 "xgl.h"
|
||||
#include "inputstr.h"
|
||||
#include "cursorstr.h"
|
||||
#include "mipointer.h"
|
||||
|
@ -46,7 +45,7 @@
|
|||
int xeglScreenGeneration = -1;
|
||||
int xeglScreenPrivateIndex;
|
||||
|
||||
#define XEGL_GET_SCREEN_PRIV(pScreen) \
|
||||
#define XEGL_GET_SCREEN_PRIV(pScreen) \
|
||||
((xeglScreenPtr) (pScreen)->devPrivates[xeglScreenPrivateIndex].ptr)
|
||||
|
||||
#define XEGL_SET_SCREEN_PRIV(pScreen, v) \
|
||||
|
@ -55,34 +54,10 @@ int xeglScreenPrivateIndex;
|
|||
#define XEGL_SCREEN_PRIV(pScreen) \
|
||||
xeglScreenPtr pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen)
|
||||
|
||||
typedef struct _xeglCursor {
|
||||
Cursor cursor;
|
||||
} xeglCursorRec, *xeglCursorPtr;
|
||||
|
||||
#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
|
||||
};
|
||||
static EGLDisplay eDisplay;
|
||||
static EGLScreenMESA eScreen;
|
||||
static ScreenPtr currentScreen = 0;
|
||||
static Bool softCursor = TRUE;
|
||||
|
||||
extern miPointerScreenFuncRec kdPointerScreenFuncs;
|
||||
|
||||
|
@ -97,7 +72,7 @@ xeglAllocatePrivates (ScreenPtr pScreen)
|
|||
if (xeglScreenPrivateIndex < 0)
|
||||
return FALSE;
|
||||
|
||||
xeglScreenGeneration = serverGeneration;
|
||||
xeglScreenGeneration = serverGeneration;
|
||||
}
|
||||
|
||||
pScreenPriv = xalloc (sizeof (xeglScreenRec));
|
||||
|
@ -109,189 +84,6 @@ xeglAllocatePrivates (ScreenPtr pScreen)
|
|||
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
|
||||
xeglCloseScreen (int index,
|
||||
ScreenPtr pScreen)
|
||||
|
@ -305,135 +97,29 @@ xeglCloseScreen (int index,
|
|||
glitz_drawable_destroy (drawable);
|
||||
|
||||
xglClearVisualTypes ();
|
||||
#if 0
|
||||
if (pScreenPriv->win)
|
||||
XDestroyWindow (xdisplay, pScreenPriv->win);
|
||||
|
||||
if (pScreenPriv->colormap)
|
||||
XFreeColormap (xdisplay, pScreenPriv->colormap);
|
||||
#endif
|
||||
XGL_SCREEN_UNWRAP (CloseScreen);
|
||||
xfree (pScreenPriv);
|
||||
|
||||
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
|
||||
xeglScreenInit (int index,
|
||||
ScreenPtr pScreen,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
EGLSurface screen_surf;
|
||||
EGLModeMESA mode;
|
||||
int count;
|
||||
EGLSurface eSurface;
|
||||
EGLModeMESA mode;
|
||||
int count;
|
||||
xeglScreenPtr pScreenPriv;
|
||||
glitz_drawable_format_t *format;
|
||||
glitz_drawable_t *drawable;
|
||||
const EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
xglScreenInfo.width = 1024;
|
||||
|
@ -448,114 +134,71 @@ xeglScreenInit (int index,
|
|||
|
||||
pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen);
|
||||
|
||||
if (xglScreenInfo.fullscreen)
|
||||
{
|
||||
// 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)
|
||||
if (xglScreenInfo.width == 0 || xglScreenInfo.height == 0)
|
||||
{
|
||||
xglScreenInfo.width = XEGL_DEFAULT_SCREEN_WIDTH;
|
||||
xglScreenInfo.height = XEGL_DEFAULT_SCREEN_HEIGHT;
|
||||
}
|
||||
|
||||
eglGetModesMESA(xdisplay, xscreen, &mode, 1, &count);
|
||||
screen_surf = eglCreateScreenSurfaceMESA(xdisplay, format->id, screenAttribs);
|
||||
if (screen_surf == EGL_NO_SURFACE) {
|
||||
printf("failed to create screen surface\n");
|
||||
return FALSE;
|
||||
eglGetModesMESA (eDisplay, eScreen, &mode, 1, &count);
|
||||
|
||||
eSurface = eglCreateScreenSurfaceMESA (eDisplay, format->id, screenAttribs);
|
||||
if (eSurface == EGL_NO_SURFACE)
|
||||
{
|
||||
ErrorF ("failed to create screen surface\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(xdisplay, xscreen, screen_surf, mode);
|
||||
eglShowSurfaceMESA (eDisplay, eScreen, eSurface, mode);
|
||||
|
||||
drawable = glitz_egl_create_surface (xdisplay, xscreen, format, screen_surf,
|
||||
xglScreenInfo.width, xglScreenInfo.height);
|
||||
drawable = glitz_egl_create_surface (eDisplay, eScreen, format, eSurface,
|
||||
xglScreenInfo.width,
|
||||
xglScreenInfo.height);
|
||||
if (!drawable)
|
||||
{
|
||||
ErrorF ("[%d] couldn't create glitz drawable for window\n", index);
|
||||
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;
|
||||
|
||||
if (!xglScreenInit (pScreen, &xglScreenInfo))
|
||||
if (!xglScreenInit (pScreen))
|
||||
return FALSE;
|
||||
|
||||
#ifdef GLXEXT
|
||||
if (!xglInitVisualConfigs (pScreen))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
XGL_SCREEN_WRAP (CloseScreen, xeglCloseScreen);
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
if (!xeglARGBCursorSupport ())
|
||||
softCursor = TRUE;
|
||||
#endif
|
||||
miDCInitialize (pScreen, &xeglPointerScreenFuncs);
|
||||
miCreateDefColormap (pScreen);
|
||||
|
||||
// miPointerInitialize(pScreen, &eglPointerSpriteFuncs,
|
||||
// &kdPointerScreenFuncs, FALSE);
|
||||
miDCInitialize (pScreen, &kdPointerScreenFuncs);
|
||||
|
||||
if (!xglFinishScreenInit (pScreen))
|
||||
return FALSE;
|
||||
|
||||
// while (XNextEvent (xdisplay, &xevent))
|
||||
// if (xevent.type == Expose)
|
||||
// break;
|
||||
|
||||
// XSelectInput (xdisplay, pScreenPriv->win,
|
||||
// ButtonPressMask | ButtonReleaseMask |
|
||||
// KeyPressMask | KeyReleaseMask | EnterWindowMask |
|
||||
// PointerMotionMask);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
InitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
xeglInitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
glitz_drawable_format_t *format, templ;
|
||||
int i, maj, min, count;
|
||||
int i, maj, min, count;
|
||||
unsigned long mask;
|
||||
|
||||
xglSetPixmapFormats (pScreenInfo);
|
||||
|
||||
if (!xdisplay)
|
||||
if (!eDisplay)
|
||||
{
|
||||
xdisplay = eglGetDisplay(":0");
|
||||
assert(xdisplay);
|
||||
eDisplay = eglGetDisplay ("!fb_dri");
|
||||
|
||||
if (!eglInitialize(xdisplay, &maj, &min))
|
||||
if (!eglInitialize (eDisplay, &maj, &min))
|
||||
FatalError ("can't open display");
|
||||
|
||||
eglGetScreensMESA(xdisplay, &xscreen, 1, &count);
|
||||
|
||||
glitz_egl_init (NULL);
|
||||
eglGetScreensMESA (eDisplay, &eScreen, 1, &count);
|
||||
}
|
||||
|
||||
templ.samples = 1;
|
||||
|
@ -564,7 +207,7 @@ InitOutput (ScreenInfo *pScreenInfo,
|
|||
|
||||
mask = GLITZ_FORMAT_SAMPLES_MASK;
|
||||
|
||||
format = glitz_egl_find_config (xdisplay, xscreen,
|
||||
format = glitz_egl_find_config (eDisplay, eScreen,
|
||||
mask, &templ, 0);
|
||||
|
||||
if (!format)
|
||||
|
@ -589,105 +232,52 @@ xeglBlockHandler (pointer blockData,
|
|||
|
||||
glitz_surface_flush (pScreenPriv->surface);
|
||||
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
|
||||
InitInput (int argc, char **argv)
|
||||
xeglInitInput (int argc,
|
||||
char **argv)
|
||||
{
|
||||
eglInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
|
||||
RegisterBlockAndWakeupHandlers (xeglBlockHandler,
|
||||
KdWakeupHandler,
|
||||
NULL);
|
||||
RegisterBlockAndWakeupHandlers (xeglBlockHandler, KdWakeupHandler, NULL);
|
||||
}
|
||||
|
||||
Bool
|
||||
xeglLegalModifier (unsigned int key,
|
||||
DevicePtr pDev)
|
||||
{
|
||||
return KdLegalModifier (key, pDev);
|
||||
}
|
||||
|
||||
void
|
||||
ddxUseMsg (void)
|
||||
xeglProcessInputEvents (void)
|
||||
{
|
||||
ErrorF ("\nXegl usage:\n");
|
||||
ErrorF ("-display string display name of the real server\n");
|
||||
ErrorF ("-softcursor force software cursor\n");
|
||||
KdProcessInputEvents ();
|
||||
}
|
||||
|
||||
xglUseMsg ();
|
||||
void
|
||||
xeglUseMsg (void)
|
||||
{
|
||||
ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM] "
|
||||
"specify screen characteristics\n");
|
||||
ErrorF ("-softcursor force software cursor\n");
|
||||
}
|
||||
|
||||
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) {
|
||||
xDisplayName = argv[i];
|
||||
return 2;
|
||||
if ((i + 1) < argc)
|
||||
{
|
||||
xglParseScreen (argv[i + 1]);
|
||||
}
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 2;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-softcursor"))
|
||||
{
|
||||
|
@ -695,90 +285,21 @@ ddxProcessArgument (int argc, char **argv, int i)
|
|||
return 1;
|
||||
}
|
||||
|
||||
return xglProcessArgument (&xglScreenInfo, argc, argv, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
AbortDDX (void)
|
||||
xeglAbort (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ddxGiveUp ()
|
||||
xeglGiveUp (void)
|
||||
{
|
||||
AbortDDX ();
|
||||
}
|
||||
|
||||
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"
|
||||
|
||||
#define KD_BUTTON_1 0x01
|
||||
|
@ -8,33 +38,33 @@
|
|||
#define KD_MOUSE_DELTA 0x80000000
|
||||
|
||||
typedef struct _KdMouseFuncs {
|
||||
Bool (*Init) (void);
|
||||
void (*Fini) (void);
|
||||
Bool (*Init) (void);
|
||||
void (*Fini) (void);
|
||||
} KdMouseFuncs;
|
||||
|
||||
typedef struct _KdKeyboardFuncs {
|
||||
void (*Load) (void);
|
||||
int (*Init) (void);
|
||||
void (*Leds) (int);
|
||||
void (*Bell) (int, int, int);
|
||||
void (*Fini) (void);
|
||||
int LockLed;
|
||||
void (*Load) (void);
|
||||
int (*Init) (void);
|
||||
void (*Leds) (int);
|
||||
void (*Bell) (int, int, int);
|
||||
void (*Fini) (void);
|
||||
int LockLed;
|
||||
} KdKeyboardFuncs;
|
||||
|
||||
typedef struct _KdOsFuncs {
|
||||
int (*Init) (void);
|
||||
void (*Enable) (void);
|
||||
Bool (*SpecialKey) (KeySym);
|
||||
void (*Disable) (void);
|
||||
void (*Fini) (void);
|
||||
void (*pollEvents) (void);
|
||||
int (*Init) (void);
|
||||
void (*Enable) (void);
|
||||
Bool (*SpecialKey) (KeySym);
|
||||
void (*Disable) (void);
|
||||
void (*Fini) (void);
|
||||
void (*pollEvents) (void);
|
||||
} KdOsFuncs;
|
||||
|
||||
typedef struct _KdMouseMatrix {
|
||||
int matrix[2][3];
|
||||
int matrix[2][3];
|
||||
} KdMouseMatrix;
|
||||
|
||||
typedef enum _kdMouseState {
|
||||
typedef enum _KdMouseState {
|
||||
start,
|
||||
button_1_pend,
|
||||
button_1_down,
|
||||
|
@ -51,81 +81,134 @@ typedef enum _kdMouseState {
|
|||
|
||||
typedef struct _KdMouseInfo {
|
||||
struct _KdMouseInfo *next;
|
||||
void *driver;
|
||||
void *closure;
|
||||
char *name;
|
||||
char *prot;
|
||||
char map[KD_MAX_BUTTON];
|
||||
int nbutton;
|
||||
Bool emulateMiddleButton;
|
||||
unsigned long emulationTimeout;
|
||||
Bool timeoutPending;
|
||||
KdMouseState mouseState;
|
||||
Bool eventHeld;
|
||||
xEvent heldEvent;
|
||||
unsigned char buttonState;
|
||||
int emulationDx, emulationDy;
|
||||
int inputType;
|
||||
Bool transformCoordinates;
|
||||
void *driver;
|
||||
void *closure;
|
||||
char *name;
|
||||
char *prot;
|
||||
char map[KD_MAX_BUTTON];
|
||||
int nbutton;
|
||||
Bool emulateMiddleButton;
|
||||
unsigned long emulationTimeout;
|
||||
Bool timeoutPending;
|
||||
KdMouseState mouseState;
|
||||
Bool eventHeld;
|
||||
xEvent heldEvent;
|
||||
unsigned char buttonState;
|
||||
int emulationDx, emulationDy;
|
||||
int inputType;
|
||||
Bool transformCoordinates;
|
||||
} 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 {
|
||||
Window win;
|
||||
Colormap colormap;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
KdScreenInfo *screen;
|
||||
ColormapPtr pInstalledmap[KD_MAX_FB]; /* current colormap */
|
||||
ScreenPtr pScreen;
|
||||
DDXPointRec origin;
|
||||
} xeglScreenRec, *xeglScreenPtr;
|
||||
|
||||
extern KdMouseInfo *kdMouseInfo;
|
||||
extern KdOsFuncs *kdOsFuncs;
|
||||
extern Bool kdDontZap;
|
||||
extern Bool kdDisableZaphod;
|
||||
extern int kdScreenPrivateIndex;
|
||||
extern KdMouseFuncs LinuxEvdevMouseFuncs;
|
||||
extern KdMouseInfo *kdMouseInfo;
|
||||
extern KdOsFuncs *kdOsFuncs;
|
||||
extern Bool kdDontZap;
|
||||
extern Bool kdDisableZaphod;
|
||||
extern int xeglScreenPrivateIndex;
|
||||
extern KdMouseFuncs LinuxEvdevMouseFuncs;
|
||||
extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs;
|
||||
|
||||
#define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
|
||||
#define RR_Reflect_All (RR_Reflect_X|RR_Reflect_Y)
|
||||
#define RR_Rotate_All \
|
||||
(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) \
|
||||
(pScreen)->devPrivates[kdScreenPrivateIndex].ptr)
|
||||
#define KdScreenPriv(pScreen) xeglScreenPtr pScreenPriv = KdGetScreenPriv(pScreen)
|
||||
#define KdGetScreenPriv(pScreen) \
|
||||
((xeglScreenPtr) ((pScreen)->devPrivates[xeglScreenPrivateIndex].ptr))
|
||||
#define KdScreenPriv(pScreen) \
|
||||
xeglScreenPtr pScreenPriv = KdGetScreenPriv (pScreen)
|
||||
|
||||
extern void eglInitInput(KdMouseFuncs *pMouseFuncs, KdKeyboardFuncs *pKeyboardFuncs);
|
||||
extern void KdParseMouse(char *arg);
|
||||
extern KdMouseInfo *KdMouseInfoAdd(void);
|
||||
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
|
||||
eglInitInput (KdMouseFuncs *pMouseFuncs,
|
||||
KdKeyboardFuncs *pKeyboardFuncs);
|
||||
|
||||
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 = \
|
||||
@XGL_INCS@ \
|
||||
@XGLX_INCS@ \
|
||||
@XSERVER_CFLAGS@ \
|
||||
@XGLSERVER_CFLAGS@ \
|
||||
@XGLXSERVER_CFLAGS@
|
||||
|
||||
bin_PROGRAMS = Xglx
|
||||
noinst_LTLIBRARIES = libxglx.la
|
||||
|
||||
Xglx_SOURCES = xglx.c
|
||||
libxglx_la_SOURCES = \
|
||||
xglx.h \
|
||||
xglx.c
|
||||
|
||||
Xglx_LDADD = \
|
||||
@XGL_LIBS@ \
|
||||
if XGLXSERVER
|
||||
Xglx_DEPENDENCIES = @XGLX_LIBS@
|
||||
Xglx_LDFLAGS = -export-dynamic
|
||||
Xglx_SOURCES = xglxinit.c
|
||||
Xglx_LDADD = \
|
||||
@XGLX_LIBS@ \
|
||||
@XSERVER_LIBS@ \
|
||||
@XGLSERVER_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 <glitz-glx.h>
|
||||
|
||||
#include "xgl.h"
|
||||
#include "xglx.h"
|
||||
|
||||
#ifdef GLXEXT
|
||||
#include "xglglxext.h"
|
||||
#endif
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "cursorstr.h"
|
||||
#include "mipointer.h"
|
||||
|
@ -72,21 +77,13 @@ typedef struct _xglxCursor {
|
|||
#define XGLX_CURSOR_PRIV(pCursor, pScreen) \
|
||||
xglxCursorPtr pCursorPriv = XGLX_GET_CURSOR_PRIV (pCursor, pScreen)
|
||||
|
||||
char *xDisplayName = NULL;
|
||||
Display *xdisplay = NULL;
|
||||
int xscreen;
|
||||
glitz_format_t *xglxCurrentFormat;
|
||||
CARD32 lastEventTime = 0;
|
||||
ScreenPtr currentScreen = NULL;
|
||||
Bool softCursor = FALSE;
|
||||
xglScreenInfoRec xglScreenInfo = {
|
||||
NULL, 0, 0, 0, 0, FALSE,
|
||||
DEFAULT_GEOMETRY_DATA_TYPE,
|
||||
DEFAULT_GEOMETRY_USAGE,
|
||||
FALSE,
|
||||
XGL_DEFAULT_PBO_MASK,
|
||||
FALSE
|
||||
};
|
||||
static char *xDisplayName = 0;
|
||||
static Display *xdisplay = 0;
|
||||
static int xscreen;
|
||||
static CARD32 lastEventTime = 0;
|
||||
static ScreenPtr currentScreen = 0;
|
||||
static Bool softCursor = FALSE;
|
||||
static Bool fullscreen = FALSE;
|
||||
|
||||
static Bool
|
||||
xglxAllocatePrivates (ScreenPtr pScreen)
|
||||
|
@ -375,7 +372,7 @@ xglxScreenInit (int index,
|
|||
pScreenPriv->colormap =
|
||||
XCreateColormap (xdisplay, root, vinfo->visual, AllocNone);
|
||||
|
||||
if (xglScreenInfo.fullscreen)
|
||||
if (fullscreen)
|
||||
{
|
||||
xglScreenInfo.width = DisplayWidth (xdisplay, xscreen);
|
||||
xglScreenInfo.height = DisplayHeight (xdisplay, xscreen);
|
||||
|
@ -405,7 +402,7 @@ xglxScreenInit (int index,
|
|||
normalHints->max_width = xglScreenInfo.width;
|
||||
normalHints->max_height = xglScreenInfo.height;
|
||||
|
||||
if (xglScreenInfo.fullscreen)
|
||||
if (fullscreen)
|
||||
{
|
||||
normalHints->x = 0;
|
||||
normalHints->y = 0;
|
||||
|
@ -444,7 +441,7 @@ xglxScreenInit (int index,
|
|||
|
||||
XMapWindow (xdisplay, pScreenPriv->win);
|
||||
|
||||
if (xglScreenInfo.fullscreen)
|
||||
if (fullscreen)
|
||||
{
|
||||
XClientMessageEvent xev;
|
||||
|
||||
|
@ -465,9 +462,14 @@ xglxScreenInit (int index,
|
|||
|
||||
xglScreenInfo.drawable = drawable;
|
||||
|
||||
if (!xglScreenInit (pScreen, &xglScreenInfo))
|
||||
if (!xglScreenInit (pScreen))
|
||||
return FALSE;
|
||||
|
||||
|
||||
#ifdef GLXEXT
|
||||
if (!xglInitVisualConfigs (pScreen))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
XGL_SCREEN_WRAP (CloseScreen, xglxCloseScreen);
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
|
@ -526,9 +528,9 @@ xglxScreenInit (int index,
|
|||
}
|
||||
|
||||
void
|
||||
InitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
xglxInitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
glitz_drawable_format_t *format, templ;
|
||||
int i;
|
||||
|
@ -792,21 +794,22 @@ xglxKeybdProc (DeviceIntPtr pDevice,
|
|||
}
|
||||
|
||||
Bool
|
||||
LegalModifier (unsigned int key,
|
||||
DevicePtr pDev)
|
||||
xglxLegalModifier (unsigned int key,
|
||||
DevicePtr pDev)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ProcessInputEvents ()
|
||||
xglxProcessInputEvents (void)
|
||||
{
|
||||
mieqProcessInputEvents ();
|
||||
miPointerUpdate ();
|
||||
}
|
||||
|
||||
void
|
||||
InitInput (int argc, char **argv)
|
||||
xglxInitInput (int argc,
|
||||
char **argv)
|
||||
{
|
||||
DeviceIntPtr pKeyboard, pPointer;
|
||||
|
||||
|
@ -827,18 +830,36 @@ InitInput (int argc, char **argv)
|
|||
}
|
||||
|
||||
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 ("-softcursor force software cursor\n");
|
||||
|
||||
xglUseMsg ();
|
||||
}
|
||||
|
||||
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 (++i < argc) {
|
||||
|
@ -853,22 +874,22 @@ ddxProcessArgument (int argc, char **argv, int i)
|
|||
return 1;
|
||||
}
|
||||
|
||||
return xglProcessArgument (&xglScreenInfo, argc, argv, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
AbortDDX (void)
|
||||
{
|
||||
xglxAbort (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ddxGiveUp ()
|
||||
xglxGiveUp ()
|
||||
{
|
||||
AbortDDX ();
|
||||
}
|
||||
|
||||
void
|
||||
OsVendorInit (void)
|
||||
xglxOsVendorInit (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -924,7 +945,7 @@ xglxCreateARGBCursor (ScreenPtr pScreen,
|
|||
|
||||
xformat = XRenderFindStandardFormat (xdisplay, PictStandardARGB32);
|
||||
xpicture = XRenderCreatePicture (xdisplay, xpixmap, xformat, 0, 0);
|
||||
|
||||
|
||||
cursor = XRenderCreateCursor (xdisplay, xpicture,
|
||||
pCursor->bits->xhot,
|
||||
pCursor->bits->yhot);
|
||||
|
|
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;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
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_ */
|
66
hw/xgl/xgl.h
66
hw/xgl/xgl.h
|
@ -55,7 +55,7 @@ typedef struct _GCFuncs *GCFuncsPtr;
|
|||
|
||||
extern WindowPtr *WindowTable;
|
||||
|
||||
#define XGL_DEFAULT_PBO_MASK 0 /* don't use PBO as default */
|
||||
#define XGL_DEFAULT_PBO_MASK 0
|
||||
|
||||
typedef struct _xglScreenInfo {
|
||||
glitz_drawable_t *drawable;
|
||||
|
@ -63,14 +63,16 @@ typedef struct _xglScreenInfo {
|
|||
unsigned int height;
|
||||
unsigned int widthMm;
|
||||
unsigned int heightMm;
|
||||
Bool fullscreen;
|
||||
int geometryDataType;
|
||||
int geometryUsage;
|
||||
Bool yInverted;
|
||||
int pboMask;
|
||||
Bool lines;
|
||||
Bool fbo;
|
||||
} xglScreenInfoRec, *xglScreenInfoPtr;
|
||||
|
||||
extern xglScreenInfoRec xglScreenInfo;
|
||||
|
||||
typedef struct _xglPixelFormat {
|
||||
CARD8 depth, bitsPerRGB;
|
||||
glitz_pixel_masks_t masks;
|
||||
|
@ -213,6 +215,7 @@ typedef struct _xglScreen {
|
|||
Bool yInverted;
|
||||
int pboMask;
|
||||
Bool lines;
|
||||
Bool fbo;
|
||||
xglGeometryRec scratchGeometry;
|
||||
|
||||
#ifdef RENDER
|
||||
|
@ -489,24 +492,21 @@ xglParseFindNext (char *cur,
|
|||
char *last);
|
||||
|
||||
void
|
||||
xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
||||
char *arg);
|
||||
xglParseScreen (char *arg);
|
||||
|
||||
void
|
||||
xglUseMsg (void);
|
||||
|
||||
int
|
||||
xglProcessArgument (xglScreenInfoPtr pScreenInfo,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i);
|
||||
xglProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i);
|
||||
|
||||
|
||||
/* xglscreen.c */
|
||||
|
||||
Bool
|
||||
xglScreenInit (ScreenPtr pScreen,
|
||||
xglScreenInfoPtr pScreenInfo);
|
||||
xglScreenInit (ScreenPtr pScreen);
|
||||
|
||||
Bool
|
||||
xglFinishScreenInit (ScreenPtr pScreen);
|
||||
|
@ -871,6 +871,10 @@ xglAddSurfaceDamage (DrawablePtr pDrawable,
|
|||
void
|
||||
xglAddCurrentSurfaceDamage (DrawablePtr pDrawable);
|
||||
|
||||
void
|
||||
xglAddBitDamage (DrawablePtr pDrawable,
|
||||
RegionPtr pRegion);
|
||||
|
||||
void
|
||||
xglAddCurrentBitDamage (DrawablePtr pDrawable);
|
||||
|
||||
|
@ -1327,10 +1331,47 @@ xglAddTraps (PicturePtr pDst,
|
|||
|
||||
#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
|
||||
|
||||
/* xglglx.c */
|
||||
|
||||
Bool
|
||||
xglLoadGLXModules (void);
|
||||
|
||||
void
|
||||
xglUnloadGLXModules (void);
|
||||
|
||||
#endif
|
||||
|
||||
/* xglhash.c */
|
||||
|
||||
typedef struct _xglHashTable *xglHashTablePtr;
|
||||
|
||||
Bool
|
||||
xglLoadHashFuncs (void *handle);
|
||||
|
||||
xglHashTablePtr
|
||||
xglNewHashTable (void);
|
||||
|
||||
|
@ -1361,9 +1402,4 @@ unsigned int
|
|||
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
||||
unsigned int numKeys);
|
||||
|
||||
Bool
|
||||
xglInitVisualConfigs (ScreenPtr pScreen);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _XGL_H_ */
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* Author: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "xgl.h"
|
||||
#include "colormapst.h"
|
||||
#include "micmap.h"
|
||||
|
@ -147,7 +148,6 @@ xglSetVisualTypesAndMasks (ScreenInfo *pScreenInfo,
|
|||
nxglVisuals++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
|
@ -12,11 +12,11 @@
|
|||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* 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,
|
||||
* 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.
|
||||
*
|
||||
|
@ -25,58 +25,77 @@
|
|||
|
||||
#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);
|
||||
void (*DeleteHashTable) (xglHashTablePtr pTable);
|
||||
void *(*HashLookup) (const xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
void (*HashInsert) (xglHashTablePtr pTable,
|
||||
unsigned int key,
|
||||
void *data);
|
||||
void (*HashRemove) (xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
unsigned int (*HashFirstEntry) (xglHashTablePtr pTable);
|
||||
unsigned int (*HashNextEntry) (const xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
unsigned int (*HashFindFreeKeyBlock) (xglHashTablePtr pTable,
|
||||
unsigned int numKeys);
|
||||
} xglHashFuncRec;
|
||||
|
||||
extern struct _mesa_HashTable *
|
||||
_mesa_NewHashTable (void);
|
||||
static xglHashFuncRec __hashFunc;
|
||||
|
||||
extern void
|
||||
_mesa_DeleteHashTable (struct _mesa_HashTable *table);
|
||||
static void *hashHandle = 0;
|
||||
|
||||
extern void *
|
||||
_mesa_HashLookup (const struct _mesa_HashTable *table,
|
||||
unsigned int key);
|
||||
Bool
|
||||
xglLoadHashFuncs (void *handle)
|
||||
{
|
||||
|
||||
extern void
|
||||
_mesa_HashInsert (struct _mesa_HashTable *table,
|
||||
unsigned int key,
|
||||
void *data);
|
||||
#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")
|
||||
};
|
||||
|
||||
extern void
|
||||
_mesa_HashRemove (struct _mesa_HashTable *table,
|
||||
unsigned int key);
|
||||
if (!xglLookupSymbols (handle, sym, sizeof (sym) / sizeof (sym[0])))
|
||||
return FALSE;
|
||||
|
||||
extern unsigned int
|
||||
_mesa_HashFirstEntry (struct _mesa_HashTable *table);
|
||||
hashHandle = handle;
|
||||
|
||||
extern unsigned int
|
||||
_mesa_HashNextEntry (const struct _mesa_HashTable *table,
|
||||
unsigned int key);
|
||||
|
||||
extern unsigned int
|
||||
_mesa_HashFindFreeKeyBlock (struct _mesa_HashTable *table,
|
||||
unsigned int numKeys);
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
xglHashTablePtr
|
||||
xglNewHashTable (void)
|
||||
{
|
||||
return (xglHashTablePtr) _mesa_NewHashTable ();
|
||||
if (!hashHandle)
|
||||
return 0;
|
||||
|
||||
return (*__hashFunc.NewHashTable) ();
|
||||
}
|
||||
|
||||
void
|
||||
xglDeleteHashTable (xglHashTablePtr pTable)
|
||||
{
|
||||
_mesa_DeleteHashTable ((struct _mesa_HashTable *) pTable);
|
||||
(*__hashFunc.DeleteHashTable) (pTable);
|
||||
}
|
||||
|
||||
void *
|
||||
xglHashLookup (const xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
return _mesa_HashLookup ((struct _mesa_HashTable *) pTable, key);
|
||||
return (*__hashFunc.HashLookup) (pTable, key);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -84,35 +103,32 @@ xglHashInsert (xglHashTablePtr pTable,
|
|||
unsigned int key,
|
||||
void *data)
|
||||
{
|
||||
_mesa_HashInsert ((struct _mesa_HashTable *) pTable, key, data);
|
||||
(*__hashFunc.HashInsert) (pTable, key, data);
|
||||
}
|
||||
|
||||
void
|
||||
xglHashRemove (xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
_mesa_HashRemove ((struct _mesa_HashTable *) pTable, key);
|
||||
(*__hashFunc.HashRemove) (pTable, key);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashFirstEntry (xglHashTablePtr pTable)
|
||||
{
|
||||
return _mesa_HashFirstEntry ((struct _mesa_HashTable *) pTable);
|
||||
return (*__hashFunc.HashFirstEntry) (pTable);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashNextEntry (const xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
return _mesa_HashNextEntry ((struct _mesa_HashTable *) pTable, key);
|
||||
return (*__hashFunc.HashNextEntry) (pTable, key);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
||||
unsigned int numKeys)
|
||||
{
|
||||
return _mesa_HashFindFreeKeyBlock ((struct _mesa_HashTable *) pTable,
|
||||
numKeys);
|
||||
return (*__hashFunc.HashFindFreeKeyBlock) (pTable, 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,18 +44,17 @@ xglParseFindNext (char *cur,
|
|||
}
|
||||
|
||||
void
|
||||
xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
||||
char *arg)
|
||||
xglParseScreen (char *arg)
|
||||
{
|
||||
char delim;
|
||||
char save[1024];
|
||||
int i, pixels, mm;
|
||||
|
||||
pScreenInfo->width = 0;
|
||||
pScreenInfo->height = 0;
|
||||
pScreenInfo->widthMm = 0;
|
||||
pScreenInfo->heightMm = 0;
|
||||
|
||||
|
||||
xglScreenInfo.width = 0;
|
||||
xglScreenInfo.height = 0;
|
||||
xglScreenInfo.widthMm = 0;
|
||||
xglScreenInfo.heightMm = 0;
|
||||
|
||||
if (!arg)
|
||||
return;
|
||||
|
||||
|
@ -82,13 +81,13 @@ xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
|||
|
||||
if (i == 0)
|
||||
{
|
||||
pScreenInfo->width = pixels;
|
||||
pScreenInfo->widthMm = mm;
|
||||
xglScreenInfo.width = pixels;
|
||||
xglScreenInfo.widthMm = mm;
|
||||
}
|
||||
else
|
||||
{
|
||||
pScreenInfo->height = pixels;
|
||||
pScreenInfo->heightMm = mm;
|
||||
xglScreenInfo.height = pixels;
|
||||
xglScreenInfo.heightMm = mm;
|
||||
}
|
||||
|
||||
if (delim != 'x')
|
||||
|
@ -99,79 +98,66 @@ xglParseScreen (xglScreenInfoPtr pScreenInfo,
|
|||
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 ("-vbostream "
|
||||
"use vertex buffer objects for streaming of vertex data\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 "
|
||||
"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
|
||||
xglProcessArgument (xglScreenInfoPtr pScreenInfo,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
xglProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (!strcmp (argv[i], "-screen"))
|
||||
{
|
||||
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 (!strcmp (argv[i], "-vertextype"))
|
||||
{
|
||||
if ((i + 1) < argc)
|
||||
{
|
||||
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"))
|
||||
pScreenInfo->geometryDataType = GEOMETRY_DATA_TYPE_FLOAT;
|
||||
xglScreenInfo.geometryDataType = GEOMETRY_DATA_TYPE_FLOAT;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 2;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-vbostream"))
|
||||
{
|
||||
pScreenInfo->geometryUsage = GEOMETRY_USAGE_STREAM;
|
||||
return 1;
|
||||
}
|
||||
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;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-pbomask"))
|
||||
{
|
||||
if ((i + 1) < argc)
|
||||
{
|
||||
pScreenInfo->pboMask = atoi (argv[i + 1]);
|
||||
xglScreenInfo.pboMask = atoi (argv[i + 1]);
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 2;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-lines"))
|
||||
else if (!strcmp (argv[i], "-fbo"))
|
||||
{
|
||||
pScreenInfo->lines = TRUE;
|
||||
xglScreenInfo.fbo = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,6 +114,8 @@ xglPixmapSurfaceInit (PixmapPtr pPixmap,
|
|||
|
||||
if (width && height)
|
||||
{
|
||||
XGL_SCREEN_PRIV (pPixmap->drawable.pScreen);
|
||||
|
||||
if (width == 1 && height == 1)
|
||||
{
|
||||
pPixmapPriv->acceleratedTile = TRUE;
|
||||
|
@ -124,19 +126,27 @@ xglPixmapSurfaceInit (PixmapPtr pPixmap,
|
|||
(POWER_OF_TWO (width) && POWER_OF_TWO (height)))
|
||||
pPixmapPriv->acceleratedTile = TRUE;
|
||||
}
|
||||
|
||||
pPixmapPriv->target = xglPixmapTargetOut;
|
||||
|
||||
/*
|
||||
* Do not allow accelerated drawing to bitmaps.
|
||||
*/
|
||||
if (pPixmap->drawable.depth == 1)
|
||||
pPixmapPriv->target = xglPixmapTargetNo;
|
||||
|
||||
/*
|
||||
* Drawing to really small pixmaps is not worth accelerating.
|
||||
* Accelerated drawing to pixmaps when using FBOs
|
||||
*/
|
||||
if (width < 8 && height < 8)
|
||||
if (pScreenPriv->fbo)
|
||||
{
|
||||
pPixmapPriv->target = xglPixmapTargetOut;
|
||||
|
||||
/*
|
||||
* Do not allow accelerated drawing to bitmaps.
|
||||
*/
|
||||
if (pPixmap->drawable.depth == 1)
|
||||
pPixmapPriv->target = xglPixmapTargetNo;
|
||||
|
||||
/*
|
||||
* Drawing to really small pixmaps is not worth accelerating.
|
||||
*/
|
||||
if (width < 8 && height < 8)
|
||||
pPixmapPriv->target = xglPixmapTargetNo;
|
||||
}
|
||||
else
|
||||
pPixmapPriv->target = xglPixmapTargetNo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,8 +134,7 @@ xglAllocatePrivates (ScreenPtr pScreen)
|
|||
}
|
||||
|
||||
Bool
|
||||
xglScreenInit (ScreenPtr pScreen,
|
||||
xglScreenInfoPtr pScreenInfo)
|
||||
xglScreenInit (ScreenPtr pScreen)
|
||||
{
|
||||
xglScreenPtr pScreenPriv;
|
||||
int depth, bpp;
|
||||
|
@ -152,9 +151,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
pScreenPriv->pScreenPixmap = NULL;
|
||||
|
||||
pScreenPriv->pVisual = &xglVisuals[0];
|
||||
pScreenPriv->drawable = pScreenInfo->drawable;
|
||||
pScreenPriv->drawable = xglScreenInfo.drawable;
|
||||
pScreenPriv->features =
|
||||
glitz_drawable_get_features (pScreenInfo->drawable);
|
||||
glitz_drawable_get_features (xglScreenInfo.drawable);
|
||||
|
||||
depth = pScreenPriv->pVisual->pPixel->depth;
|
||||
bpp = pScreenPriv->pVisual->pPixel->masks.bpp;
|
||||
|
@ -163,11 +162,12 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
if (!pScreenPriv->pixmapFormats[depth].format)
|
||||
return FALSE;
|
||||
|
||||
pScreenPriv->geometryDataType = pScreenInfo->geometryDataType;
|
||||
pScreenPriv->geometryUsage = pScreenInfo->geometryUsage;
|
||||
pScreenPriv->yInverted = pScreenInfo->yInverted;
|
||||
pScreenPriv->pboMask = pScreenInfo->pboMask;
|
||||
pScreenPriv->lines = pScreenInfo->lines;
|
||||
pScreenPriv->geometryDataType = xglScreenInfo.geometryDataType;
|
||||
pScreenPriv->geometryUsage = xglScreenInfo.geometryUsage;
|
||||
pScreenPriv->yInverted = xglScreenInfo.yInverted;
|
||||
pScreenPriv->pboMask = xglScreenInfo.pboMask;
|
||||
pScreenPriv->lines = xglScreenInfo.lines;
|
||||
pScreenPriv->fbo = xglScreenInfo.fbo;
|
||||
|
||||
GEOMETRY_INIT (pScreen, &pScreenPriv->scratchGeometry,
|
||||
GLITZ_GEOMETRY_TYPE_VERTEX,
|
||||
|
@ -176,7 +176,7 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
pScreenPriv->surface =
|
||||
glitz_surface_create (pScreenPriv->drawable,
|
||||
pScreenPriv->pixmapFormats[depth].format,
|
||||
pScreenInfo->width, pScreenInfo->height,
|
||||
xglScreenInfo.width, xglScreenInfo.height,
|
||||
0, NULL);
|
||||
if (!pScreenPriv->surface)
|
||||
return FALSE;
|
||||
|
@ -191,9 +191,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
monitorResolution = XGL_DEFAULT_DPI;
|
||||
|
||||
if (!fbSetupScreen (pScreen, NULL,
|
||||
pScreenInfo->width, pScreenInfo->height,
|
||||
xglScreenInfo.width, xglScreenInfo.height,
|
||||
monitorResolution, monitorResolution,
|
||||
pScreenInfo->width, bpp))
|
||||
xglScreenInfo.width, bpp))
|
||||
return FALSE;
|
||||
|
||||
pScreen->SaveScreen = xglSaveScreen;
|
||||
|
@ -202,9 +202,9 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
pScreen->DestroyPixmap = xglDestroyPixmap;
|
||||
|
||||
if (!fbFinishScreenInit (pScreen, NULL,
|
||||
pScreenInfo->width, pScreenInfo->height,
|
||||
xglScreenInfo.width, xglScreenInfo.height,
|
||||
monitorResolution, monitorResolution,
|
||||
pScreenInfo->width, bpp))
|
||||
xglScreenInfo.width, bpp))
|
||||
return FALSE;
|
||||
|
||||
#ifdef MITSHM
|
||||
|
@ -276,11 +276,6 @@ xglScreenInit (ScreenPtr pScreen,
|
|||
return FALSE;
|
||||
#endif
|
||||
|
||||
#ifdef GLXEXT
|
||||
if (!xglInitVisualConfigs (pScreen))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
/* Damage is required */
|
||||
DamageSetup (pScreen);
|
||||
|
||||
|
|
|
@ -293,7 +293,13 @@ xglPrepareTarget (DrawablePtr pDrawable)
|
|||
|
||||
switch (pPixmapPriv->target) {
|
||||
case xglPixmapTargetNo:
|
||||
break;
|
||||
case xglPixmapTargetOut:
|
||||
if (xglSyncSurface (pDrawable))
|
||||
{
|
||||
pPixmapPriv->target = xglPixmapTargetIn;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case xglPixmapTargetIn:
|
||||
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
|
||||
xglAddCurrentBitDamage (DrawablePtr pDrawable)
|
||||
{
|
||||
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
|
||||
|
||||
if (pPixmapPriv->target == xglPixmapTargetIn &&
|
||||
pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
|
||||
if (pPixmapPriv->damageBox.x1 < pPixmapPriv->bitBox.x2 &&
|
||||
pPixmapPriv->damageBox.y1 < pPixmapPriv->bitBox.y2 &&
|
||||
pPixmapPriv->damageBox.x2 > pPixmapPriv->bitBox.x1 &&
|
||||
pPixmapPriv->damageBox.y2 > pPixmapPriv->bitBox.y1)
|
||||
|
|
|
@ -173,7 +173,7 @@ xglTrapezoids (CARD8 op,
|
|||
target = xglPrepareTarget (pDst->pDrawable);
|
||||
|
||||
if (nTrap > 1 && op != PictOpAdd && maskFormat &&
|
||||
(overlap || op != PictOpOver))
|
||||
(!target || overlap || op != PictOpOver))
|
||||
{
|
||||
PixmapPtr pPixmap;
|
||||
GCPtr pGC;
|
||||
|
|
Loading…
Reference in New Issue
Block a user