xserver: Branch 'master' - 27 commits
Keith Packard
keithp at kemper.freedesktop.org
Mon Jan 3 10:08:18 PST 2011
Xext/geext.c | 2
Xext/security.c | 2
Xi/xigrabdev.c | 2
Xi/xipassivegrab.c | 2
Xi/xiselectev.c | 15 +++-
composite/compalloc.c | 29 +++++++-
composite/compinit.c | 34 ---------
composite/compint.h | 1
config/udev.c | 19 +++--
dix/events.c | 15 ----
dix/property.c | 3
glx/glxdri2.c | 2
glx/unpack.h | 2
hw/dmx/glxProxy/unpack.h | 2
hw/xfree86/common/xf86AutoConfig.c | 2
hw/xfree86/common/xf86Module.h | 2
hw/xfree86/dixmods/extmod/modinit.c | 2
hw/xfree86/dixmods/extmod/modinit.h | 4 +
hw/xfree86/dri/dri.c | 2
hw/xfree86/loader/loadmod.c | 2
hw/xfree86/os-support/linux/lnx_agp.c | 2
hw/xfree86/os-support/linux/lnx_video.c | 2
include/exevents.h | 2
include/input.h | 20 +++++
include/inpututils.h | 8 --
include/resource.h | 2
mi/misprite.c | 115 +++++++++++++++++++-------------
os/access.c | 22 ++++--
os/connection.c | 1
os/osdep.h | 4 +
render/animcur.c | 26 +++++--
31 files changed, 206 insertions(+), 142 deletions(-)
New commits:
commit 261d0d16af797bb52d4c778e220296d7f2b28e14
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Thu Dec 30 16:08:48 2010 -0800
Fix asprintf typo in commit d2c42b10
Reported-by: Jerome Carretero <cJ at zougloub.eu>
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Cyril Brulebois <kibi at debian.org>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index 168795d..a415e5f 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -146,7 +146,7 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
for (i = 0; extensionModules[i].name != NULL; i++) {
if (opts) {
char *s;
- if (Xasprinf(&s, "omit%s", extensionModules[i].name) != -1) {
+ if (asprintf(&s, "omit%s", extensionModules[i].name) != -1) {
pointer o;
o = xf86FindOption(opts, s);
free(s);
commit c6afe64bad7a27ff8828de499d56776c113df60f
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Dec 31 03:15:27 2010 +0000
XFree86: Linux: AGP: Fix void-pointer-arithmetic warning
Cast it to a char *, mimicking the return immediately below it.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 39c728d..3d45511 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -461,7 +461,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
" (0x%08lx,0x%lx) (%s)\n", Base, Size,
strerror(errno));
}
- DebugF("base: %lx aligned base: %lx\n",base, base + alignOff);
+ DebugF("base: %lx aligned base: %lx\n",base, (char *)base + alignOff);
return (char *)base + alignOff;
}
#endif /* !(__sparc__) */
commit 2d67ada3c4079a11c52024a9c3d4138becca5171
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:43 2010 +0200
os: always check if client is local when connection is accepted
LocalClient is used for all DRI2 requests that makes it frequently
called function. Querying if connection is local or not takes 10-15us
(on ARM) depending on malloc speed.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/os/access.c b/os/access.c
index 494986e..eb1a21d 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1028,20 +1028,19 @@ ResetHosts (char *display)
}
/* Is client on the local host */
-Bool LocalClient(ClientPtr client)
+Bool
+ComputeLocalClient(ClientPtr client)
{
int alen, family, notused;
Xtransaddr *from = NULL;
pointer addr;
register HOST *host;
+ OsCommPtr oc = (OsCommPtr) client->osPrivate;
- if (!client->osPrivate)
- return FALSE;
- if (!((OsCommPtr)client->osPrivate)->trans_conn)
+ if (!oc->trans_conn)
return FALSE;
- if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn,
- ¬used, &alen, &from))
+ if (!_XSERVTransGetPeerAddr (oc->trans_conn, ¬used, &alen, &from))
{
family = ConvertAddr ((struct sockaddr *) from,
&alen, (pointer *)&addr);
@@ -1067,6 +1066,13 @@ Bool LocalClient(ClientPtr client)
return FALSE;
}
+Bool LocalClient(ClientPtr client)
+{
+ if (!client->osPrivate)
+ return FALSE;
+ return ((OsCommPtr)client->osPrivate)->local_client;
+}
+
/*
* Return the uid and gid of a connected local client
*
diff --git a/os/connection.c b/os/connection.c
index 5452ae1..5580fab 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -746,6 +746,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
free(oc);
return NullClient;
}
+ oc->local_client = ComputeLocalClient(client);
#if !defined(WIN32)
ConnectionTranslation[fd] = client->index;
#else
diff --git a/os/osdep.h b/os/osdep.h
index 3c0e78f..087e36d 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -172,6 +172,7 @@ typedef struct _osComm {
XID auth_id; /* authorization id */
CARD32 conn_time; /* timestamp if not established, else 0 */
struct _XtransConnInfo *trans_conn; /* transport connection object */
+ Bool local_client;
} OsCommRec, *OsCommPtr;
extern int FlushClient(
@@ -217,6 +218,9 @@ typedef long int fd_mask;
#define ffs mffs
extern int mffs(fd_mask);
+/* in access.c */
+extern Bool ComputeLocalClient(ClientPtr client);
+
/* in auth.c */
extern void GenerateRandomData (int len, char *buf);
commit 617b7d22115ccaaaa7ec69c99885054d33a3bc37
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:42 2010 +0200
os: Fix a memory leak
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/os/access.c b/os/access.c
index d43fdf8..494986e 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1057,8 +1057,10 @@ Bool LocalClient(ClientPtr client)
}
for (host = selfhosts; host; host = host->next)
{
- if (addrEqual (family, addr, alen, host))
+ if (addrEqual (family, addr, alen, host)) {
+ free(from);
return TRUE;
+ }
}
free(from);
}
commit 3e1455505addc7e52178fa04399aef2a8522c921
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:41 2010 +0200
udev: Fix removing of the wake up handler
RemoveBlockAndWakeupHandlers requires caller to pass same block data
parameter as for RegisterBlockAndWakeupHandlers.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/config/udev.c b/config/udev.c
index e401894..ab27c98 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -314,7 +314,7 @@ config_udev_fini(void)
udev = udev_monitor_get_udev(udev_monitor);
RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor));
- RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, udev_monitor);
+ RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
udev_monitor_unref(udev_monitor);
udev_monitor = NULL;
udev_unref(udev);
commit 13ac3deedb532b39f41dcd45d70f9eb4a85c1f58
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:40 2010 +0200
mi: Only register sprite block handler when needed
miSpriteBlockHandler takes about 10us in arm each time BlockHandlers are
called. To eliminate that overhead from xserver side only register the
BlockHandler when there actually is any cursor down.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/mi/misprite.c b/mi/misprite.c
index 1a76d20..c25c093 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -256,6 +256,15 @@ static void miSpriteRestoreCursor(DeviceIntPtr pDev,
ScreenPtr pScreen);
static void
+miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
+{
+ if (!pScreenPriv->BlockHandler) {
+ pScreenPriv->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = miSpriteBlockHandler;
+ }
+}
+
+static void
miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
ScreenPtr pScreen = closure;
@@ -332,7 +341,7 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->InstallColormap = pScreen->InstallColormap;
pScreenPriv->StoreColors = pScreen->StoreColors;
- pScreenPriv->BlockHandler = pScreen->BlockHandler;
+ pScreenPriv->BlockHandler = NULL;
pScreenPriv->DeviceCursorInitialize = pScreen->DeviceCursorInitialize;
pScreenPriv->DeviceCursorCleanup = pScreen->DeviceCursorCleanup;
@@ -359,8 +368,6 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreen->InstallColormap = miSpriteInstallColormap;
pScreen->StoreColors = miSpriteStoreColors;
- pScreen->BlockHandler = miSpriteBlockHandler;
-
return TRUE;
}
@@ -382,7 +389,6 @@ miSpriteCloseScreen (int i, ScreenPtr pScreen)
pScreen->GetImage = pScreenPriv->GetImage;
pScreen->GetSpans = pScreenPriv->GetSpans;
pScreen->SourceValidate = pScreenPriv->SourceValidate;
- pScreen->BlockHandler = pScreenPriv->BlockHandler;
pScreen->InstallColormap = pScreenPriv->InstallColormap;
pScreen->StoreColors = pScreenPriv->StoreColors;
@@ -555,12 +561,7 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
-
- SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler);
-
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
-
- SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
+ Bool WorkToDo = FALSE;
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
@@ -587,9 +588,20 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
{
SPRITE_DEBUG (("BlockHandler restore\n"));
miSpriteRestoreCursor (pDev, pScreen);
+ if (!pCursorInfo->isUp)
+ WorkToDo = TRUE;
}
}
}
+
+ SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler);
+
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+
+ if (WorkToDo)
+ SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
+ else
+ pPriv->BlockHandler = NULL;
}
static void
@@ -798,6 +810,8 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
if (!pPointer->shouldBeUp)
pScreenPriv->numberOfCursors++;
pPointer->shouldBeUp = TRUE;
+ if (!pPointer->isUp)
+ miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
if (pPointer->x == x &&
pPointer->y == y &&
pPointer->pCursor == pCursor &&
@@ -898,6 +912,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo = MISPRITE(pDev);
miSpriteIsDown(pCursorInfo);
+ miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
pCursorInfo->pCacheWin = NullWindow;
miSpriteDisableDamage(pScreen, pScreenPriv);
if (!miDCRestoreUnderCursor(pDev,
commit 4f6e3b0f378d7306dbd8c00ef9a7df81e24e5769
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:39 2010 +0200
mi: Register sprite damage handler only when required
There is no need to have damage handler registered when there isn't any
pointer in the screen. This avoids some overhead from damage handling
which takes tens of microseconds on arm.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/mi/misprite.c b/mi/misprite.c
index a269705..1a76d20 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -96,6 +96,7 @@ typedef struct {
VisualPtr pVisual;
DamagePtr pDamage; /* damage tracking structure */
Bool damageRegistered;
+ int numberOfCursors;
} miSpriteScreenRec, *miSpriteScreenPtr;
#define SOURCE_COLOR 0
@@ -345,6 +346,7 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->colors[MASK_COLOR].green = 0;
pScreenPriv->colors[MASK_COLOR].blue = 0;
pScreenPriv->damageRegistered = 0;
+ pScreenPriv->numberOfCursors = 0;
dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv);
@@ -772,21 +774,29 @@ static void
miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y)
{
- miCursorInfoPtr pPointer;
+ miCursorInfoPtr pPointer;
+ miSpriteScreenPtr pScreenPriv;
if (!IsMaster(pDev) && !pDev->u.master)
return;
pPointer = MISPRITE(pDev);
+ pScreenPriv = GetSpriteScreen(pScreen);
if (!pCursor)
{
+ if (pPointer->shouldBeUp)
+ --pScreenPriv->numberOfCursors;
pPointer->shouldBeUp = FALSE;
if (pPointer->isUp)
miSpriteRemoveCursor (pDev, pScreen);
+ if (pScreenPriv->numberOfCursors == 0)
+ miSpriteDisableDamage(pScreen, pScreenPriv);
pPointer->pCursor = 0;
return;
}
+ if (!pPointer->shouldBeUp)
+ pScreenPriv->numberOfCursors++;
pPointer->shouldBeUp = TRUE;
if (pPointer->x == x &&
pPointer->y == y &&
commit bf48082f30818b96bc623834be3022600371d4fc
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:38 2010 +0200
mi: Fix the debug message
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/mi/misprite.c b/mi/misprite.c
index e5dbf1d..a269705 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -569,7 +569,7 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
&& pCursorInfo->pScreen == pScreen
&& pCursorInfo->shouldBeUp)
{
- SPRITE_DEBUG (("BlockHandler restore\n"));
+ SPRITE_DEBUG (("BlockHandler save"));
miSpriteSaveUnderCursor (pDev, pScreen);
}
}
commit 8fb43b8bf9fcbe015d4e98c7e09889184d136a1e
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:37 2010 +0200
mi: Fix wrapping for sprite screen
SCREEN_EPILOGUE should read the current function pointer from screen
after calling wrapped function in case the pointer changes.
Passing pPriv to macros instead of asking dix each time makes sense when
both macros need same pointer.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/mi/misprite.c b/mi/misprite.c
index d1cf2bb..e5dbf1d 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -216,11 +216,10 @@ static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev,
static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev,
ScreenPtr pScreen);
-#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
- ((miSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
- miSpriteScreenKey))->field)
-#define SCREEN_EPILOGUE(pScreen, field)\
- ((pScreen)->field = miSprite##field)
+#define SCREEN_PROLOGUE(pPriv, pScreen, field) ((pScreen)->field = \
+ (pPriv)->field)
+#define SCREEN_EPILOGUE(pPriv, pScreen, field)\
+ ((pPriv)->field = (pScreen)->field, (pScreen)->field = miSprite##field)
/*
* pointer-sprite method table
@@ -397,11 +396,12 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
unsigned int format, unsigned long planemask,
char *pdstLine)
{
- ScreenPtr pScreen = pDrawable->pScreen;
- DeviceIntPtr pDev;
- miCursorInfoPtr pCursorInfo;
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DeviceIntPtr pDev;
+ miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE (pScreen, GetImage);
+ SCREEN_PROLOGUE (pPriv, pScreen, GetImage);
if (pDrawable->type == DRAWABLE_WINDOW)
{
@@ -424,7 +424,7 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
format, planemask, pdstLine);
- SCREEN_EPILOGUE (pScreen, GetImage);
+ SCREEN_EPILOGUE (pPriv, pScreen, GetImage);
}
static void
@@ -434,8 +434,9 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
ScreenPtr pScreen = pDrawable->pScreen;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE (pScreen, GetSpans);
+ SCREEN_PROLOGUE (pPriv, pScreen, GetSpans);
if (pDrawable->type == DRAWABLE_WINDOW)
{
@@ -475,7 +476,7 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- SCREEN_EPILOGUE (pScreen, GetSpans);
+ SCREEN_EPILOGUE (pPriv, pScreen, GetSpans);
}
static void
@@ -485,8 +486,9 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
ScreenPtr pScreen = pDrawable->pScreen;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE (pScreen, SourceValidate);
+ SCREEN_PROLOGUE (pPriv, pScreen, SourceValidate);
if (pDrawable->type == DRAWABLE_WINDOW)
{
@@ -509,7 +511,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
if (pScreen->SourceValidate)
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
- SCREEN_EPILOGUE (pScreen, SourceValidate);
+ SCREEN_EPILOGUE (pPriv, pScreen, SourceValidate);
}
static void
@@ -518,8 +520,9 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
ScreenPtr pScreen = pWindow->drawable.pScreen;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE (pScreen, CopyWindow);
+ SCREEN_PROLOGUE (pPriv, pScreen, CopyWindow);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
@@ -539,7 +542,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
}
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
- SCREEN_EPILOGUE (pScreen, CopyWindow);
+ SCREEN_EPILOGUE (pPriv, pScreen, CopyWindow);
}
static void
@@ -551,11 +554,11 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- SCREEN_PROLOGUE(pScreen, BlockHandler);
+ SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler);
(*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
- SCREEN_EPILOGUE(pScreen, BlockHandler);
+ SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
@@ -593,11 +596,11 @@ miSpriteInstallColormap (ColormapPtr pMap)
ScreenPtr pScreen = pMap->pScreen;
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- SCREEN_PROLOGUE(pScreen, InstallColormap);
+ SCREEN_PROLOGUE(pPriv, pScreen, InstallColormap);
(*pScreen->InstallColormap) (pMap);
- SCREEN_EPILOGUE(pScreen, InstallColormap);
+ SCREEN_EPILOGUE(pPriv, pScreen, InstallColormap);
/* InstallColormap can be called before devices are initialized. */
pPriv->pInstalledMap = pMap;
@@ -630,11 +633,11 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- SCREEN_PROLOGUE(pScreen, StoreColors);
+ SCREEN_PROLOGUE(pPriv, pScreen, StoreColors);
(*pScreen->StoreColors) (pMap, ndef, pdef);
- SCREEN_EPILOGUE(pScreen, StoreColors);
+ SCREEN_EPILOGUE(pPriv, pScreen, StoreColors);
if (pPriv->pColormap == pMap)
{
commit 4be2a6d1b33fac7ceb50ad1de249a1acd5a46ab0
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:36 2010 +0200
mi: Add GetSpriteScreen macro to hide dixLookupPrivate
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/mi/misprite.c b/mi/misprite.c
index 38a6b93..d1cf2bb 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -184,6 +184,8 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
static DevPrivateKeyRec miSpriteScreenKeyRec;
#define miSpriteScreenKey (&miSpriteScreenKeyRec)
+#define GetSpriteScreen(pScreen) \
+ (dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey))
static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
#define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
@@ -373,9 +375,8 @@ miSpriteInitialize (ScreenPtr pScreen,
static Bool
miSpriteCloseScreen (int i, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv;
+ miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
pScreen->GetImage = pScreenPriv->GetImage;
pScreen->GetSpans = pScreenPriv->GetSpans;
@@ -546,11 +547,10 @@ miSpriteBlockHandler (int i, pointer blockData, pointer pTimeout,
pointer pReadmask)
{
ScreenPtr pScreen = screenInfo.screens[i];
- miSpriteScreenPtr pPriv;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, BlockHandler);
(*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
@@ -591,9 +591,8 @@ static void
miSpriteInstallColormap (ColormapPtr pMap)
{
ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
- pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, InstallColormap);
(*pScreen->InstallColormap) (pMap);
@@ -624,14 +623,13 @@ static void
miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
{
ScreenPtr pScreen = pMap->pScreen;
- miSpriteScreenPtr pPriv;
+ miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
int i;
int updated;
VisualPtr pVisual;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
- pPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
SCREEN_PROLOGUE(pScreen, StoreColors);
(*pScreen->StoreColors) (pMap, ndef, pdef);
@@ -706,8 +704,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef)
static void
miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
{
- miSpriteScreenPtr pScreenPriv =
- dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
CursorPtr pCursor;
xColorItem *sourceColor, *maskColor;
@@ -884,7 +881,7 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteIsDown(pCursorInfo);
@@ -922,7 +919,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);
@@ -963,7 +960,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
return;
DamageDrawInternal (pScreen, TRUE);
- pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
+ pScreenPriv = GetSpriteScreen(pScreen);
pCursorInfo = MISPRITE(pDev);
miSpriteComputeSaved (pDev, pScreen);
commit ed8db09b4bff5c4a8d8056808368650e1876547b
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:35 2010 +0200
composite: Remove unnecessary variable.
We know that there is damage if the dynamic block handler is registered.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/composite/compalloc.c b/composite/compalloc.c
index e628c45..86a6f8e 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -50,14 +50,8 @@
static void
compScreenUpdate (ScreenPtr pScreen)
{
- CompScreenPtr cs = GetCompScreen (pScreen);
-
compCheckTree (pScreen);
- if (cs->damaged)
- {
- compWindowUpdate (pScreen->root);
- cs->damaged = FALSE;
- }
+ compWindowUpdate (pScreen->root);
}
static void
@@ -85,11 +79,9 @@ compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
CompScreenPtr cs = GetCompScreen (pScreen);
CompWindowPtr cw = GetCompWindow (pWin);
- if (!cs->damaged) {
+ if (!cs->BlockHandler) {
cs->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = compBlockHandler;
-
- cs->damaged = TRUE;
}
cw->damaged = TRUE;
}
diff --git a/composite/compinit.c b/composite/compinit.c
index 885cc73..276ed75 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -301,7 +301,6 @@ compScreenInit (ScreenPtr pScreen)
if (!cs)
return FALSE;
- cs->damaged = FALSE;
cs->overlayWid = FakeClientID(0);
cs->pOverlayWin = NULL;
cs->pOverlayClients = NULL;
diff --git a/composite/compint.h b/composite/compint.h
index 9ba5dd0..4b058e7 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -152,7 +152,6 @@ typedef struct _CompScreen {
ScreenBlockHandlerProcPtr BlockHandler;
CloseScreenProcPtr CloseScreen;
- Bool damaged;
int numAlternateVisuals;
VisualID *alternateVisuals;
commit c038b8b28e5c436cd31bea7a3bef2c8c9d818b58
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:34 2010 +0200
composite: Only register the block handler when it is required
Even calling block handler that doesn't do much is costly in arm. It
takes a few microseconds each time which adds up to relative high CPU
time because it is done 500+ times per second.
Simple optimization is to register the block handler only when it is
required.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 93571ee..e628c45 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -48,6 +48,36 @@
#include "compint.h"
static void
+compScreenUpdate (ScreenPtr pScreen)
+{
+ CompScreenPtr cs = GetCompScreen (pScreen);
+
+ compCheckTree (pScreen);
+ if (cs->damaged)
+ {
+ compWindowUpdate (pScreen->root);
+ cs->damaged = FALSE;
+ }
+}
+
+static void
+compBlockHandler (int i,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[i];
+ CompScreenPtr cs = GetCompScreen (pScreen);
+
+ pScreen->BlockHandler = cs->BlockHandler;
+ compScreenUpdate (pScreen);
+ (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+
+ /* Next damage will restore the block handler */
+ cs->BlockHandler = NULL;
+}
+
+static void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
WindowPtr pWin = (WindowPtr) closure;
@@ -55,7 +85,12 @@ compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
CompScreenPtr cs = GetCompScreen (pScreen);
CompWindowPtr cw = GetCompWindow (pWin);
- cs->damaged = TRUE;
+ if (!cs->damaged) {
+ cs->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = compBlockHandler;
+
+ cs->damaged = TRUE;
+ }
cw->damaged = TRUE;
}
diff --git a/composite/compinit.c b/composite/compinit.c
index 159f7c2..885cc73 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -61,7 +61,6 @@ compCloseScreen (int index, ScreenPtr pScreen)
free(cs->alternateVisuals);
pScreen->CloseScreen = cs->CloseScreen;
- pScreen->BlockHandler = cs->BlockHandler;
pScreen->InstallColormap = cs->InstallColormap;
pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes;
pScreen->ReparentWindow = cs->ReparentWindow;
@@ -130,35 +129,6 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
return ret;
}
-static void
-compScreenUpdate (ScreenPtr pScreen)
-{
- CompScreenPtr cs = GetCompScreen (pScreen);
-
- compCheckTree (pScreen);
- if (cs->damaged)
- {
- compWindowUpdate (pScreen->root);
- cs->damaged = FALSE;
- }
-}
-
-static void
-compBlockHandler (int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask)
-{
- ScreenPtr pScreen = screenInfo.screens[i];
- CompScreenPtr cs = GetCompScreen (pScreen);
-
- pScreen->BlockHandler = cs->BlockHandler;
- compScreenUpdate (pScreen);
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
- cs->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = compBlockHandler;
-}
-
/*
* Add alternate visuals -- always expose an ARGB32 and RGB24 visual
*/
@@ -387,8 +357,7 @@ compScreenInit (ScreenPtr pScreen)
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
- cs->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = compBlockHandler;
+ cs->BlockHandler = NULL;
cs->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = compCloseScreen;
commit 6d0e9e5d6e1b847961ab52a11aae96981a1cf1c0
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:33 2010 +0200
render: Enable animated cursor block handler only when needed
Calling BlockHandlers takes some time for each iteration in main loop
which adds up quickly over multiple request. To reduce the round-trip
costs to xserver BlockHandlers should be registered only when required.
AnimCurScreenBlockHandler is the first victim for this optimization.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/render/animcur.c b/render/animcur.c
index 1a8ca43..31cbab9 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -95,8 +95,6 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen)
Bool ret;
Unwrap(as, pScreen, CloseScreen);
-
- Unwrap(as, pScreen, BlockHandler);
Unwrap(as, pScreen, CursorLimits);
Unwrap(as, pScreen, DisplayCursor);
@@ -196,7 +194,10 @@ AnimCurScreenBlockHandler (int screenNum,
Unwrap (as, pScreen, BlockHandler);
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
- Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
+ if (activeDevice)
+ Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
+ else
+ as->BlockHandler = NULL;
}
static Bool
@@ -222,6 +223,9 @@ AnimCurDisplayCursor (DeviceIntPtr pDev,
pDev->spriteInfo->anim.time = GetTimeInMillis () + ac->elts[0].delay;
pDev->spriteInfo->anim.pCursor = pCursor;
pDev->spriteInfo->anim.pScreen = pScreen;
+
+ if (!as->BlockHandler)
+ Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
}
}
else
@@ -248,8 +252,12 @@ AnimCurSetCursorPosition (DeviceIntPtr pDev,
Bool ret;
Unwrap (as, pScreen, SetCursorPosition);
- if (pDev->spriteInfo->anim.pCursor)
+ if (pDev->spriteInfo->anim.pCursor) {
pDev->spriteInfo->anim.pScreen = pScreen;
+
+ if (!as->BlockHandler)
+ Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
+ }
ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
return ret;
@@ -334,7 +342,7 @@ AnimCurInit (ScreenPtr pScreen)
return FALSE;
Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
- Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler);
+ as->BlockHandler = NULL;
Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits);
Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor);
commit aa8cea953dc66bcf4cb4d08f2681f9e6cb1bc8c5
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date: Thu Dec 30 19:19:32 2010 +0200
render: Don't filter 0 return from GetTimeInMillis
In animate cursor block handler code assumes GetTimeInMillis returns
always nonzero value. This isn't true when time wraps around.
To prevent any problems in case GetTimeInMillis would return zero use
activeDevice variable to track if we have received time.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/render/animcur.c b/render/animcur.c
index 2160f50..1a8ca43 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -150,6 +150,7 @@ AnimCurScreenBlockHandler (int screenNum,
ScreenPtr pScreen = screenInfo.screens[screenNum];
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
DeviceIntPtr dev;
+ Bool activeDevice = FALSE;
CARD32 now = 0,
soonest = ~0; /* earliest time to wakeup again */
@@ -157,7 +158,10 @@ AnimCurScreenBlockHandler (int screenNum,
{
if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen)
{
- if (!now) now = GetTimeInMillis ();
+ if (!activeDevice) {
+ now = GetTimeInMillis ();
+ activeDevice = TRUE;
+ }
if ((INT32) (now - dev->spriteInfo->anim.time) >= 0)
{
@@ -187,7 +191,7 @@ AnimCurScreenBlockHandler (int screenNum,
}
}
- if (now)
+ if (activeDevice)
AdjustWaitForDelay (pTimeout, soonest - now);
Unwrap (as, pScreen, BlockHandler);
commit 91beeee05f88eed10ab0fd97dc625e96cb7763ba
Author: Daniel Stone <daniel at fooishbar.org>
Date: Tue Oct 13 16:27:30 2009 +1100
DIX: Reset window properties when freeing them
This enables us to reliably inspect properties when destroying windows.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Fernando Carrijo <fcarrijo at freedesktop.org>
diff --git a/dix/property.c b/dix/property.c
index 1d4332a..a1ae530 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -424,6 +424,9 @@ DeleteAllWindowProperties(WindowPtr pWin)
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
pProp = pNextProp;
}
+
+ if (pWin->optional)
+ pWin->optional->userProps = NULL;
}
static int
commit 36ebdd361616eedbe4919deae2a4e6f6606ae6b4
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:24 2010 -0400
linux: warning fix
lnx_agp.c: In function âxf86DeallocateGARTMemoryâ:
lnx_agp.c:267: warning: cast to pointer from integer of different size
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c
index c65f1e3..a5f0411 100644
--- a/hw/xfree86/os-support/linux/lnx_agp.c
+++ b/hw/xfree86/os-support/linux/lnx_agp.c
@@ -264,7 +264,7 @@ xf86DeallocateGARTMemory(int screenNum, int key)
}
#ifdef __linux__
- if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)key) != 0) {
+ if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)(uintptr_t)key) != 0) {
#else
if (ioctl(gartFd, AGPIOC_DEALLOCATE, &key) != 0) {
#endif
commit 63ccaec2c39f4b5742383472c951ee2cd35c9e14
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:23 2010 -0400
glx: warning fixes
render2.c: In function â__glXDisp_Map2dâ:
render2.c:127: warning: âu1â may be used uninitialized in this function
render2.c: In function â__glXDisp_Map1dâ:
render2.c:90: warning: âu1â may be used uninitialized in this function
Remove unnecessary test, and change memcpy to memmove as all users were
doing overlapping copies.
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/glx/unpack.h b/glx/unpack.h
index a4e6d7e..738e79d 100644
--- a/glx/unpack.h
+++ b/glx/unpack.h
@@ -47,7 +47,7 @@
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n) if (src != NULL && dst != NULL) memcpy(dst,src,n)
+#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
#else
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
diff --git a/hw/dmx/glxProxy/unpack.h b/hw/dmx/glxProxy/unpack.h
index f34b6fd..f4a9572 100644
--- a/hw/dmx/glxProxy/unpack.h
+++ b/hw/dmx/glxProxy/unpack.h
@@ -43,7 +43,7 @@
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n) memcpy(dst,src,n)
+#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
#else
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
commit d057e265c862f90e9b6fddff89f40cb82b2a59b1
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:22 2010 -0400
xcmisc: warning fix
xcmisc.c:202: warning: no previous prototype for âXCMiscExtensionInitâ
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 1154e46..5bbbb88 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -18,6 +18,10 @@ extern void XTestExtensionInit(INITARGS);
extern void XTestExtension1Init(INITARGS);
#endif
+#if 1
+extern void XCMiscExtensionInit(INITARGS);
+#endif
+
#ifdef SCREENSAVER
extern void ScreenSaverExtensionInit (INITARGS);
#include <X11/extensions/saver.h>
commit 67e0bcba4307de5a330e027f4504c9aed4987e5a
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:21 2010 -0400
dri1: warning fix
dri.c: In function âDRIScreenInitâ:
dri.c:434: warning: cast from pointer to integer of different size
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 1d83630..3c64ae4 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -431,7 +431,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
if (!pDRIPriv->pDriverInfo->dontMapFrameBuffer)
{
if (drmAddMap( pDRIPriv->drmFD,
- (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
+ (uintptr_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
pDRIPriv->pDriverInfo->frameBufferSize,
DRM_FRAME_BUFFER,
0,
commit a298d044f965e5ba91f178c6b599c1df26a958ba
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:20 2010 -0400
loader: warning fix
loadmod.c: In function âFreeSubdirsâ:
loadmod.c:377: warning: passing argument 1 of âfreeâ discards qualifiers
from pointer target type
/usr/include/stdlib.h:488: note: expected âvoid *â but argument is of
type âconst char *â
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 3b3511c..eaa99e8 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -374,7 +374,7 @@ FreeSubdirs(const char **subdirs)
if (subdirs) {
for (s = subdirs; *s; s++)
- free(*s);
+ free((char *)*s);
free(subdirs);
}
}
commit ee0b1b564413327c73bb8cdbabb76667ca4a744c
Author: Adam Jackson <ajax at redhat.com>
Date: Tue Oct 19 11:59:18 2010 -0400
config: warning fixes
xf86AutoConfig.c: In function âFreeListâ:
xf86AutoConfig.c:123: warning: passing argument 1 of âfreeâ discards
qualifiers from pointer target type
/usr/include/stdlib.h:488: note: expected âvoid *â but argument is of
type âconst char *â
Signed-off-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index eb61f87..5c6e721 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -120,7 +120,7 @@ FreeList(const char ***list, int *lines)
int i;
for (i = 0; i < *lines; i++) {
- free((*list)[i]);
+ free((char *)((*list)[i]));
}
free(*list);
*list = NULL;
commit 32c85ad4b8fe27fed0c494f69c39e3902ce57b1b
Author: Daniel Stone <daniel at fooishbar.org>
Date: Tue Dec 28 12:40:31 2010 +0000
GLX: DRI2: Fix mismatched-types warning
All the DRI extension types have a base extension type as their first
member to avoid exactly these types of warning.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
Reviewed-by: Cyril Brulebois <kibi at debian.org>
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 1111183..8d21c93 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -594,7 +594,7 @@ static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&loaderExtension.base,
#ifdef __DRI_USE_INVALIDATE
- &dri2UseInvalidate,
+ &dri2UseInvalidate.base,
#endif
NULL
};
commit 22796cfa4805cc9551e1b3fa1d3e2e1bfae5bad1
Author: Daniel Stone <daniel at fooishbar.org>
Date: Tue Dec 28 12:29:53 2010 +0000
udev: Add strdups to kill const warnings
InputAttributes wants non-const members, and while it appears safe to
cast it, just leave it be for the moment.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
diff --git a/config/udev.c b/config/udev.c
index 496bfbf..e401894 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -94,6 +94,7 @@ device_added(struct udev_device *udev_device)
if (parent) {
const char *ppath = udev_device_get_devnode(parent);
const char *product = udev_device_get_property_value(parent, "PRODUCT");
+ const char *pnp_id = udev_device_get_sysattr_value(parent, "id");
unsigned int usb_vendor, usb_model;
name = udev_device_get_sysattr_value(parent, "name");
@@ -103,8 +104,9 @@ device_added(struct udev_device *udev_device)
LOG_PROPERTY(ppath, "NAME", name);
}
- attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
- LOG_SYSATTR(ppath, "id", attrs.pnp_id);
+ if (pnp_id)
+ attrs.pnp_id = strdup(pnp_id);
+ LOG_SYSATTR(ppath, "id", pnp_id);
/* construct USB ID in lowercase hex - "0000:ffff" */
if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) {
@@ -118,12 +120,13 @@ device_added(struct udev_device *udev_device)
if (!name)
name = "(unnamed)";
else
- attrs.product = name;
+ attrs.product = strdup(name);
add_option(&options, "name", name);
add_option(&options, "path", path);
add_option(&options, "device", path);
- attrs.device = path;
+ if (path)
+ attrs.device = strdup(path);
tags_prop = udev_device_get_property_value(udev_device, "ID_INPUT.tags");
LOG_PROPERTY(path, "ID_INPUT.tags", tags_prop);
@@ -162,7 +165,7 @@ device_added(struct udev_device *udev_device)
add_option(&options, "xkb_options", value);
} else if (!strcmp(key, "ID_VENDOR")) {
LOG_PROPERTY(path, key, value);
- attrs.vendor = value;
+ attrs.vendor = strdup(value);
} else if (!strcmp(key, "ID_INPUT_KEY")) {
LOG_PROPERTY(path, key, value);
attrs.flags |= ATTR_KEYBOARD;
@@ -202,6 +205,10 @@ device_added(struct udev_device *udev_device)
}
free(attrs.usb_id);
+ free(attrs.pnp_id);
+ free(attrs.product);
+ free(attrs.device);
+ free(attrs.vendor);
if (attrs.tags) {
char **tag = attrs.tags;
while (*tag) {
commit 03f2eb1e156796afb70118d7f7f60ac61beed026
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Dec 17 17:13:34 2010 +0000
Input: Set client error value for invalid mask bits
When we send BadValue back to the client for having invalid mask bits,
at least tell them what the (first) invalid bit was.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c
index 24ededc..0adc878 100644
--- a/Xi/xigrabdev.c
+++ b/Xi/xigrabdev.c
@@ -79,7 +79,7 @@ ProcXIGrabDevice(ClientPtr client)
if (!IsMaster(dev))
stuff->paired_device_mode = GrabModeAsync;
- if (XICheckInvalidMaskBits((unsigned char*)&stuff[1],
+ if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1],
stuff->mask_len * 4) != Success)
return BadValue;
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 2966145..e99b6e5 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -118,7 +118,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
return BadValue;
}
- if (XICheckInvalidMaskBits((unsigned char*)&stuff[1],
+ if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1],
stuff->mask_len * 4) != Success)
return BadValue;
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 7aa3f0a..22fbaf5 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -42,14 +42,19 @@
*
* @return BadValue if at least one invalid bit is set or Success otherwise.
*/
-int XICheckInvalidMaskBits(unsigned char *mask, int len)
+int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
{
if (len >= XIMaskLen(XI2LASTEVENT))
{
int i;
for (i = XI2LASTEVENT + 1; i < len * 8; i++)
+ {
if (BitIsOn(mask, i))
+ {
+ client->errorValue = i;
return BadValue;
+ }
+ }
}
return Success;
@@ -126,7 +131,10 @@ ProcXISelectEvents(ClientPtr client)
{
unsigned char *bits = (unsigned char*)&evmask[1];
if (BitIsOn(bits, XI_HierarchyChanged))
+ {
+ client->errorValue = XI_HierarchyChanged;
return BadValue;
+ }
}
/* Raw events may only be selected on root windows */
@@ -138,10 +146,13 @@ ProcXISelectEvents(ClientPtr client)
BitIsOn(bits, XI_RawButtonPress) ||
BitIsOn(bits, XI_RawButtonRelease) ||
BitIsOn(bits, XI_RawMotion))
+ {
+ client->errorValue = XI_RawKeyPress;
return BadValue;
+ }
}
- if (XICheckInvalidMaskBits((unsigned char*)&evmask[1],
+ if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1],
evmask->mask_len * 4) != Success)
return BadValue;
diff --git a/include/exevents.h b/include/exevents.h
index bfee385..dc59430 100644
--- a/include/exevents.h
+++ b/include/exevents.h
@@ -307,6 +307,6 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
unsigned int len, unsigned char* mask);
extern int
-XICheckInvalidMaskBits(unsigned char *mask, int len);
+XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
#endif /* EXEVENTS_H */
commit 47818287983b04625661b08ae362e0966cddf3e1
Author: Chase Douglas <chase.douglas at canonical.com>
Date: Fri Dec 17 17:13:30 2010 +0000
Make EventIsDeliverable non-static
Will be used outside dix/events.c in proceeding XI 2.1 MT changes.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/dix/events.c b/dix/events.c
index 4e2dd89..f280f9d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2290,17 +2290,6 @@ FixUpEventFromWindow(
}
/**
- * Return masks for EventIsDeliverable.
- * @defgroup EventIsDeliverable return flags
- * @{
- */
-#define XI_MASK (1 << 0) /**< XI mask set on window */
-#define CORE_MASK (1 << 1) /**< Core mask set on window */
-#define DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set on window */
-#define XI2_MASK (1 << 3) /**< XI2 mask set on window */
-/* @} */
-
-/**
* Check if a given event is deliverable at all on a given window.
*
* This function only checks if any client wants it, not for a specific
@@ -2313,7 +2302,7 @@ FixUpEventFromWindow(
* @return Bitmask of ::XI2_MASK, ::XI_MASK, ::CORE_MASK, and
* ::DONT_PROPAGATE_MASK.
*/
-static int
+int
EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event, WindowPtr win)
{
int rc = 0;
diff --git a/include/input.h b/include/input.h
index fef69a1..9f3227f 100644
--- a/include/input.h
+++ b/include/input.h
@@ -532,6 +532,18 @@ void FixUpEventFromWindow(DeviceIntPtr pDev,
WindowPtr pWin,
Window child,
Bool calcChild);
+extern int EventIsDeliverable(DeviceIntPtr dev, InternalEvent* event,
+ WindowPtr win);
+/**
+ * Return masks for EventIsDeliverable.
+ * @defgroup EventIsDeliverable return flags
+ * @{
+ */
+#define XI_MASK (1 << 0) /**< XI mask set on window */
+#define CORE_MASK (1 << 1) /**< Core mask set on window */
+#define DONT_PROPAGATE_MASK (1 << 2) /**< DontPropagate mask set on window */
+#define XI2_MASK (1 << 3) /**< XI2 mask set on window */
+/* @} */
/* Implemented by the DDX. */
extern _X_EXPORT int NewInputDeviceRequest(
commit f7d8ade3c5ac44faf7f3ea0d846e35f75b31c9ec
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Dec 17 17:13:26 2010 +0000
Resources: Move rClient to resource.h
The definition of rClient was duplicated across three source files, so
move it to resource.h.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/Xext/geext.c b/Xext/geext.c
index 8319c92..b37c1a0 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -33,8 +33,6 @@
#include "geext.h"
#include "protocol-versions.h"
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
DevPrivateKeyRec GEClientPrivateKeyRec;
int RT_GECLIENT = 0;
diff --git a/Xext/security.c b/Xext/security.c
index 7eb95de..8673880 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -154,8 +154,6 @@ SecurityLookupRequestName(ClientPtr client)
}
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
/* SecurityDeleteAuthorization
*
* Arguments:
diff --git a/dix/events.c b/dix/events.c
index ac07923..4e2dd89 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -195,8 +195,6 @@ typedef const char *string;
#define XE_KBPTR (xE->u.keyButtonPointer)
-#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
-
CallbackListPtr EventCallback;
CallbackListPtr DeviceEventCallback;
diff --git a/include/resource.h b/include/resource.h
index 0c5a59d..080061f 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -121,6 +121,8 @@ typedef unsigned long RESTYPE;
#define BAD_RESOURCE 0xe0000000
+#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
+
/* Resource state callback */
extern _X_EXPORT CallbackListPtr ResourceStateCallback;
commit 05e437c2ce230b588362f012c06ead5c6d89c006
Author: Chase Douglas <chase.douglas at canonical.com>
Date: Fri Dec 17 17:13:27 2010 +0000
Export all valuator_mask_* functions
Input drivers may use valuator masks for internal state. Having all the
valuator_mask_* functions available will help.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Bump ABI_XINPUT_VERSION minor.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index af7b778..609819b 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -83,7 +83,7 @@ typedef enum {
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 1)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/include/input.h b/include/input.h
index 8feac28..fef69a1 100644
--- a/include/input.h
+++ b/include/input.h
@@ -554,7 +554,6 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
-/* For server-internal functions, see inpututil.h */
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
int first_valuator, int num_valuators,
@@ -563,5 +562,12 @@ extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
int valuator,
int data);
extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
+extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
+extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
+extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
+ const ValuatorMask *src);
+extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
#endif /* INPUT_H */
diff --git a/include/inpututils.h b/include/inpututils.h
index 54b5764..b8ca6ab 100644
--- a/include/inpututils.h
+++ b/include/inpututils.h
@@ -37,12 +37,4 @@ struct _ValuatorMask {
int valuators[MAX_VALUATORS]; /* valuator data */
};
-/* server-internal */
-extern _X_HIDDEN int valuator_mask_size(const ValuatorMask *mask);
-extern _X_HIDDEN int valuator_mask_isset(const ValuatorMask *mask, int bit);
-extern _X_HIDDEN void valuator_mask_unset(ValuatorMask *mask, int bit);
-extern _X_HIDDEN int valuator_mask_num_valuators(const ValuatorMask *mask);
-extern _X_HIDDEN void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src);
-extern _X_HIDDEN int valuator_mask_get(const ValuatorMask *mask, int valnum);
-
#endif
More information about the xorg-commit
mailing list