Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework

This commit is contained in:
Ian Romanick 2006-07-13 12:48:03 -07:00
commit 12595a77d6
26 changed files with 297 additions and 131 deletions

View File

@ -48,6 +48,7 @@ extern int __glXCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXBindTexImageEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXCopySubBufferMESA(__GLXclientState *cl, GLbyte *pc);
extern int __glXGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXUseXFont(__GLXclientState*, GLbyte*);
extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
@ -85,6 +86,7 @@ extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
extern int __glXSwapBindTexImageEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
@ -124,4 +126,11 @@ extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
/* Copied from mesa src/glx/x11/glxcmds.c
*
* Apparently there's no standardized opcode for this extension.
*/
#define X_GLXvop_CopySubBufferMESA 5154 /* temporary */
#endif /* _GLX_g_disptab_h_ */

View File

@ -1602,6 +1602,65 @@ int __glXReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
pGlxPixmap);
}
int __glXCopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXContextTag tag = req->contextTag;
__GLXcontext *glxc = NULL;
__GLXdrawable *pGlxDraw;
__GLXpixmap *pPixmap;
ClientPtr client = cl->client;
GLXDrawable drawId;
int error;
int x, y, width, height;
(void) client;
(void) req;
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = *((CARD32 *) (pc));
x = *((INT32 *) (pc + 4));
y = *((INT32 *) (pc + 8));
width = *((INT32 *) (pc + 12));
height = *((INT32 *) (pc + 16));
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc) {
return __glXError(GLXBadContextTag);
}
/*
** The calling thread is swapping its current drawable. In this case,
** glxSwapBuffers is in both GL and X streams, in terms of
** sequentiality.
*/
if (__glXForceCurrent(cl, tag, &error)) {
/*
** Do whatever is needed to make sure that all preceding requests
** in both streams are completed before the swap is executed.
*/
CALL_Finish( GET_DISPATCH(), () );
__GLX_NOTE_FLUSHED_CMDS(glxc);
} else {
return error;
}
}
error = GetDrawableOrPixmap(glxc, drawId, &pGlxDraw, &pPixmap, client);
if (error != Success)
return error;
if (pGlxDraw == NULL ||
pGlxDraw->type != DRAWABLE_WINDOW ||
pGlxDraw->copySubBuffer == NULL)
return __glXError(GLXBadDrawable);
(*pGlxDraw->copySubBuffer)(pGlxDraw, x, y, width, height);
return Success;
}
/*
** Get drawable attributes
*/
@ -2238,7 +2297,9 @@ int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
case X_GLXvop_BindTexImageEXT:
return __glXBindTexImageEXT(cl, pc);
case X_GLXvop_ReleaseTexImageEXT:
return __glXReleaseTexImageEXT(cl, pc);
return __glXReleaseTexImageEXT(cl, pc);
case X_GLXvop_CopySubBufferMESA:
return __glXCopySubBufferMESA(cl, pc);
}
#endif

View File

@ -494,6 +494,31 @@ int __glXSwapReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
return __glXReleaseTexImageEXT(cl, (GLbyte *)pc);
}
int __glXSwapCopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXDrawable *drawId;
int *buffer;
(void) drawId;
(void) buffer;
__GLX_DECLARE_SWAP_VARIABLES;
pc += __GLX_VENDPRIV_HDR_SIZE;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(pc);
__GLX_SWAP_INT(pc + 4);
__GLX_SWAP_INT(pc + 8);
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_INT(pc + 16);
return __glXCopySubBufferMESA(cl, pc);
}
int __glXSwapGetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc;
@ -973,7 +998,9 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
case X_GLXvop_BindTexImageEXT:
return __glXSwapBindTexImageEXT(cl, pc);
case X_GLXvop_ReleaseTexImageEXT:
return __glXSwapReleaseTexImageEXT(cl, pc);
return __glXSwapReleaseTexImageEXT(cl, pc);
case X_GLXvop_CopySubBufferMESA:
return __glXSwapCopySubBufferMESA(cl, pc);
}
#endif

View File

@ -58,6 +58,8 @@ struct __GLXdrawable {
void (*destroy)(__GLXdrawable *private);
GLboolean (*resize)(__GLXdrawable *private);
GLboolean (*swapBuffers)(__GLXdrawable *);
void (*copySubBuffer)(__GLXdrawable *drawable,
int x, int y, int w, int h);
/*
** list of drawable private structs

View File

@ -112,12 +112,28 @@ struct __GLXDRIdrawable {
* months ago. :(
* 20050727 - Gut all the old interfaces. This breaks compatability with
* any DRI driver built to any previous version.
* 20060314 - Added support for GLX_MESA_copy_sub_buffer.
*/
#define INTERNAL_VERSION 20050727
static const char CREATE_NEW_SCREEN_FUNC[] =
"__driCreateNewScreen_" STRINGIFY (INTERNAL_VERSION);
/* The DRI driver entry point version wasn't bumped when the
* copySubBuffer functionality was added to the DRI drivers, but the
* functionality is still conditional on the value of the
* internal_api_version passed to __driCreateNewScreen. However, the
* screen constructor doesn't fail for a DRI driver that's older than
* the passed in version number, so there's no way we can know for
* sure that we can actually use the copySubBuffer functionality. But
* since the earliest (and at this point only) released mesa version
* (6.5) that uses the 20050727 entry point does have copySubBuffer,
* we'll just settle for that. We still have to pass in a higher to
* the screen constructor to enable the functionality.
*/
#define COPY_SUB_BUFFER_INTERNAL_VERSION 20060314
static void
__glXDRIleaveServer(void)
{
@ -177,6 +193,27 @@ __glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate)
return TRUE;
}
static void
__glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate,
int x, int y, int w, int h)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate;
__GLXDRIscreen *screen;
/* FIXME: We're jumping through hoops here to get the DRIdrawable
* which the dri driver tries to keep to it self... cf. FIXME in
* createDrawable. */
screen = (__GLXDRIscreen *) __glXgetActiveScreen(private->base.pDraw->pScreen->myNum);
private->driDrawable = (screen->driScreen.getDrawable)(NULL,
private->base.drawId,
screen->driScreen.private);
(*private->driDrawable->copySubBuffer)(NULL,
private->driDrawable->private,
x, y, w, h);
}
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
@ -474,10 +511,11 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
return NULL;
}
private->base.destroy = __glXDRIdrawableDestroy;
private->base.resize = __glXDRIdrawableResize;
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.destroy = __glXDRIdrawableDestroy;
private->base.resize = __glXDRIdrawableResize;
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
#if 0
/* FIXME: It would only be natural that we called
* driScreen->createNewDrawable here but the DRI drivers manage
@ -770,7 +808,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__DRIframebuffer framebuffer;
int fd = -1;
int status;
int api_ver = INTERNAL_VERSION;
int api_ver = COPY_SUB_BUFFER_INTERNAL_VERSION;
drm_magic_t magic;
drmVersionPtr version;
char *driverName;

View File

@ -139,6 +139,7 @@ static char GLXServerExtensions[] =
"GLX_SGIX_swap_barrier "
#endif
"GLX_SGIX_fbconfig "
"GLX_MESA_copy_sub_buffer "
;
__GLXscreen **__glXActiveScreens;

View File

@ -421,7 +421,7 @@ AC_ARG_ENABLE(multibuffer, AS_HELP_STRING([--enable-multibuffer], [Build Mult
AC_ARG_ENABLE(fontcache, AS_HELP_STRING([--enable-fontcache], [Build FontCache extension (default: disabled)]), [FONTCACHE=$enableval], [FONTCACHE=no])
AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMS=$enableval], [DPMSExtension=yes])
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
AC_ARG_ENABLE(xinput, AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes])
dnl DDXes.
@ -572,7 +572,7 @@ fi
if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.6])
PKG_CHECK_MODULES([GL], [glproto >= 1.4.7])
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
@ -1065,6 +1065,25 @@ dnl has it in libc), or if libdl is needed to get it.
*)
;;
esac
# check whether struct kbd_repeat has the 'period' field.
# on kernels < 2.5.42 it's called 'rate' instead.
AC_TRY_COMPILE([
#include <linux/kd.h>
#ifdef __sparc__
#include <asm/param.h>
#include <asm/kbio.h>
#endif
],[
int main () {
struct kbd_repeat k;
k.period = 0;
return 0;
}],
[period_field="period"],
[period_field="rate"])
AC_DEFINE_UNQUOTED(LNX_KBD_PERIOD_NAME, [$period_field],
[Name of the period field in struct kbd_repeat])
;;
freebsd* | kfreebsd*-gnu)
XORG_OS="freebsd"
@ -1539,7 +1558,7 @@ AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg],
[XORGCFG=$enableval],[XORGCFG=yes])
if test x$XORGCFG = xyes ; then
PKG_CHECK_MODULES([XORGCFG_DEP],
[xkbui xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11])
[xkbui >= 1.0.2 xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11])
AC_CHECK_LIB([curses],[waddstr],
[XORGCFG_DEP_LIBS="$XORGCFG_DEP_LIBS -lcurses"; CURSES=yes],
AC_CHECK_LIB([ncurses],[waddstr],

View File

@ -29,7 +29,8 @@ libdix_la_SOURCES = \
swaprep.c \
swapreq.c \
tables.c \
window.c
window.c \
strcasecmp.c
libxpstubs_la_SOURCES = \
xpstubs.c

50
dix/strcasecmp.c Normal file
View File

@ -0,0 +1,50 @@
/* $Xorg: xkbmisc.c,v 1.4 2000/08/17 19:46:44 cpqbld Exp $ */
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, 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 Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS 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.
********************************************************/
/* $XFree86: xc/lib/xkbfile/xkbmisc.c,v 1.7 2003/07/16 02:31:10 dawes Exp $ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <ctype.h>
#include "dix.h"
#ifdef NEED_STRCASECMP
int
xstrcasecmp(char *str1,char *str2)
{
const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
while (tolower(*us1) == tolower(*us2)) {
if (*us1++ == '\0')
return (0);
us2++;
}
return (tolower(*us1) - tolower(*us2));
}
#endif

View File

@ -662,7 +662,7 @@ static int dmxProcRenderSetPictureFilter(ClientPtr client)
int nparams;
REQUEST(xRenderSetPictureFilterReq);
REQUEST_SIZE_MATCH(xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess,
RenderErrBase + BadPicture);

View File

@ -40,6 +40,8 @@ extern DeviceIntPtr pKdKeyboard;
static int mouseState = 0;
Bool EphyrWantGrayScale = 0;
Bool
ephyrInitialize (KdCardInfo *card, EphyrPriv *priv)
{
@ -80,7 +82,10 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
screen->width = width;
screen->height = height;
}
if (EphyrWantGrayScale)
screen->fb[0].depth = 8;
if (screen->fb[0].depth && screen->fb[0].depth != hostx_get_depth())
{
if (screen->fb[0].depth < hostx_get_depth()
@ -98,12 +103,15 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
if (screen->fb[0].depth <= 8)
{
screen->fb[0].visuals = ((1 << StaticGray) |
(1 << GrayScale) |
(1 << StaticColor) |
(1 << PseudoColor) |
(1 << TrueColor) |
(1 << DirectColor));
if (EphyrWantGrayScale)
screen->fb[0].visuals = ((1 << StaticGray) | (1 << GrayScale));
else
screen->fb[0].visuals = ((1 << StaticGray) |
(1 << GrayScale) |
(1 << StaticColor) |
(1 << PseudoColor) |
(1 << TrueColor) |
(1 << DirectColor));
screen->fb[0].redMask = 0x00;
screen->fb[0].greenMask = 0x00;

View File

@ -29,6 +29,7 @@
#include "ephyr.h"
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
void
InitCard (char *name)
@ -62,6 +63,7 @@ ddxUseMsg (void)
ErrorF("-parent XID Use existing window as Xephyr root win\n");
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-fakexa Simulate acceleration using software rendering\n");
ErrorF("\n");
@ -94,6 +96,11 @@ ddxProcessArgument (int argc, char **argv, int i)
hostx_use_fullscreen();
return 1;
}
else if (!strcmp (argv[i], "-grayscale"))
{
EphyrWantGrayScale = 1;
return 1;
}
else if (!strcmp (argv[i], "-fakexa"))
{
ephyrFuncs.initAccel = ephyrDrawInit;

View File

@ -669,7 +669,7 @@ void
hostx_load_keymap(void)
{
KeySym *keymap;
int mapWidth, min_keycode, max_keycode;
int host_width, min_keycode, max_keycode, width;
int i,j;
XDisplayKeycodes(HostX.dpy, &min_keycode, &max_keycode);
@ -679,25 +679,21 @@ hostx_load_keymap(void)
keymap = XGetKeyboardMapping(HostX.dpy,
min_keycode,
max_keycode - min_keycode + 1,
&mapWidth);
&host_width);
/* Try and copy the hosts keymap into our keymap to avoid loads
* of messing around.
*
* kdrive cannot can have more than 4 keysyms per keycode
* so we only copy the first 4 ( xorg has 6 per keycode )
* so we only copy at most the first 4 ( xorg has 6 per keycode, XVNC 2 )
*/
width = (host_width > 4) ? 4 : host_width;
for (i=0; i<(max_keycode - min_keycode+1); i++)
for (j=0; j<4; j++)
kdKeymap[ (i*4)+j ] = keymap[ (i*mapWidth) + j ];
for (j=0; j<width; j++)
kdKeymap[ (i*width)+j ] = keymap[ (i*host_width) + j ];
/* old way
memcpy (kdKeymap, keymap,
(max_keycode - min_keycode + 1)*mapWidth*sizeof(KeySym));
*/
EPHYR_DBG("keymap width: %d", mapWidth);
EPHYR_DBG("keymap width, host:%d kdrive:%d", host_width, width);
/* all kdrive vars - see kkeymap.c */
@ -705,7 +701,7 @@ hostx_load_keymap(void)
kdMaxScanCode = max_keycode;
kdMinKeyCode = min_keycode;
kdMaxKeyCode = max_keycode;
kdKeymapWidth = (mapWidth > 4) ? 4 : mapWidth;
kdKeymapWidth = width;
XFree(keymap);
}

View File

@ -1079,7 +1079,10 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
extern volatile unsigned char *ioBase;
#if defined(linux) && defined(__powerpc64__)
# include <asm/memory.h>
# include <linux/version.h>
# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
# include <asm/memory.h>
# endif
#endif /* defined(linux) && defined(__powerpc64__) */
#ifndef eieio /* We deal with arch-specific eieio() routines above... */
# define eieio() __asm__ __volatile__ ("eieio" ::: "memory")

View File

@ -95,6 +95,7 @@ libtype1_la_SOURCES = type1mod.c
libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
libxorgxkb_la_LIBADD = $(top_builddir)/dix/libdix.la
libxtrap_la_LDFLAGS = -avoid-version
libxtrap_la_LIBADD = $(top_builddir)/XTrap/libxtrap.la

View File

@ -26,13 +26,13 @@ XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
if (xf86act->type == XkbSA_XFree86Private) {
memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
msgbuf[XkbAnyActionDataSize]= '\0';
if (strcmp(msgbuf, "-vmode")==0)
if (strcasecmp(msgbuf, "-vmode")==0)
xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
else if (strcmp(msgbuf, "+vmode")==0)
else if (strcasecmp(msgbuf, "+vmode")==0)
xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
else if (strcmp(msgbuf, "ungrab")==0)
else if (strcasecmp(msgbuf, "ungrab")==0)
xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL);
else if (strcmp(msgbuf, "clsgrb")==0)
else if (strcasecmp(msgbuf, "clsgrb")==0)
xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL);
else
xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf);

View File

@ -67,25 +67,6 @@ xf86GetKbdLeds()
return(leds);
}
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
* from util-linux-2.9t package */
#include <linux/kd.h>
#include <linux/version.h>
#ifdef __sparc__
#include <asm/param.h>
#include <asm/kbio.h>
#endif
/* Deal with spurious kernel header change in struct kbd_repeat.
We undo this define after the routine using that struct is over,
so as not to interfere with other 'rate' elements. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period
# endif
#endif
static int
KDKBDREP_ioctl_ok(int rate, int delay) {
#if defined(KDKBDREP) && !defined(__sparc__)
@ -94,18 +75,18 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
struct kbd_repeat kbdrep_s;
/* don't change, just test */
kbdrep_s.rate = -1;
kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
kbdrep_s.delay = -1;
if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
return 0;
}
/* do the change */
if (rate == 0) /* switch repeat off */
kbdrep_s.rate = 0;
kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
else
kbdrep_s.rate = 10000 / rate; /* convert cps to msec */
if (kbdrep_s.rate < 1)
kbdrep_s.rate = 1;
kbdrep_s.LNX_KBD_PERIOD_NAME = 10000 / rate; /* convert cps to msec */
if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
kbdrep_s.delay = delay;
if (kbdrep_s.delay < 1)
kbdrep_s.delay = 1;
@ -120,15 +101,6 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#endif /* KDKBDREP */
}
#undef rate
/* Undo the earlier define for the struct kbd_repeat problem. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# undef rate
# endif
#endif
static int
KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE

View File

@ -97,25 +97,6 @@ GetKbdLeds(InputInfoPtr pInfo)
return(leds);
}
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
* from util-linux-2.9t package */
#include <linux/kd.h>
#include <linux/version.h>
#ifdef __sparc__
#include <asm/param.h>
#include <asm/kbio.h>
#endif
/* Deal with spurious kernel header change in struct kbd_repeat.
We undo this define after the routine using that struct is over,
so as not to interfere with other 'rate' elements. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period
# endif
#endif
static int
KDKBDREP_ioctl_ok(int rate, int delay) {
#if defined(KDKBDREP) && !defined(__sparc__)
@ -124,7 +105,7 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
struct kbd_repeat kbdrep_s;
/* don't change, just test */
kbdrep_s.rate = -1;
kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
kbdrep_s.delay = -1;
if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
return 0;
@ -132,11 +113,11 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
/* do the change */
if (rate == 0) /* switch repeat off */
kbdrep_s.rate = 0;
kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
else
kbdrep_s.rate = 10000 / rate; /* convert cps to msec */
if (kbdrep_s.rate < 1)
kbdrep_s.rate = 1;
kbdrep_s.LNX_KBD_PERIOD_NAME = 10000 / rate; /* convert cps to msec */
if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
kbdrep_s.delay = delay;
if (kbdrep_s.delay < 1)
kbdrep_s.delay = 1;
@ -151,15 +132,6 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#endif /* KDKBDREP */
}
#undef rate
/* Undo the earlier define for the struct kbd_repeat problem. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# undef rate
# endif
#endif
static int
KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE

View File

@ -29,7 +29,7 @@ DefaultProtocol(void)
return "Auto";
}
#define DEFAULT_MOUSE_DEV "/dev/mouse"
#define DEFAULT_MOUSE_DEV "/dev/input/mice"
#define DEFAULT_PS2_DEV "/dev/psaux"
#define DEFAULT_GPM_DATA_DEV "/dev/gpmdata"
#define DEFAULT_GPM_CTL_DEV "/dev/gpmdata"

View File

@ -4,7 +4,7 @@ bin_PROGRAMS = Xprt
Xprt_CFLAGS = @SERVER_DEFINES@ @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
-DXPRINT -DPRINT_ONLY_SERVER -D_XP_PRINT_SERVER_ \
-DXPRINTDIR=\"$(prefix)/X11/xserver\" \
-DXPRINTDIR=\"$(libdir)/X11/xserver\" \
-DXPRASTERDDX -DXPPCLDDX -DXPMONOPCLDDX -DXPPSDDX
Xprt_LDFLAGS = -L$(top_srcdir)

View File

@ -1 +1,12 @@
include $(top_srcdir)/cpprules.in
noinst_PRE = xprint
BUILT_SOURCES = $(noinst_PRE)
CLEANFILES = $(noinst_PRE) xprint.pre
CPP_FILES_FLAGS = -DProjectRoot='"$(PROJECTROOT)"' -DOS_LINUX
xprint.pre: xprint.cpp
$(SED) -e 's/^\(\s\+\)#/\1XCOMM/' ${srcdir}/xprint.cpp > $@
EXTRA_DIST = xprint.cpp

View File

@ -820,4 +820,10 @@ typedef struct {
SelectionCallbackKind kind;
} SelectionInfoRec;
/* strcasecmp.c */
#if NEED_STRCASECMP
#define strcasecmp xstrcasecmp
extern int xstrcasecmp(char *s1, char *s2);
#endif
#endif /* DIX_H */

View File

@ -106,4 +106,7 @@
/* Has backtrace support */
#undef HAVE_BACKTRACE
/* Name of the period field in struct kbd_repeat */
#undef LNX_KBD_PERIOD_NAME
#endif /* _XORG_CONFIG_H_ */

View File

@ -108,6 +108,7 @@ SOFTWARE.
#undef XF86DRI
#undef DPMSExtension
#undef FONTCACHE
#undef COMPOSITE
#undef DAMAGE
#undef XFIXES
#undef XEVIE

View File

@ -62,12 +62,6 @@
#define PR_DEBUG2(s,a,b)
#endif
#ifdef NEED_STRCASECMP
extern int _XkbStrCaseCmp(char *s1, char *s2);
#else
#define _XkbStrCaseCmp strcasecmp
#endif
/***====================================================================***/
#define DFLT_LINE_SIZE 128
@ -1092,20 +1086,20 @@ int len,headingtype,extra_ndx = 0;
for ( ; GetInputLine(file,&line,False); line.num_line= 0) {
if (line.line[0]=='!') {
tok = strtok(&(line.line[1]), " \t");
if (_XkbStrCaseCmp(tok,"model") == 0)
if (strcasecmp(tok,"model") == 0)
headingtype = HEAD_MODEL;
else if (_XkbStrCaseCmp(tok,"layout") == 0)
else if (strcasecmp(tok,"layout") == 0)
headingtype = HEAD_LAYOUT;
else if (_XkbStrCaseCmp(tok,"variant") == 0)
else if (strcasecmp(tok,"variant") == 0)
headingtype = HEAD_VARIANT;
else if (_XkbStrCaseCmp(tok,"option") == 0)
else if (strcasecmp(tok,"option") == 0)
headingtype = HEAD_OPTION;
else {
int i;
headingtype = HEAD_EXTRA;
extra_ndx= -1;
for (i=0;(i<rules->num_extra)&&(extra_ndx<0);i++) {
if (!_XkbStrCaseCmp(tok,rules->extra_names[i]))
if (!strcasecmp(tok,rules->extra_names[i]))
extra_ndx= i;
}
if (extra_ndx<0) {

View File

@ -247,19 +247,3 @@ XkbNameMatchesPattern(char *name,char *ptrn)
/* if we get here, the pattern is exhausted (-:just like me:-) */
return (name[0]=='\0');
}
#ifdef NEED_STRCASECMP
_X_HIDDEN int
_XkbStrCaseCmp(char *str1,char *str2)
{
const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
while (tolower(*us1) == tolower(*us2)) {
if (*us1++ == '\0')
return (0);
us2++;
}
return (tolower(*us1) - tolower(*us2));
}
#endif