Re: [PATCH 5/5] panoramiX: macro checking if drawable is root

2011-03-08 Thread Dave Airlie
On Wed, Mar 9, 2011 at 3:29 PM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> this code appears in quite a few places, consolidate it into
> a macro in a header.

Nak

I've posted a v2 of this patch on its own, just aligning the braces.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH] panoramiX: macro checking if drawable is root (v2)

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

this code appears in quite a few places, consolidate it into
a macro in a header.

v2: align braces with macro just above it, and with
lines removed

Signed-off-by: Dave Airlie 
---
 Xext/panoramiX.h  |1 +
 Xext/panoramiXprocs.c |   26 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index fcfac0e..71651e5 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -76,4 +76,5 @@ typedef struct {
 
 #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
 
+#define IS_ROOT_DRAWABLE(d) (((d)->type == XRT_WINDOW) && (d)->u.win.root)
 #endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index b6ca807..9ea4611 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1328,7 +1328,7 @@ int PanoramiXPolyLine(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
 if (npoint > 0){
 origPts = malloc(npoint * sizeof(xPoint));
@@ -1388,7 +1388,7 @@ int PanoramiXPolySegment(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
 if(nsegs & 4) return BadLength;
@@ -1451,7 +1451,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
 if(nrects & 4) return BadLength;
@@ -1513,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
 if(narcs % sizeof(xArc)) return BadLength;
@@ -1573,7 +1573,7 @@ int PanoramiXFillPoly(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
 if (count > 0){
@@ -1634,7 +1634,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
 if(things & 4) return BadLength;
@@ -1695,7 +1695,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
 if (narcs % sizeof(xArc)) return BadLength;
@@ -1755,7 +1755,7 @@ int PanoramiXPutImage(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->dstX;
 orig_y = stuff->dstY;
@@ -1818,7 +1818,7 @@ int PanoramiXGetImage(ClientPtr client)
 format = stuff->format;
 planemask = stuff->planeMask;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 if(isRoot) {
   if( /* check for being onscreen */
@@ -1956,7 +1956,7 @@ PanoramiXPolyText8(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -1997,7 +1997,7 @@ PanoramiXPolyText16(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -2038,7 +2038,7 @@ int PanoramiXImageText8(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -2079,7 +2079,7 @@ int PanoramiXImageText16(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
-- 
1.7.3.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH v2 evdev 0/3] Memory leak fixes.

2011-03-08 Thread Peter Hutterer
On Tue, Mar 08, 2011 at 11:23:44AM +0200, Rami Ylimäki wrote:
> v2:
> 
> XKB options are now released with XkbFreeRMLVOSet.
> 
> The first version of these patches assigned a dynamically allocated
> device filename to a const pointer. Calling free with this pointer
> causes a warning, but this warning was suppressed by casting its
> constness away when calling free. The warning could be alternatively
> avoided by not using a const pointers in the first place.
> 
> In my opinion, using const pointer in this case is completely
> fine. Removing the constness just because the string is dynamically
> allocated isn't necessary. Therefore I prefer keeping the cast instead
> of removing the constness of device filename string.

I realise this is personal preference but I'd prefer const to be used where
the data is actually const and here it certainly isn't.

All three applied, thanks. I've squashed in a removal of a now-unnecessary
typecast char *device = (char*)pEvdev->device into the last patch.

Cheers,
  Peter

> However, patch 3 of this series can be squashed with the 2nd patch to
> remove the constness. Otherwise the 3rd patch could be just dropped.
> 
> Rami Ylimäki (3):
>   Release leaked XKB options on input device disconnect.
>   Release leaked device identifier on input device disconnect.
>   Remove constness of device filename to avoid warning when freed.
> 
>  src/evdev.c |   19 +--
>  src/evdev.h |2 +-
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 5/5] panoramiX: macro checking if drawable is root

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

this code appears in quite a few places, consolidate it into
a macro in a header.

Signed-off-by: Dave Airlie 
---
 Xext/panoramiX.h  |1 +
 Xext/panoramiXprocs.c |   26 +-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index fcfac0e..048203c 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -76,4 +76,5 @@ typedef struct {
 
 #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
 
+#define IS_ROOT_DRAWABLE(d) ((d)->type == XRT_WINDOW && (d)->u.win.root)
 #endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index b6ca807..9ea4611 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1328,7 +1328,7 @@ int PanoramiXPolyLine(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
 if (npoint > 0){
 origPts = malloc(npoint * sizeof(xPoint));
@@ -1388,7 +1388,7 @@ int PanoramiXPolySegment(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
 if(nsegs & 4) return BadLength;
@@ -1451,7 +1451,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
 if(nrects & 4) return BadLength;
@@ -1513,7 +1513,7 @@ int PanoramiXPolyArc(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
 if(narcs % sizeof(xArc)) return BadLength;
@@ -1573,7 +1573,7 @@ int PanoramiXFillPoly(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
 if (count > 0){
@@ -1634,7 +1634,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
 if(things & 4) return BadLength;
@@ -1695,7 +1695,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
 if (narcs % sizeof(xArc)) return BadLength;
@@ -1755,7 +1755,7 @@ int PanoramiXPutImage(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->dstX;
 orig_y = stuff->dstY;
@@ -1818,7 +1818,7 @@ int PanoramiXGetImage(ClientPtr client)
 format = stuff->format;
 planemask = stuff->planeMask;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 if(isRoot) {
   if( /* check for being onscreen */
@@ -1956,7 +1956,7 @@ PanoramiXPolyText8(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -1997,7 +1997,7 @@ PanoramiXPolyText16(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -2038,7 +2038,7 @@ int PanoramiXImageText8(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
@@ -2079,7 +2079,7 @@ int PanoramiXImageText16(ClientPtr client)
 if (result != Success)
return result;
 
-isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+isRoot = IS_ROOT_DRAWABLE(draw);
 
 orig_x = stuff->x;
 orig_y = stuff->y;
-- 
1.7.3.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 4/5] panoramiX: use RESTYPE instead of unsigned long

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

unsigned long seems like the wrong type to use here,
switch to using RESTYPE.

Signed-off-by: Dave Airlie 
---
 Xext/panoramiX.c|   10 +-
 Xext/panoramiXsrv.h |   12 ++--
 render/render.c |2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 74241d8..00afe94 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -83,11 +83,11 @@ static DepthPtr PanoramiXDepths;
 static int PanoramiXNumVisuals;
 static VisualPtr   PanoramiXVisuals;
 
-unsigned long XRC_DRAWABLE;
-unsigned long XRT_WINDOW;
-unsigned long XRT_PIXMAP;
-unsigned long XRT_GC;
-unsigned long XRT_COLORMAP;
+RESTYPE XRC_DRAWABLE;
+RESTYPE XRT_WINDOW;
+RESTYPE XRT_PIXMAP;
+RESTYPE XRT_GC;
+RESTYPE XRT_COLORMAP;
 
 static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
 XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index 5dd02e8..6fc903b 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -21,12 +21,12 @@ extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
 
 extern _X_EXPORT void XineramaReinitData(ScreenPtr);
 
-extern _X_EXPORT unsigned long XRC_DRAWABLE;
-extern _X_EXPORT unsigned long XRT_WINDOW;
-extern _X_EXPORT unsigned long XRT_PIXMAP;
-extern _X_EXPORT unsigned long XRT_GC;
-extern _X_EXPORT unsigned long XRT_COLORMAP;
-extern _X_EXPORT unsigned long XRT_PICTURE;
+extern _X_EXPORT RESTYPE XRC_DRAWABLE;
+extern _X_EXPORT RESTYPE XRT_WINDOW;
+extern _X_EXPORT RESTYPE XRT_PIXMAP;
+extern _X_EXPORT RESTYPE XRT_GC;
+extern _X_EXPORT RESTYPE XRT_COLORMAP;
+extern _X_EXPORT RESTYPE XRT_PICTURE;
 
 /*
  * Drivers are allowed to wrap this function.  Each wrapper can decide that the
diff --git a/render/render.c b/render/render.c
index 3cb1b54..8ff8ee6 100644
--- a/render/render.c
+++ b/render/render.c
@@ -239,7 +239,7 @@ RenderClientCallback (CallbackListPtr   *list,
 }
 
 #ifdef PANORAMIX
-unsigned long  XRT_PICTURE;
+RESTYPEXRT_PICTURE;
 #endif
 
 void
-- 
1.7.3.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 3/5] panoramiX: convert 1->panoramiXNumScreens loops to use macro

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

This converts all the remaining 1->num loops to the macro,
this removes nearly all the panoramiXNumScreens usage in
loops, and is a step to replacing it.

Signed-off-by: Dave Airlie 
---
 Xext/panoramiX.c  |2 +-
 Xext/panoramiXprocs.c |2 +-
 Xext/xvdisp.c |2 +-
 dix/events.c  |6 +++---
 hw/dmx/dmxgcops.c |2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index da0266f..74241d8 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -413,7 +413,7 @@ static void XineramaInitData(ScreenPtr pScreen)
 PanoramiXPixWidth = screenInfo.screens[0]->x + 
screenInfo.screens[0]->width;
 PanoramiXPixHeight = screenInfo.screens[0]->y + 
screenInfo.screens[0]->height;
 
-for (i = 1; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS_FORWARD_SKIP(i) {
pScreen = screenInfo.screens[i];
w = pScreen->x + pScreen->width;
h = pScreen->y + pScreen->height;
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 6a6c6a0..b6ca807 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1840,7 +1840,7 @@ int PanoramiXGetImage(ClientPtr client)
 }
 
 drawables[0] = pDraw;
-for(i = 1; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS_FORWARD_SKIP(i) {
rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
   DixGetAttrAccess);
if (rc != Success)
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index beb26a9..b968431 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1918,7 +1918,7 @@ void XineramifyXv(void)
 
   MatchingAdaptors[0] = refAdapt;
   isOverlay = hasOverlay(refAdapt);
-  for(j = 1; j < PanoramiXNumScreens; j++)
+  FOR_NSCREENS_FORWARD_SKIP(j)
 MatchingAdaptors[j] = matchAdaptor(screenInfo.screens[j], refAdapt, 
isOverlay);
 
   /* now create a resource for each port */
diff --git a/dix/events.c b/dix/events.c
index 5151f74..8835c5e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2554,7 +2554,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite;
int i;
 
-   for(i = 1; i < PanoramiXNumScreens; i++) {
+   FOR_NSCREENS_FORWARD_SKIP(i) {
   if(RegionContainsPoint(&pSprite->windows[i]->borderSize,
  x + screenInfo.screens[0]->x - 
screenInfo.screens[i]->x,
  y + screenInfo.screens[0]->y - 
screenInfo.screens[i]->y,
@@ -3153,7 +3153,7 @@ XineramaPointInWindowIsVisible(
 xoff = x + screenInfo.screens[0]->x;
 yoff = y + screenInfo.screens[0]->y;
 
-for(i = 1; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS_FORWARD_SKIP(i) {
pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
x = xoff - screenInfo.screens[i]->x;
y = yoff - screenInfo.screens[i]->y;
@@ -3360,7 +3360,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
  if(!noPanoramiXExtension && XineramaSetWindowPntrs(pDev, pWin)) {
int i;
 
-   for(i = 1; i < PanoramiXNumScreens; i++) {
+   FOR_NSCREENS_FORWARD_SKIP(i) {

if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize))
return TRUE;
}
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index bc8cd9e..500e2cd 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -529,7 +529,7 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr 
pDrawable, XID *draw)
   NullClient, DixUnknownAccess))
 return NULL;
 
-for (i = 1; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS_FORWARD_SKIP(i) {
 dmxScreen = &dmxScreens[i];
 if (dmxScreen->beDisplay) {
 PixmapPtr pSrc;
-- 
1.7.3.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 2/5] panoramiX: convert 0->panoramiXNumScreens loops to macro

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

This just uses the FOR_NSCREENS macro instead.
---
 Xext/panoramiX.c  |   14 +++---
 Xext/panoramiXprocs.c |2 +-
 Xext/saver.c  |2 +-
 Xext/shm.c|2 +-
 Xext/xvdisp.c |2 +-
 dix/events.c  |4 ++--
 dix/window.c  |4 ++--
 hw/dmx/dmxcb.c|7 ---
 hw/dmx/dmxextension.c |4 ++--
 9 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index e6334bd..da0266f 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -393,7 +393,7 @@ static void XineramaInitData(ScreenPtr pScreen)
 int i, w, h;
 
 RegionNull(&PanoramiXScreenRegion);
-for (i = 0; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS(i) {
BoxRec TheBox;
RegionRec ScreenRegion;
 
@@ -478,7 +478,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
 *  run in non-PanoramiXeen mode.
 */
 
-   for (i = 0; i < PanoramiXNumScreens; i++) {
+   FOR_NSCREENS(i) {
   pScreen = screenInfo.screens[i];
   pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
   dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
@@ -740,7 +740,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
 int j, k;
 Bool found = FALSE;
 
-for (j = 1; j < PanoramiXNumScreens; j++) {
+FOR_NSCREENS_FORWARD_SKIP(j) {
pScreen = screenInfo.screens[j];
for (k = 0; k < pScreen->numDepths; k++) {
if (pScreen->allowedDepths[k].depth == pDepth->depth) {
@@ -773,7 +773,7 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
 int j, k;
 Bool found = FALSE;
 
-for (j = 1; j < PanoramiXNumScreens; j++) {
+FOR_NSCREENS_FORWARD_SKIP(j) {
pScreen = screenInfo.screens[j];
found = FALSE;
 
@@ -836,7 +836,7 @@ PanoramiXConsolidate(void)
 saver = malloc(sizeof(PanoramiXRes));
 saver->type = XRT_WINDOW;
 
-for (i =  0; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS(i) {
ScreenPtr pScreen = screenInfo.screens[i];
root->info[i].id = pScreen->root->drawable.id;
root->u.win.class = InputOutput;
@@ -1074,7 +1074,7 @@ ProcXineramaQueryScreens(ClientPtr client)
xXineramaScreenInfo scratch;
int i;
 
-   for(i = 0; i < PanoramiXNumScreens; i++) {
+   FOR_NSCREENS(i) {
scratch.x_org  = screenInfo.screens[i]->x;
scratch.y_org  = screenInfo.screens[i]->y;
scratch.width  = screenInfo.screens[i]->width;
@@ -1179,7 +1179,7 @@ XineramaGetImageData(
 
 depth = (format == XYPixmap) ? 1 : pDraw->depth;
 
-for(i = 0; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS(i) {
BoxRec TheBox;
ScreenPtr pScreen;
pDraw = pDrawables[i];
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 6c5c6e8..6a6c6a0 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -2186,7 +2186,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
 newCmap->type = XRT_COLORMAP;
 panoramix_setup_ids(newCmap, client, stuff->mid);
 
-FOR_NSCREENS_BACKWARD(j){
+FOR_NSCREENS_BACKWARD(j) {
 stuff->srcCmap = cmap->info[j].id;
stuff->mid = newCmap->info[j].id;
 result = (* SavedProcVector[X_CopyColormapAndFree])(client);
diff --git a/Xext/saver.c b/Xext/saver.c
index 1888603..492a54f 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1288,7 +1288,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client)
if (rc != Success)
return (rc == BadValue) ? BadDrawable : rc;
 
-   for(i = PanoramiXNumScreens - 1; i > 0; i--) {
+   FOR_NSCREENS_BACKWARD(i) {
 stuff->drawable = draw->info[i].id;
 ScreenSaverUnsetAttributes(client);
}
diff --git a/Xext/shm.c b/Xext/shm.c
index 6294720..b08af82 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -848,7 +848,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return BadAlloc;
 
 drawables[0] = pDraw;
-for(i = 1; i < PanoramiXNumScreens; i++) {
+FOR_NSCREENS_FORWARD_SKIP(i) {
rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, 
   DixReadAccess);
if (rc != Success)
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index deddebd..beb26a9 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1927,7 +1927,7 @@ void XineramifyXv(void)
 if(!port)
break;
 
-for(k = 0; k < PanoramiXNumScreens; k++) {
+FOR_NSCREENS(k) {
if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) 
port->info[k].id = MatchingAdaptors[k]->base_id + j;
else
diff --git a/dix/events.c b/dix/events.c
index df62e83..5151f74 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -558,7 +558,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
 
 if(pWin == screenInfo.screens[0]->root) {
int i;
-   for (i = 0; i < PanoramiXNumScreens; i++)
+   FOR_NSCREENS(i)
pSprite->w

[PATCH 1/5] panoramiX: consolidate common id assignment code.

2011-03-08 Thread Dave Airlie
From: Dave Airlie 

This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first
element and is a common idiom throughout panoramiX code.

It then adds a new inline function to hide id assignment to a
panoramiX resource and cleans up lots of common repeated code.

Signed-off-by: Dave Airlie 
---
 Xext/panoramiX.h  |3 ++-
 Xext/panoramiXprocs.c |   20 +---
 Xext/panoramiXsrv.h   |   11 +++
 Xext/shm.c|4 +---
 composite/compext.c   |5 +
 render/render.c   |   25 +
 6 files changed, 25 insertions(+), 43 deletions(-)

diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index a8684f0..fcfac0e 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -44,7 +44,7 @@ Equipment Corporation.
 #include 
 #undef _PANORAMIX_SERVER
 #include "gcstruct.h"
-
+#include "dixstruct.h"
 
 typedef struct _PanoramiXInfo {
 XID id ;
@@ -70,6 +70,7 @@ typedef struct {
 } PanoramiXRes;
 
 #define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
+#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++)
 #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
 #define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
 
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index d843168..6c5c6e8 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -120,9 +120,7 @@ int PanoramiXCreateWindow(ClientPtr client)
 newWin->u.win.visibility = VisibilityNotViewable;
 newWin->u.win.class = stuff->class;
 newWin->u.win.root = FALSE;
-newWin->info[0].id = stuff->wid;
-for(j = 1; j < PanoramiXNumScreens; j++)
-newWin->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newWin, client, stuff->wid);
 
 if (stuff->class == InputOnly)
stuff->visual = CopyFromParent;
@@ -663,9 +661,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
 
 newPix->type = XRT_PIXMAP;
 newPix->u.pix.shared = FALSE;
-newPix->info[0].id = stuff->pid;
-for(j = 1; j < PanoramiXNumScreens; j++)
-   newPix->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newPix, client, stuff->pid);

 FOR_NSCREENS_BACKWARD(j) {
stuff->pid = newPix->info[j].id;
@@ -767,9 +763,7 @@ int PanoramiXCreateGC(ClientPtr client)
 return BadAlloc;
 
 newGC->type = XRT_GC;
-newGC->info[0].id = stuff->gc;
-for(j = 1; j < PanoramiXNumScreens; j++)
-newGC->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newGC, client, stuff->gc);
 
 FOR_NSCREENS_BACKWARD(j) {
 stuff->gc = newGC->info[j].id;
@@ -2121,9 +2115,7 @@ int PanoramiXCreateColormap(ClientPtr client)
 return BadAlloc;
 
 newCmap->type = XRT_COLORMAP;
-newCmap->info[0].id = stuff->mid;
-for(j = 1; j < PanoramiXNumScreens; j++)
-newCmap->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newCmap, client, stuff->mid);
 
 orig_visual = stuff->visual;
 FOR_NSCREENS_BACKWARD(j){
@@ -2192,9 +2184,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
 return BadAlloc;
 
 newCmap->type = XRT_COLORMAP;
-newCmap->info[0].id = stuff->mid;
-for(j = 1; j < PanoramiXNumScreens; j++)
-newCmap->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newCmap, client, stuff->mid);
 
 FOR_NSCREENS_BACKWARD(j){
 stuff->srcCmap = cmap->info[j].id;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index b0a5a6e..5dd02e8 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -51,4 +51,15 @@ extern _X_EXPORT void XineramaGetImageData(
 Bool isRoot
 );
 
+static inline void panoramix_setup_ids(PanoramiXRes *resource, 
+   ClientPtr client, XID base_id)
+{
+int j;
+
+resource->info[0].id = base_id;
+FOR_NSCREENS_FORWARD_SKIP(j) {
+resource->info[j].id = FakeClientID(client->index);
+}
+}
+
 #endif /* _PANORAMIXSRV_H_ */
diff --git a/Xext/shm.c b/Xext/shm.c
index 23afe6b..6294720 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -972,9 +972,7 @@ CreatePmap:
 
 newPix->type = XRT_PIXMAP;
 newPix->u.pix.shared = TRUE;
-newPix->info[0].id = stuff->pid;
-for(j = 1; j < PanoramiXNumScreens; j++)
-   newPix->info[j].id = FakeClientID(client->index);
+panoramix_setup_ids(newPix, client, stuff->pid);
 
 result = Success;
 
diff --git a/composite/compext.c b/composite/compext.c
index fbd36b5..e0d8e75 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -703,10 +703,7 @@ PanoramiXCompositeNameWindowPixmap (ClientPtr client)
 
 newPix->type = XRT_PIXMAP;
 newPix->u.pix.shared = FALSE;
-newPix->info[0].id = stuff->pixmap;
-
-for (i = 1; i < PanoramiXNumScreens; i++)
-   newPix->info[i].id = FakeClientID (client->index);
+panoramix_setup_ids(newPix, client, stuff->pixmap);
 
 FOR_NSCREENS(i) {
rc = dixLookupResourceByType ((void **) &pWin, 

panoramiX macro/inline cleanups

2011-03-08 Thread Dave Airlie
this patch series are things I extracted from my dynerama tree,
they just clean up a few things with macros and inlines.

This is the first step to dropping panoramiXNumScreens which is
needed to do dynamic xinerama stuff.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PULL] misc fixes

2011-03-08 Thread Peter Hutterer
a few warning fixes, ptraccel refactoring and memleaks, that pretty much
sums it up.

The following changes since commit 628d16a92a7fa556fbb70bf4a4adf57ec05c190b:

  loader: Don't distribute sdksyms.c and make it depend on the config 
(2011-03-03 21:54:25 -0800)

are available in the git repository at:
  git://people.freedesktop.org/~whot/xserver.git for-keith

Adam Jackson (3):
  input: warning fix
  input: warning fixes
  record: warning fix

Julien Cristau (1):
  Xi: fix length checks for swapped clients

Peter Hutterer (2):
  xfree86: block signals between EnableDevice and first CheckMotion()
  Xi: fix XI2 passive grab reply length calculation

Rami Ylimäki (3):
  xkb: Ensure that XKB device private won't leak on device disconnect.
  dix: Release input device config info when the device disconnects.
  config: Ensure that stolen option list elements are released.

Simon Thum (3):
  dix: refactor predictable scheme initialization
  dix: update pointer acceleration code to use ValuatorMask
  dix: change all timestamps in pointer acceleration to CARD32

 Xi/xipassivegrab.c |4 +-
 Xi/xiproperty.c|4 +-
 config/hal.c   |6 +-
 config/udev.c  |6 +-
 dix/devices.c  |2 +
 dix/eventconvert.c |3 +
 dix/getevents.c|   26 +
 dix/ptrveloc.c |  217 ++--
 hw/xfree86/common/xf86Xinput.c |3 +
 include/input.h|   12 +--
 include/ptrveloc.h |   26 +++--
 record/record.c|1 -
 xkb/xkbActions.c   |   11 +--
 13 files changed, 164 insertions(+), 157 deletions(-)
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration

2011-03-08 Thread Peter Hutterer
On Tue, Mar 08, 2011 at 01:11:50PM +0200, Erkki Seppälä wrote:
> There were two memory leaks in the function: one was the lack of free
> for "enabled", the other was the full lack of releasing anything when
> configuration was too small. The first issue was fixed by adding the
> missing free, the other was addressed by replacing the duplicate
> memory releasing sequences with one that is gotoed into.
> 
> Reviewed-by: Rami Ylimäki 
> Signed-off-by: Erkki Seppälä 

Reviewed-by: Peter Hutterer 

Cheers,
  Peter





> ---
>  hw/xfree86/modes/xf86Crtc.c |   21 -
>  1 files changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
> index 9a5e50a..7eaecdb 100644
> --- a/hw/xfree86/modes/xf86Crtc.c
> +++ b/hw/xfree86/modes/xf86Crtc.c
> @@ -2353,6 +2353,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
> canGrow)
>  int  i = scrn->scrnIndex;
>  Bool have_outputs = TRUE;
>  Bool ret;
> +Bool success = FALSE;
>  
>  /* Set up the device options */
>  config->options = xnfalloc (sizeof (xf86DeviceOptions));
> @@ -2411,11 +2412,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
> canGrow)
>   * Set the position of each output
>   */
>  if (!xf86InitialOutputPositions (scrn, modes))
> -{
> - free(crtcs);
> - free(modes);
> - return FALSE;
> -}
> + goto bailout;
>  
>  /*
>   * Set initial panning of each output
> @@ -2426,11 +2423,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
> canGrow)
>   * Assign CRTCs to fit output configuration
>   */
>  if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, 
> height))
> -{
> - free(crtcs);
> - free(modes);
> - return FALSE;
> -}
> + goto bailout;
>  
>  /* XXX override xf86 common frame computation code */
>  
> @@ -2507,7 +2500,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
> canGrow)
>   * Make sure the configuration isn't too small.
>   */
>  if (width < config->minWidth || height < config->minHeight)
> - return FALSE;
> + goto bailout;
>  
>  /*
>   * Limit the crtc config to virtual[XY] if the driver can't grow the
> @@ -2530,10 +2523,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
> canGrow)
>  xf86CVTMode(width, height, 60, 0, 0));
>  }
>  
> -
> +success = TRUE;
> + bailout:
>  free(crtcs);
>  free(modes);
> -return TRUE;
> +free(enabled);
> +return success;
>  }
>  
>  /*
> -- 
> 1.7.0.4
> 
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH inputproto xi 2.1] Updates for pointer emulation and more touch device modes

2011-03-08 Thread Peter Hutterer
On Tue, Mar 08, 2011 at 10:24:42AM -0500, Chase Douglas wrote:
> On 03/08/2011 12:41 AM, Peter Hutterer wrote:
> > On Wed, Mar 02, 2011 at 11:35:41AM -0500, Chase Douglas wrote:
> >> On 03/02/2011 05:58 AM, Daniel Stone wrote:
> >>> On Tue, Feb 22, 2011 at 10:06:37AM -0500, Chase Douglas wrote:
>  @@ -132,16 +133,16 @@
>   /* Device event flags (common) */
>   /* Device event flags (key events only) */
>   #define XIKeyRepeat (1 << 16)
>  -/* Device event flags (pointer events only) */
>  +/* Device event flags (pointer and touch events only) */
>   #define XIPointerEmulated   (1 << 16)
>   /* Device event flags (touch events only) */
>  -#define XITouchPendingEnd   (1 << 16)
>  -/* Device event flags (touch end events only) */
>  -#define XITouchAccepted (1 << 17)
>  +#define XITouchPendingEnd   (1 << 17)
> >>>
> >>> Is there any particular reason to unify the two sets of flags? I guess
> >>> it can't really hurt as we shouldn't be using sixteen flags between
> >>> pointer and touch, but eh.
> >>
> >> We don't have to unify them per se, we could leave them independent.
> >> However, we need XIPointerEmulated for both touch events and pointer
> >> events. As an example, through Qt one can query which touch point is
> >> associated with an emulated pointer event. To do this, we need a way to
> >> designate that touch in the protocol. Reusing the XIPointerEmulated flag
> >> for the associated touch seems to be a reasonable solution to me.
> > 
> > I'm not sure how well that works in practice given that pointer events may
> > be held up by grabs, whereas touch events are delivered immediately. so even
> > if you have both pointer and touch event flagged, you may not get one event
> > until much later.
> 
> True, this may not actually be effective for matching up a pointer event
> to a touch sequence. However, it's still useful in that it tells us if a
> pointer event is emulated and whether a touch sequence has generated
> emulated pointer events.
> 
> A more precise solution would be to give the touch id of the emulated
> touch sequence in the pointer events, but there doesn't appear to be any
> fields available for this. Further, it still won't help the fact that
> you may receive the emulated pointer events without ever seeing the
> touch sequence, in the case of an indirect device. I think this may be
> the best we can do.

device events are supposedly extensible (unless I screwed up) so adding a
uint32_t for the touch ID would be easy enough. whether it's worth it is
another question given that pointer emulation has different time delivery
semantics. I don't know what the answer to this is.

anyway, adding this to the protocol and the server is easy. turns out I'm
better at designing the protocol than writing libXi interfaces, those are
painful to extend.
 
>  @@ -205,62 +208,145 @@ to touch the device. The init and destroy stage 
>  of this sequence are always
>   present, while the move stage is optional. Within this document, the 
>  term
>   "touch sequence" is used to describe the above chain of events. A client
>   wishing to receive touch events must register for at least TouchBegin,
>  -TouchOwnership, TouchUpdate, and TouchEnd simultaneously; it may also 
>  select
>  -for TouchUpdateUnowned events if it wants to receive the full touch 
>  stream,
>  -rather than just the final state.
>  +TouchUpdate, and TouchEnd simultaneously. It may also select for
>  +TouchUpdateUnowned and TouchOwnership events if it wants to receive the 
>  full
>  +touch stream while other clients own or have active grabs involving the 
>  touch.
> >>>
> >>> I'm not particularly happy with this hunk, as it means we'll be
> >>> delivering TouchOwnership events to clients who haven't selected for
> >>> them.  I think it was fairly clear as it is: you must always select for
> >>> TouchBegin, TouchOwnership, TouchUpdate and TouchEnd.  If you also want
> >>> unowned events, you select for TouchUpdateUnowned as well.
> >>
> >> When would we ever need to send an ownership event if the client didn't
> >> select for it? If you don't select for ownership and update unowned, you
> >> won't receive any events until you have become the owner of the touch.
> >> When you receive the begin event, you already know you're the owner, so
> >> an ownership event isn't needed.
> > 
> > daniel's approach requires that the touchbegin is sent immediately to all
> > clients, the ownership when a client receives the ownership. your approach
> > holds the touch begin until the client becomes the owner, thus being
> > more-or-less the equivalent of the ownership event in daniel's apparoch.
> 
> Correct, in the case of selecting only for owned events.
> 
>  +grab. When a client does not select for unowned and ownership events,

Re: [PATCH inputproto xi 2.1] Updates for pointer emulation and more touch device modes

2011-03-08 Thread Peter Hutterer
On Mon, Mar 07, 2011 at 06:07:57PM -0500, Chase Douglas wrote:
>  The event stream for an unowned selection is identical to a touch
>  +grab. When a client does not select for unowned and ownership events, 
>  it will
>  +receive a TouchBegin event when it becomes the owner of a touch stream.
> >>>
> >>> this means you have to buffer Begin + Update events in the server until 
> >>> the
> >>> ownership has the right client. Which, IIRC, is the reason we decided not 
> >>> to
> >>> re-implement the pointer grab's serial semantics but the parallel ones
> >>> sending to all clients.
> >>
> >> My implementation has a bounded ring buffer with N events for each
> >> touch. If you overrun the ring buffer, then you'll get the touch begin
> >> event, you'll miss some events from the beginning of the sequence, and
> >> then you'll get the last N events.
> >>
> >> The reason this was added was to reduce the need for clients to listen
> >> for unowned events, who may be woken up on every touch event yet never
> >> become the owner. This can be a power drain on mobile devices.
> >>
> >> I've been meaning to add a bit of text saying that clients selecting
> >> only for owned events may miss touch update events from the beginning of
> >> the sequence.
> > 
> > so let me rephrase this. unowned events are sent to any client selecting.
> > owned events are sent to the client if  I'm now missing this bit here.
> > assuming that you have a TouchBegin and N TouchUpdate events, with one or
> > more grabbing clients above you. At what point does a client get which
> > event?
> 
> There's a few sets of touch events. Touch events consist of:
> 
> TouchBegin
> TouchUpdate
> TouchUpdateUnowned
> TouchOwnership
> TouchEnd
> 
> If you select for unowned events, you may receive all of these events.
> You will receive a TouchBegin event when the touch sequence begins,
> TouchUpdateUnowned events while you are not the owner, then a
> TouchOwnership event when you become the owner, then more TouchUpdate
> events, and then finally a TouchEnd event.
> 
> If you select only for owned events, you may receive:
> 
> TouchBegin
> TouchUpdate
> TouchEnd
> 
> In this case, you receive a TouchBegin event when you become the owner
> of the touch sequence, and then you receive any TouchUpdate events that
> were generated and enqueued while some other client owned the touch
> sequence.
> 
> The two selections above are the only two valid selections for any touch
> events. A client cannot select for just TouchBegin, TouchUpdateUnowned,
> and TouchEnd, for example.

I'll refer here to the questions about timestamps, etc. in the other email.
Lets keep it in one place, makes it easier.

> > daniel's spec has an example for a client that selects for both owned and
> > unowned but I don't know anymore what happens if a client doesn't select for
> > owned.
> 
> This is a patch against his spec, so what you read should be in here
> somewhere :).
> 
> You can't select for any touch events without also selecting for owned
> events. The only distinction is whether you want unowned events as well.
> 
>  +4.4.2 Touch device modes
>  +
>  +Touch devices come in many different forms with varying capabilities. 
>  The
>  +following device modes are defined for this protocol:
>  +
>  +DirectTouch:
>  +These devices map their input region to a subset of the screen 
>  region. Touch
>  +events are delivered according to where the touch occurs in the 
>  mapped
>  +screen region. An example of a DirectTouch device is a touchscreen.
>  +
>  +DependentTouch:
>  +These devices do not have a direct correlation between a touch 
>  location and
>  +a position on the screen. Touch events are delivered according to 
>  the
>  +location of the pointer on screen. An Example of a DependentTouch 
>  device
>  +is a trackpad.
>  +
>  +IndependentPointer:
>  +These devices do not have any correlation between touch events and 
>  pointer
>  +events. IndependentPointer devices are a subset of DependentTouch 
>  devices.
>  +An example of an IndependentPointer device is a mouse with a touch 
>  surface.
> >>>
> >>> I don't quite understand what the difference to DependentTouch is here.
> >>> To me, a mouse with a touch surface is identical to a trackpad in how
> >>> gestures would be interpreted. At least that's how I'd use it, so having
> >>> this as a separate device type seems confusing.
> >>
> >> I'll take Qt as an example. If you have a touchscreen device, it passes
> >> each touch to the widget they landed on. If you have a touchpad, by
> >> default they don't send any touch events until two or more touches are
> >> active. This is due to the duality of the touchpad as a pointer
> >> controlling device and as a touch surface.
> >>
> >> Although they don't have any support for other types of devices yet, I
> >>

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Gaetan Nadon
On Wed, 2011-03-09 at 00:39 +0100, Cyril Brulebois wrote:

> I could understand why people wouldn't want glib to be pulled in
> unconditionally when building libxt. As a package maintainer, I'm
> happy to declare through a configure option that I want to enable unit
> tests, and make configure fail if the prerequisites aren't there.
> 
> So I guess it makes sense (at least in this case) to have a
> --enable-unit-tests available.
> 

Agreed. I had not thought about this. Thanks.

I'll proposed something along the lines of the doc tools macros to which
a few package maintainers contributed.


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/3] Absorb miTriFan() into CompositeTriFan()

2011-03-08 Thread Keith Packard
On Tue,  8 Mar 2011 10:14:26 -0500, Søren Sandmann  wrote:
> From: Søren Sandmann Pedersen 
> 
> There is no need to virtualize this function that nobody cares about.
> 
> Signed-off-by: Soren Sandmann 

For the series:

Acked-by: Keith Packard 
-- 
keith.pack...@intel.com


pgpmQsTfsRSdA.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 5/5] glx: Use GLX rather than AIGLX in ouput strings.

2011-03-08 Thread Christopher James Halse Rogers
If swrast is being used there's nothing “Accelerated” about it

Signed-off-by: Christopher James Halse Rogers 

---
 glx/glxdri.c   |   36 ++--
 glx/glxdri2.c  |   22 +++---
 glx/glxdricommon.c |6 +++---
 glx/glxdriswrast.c |4 ++--
 4 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/glx/glxdri.c b/glx/glxdri.c
index 3a57337..84a1c4a 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -866,7 +866,7 @@ glxDRIEnterVT (int index, int flags)
 __GLXDRIscreen *screen = (__GLXDRIscreen *) 
glxGetScreen(screenInfo.screens[index]);
 
-LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
+LogMessage(X_INFO, "GLX: Resuming GLX clients after VT switch\n");
 
 scrn->EnterVT = screen->enterVT;
 
@@ -890,7 +890,7 @@ glxDRILeaveVT (int index, int flags)
 __GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
 
-LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
+LogMessage(X_INFO, "GLX: Suspending GLX clients for VT switch\n");
 
 glxSuspendClients();
 
@@ -914,7 +914,7 @@ initializeExtensions(__GLXDRIscreen *screen)
__glXEnableExtension(screen->glx_enable_bits,
 "GLX_SGI_make_current_read");

-   LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
+   LogMessage(X_INFO, "GLX: enabled GLX_SGI_make_current_read\n");
}
 #endif
 
@@ -924,7 +924,7 @@ initializeExtensions(__GLXDRIscreen *screen)
__glXEnableExtension(screen->glx_enable_bits,
 "GLX_MESA_copy_sub_buffer");

-   LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
+   LogMessage(X_INFO, "GLX: enabled GLX_MESA_copy_sub_buffer\n");
}
 #endif
 
@@ -936,14 +936,14 @@ initializeExtensions(__GLXDRIscreen *screen)
__glXEnableExtension(screen->glx_enable_bits,
 "GLX_MESA_swap_control");

-   LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_swap_control and 
GLX_MESA_swap_control\n");
+   LogMessage(X_INFO, "GLX: enabled GLX_SGI_swap_control and 
GLX_MESA_swap_control\n");
}
 #endif
 
 #ifdef __DRI_TEX_OFFSET
if (strcmp(extensions[i]->name, __DRI_TEX_OFFSET) == 0) {
screen->texOffset = (__DRItexOffsetExtension *) extensions[i];
-   LogMessage(X_INFO, "AIGLX: enabled GLX_texture_from_pixmap with 
driver support\n");
+   LogMessage(X_INFO, "GLX: enabled GLX_texture_from_pixmap with 
driver support\n");
}
 #endif
/* Ignore unknown extensions */
@@ -978,7 +978,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
!isCapable) {
LogMessage(X_INFO,
-  "AIGLX: Screen %d is not DRI capable\n", pScreen->myNum);
+  "GLX: Screen %d is not DRI capable\n", pScreen->myNum);
return NULL;
 }
 
@@ -1000,20 +1000,20 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 dri_version.patch = XF86DRI_PATCH_VERSION;
 
 if (!DRIOpenConnection(pScreen, &hSAREA, &BusID)) {
-   LogMessage(X_ERROR, "AIGLX error: DRIOpenConnection failed\n");
+   LogMessage(X_ERROR, "GLX error: DRIOpenConnection failed\n");
goto handle_error;
 }
 
 fd = drmOpenOnce(NULL, BusID, &newlyopened);
 
 if (fd < 0) {
-   LogMessage(X_ERROR, "AIGLX error: drmOpenOnce failed (%s)\n",
+   LogMessage(X_ERROR, "GLX error: drmOpenOnce failed (%s)\n",
   strerror(-fd));
goto handle_error;
 }
 
 if (drmGetMagic(fd, &magic)) {
-   LogMessage(X_ERROR, "AIGLX error: drmGetMagic failed\n");
+   LogMessage(X_ERROR, "GLX error: drmGetMagic failed\n");
goto handle_error;
 }
 
@@ -1031,7 +1031,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 }
 
 if (newlyopened && !DRIAuthConnection(pScreen, magic)) {
-   LogMessage(X_ERROR, "AIGLX error: DRIAuthConnection failed\n");
+   LogMessage(X_ERROR, "GLX error: DRIAuthConnection failed\n");
goto handle_error;
 }
 
@@ -1043,7 +1043,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
&ddx_version.minor,
&ddx_version.patch,
&driverName)) {
-   LogMessage(X_ERROR, "AIGLX error: DRIGetClientDriverName failed\n");
+   LogMessage(X_ERROR, "GLX error: DRIGetClientDriverName failed\n");
goto handle_error;
 }
 
@@ -1065,7 +1065,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 if (!DRIGetDeviceInfo(pScreen, &hFB, &junk,
  &framebuffer.size, &framebuffer.stride,
  &framebuffer.dev_priv_size, &framebuffer.dev_priv)) {
-   LogMessage(X_ERROR, "AIGLX error: XF86DRIGetDeviceInfo failed\n");
+   LogMessage(X_ERROR, "GLX error: XF86DRIGetDeviceIn

[RFC PATCHv2 4/5] glx: Search for DRI drivers in colon-delimited list of paths.

2011-03-08 Thread Christopher James Halse Rogers
This matches the behaviour of mesa libGL.

Signed-off-by: Christopher James Halse Rogers 

---
Upon investigating more closely what mesa libGL does to find DRI drivers,
the extra work handling drivers where driCreateScreen fails isn't needed.

 configure.ac   |8 +-
 glx/glxdricommon.c |   75 ---
 2 files changed, 48 insertions(+), 35 deletions(-)

diff --git a/configure.ac b/configure.ac
index 681f9d9..58e1ba0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1243,7 +1243,13 @@ AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, 
[Default PCI text file ID path]
 AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous 
config path])
 AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
 dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
-AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
+drisearchdirs=`$PKG_CONFIG --variable=drisearchdirs dri`
+if test -n "$drisearchdirs" ; then
+   AC_DEFINE_DIR(DRI_DRIVER_PATH, drisearchdirs,
+ [Default DRI search paths])
+else
+   AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
+fi
 AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
 AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor 
name])
 AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 16f6588..0b250e1 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -217,47 +217,54 @@ glxProbeDriver(const char *driverName,
 void *driver;
 char filename[PATH_MAX];
 const __DRIextension **extensions;
+char *driDriverPath;
+const char *pathStart = dri_driver_path;
+const char *pathEnd = strchr(pathStart, ':');
 
-snprintf(filename, sizeof filename, "%s/%s_dri.so",
- dri_driver_path, driverName);
+for (; *pathStart; pathEnd = strchr(pathStart, ':')) {
+   driDriverPath = strndup(pathStart,
+   pathEnd ? pathEnd - pathStart : sizeof 
filename);
+   snprintf(filename, sizeof filename, "%s/%s_dri.so",
+driDriverPath, driverName);
+   free(driDriverPath);
+   pathStart = pathEnd ? pathEnd + 1 : pathStart + strlen(pathStart);
 
-driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-if (driver == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-  filename, dlerror());
-   goto cleanup_failure;
-}
+   driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+   if (driver == NULL) {
+   LogMessage(X_INFO, "AIGLX: dlopen of %s failed (%s)\n",
+  filename, dlerror());
+   continue;
+   }
 
-extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS);
-if (extensions == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-  driverName, dlerror());
-   goto cleanup_failure;
-}
-
-for (i = 0; extensions[i]; i++) {
-   if (strcmp(extensions[i]->name, coreName) == 0 &&
-   extensions[i]->version >= coreVersion) {
-   *coreExt = extensions[i];
+   extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS);
+   if (extensions == NULL) {
+   LogMessage(X_INFO, "AIGLX: %s exports no extensions (%s)\n",
+  driverName, dlerror());
+   dlclose(driver);
+   continue;
}
+
+   for (i = 0; extensions[i]; i++) {
+   if (strcmp(extensions[i]->name, coreName) == 0 &&
+   extensions[i]->version >= coreVersion) {
+   *coreExt = (void *)extensions[i];
+   }
 
-   if (strcmp(extensions[i]->name, renderName) == 0 &&
-   extensions[i]->version >= renderVersion) {
-   *renderExt = extensions[i];
+   if (strcmp(extensions[i]->name, renderName) == 0 &&
+   extensions[i]->version >= renderVersion) {
+   *renderExt = (void *)extensions[i];
+   }
}
-}
 
-if (*coreExt == NULL || *renderExt == NULL) {
-   LogMessage(X_ERROR,
-  "AIGLX error: %s does not export required DRI extension\n",
-  driverName);
-   goto cleanup_failure;
+   if (*coreExt == NULL || *renderExt == NULL) {
+   LogMessage(X_INFO,
+  "AIGLX: %s does not export required DRI extension\n",
+  driverName);
+   *coreExt = *renderExt = NULL;
+   dlclose(driver);
+   continue;
+   }
+   return driver;
 }
-return driver;
-
-cleanup_failure:
-if (driver)
-   dlclose(driver);
-*coreExt = *renderExt = NULL;
 return NULL;
 }
-- 
1.7.4.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/list

[PATCH 3/5] glx: Use PATH_MAX as size of filename buffer

2011-03-08 Thread Christopher James Halse Rogers
Signed-off-by: Christopher James Halse Rogers 

---
 glx/glxdricommon.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 5569ab7..16f6588 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -215,7 +215,7 @@ glxProbeDriver(const char *driverName,
 {
 int i;
 void *driver;
-char filename[128];
+char filename[PATH_MAX];
 const __DRIextension **extensions;
 
 snprintf(filename, sizeof filename, "%s/%s_dri.so",
-- 
1.7.4.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 1/5] glx: Factor out glxProbeDriver function.

2011-03-08 Thread Christopher James Halse Rogers
DRI, DRI2 and swrast all had near-identical driver probing logic.
Pull it into glxdricommon

Signed-off-by: Christopher James Halse Rogers 

Reviewed-by: Adam Jackson 
---
 glx/glxdri.c   |   44 +--
 glx/glxdri2.c  |   39 ++
 glx/glxdricommon.c |   57 
 glx/glxdricommon.h |5 
 glx/glxdriswrast.c |   42 +
 5 files changed, 77 insertions(+), 110 deletions(-)

diff --git a/glx/glxdri.c b/glx/glxdri.c
index 7717fcf..3a57337 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -858,8 +858,6 @@ static const __DRIextension *loader_extensions[] = {
 
 
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -971,13 +969,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 drm_handle_t  hFB;
 intjunk;
 __GLXDRIscreen *screen;
-char filename[128];
 Bool isCapable;
 size_t buffer_size;
 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
 const __DRIconfig **driConfigs;
-const __DRIextension **extensions;
-int i;
 
 if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@@ -1052,42 +1047,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
 }
 
-snprintf(filename, sizeof filename, "%s/%s_dri.so",
- dri_driver_path, driverName);
-
-screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+screen->driver = glxProbeDriver(driverName,
+   (void **)&screen->core,
+   __DRI_CORE, __DRI_CORE_VERSION,
+   (void **)&screen->legacy,
+   __DRI_LEGACY, __DRI_LEGACY_VERSION);
 if (screen->driver == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-  filename, dlerror());
 goto handle_error;
 }
-
-extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-if (extensions == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-  driverName, dlerror());
-   goto handle_error;
-}
 
-for (i = 0; extensions[i]; i++) {
-   if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
-   extensions[i]->version >= __DRI_CORE_VERSION) {
-   screen->core = (__DRIcoreExtension *) extensions[i];
-   }
-
-   if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0 &&
-   extensions[i]->version >= __DRI_LEGACY_VERSION) {
-   screen->legacy = (__DRIlegacyExtension *) extensions[i];
-   }
-}
-
-if (screen->core == NULL || screen->legacy == NULL) {
-   LogMessage(X_ERROR,
-  "AIGLX error: %s does not export required DRI extension\n",
-  driverName);
-   goto handle_error;
-}
-
 /*
  * Get device-specific info.  pDevPriv will point to a struct
  * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that
@@ -1172,7 +1140,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 pScrn->LeaveVT = glxDRILeaveVT;
 
 LogMessage(X_INFO,
-  "AIGLX: Loaded and initialized %s\n", filename);
+  "AIGLX: Loaded and initialized %s\n", driverName);
 
 return &screen->base;
 
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 8d21c93..18927d7 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -599,8 +599,6 @@ static const __DRIextension *loader_extensions[] = {
 NULL
 };
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -702,12 +700,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 {
 const char *driverName, *deviceName;
 __GLXDRIscreen *screen;
-char filename[128];
 size_t buffer_size;
 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-const __DRIextension **extensions;
 const __DRIconfig **driConfigs;
-int i;
 
 screen = calloc(1, sizeof *screen);
 if (screen == NULL)
@@ -729,40 +724,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
 __glXInitExtensionEnableBits(screen->glx_enable_bits);
 
-snprintf(filename, sizeof filename,
-"%s/%s_dri.so", dri_driver_path, driverName);
-
-screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+screen->driver = glxProbeDriver(driverName, (void **)&screen->core, 
__DRI_CORE, 1,
+   (void **)&screen->dri2, __DRI_DRI2, 1);
 if (screen->driver == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-  filename, dlerror());
 goto handle_error;
 }
-
-extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-if (extensions == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-  dr

[PATCH 2/5] Consolidate all the PATH_MAX handling into misc.h

2011-03-08 Thread Christopher James Halse Rogers
Signed-off-by: Christopher James Halse Rogers 

---
 hw/xfree86/common/xf86Configure.c  |5 +
 hw/xfree86/os-support/xf86_OSlib.h |   11 +++
 hw/xfree86/parser/scan.c   |   11 +++
 include/misc.h |   11 +++
 os/access.c|   19 ---
 os/osinit.c|9 +
 os/utils.c |   11 ---
 7 files changed, 19 insertions(+), 58 deletions(-)

diff --git a/hw/xfree86/common/xf86Configure.c 
b/hw/xfree86/common/xf86Configure.c
index 883c48c..c712df7 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -39,6 +39,7 @@
 #include "xf86Bus.h"
 #include "xf86Sbus.h"
 #endif
+#include "misc.h"
 
 typedef struct _DevToConfig {
 GDevRec GDev;
@@ -514,10 +515,6 @@ configureDDCMonitorSection (int screennum)
 return ptr;
 }
 
-#if !defined(PATH_MAX)
-# define PATH_MAX 1024
-#endif
-
 void
 DoConfigure(void)
 {
diff --git a/hw/xfree86/os-support/xf86_OSlib.h 
b/hw/xfree86/os-support/xf86_OSlib.h
index 147a201..24c92fb 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -370,6 +370,9 @@
 
 #include   /* May need to adjust this for other OSs */
 
+/* For PATH_MAX */
+#include "misc.h"
+
 /* 
  * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
  * and it's safe, so just do it.
@@ -390,14 +393,6 @@
 # undef _POSIX_SOURCE
 #endif /* _POSIX_SOURCE */
 
-#if !defined(PATH_MAX)
-# if defined(MAXPATHLEN)
-#  define PATH_MAX MAXPATHLEN
-# else
-#  define PATH_MAX 1024
-# endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
 
 #ifndef DEV_MEM
 #define DEV_MEM "/dev/mem"
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index e4fce30..1cff3bc 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -77,18 +77,13 @@
 #undef _POSIX_SOURCE
 #endif /* _POSIX_SOURCE */
 
-#if !defined(PATH_MAX)
-#if defined(MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
 #if !defined(MAXHOSTNAMELEN)
 #define MAXHOSTNAMELEN 32
 #endif /* !MAXHOSTNAMELEN */
 
+/* For PATH_MAX */
+#include "misc.h"
+
 #include "Configint.h"
 #include "xf86tokens.h"
 
diff --git a/include/misc.h b/include/misc.h
index 62d813e..9ab96ac 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -180,6 +180,17 @@ typedef struct _xReq *xReqPtr;
 
 #endif
 
+#ifndef PATH_MAX
+#include 
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+#endif 
+
 /**
  * Calculate the number of bytes needed to hold bits.
  * @param bits The minimum number of bits needed.
diff --git a/os/access.c b/os/access.c
index eb1a21d..3856e60 100644
--- a/os/access.c
+++ b/os/access.c
@@ -165,17 +165,6 @@ SOFTWARE.
 
 #endif /* WIN32 */
 
-#ifndef PATH_MAX
-#include 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif 
-
 
 #define X_INCLUDE_NETDB_H
 #include 
@@ -185,14 +174,6 @@ SOFTWARE.
 
 #include "xace.h"
 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
 Bool defeatAccessControl = FALSE;
 
 #define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len)
diff --git a/os/osinit.c b/os/osinit.c
index 018e404..45d202d 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -63,17 +63,10 @@ SOFTWARE.
 #include 
 #endif
 
+#include "misc.h"
 
 #include "dixstruct.h"
 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
 
 #if !defined(SYSV) && !defined(WIN32) 
 #include 
diff --git a/os/utils.c b/os/utils.c
index 18fd911..a365aca 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -231,17 +231,6 @@ OsSignal(int sig, OsSigHandlerPtr handler)
 #define LOCK_PREFIX "/.X"
 #define LOCK_SUFFIX "-lock"
 
-#ifndef PATH_MAX
-#include 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif
-
 static Bool StillLocking = FALSE;
 static char LockFile[PATH_MAX];
 static Bool nolock = FALSE;
-- 
1.7.4.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 1/5] glx: Factor out glxProbeDriver function.

2011-03-08 Thread Christopher James Halse Rogers
DRI, DRI2 and swrast all had near-identical driver probing logic.
Pull it into glxdricommon

Signed-off-by: Christopher James Halse Rogers 

Reviewed-by: Adam Jackson 
---
 glx/glxdri.c   |   44 +--
 glx/glxdri2.c  |   39 ++
 glx/glxdricommon.c |   57 
 glx/glxdricommon.h |5 
 glx/glxdriswrast.c |   42 +
 5 files changed, 77 insertions(+), 110 deletions(-)

diff --git a/glx/glxdri.c b/glx/glxdri.c
index 7717fcf..3a57337 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -858,8 +858,6 @@ static const __DRIextension *loader_extensions[] = {
 
 
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -971,13 +969,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 drm_handle_t  hFB;
 intjunk;
 __GLXDRIscreen *screen;
-char filename[128];
 Bool isCapable;
 size_t buffer_size;
 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
 const __DRIconfig **driConfigs;
-const __DRIextension **extensions;
-int i;
 
 if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@@ -1052,42 +1047,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
 }
 
-snprintf(filename, sizeof filename, "%s/%s_dri.so",
- dri_driver_path, driverName);
-
-screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+screen->driver = glxProbeDriver(driverName,
+   (void **)&screen->core,
+   __DRI_CORE, __DRI_CORE_VERSION,
+   (void **)&screen->legacy,
+   __DRI_LEGACY, __DRI_LEGACY_VERSION);
 if (screen->driver == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-  filename, dlerror());
 goto handle_error;
 }
-
-extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-if (extensions == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-  driverName, dlerror());
-   goto handle_error;
-}
 
-for (i = 0; extensions[i]; i++) {
-   if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
-   extensions[i]->version >= __DRI_CORE_VERSION) {
-   screen->core = (__DRIcoreExtension *) extensions[i];
-   }
-
-   if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0 &&
-   extensions[i]->version >= __DRI_LEGACY_VERSION) {
-   screen->legacy = (__DRIlegacyExtension *) extensions[i];
-   }
-}
-
-if (screen->core == NULL || screen->legacy == NULL) {
-   LogMessage(X_ERROR,
-  "AIGLX error: %s does not export required DRI extension\n",
-  driverName);
-   goto handle_error;
-}
-
 /*
  * Get device-specific info.  pDevPriv will point to a struct
  * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that
@@ -1172,7 +1140,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 pScrn->LeaveVT = glxDRILeaveVT;
 
 LogMessage(X_INFO,
-  "AIGLX: Loaded and initialized %s\n", filename);
+  "AIGLX: Loaded and initialized %s\n", driverName);
 
 return &screen->base;
 
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 8d21c93..18927d7 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -599,8 +599,6 @@ static const __DRIextension *loader_extensions[] = {
 NULL
 };
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -702,12 +700,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 {
 const char *driverName, *deviceName;
 __GLXDRIscreen *screen;
-char filename[128];
 size_t buffer_size;
 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-const __DRIextension **extensions;
 const __DRIconfig **driConfigs;
-int i;
 
 screen = calloc(1, sizeof *screen);
 if (screen == NULL)
@@ -729,40 +724,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
 __glXInitExtensionEnableBits(screen->glx_enable_bits);
 
-snprintf(filename, sizeof filename,
-"%s/%s_dri.so", dri_driver_path, driverName);
-
-screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+screen->driver = glxProbeDriver(driverName, (void **)&screen->core, 
__DRI_CORE, 1,
+   (void **)&screen->dri2, __DRI_DRI2, 1);
 if (screen->driver == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-  filename, dlerror());
 goto handle_error;
 }
-
-extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-if (extensions == NULL) {
-   LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-  dr

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Alan Coopersmith
On 03/ 8/11 03:23 PM, Gaetan Nadon wrote:
>> +int snlen, aslen;
> 
> Whitespace error

Will fix.

> Would it be the time to provide some common support for unit testing?
> We will soon end-up in a situation where every package does it differently,
> making it difficult to add test cases in multiple packages, having to learn
> each package option, variables and behaviors.
> 
> At a minimum, we should have a macro for the configure option so at least
> there is a common user interface.
> 
> Tests are only executed when running "make check", is the
> --enable-unit-tests really needed?
> 
> 
> A quick summary of how things look today:
> 
> libXau: always enabled; no config option; no "test" dir
> libXt and xserver: --enable-unit-tests; UNITTESTS; auto detected based on 
> required support; has "test" dir
> libxkbcommon: always enabled; no config option; has "test" dir
> libxcb: autodetected based on "check"; HAVE_CHECK; has "tests" (plural) 
> dir
> 
> Outside xorg, but using all the lastest xorg macros, wacom has copied the 
> server code verbatim

Yeah, it would probably be good to provide common framework, especially if that
makes it easier for people to start adding tests to more modules.   Seems like
we've accepted the glib test harness code as our common test code base for
in-tree unit tests.


-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Cyril Brulebois
Gaetan Nadon  (08/03/2011):
> Tests are only executed when running "make check", is the
> --enable-unit-tests really needed?

I could understand why people wouldn't want glib to be pulled in
unconditionally when building libxt. As a package maintainer, I'm
happy to declare through a configure option that I want to enable unit
tests, and make configure fail if the prerequisites aren't there.

So I guess it makes sense (at least in this case) to have a
--enable-unit-tests available.

KiBi.


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Gaetan Nadon
On Tue, 2011-03-08 at 13:07 -0800, Alan Coopersmith wrote:

> Simple test case just compares the results of snprintf to a static buffer
> with the new buffer returned by XtAsprintf.
> 
> Test run currently fails due to correctly detecting the bug in null
> terminating the XtAsprintf returned string.
> 
> Signed-off-by: Alan Coopersmith 
> ---
>  Makefile.am  |2 +-
>  configure.ac |   18 +
>  test/Alloc.c |   56 
> ++
>  test/Makefile.am |   11 ++
>  4 files changed, 86 insertions(+), 1 deletions(-)
>  create mode 100644 test/Alloc.c
>  create mode 100644 test/Makefile.am
> 
> diff --git a/Makefile.am b/Makefile.am
> index e9e0316..8ef09ca 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -19,7 +19,7 @@
>  #  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
>  #  PERFORMANCE OF THIS SOFTWARE.
>  
> -SUBDIRS = util src include man specs
> +SUBDIRS = util src include man specs test
>  
>  ACLOCAL_AMFLAGS = -I m4
>  
> diff --git a/configure.ac b/configure.ac
> index 8945729..94db440 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -95,6 +95,23 @@ if test "x$XKB" = "xyes" ; then
>   AC_DEFINE(XKB, 1, [Define to 1 to use XKB for keysym resolution.])
>  fi
>  
> +AC_ARG_ENABLE(unit-tests,AS_HELP_STRING([--enable-unit-tests],
> +  [Enable unit-tests (default: auto)]),
> +[UNITTESTS=$enableval], [UNITTESTS=auto])
> +if test "x$UNITTESTS" != xno ; then
> +   PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
> + [HAVE_GLIB=yes], [HAVE_GLIB=no])
> +fi
> +if test "x$UNITTESTS" = xyes; then
> +   if test "x$HAVE_GLIB" = xno; then
> +   AC_MSG_ERROR([glib required to build unit tests])
> +   fi
> +elif test "x$UNITTESTS" = xauto; then
> +   UNITTESTS="$HAVE_GLIB"
> +fi
> +
> +AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes])
> +
>  # Replaces XFileSearchPathDefault from Imake configs
>  
> XFILESEARCHPATHDEFAULT='$(sysconfdir)/X11/%L/%T/%N%C%S:$(sysconfdir)/X11/%l/%T/%N%C%S:$(sysconfdir)/X11/%T/%N%C%S:$(sysconfdir)/X11/%L/%T/%N%S:$(sysconfdir)/X11/%l/%T/%N%S:$(sysconfdir)/X11/%T/%N%S:$(datadir)/X11/%L/%T/%N%C%S:$(datadir)/X11/%l/%T/%N%C%S:$(datadir)/X11/%T/%N%C%S:$(datadir)/X11/%L/%T/%N%S:$(datadir)/X11/%l/%T/%N%S:$(datadir)/X11/%T/%N%S:$(libdir)/X11/%L/%T/%N%C%S:$(libdir)/X11/%l/%T/%N%C%S:$(libdir)/X11/%T/%N%C%S:$(libdir)/X11/%L/%T/%N%S:$(libdir)/X11/%l/%T/%N%S:$(libdir)/X11/%T/%N%S'
>  
> @@ -144,5 +161,6 @@ AC_CONFIG_FILES([Makefile
>   include/Makefile
>   man/Makefile
>   specs/Makefile
> + test/Makefile
>   xt.pc])
>  AC_OUTPUT
> diff --git a/test/Alloc.c b/test/Alloc.c
> new file mode 100644
> index 000..5f9e27a
> --- /dev/null
> +++ b/test/Alloc.c
> @@ -0,0 +1,56 @@
> +/*
> + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static const char *program_name;
> +
> +static void test_XtAsprintf(void)
> +{
> +char snbuf[1024];
> +char *asbuf;
> +gint32 r = g_test_rand_int();
> +int snlen, aslen;


Whitespace error

> +
> +snlen = snprintf(snbuf, sizeof(snbuf), "%s: %d\n", program_name, r);
> +aslen = XtAsprintf(&asbuf, "%s: %d\n", program_name, r);
> +
> +g_assert(asbuf != NULL);
> +g_assert(snlen == aslen);
> +g_assert(strcmp(snbuf, asbuf) == 0);
> +}
> +
> +int main(int argc, char** argv)
> +{
> +program_name = argv[0];
> +
> +g_test_init(&argc, &argv, NULL);
> +g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=";);
> +
> +g_test_add_func("/Xt/Alloc/XtAsprintf", test_XtAsprintf);
> +
> +return g_test_run();
> 

Re: [PATCH] Xi: fix XI2 passive grab reply length calculation

2011-03-08 Thread Peter Hutterer
On Tue, Mar 08, 2011 at 01:37:13PM +, Daniel Stone wrote:
> On Tue, Mar 08, 2011 at 02:44:02PM +1000, Peter Hutterer wrote:
> > If modifiers failed, the reply length was 4 bytes too short.
> > 
> > Signed-off-by: Peter Hutterer 
> 
> This only works because xXIGrabModifierInfo is a multiple of 32, else
> rounding would ruin your day, but:

it's a protocol struct, they are all multiples of 32 anyway. only exception
here are the keycodes with 16 bit IIRC.

> Reviewed-by: Daniel Stone 

thanks

Cheers,
  Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Cyril Brulebois
Alan Coopersmith  (08/03/2011):
> Simple test case just compares the results of snprintf to a static
> buffer with the new buffer returned by XtAsprintf.

Good idea. I think you should also have another test, with a bigger
string to hit the second code path (the vsnprintf call returning more
than the buffer's size: 256).

> Test run currently fails due to correctly detecting the bug in null
> terminating the XtAsprintf returned string.

It actually doesn't fail here. (And yes, I checked without the fix.)

To build some stats:
  $ ok=0; nok=0; for i in $(seq 1 100); do make -C build/test check >/dev/null 
2>&1; if [ $? -eq 2 ]; then nok=$((nok+1)); else ok=$((ok+1)); fi; done; echo 
"ok: $ok"; echo "nok: $nok"

I supposed it depends again on the size we're considering. Using "foo"
instead of program_name, I'm having this kind of stats:
  ok: 28
  nok: 72
  ok: 24
  nok: 76
  …

(Might depend on the length of the string representation for the
random int.)

While with program_name, I'm hitting those everytime:
  ok: 100
  nok: 0

Note that program_name is much longer than "foo", which might explain
the differences at run time:
  /home/cyril/debian-x/lib/libxt.git/build/test/.libs/lt-Alloc

Therefore I'd suggest running 3 tests:
 - with a short string ("foo"-like) + integer
 - with a “medium yet random” string (program_name) + integer
 - with a longer string (to hit the 256 limit) + integer

And running those in loops of several-dozens/hundreds occurrences
might be a good idea.

> diff --git a/test/Alloc.c b/test/Alloc.c
> new file mode 100644
> index 000..5f9e27a
> --- /dev/null
> +++ b/test/Alloc.c
> +static void test_XtAsprintf(void)
> +{
> +char snbuf[1024];
> +char *asbuf;
> +gint32 r = g_test_rand_int();
> +int snlen, aslen;
> +

Whitespace here.

> +snlen = snprintf(snbuf, sizeof(snbuf), "%s: %d\n", program_name, r);
> +aslen = XtAsprintf(&asbuf, "%s: %d\n", program_name, r);
> +
> +g_assert(asbuf != NULL);
> +g_assert(snlen == aslen);
> +g_assert(strcmp(snbuf, asbuf) == 0);
> +}

KiBi.


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/3] input: warning fix

2011-03-08 Thread Peter Hutterer
On Tue, Mar 08, 2011 at 03:33:11PM -0500, Adam Jackson wrote:
> getevents.c:770:5: warning: suggest parentheses around '&&' within '||'
> 
> Introduced with dc57f89959e549403f8488eb9f23425bd7118b22:
> 
> -if(dev->u.master && dev->valuator) {
> +if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
> 
> So I'm assuming the two terms around the || are meant to be a unit.
> 
> Signed-off-by: Adam Jackson 

all three merged, thanks.
 
Cheers,
  Peter

> ---
>  dix/getevents.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/dix/getevents.c b/dix/getevents.c
> index 5b8e379..4bca1b0 100644
> --- a/dix/getevents.c
> +++ b/dix/getevents.c
> @@ -767,7 +767,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, 
> ValuatorMask *mask)
>  /* if attached, clip both x and y to the defined limits (usually
>   * co-ord space limit). If it is attached, we need x/y to go over the
>   * limits to be able to change screens. */
> -if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
> +if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) {
>  if (valuator_get_mode(dev, 0) == Absolute)
>  clipAxis(dev, 0, x);
>  if (valuator_get_mode(dev, 1) == Absolute)
> -- 
> 1.7.3.5
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] modes: Replace xf86DefaultModes with DMTModes

2011-03-08 Thread Mark Kettenis
> From: Adam Jackson 
> Date: Tue, 08 Mar 2011 16:21:02 -0500
> 
> On Tue, 2011-03-08 at 21:32 +0100, Mark Kettenis wrote:
> > > Date: Tue, 8 Mar 2011 21:27:47 +0100 (CET)
> > > From: Mark Kettenis 
> > >=20
> > > > From: Adam Jackson 
> > > > Date: Tue,  8 Mar 2011 14:56:33 -0500
> > > >=20
> > > > DMTModes is what xf86DefaultModes was always meant to be.
> > >=20
> > > I'd say xf86DefaultModes is a better variable name than DMTModes for
> > > an exported symbol though.
> 
> If it makes you feel better, we can probably stop exporting it.  None of
> the open drivers are using either symbol.  I think fglrx does, but the
> thing about MIT-licensed code is...

Somewhat.

> > Hmm, looking at this a bit more, is it really ok to include the
> > "reduced blanking" modes in xf86DefaultModes?
> 
> Yes.  We filter the default mode pool based on the monitor's
> capabilities.  For non-randrful drivers, see xf86CheckModeForMonitor;
> for randrful drivers see xf86ValidateModesReducedBlanking.  (Yes, these
> paths should be made less redundant.)

Thanks for the expanation.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: moving subwindow

2011-03-08 Thread Peter Harris
On 2011-03-08 13:46, Al'miev Il'dar wrote:
> These commands produce the main window and the subwindow with the
> borders specified. However, the subwindow can not be moved inside the
> main window by dragging it with a mouse. The windows manager is
> attached only to the main window, and I guess not to the subwindow.
> 
> Could anybody help to resolve these problem: that is, how the code
> should be modified in order to achieve moving the subwindow inside
> the main window ?

Use QMdiArea (from Qt) or wxMDIChildFrame (from wxWidgets) or similar.

If you really insist on doing it yourself, both of those have source
code available so you can see how they did it.

Peter Harris
-- 
   Open Text Connectivity Solutions Group
Peter Harrishttp://connectivity.opentext.com/
Research and DevelopmentPhone: +1 905 762 6001
phar...@opentext.comToll Free: 1 877 359 4866
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


moving subwindow

2011-03-08 Thread Al'miev Il'dar
Hello, I am trying to write Xlib-program that would produce a window (main 
window) on the screen (root screen) and the subwindow inside the main window. 
To make that, the following Xlib-functions are called (the question is below):

 window = XCreateSimpleWindow ( display,
 RootWindow ( display, screen_number ),
 X, Y,WIDTH,HEIGHT,BORDER_WIDTH,
 BlackPixel ( display, screen_number ),
 WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window, X, Y, WIDTH, HEIGHT, WIDTH_MIN,
   HEIGHT_MIN, TITLE, ICON_TITLE, 0 );

 XSelectInput ( display, window, ExposureMask | KeyPressMask );

 XMapWindow ( display, window );

 window1 = XCreateSimpleWindow ( display,  window,
 (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/2.), (int)(BORDER_WIDTH),
 BlackPixel ( display, screen_number ),
 WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window1, (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/3.), (int)(WIDTH_MIN),
   (int)(HEIGHT_MIN/3.), TITLE1, ICON_TITLE, 0 );

 XSelectInput ( display, window1, ExposureMask | KeyPressMask );

 XMapWindow ( display, window1 );

These commands produce the main window and the subwindow with the borders 
specified. However, the subwindow can not be moved inside the main window by 
dragging it with a mouse. The windows manager is attached only to the main 
window, and I guess not to the subwindow.

Could anybody help to resolve these problem: that is, how the code should be 
modified in order to achieve moving the subwindow inside the main window ?

I also attach the the example code.

Thank you.

Il'dar#include 
#include 
#include 
#include 
#include 

#define X 0
#define Y 0
#define WIDTH 400
#define HEIGHT 400
#define WIDTH_MIN 100
#define HEIGHT_MIN 100
#define BORDER_WIDTH 5
#define TITLE "Example"
#define TITLE1 "Sub_example"
#define ICON_TITLE "Example"
#define PRG_CLASS "Example"

static void SetWindowManagerHints ( 
 Display * display, 		
 char * PClass, 		
 char * argv[],   		
 int argc,			
 Window window,		
 int x, 			
 int y,	   
 int win_wdt,			
 int win_hgt,  			
 int win_wdt_min,			
 int win_hgt_min, 		
 char * ptrTitle,  		
 char * ptrITitle,	
 Pixmap pixmap 	
)
{
 XSizeHints size_hints;

 XWMHints wm_hints;
 XClassHint class_hint;
 XTextProperty windowname, iconname;

 if ( !XStringListToTextProperty (&ptrTitle, 1, &windowname ) ||
!XStringListToTextProperty (&ptrITitle, 1, &iconname ) ) {
  puts ( "No memory!\n");
  exit ( 1 );
}

size_hints.flags = PPosition | PSize | PMinSize;
size_hints.min_width = win_wdt_min;
size_hints.min_height = win_hgt_min;
wm_hints.flags = StateHint | IconPixmapHint | InputHint;
wm_hints.initial_state = NormalState;
wm_hints.input = True;
wm_hints.icon_pixmap= pixmap;
class_hint.res_name = argv[0];
class_hint.res_class = PClass;

XSetWMProperties ( display, window, &windowname,
  &iconname, argv, argc, &size_hints, &wm_hints,
  &class_hint );
}

void main(int argc, char *argv[])
{
 int ii;
 Display * display; 
 int screen_number;
 GC gc,gc1;			
 XEvent report;
 Window window, window1;
  char disp1[]="microsof-70c56f:1.0";

 if ( ( display = XOpenDisplay(disp1) ) == NULL ) {
  puts ("Can not connect to the X server!\n");
  exit ( 1 );
 }

// screen_number = DefaultScreen ( display );

screen_number=0;

 window = XCreateSimpleWindow ( display,
 RootWindow ( display, screen_number ),
 X, Y,WIDTH,HEIGHT,BORDER_WIDTH,
 BlackPixel ( display, screen_number ),
 WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window, X, Y, WIDTH, HEIGHT, WIDTH_MIN,
   HEIGHT_MIN, TITLE, ICON_TITLE, 0 );

 XSelectInput ( display, window, ExposureMask | KeyPressMask );

 XMapWindow ( display, window );



 window1 = XCreateSimpleWindow ( display,
 window,
 (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/2.), (int)(BORDER_WIDTH),
 BlackPixel ( display, screen_number ),
 WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window1, (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/3.), (int)(WIDTH_MIN),
   (int)(HEIGHT_MIN/3.), TITLE1, ICON_TITLE, 0 );

 XSelectInput ( display, window1, ExposureMask | KeyPressMask );

 XMapWindow ( display, window1 );


while(1)
 {
  XNextEvent ( display, &report );

  switch ( report.type ) {
case Expose :
 if ( report.xexpose.count != 0 )
  break;

 gc = XCreateGC ( display, window, 0 , NULL );

 XSetForeground ( display, gc, BlackPixel ( display, 0) );


 gc1 = XCreateGC ( display, window1, 0 , NULL );

 XSetForeground ( display, gc1, BlackPixel ( display, 0) );
 
 XDrawString ( display, window, gc, 20,50,
   "Main Window", strlen ( "Main Window" ) );

 XDrawString ( display, window1, gc1, 20,50,
  "Subwindow", strlen ( "Subwindow" ) );


 XFreeGC ( display, gc );
 XFreeGC ( display, gc1 );
 XFlush(display);
   

Re: [PATCH] modes: Replace xf86DefaultModes with DMTModes

2011-03-08 Thread Adam Jackson
On Tue, 2011-03-08 at 21:32 +0100, Mark Kettenis wrote:
> > Date: Tue, 8 Mar 2011 21:27:47 +0100 (CET)
> > From: Mark Kettenis 
> > 
> > > From: Adam Jackson 
> > > Date: Tue,  8 Mar 2011 14:56:33 -0500
> > > 
> > > DMTModes is what xf86DefaultModes was always meant to be.
> > 
> > I'd say xf86DefaultModes is a better variable name than DMTModes for
> > an exported symbol though.

If it makes you feel better, we can probably stop exporting it.  None of
the open drivers are using either symbol.  I think fglrx does, but the
thing about MIT-licensed code is...

> Hmm, looking at this a bit more, is it really ok to include the
> "reduced blanking" modes in xf86DefaultModes?

Yes.  We filter the default mode pool based on the monitor's
capabilities.  For non-randrful drivers, see xf86CheckModeForMonitor;
for randrful drivers see xf86ValidateModesReducedBlanking.  (Yes, these
paths should be made less redundant.)

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [libXt:PATCH] XtAsprintf: Fix memory corruption.

2011-03-08 Thread Alan Coopersmith
On 03/ 8/11 07:09 AM, Cyril Brulebois wrote:
> Don't write the null terminator to a random place, this can trigger some
> segfault in XtOpenDisplay() and other annoyances.
> - new_string[len] = '\0';
> + (*new_string)[len] = '\0';

Oops!  Sorry.   Yes.

Reviewed-by: Alan Coopersmith 

As penance I wrote a quick test that catches this failure and confirms the fix.
(See separate mail for that.)   A very incomplete test case, but we have to
start somewhere, and it seems to be working for the xserver so far.

Once the fix & test are in, we'll get a libXt-1.1.1 release out with those and
the two other minor changes in git master - I'll hold back on pushing the
possibly more risky XtAppMainLoop patch until after that.

-- 
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Alan Coopersmith
Simple test case just compares the results of snprintf to a static buffer
with the new buffer returned by XtAsprintf.

Test run currently fails due to correctly detecting the bug in null
terminating the XtAsprintf returned string.

Signed-off-by: Alan Coopersmith 
---
 Makefile.am  |2 +-
 configure.ac |   18 +
 test/Alloc.c |   56 ++
 test/Makefile.am |   11 ++
 4 files changed, 86 insertions(+), 1 deletions(-)
 create mode 100644 test/Alloc.c
 create mode 100644 test/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index e9e0316..8ef09ca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
 #  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 #  PERFORMANCE OF THIS SOFTWARE.
 
-SUBDIRS = util src include man specs
+SUBDIRS = util src include man specs test
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/configure.ac b/configure.ac
index 8945729..94db440 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,6 +95,23 @@ if test "x$XKB" = "xyes" ; then
AC_DEFINE(XKB, 1, [Define to 1 to use XKB for keysym resolution.])
 fi
 
+AC_ARG_ENABLE(unit-tests,AS_HELP_STRING([--enable-unit-tests],
+  [Enable unit-tests (default: auto)]),
+[UNITTESTS=$enableval], [UNITTESTS=auto])
+if test "x$UNITTESTS" != xno ; then
+   PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
+ [HAVE_GLIB=yes], [HAVE_GLIB=no])
+fi
+if test "x$UNITTESTS" = xyes; then
+   if test "x$HAVE_GLIB" = xno; then
+   AC_MSG_ERROR([glib required to build unit tests])
+   fi
+elif test "x$UNITTESTS" = xauto; then
+   UNITTESTS="$HAVE_GLIB"
+fi
+
+AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes])
+
 # Replaces XFileSearchPathDefault from Imake configs
 
XFILESEARCHPATHDEFAULT='$(sysconfdir)/X11/%L/%T/%N%C%S:$(sysconfdir)/X11/%l/%T/%N%C%S:$(sysconfdir)/X11/%T/%N%C%S:$(sysconfdir)/X11/%L/%T/%N%S:$(sysconfdir)/X11/%l/%T/%N%S:$(sysconfdir)/X11/%T/%N%S:$(datadir)/X11/%L/%T/%N%C%S:$(datadir)/X11/%l/%T/%N%C%S:$(datadir)/X11/%T/%N%C%S:$(datadir)/X11/%L/%T/%N%S:$(datadir)/X11/%l/%T/%N%S:$(datadir)/X11/%T/%N%S:$(libdir)/X11/%L/%T/%N%C%S:$(libdir)/X11/%l/%T/%N%C%S:$(libdir)/X11/%T/%N%C%S:$(libdir)/X11/%L/%T/%N%S:$(libdir)/X11/%l/%T/%N%S:$(libdir)/X11/%T/%N%S'
 
@@ -144,5 +161,6 @@ AC_CONFIG_FILES([Makefile
include/Makefile
man/Makefile
specs/Makefile
+   test/Makefile
xt.pc])
 AC_OUTPUT
diff --git a/test/Alloc.c b/test/Alloc.c
new file mode 100644
index 000..5f9e27a
--- /dev/null
+++ b/test/Alloc.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+static const char *program_name;
+
+static void test_XtAsprintf(void)
+{
+char snbuf[1024];
+char *asbuf;
+gint32 r = g_test_rand_int();
+int snlen, aslen;
+
+snlen = snprintf(snbuf, sizeof(snbuf), "%s: %d\n", program_name, r);
+aslen = XtAsprintf(&asbuf, "%s: %d\n", program_name, r);
+
+g_assert(asbuf != NULL);
+g_assert(snlen == aslen);
+g_assert(strcmp(snbuf, asbuf) == 0);
+}
+
+int main(int argc, char** argv)
+{
+program_name = argv[0];
+
+g_test_init(&argc, &argv, NULL);
+g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=";);
+
+g_test_add_func("/Xt/Alloc/XtAsprintf", test_XtAsprintf);
+
+return g_test_run();
+}
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 000..3e76bc5
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,11 @@
+if UNITTESTS
+check_PROGRAMS = Alloc
+
+TESTS=$(check_PROGRAMS)
+
+AM_CFLAGS = $(CWARNFLAGS) $(XT_CFLAGS) $(GLIB_CFLAGS)
+INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)

[PATCH 3/3] record: warning fix

2011-03-08 Thread Adam Jackson
record.c:810:9: warning: unused variable 'count'

Scope-shadowed by a later variable of the same name, safe to just
delete.

Signed-off-by: Adam Jackson 
---
 record/record.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/record/record.c b/record/record.c
index df3f9c6..53be182 100644
--- a/record/record.c
+++ b/record/record.c
@@ -807,7 +807,6 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, 
pointer calldata)
 RecordContextPtr pContext;
 RecordClientsAndProtocolPtr pRCAP;
 int eci; /* enabled context index */
-int count;
 
 for (eci = 0; eci < numEnabledContexts; eci++)
 {
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 2/3] input: warning fixes

2011-03-08 Thread Adam Jackson
eventconvert.c:287:9: warning: enumeration value 'ET_Enter' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_Leave' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_FocusIn' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_FocusOut' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_DeviceChanged' not handled 
in switch
eventconvert.c:287:9: warning: enumeration value 'ET_Hierarchy' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_DGAEvent' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyPress' not handled 
in switch
eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyRelease' not handled 
in switch
eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonPress' not 
handled in switch
eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonRelease' not 
handled in switch
eventconvert.c:287:9: warning: enumeration value 'ET_RawMotion' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_XQuartz' not handled in 
switch
eventconvert.c:287:9: warning: enumeration value 'ET_Internal' not handled in 
switch

>From the code it appears these are can't happens, so if they ever do,
BadImplementation seems entirely appropriate.

Signed-off-by: Adam Jackson 
---
 dix/eventconvert.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 760729b..c9d1994 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -297,6 +297,9 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int 
*count)
 case ET_ProximityOut:
 *count = 0;
 return BadMatch;
+   default:
+   *count = 0;
+   return BadImplementation;
 }
 }
 
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 1/3] input: warning fix

2011-03-08 Thread Adam Jackson
getevents.c:770:5: warning: suggest parentheses around '&&' within '||'

Introduced with dc57f89959e549403f8488eb9f23425bd7118b22:

-if(dev->u.master && dev->valuator) {
+if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {

So I'm assuming the two terms around the || are meant to be a unit.

Signed-off-by: Adam Jackson 
---
 dix/getevents.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 5b8e379..4bca1b0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -767,7 +767,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask 
*mask)
 /* if attached, clip both x and y to the defined limits (usually
  * co-ord space limit). If it is attached, we need x/y to go over the
  * limits to be able to change screens. */
-if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
+if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) {
 if (valuator_get_mode(dev, 0) == Absolute)
 clipAxis(dev, 0, x);
 if (valuator_get_mode(dev, 1) == Absolute)
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] modes: Replace xf86DefaultModes with DMTModes

2011-03-08 Thread Mark Kettenis
> Date: Tue, 8 Mar 2011 21:27:47 +0100 (CET)
> From: Mark Kettenis 
> 
> > From: Adam Jackson 
> > Date: Tue,  8 Mar 2011 14:56:33 -0500
> > 
> > DMTModes is what xf86DefaultModes was always meant to be.
> 
> I'd say xf86DefaultModes is a better variable name than DMTModes for
> an exported symbol though.

Hmm, looking at this a bit more, is it really ok to include the
"reduced blanking" modes in xf86DefaultModes?
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] modes: Replace xf86DefaultModes with DMTModes

2011-03-08 Thread Mark Kettenis
> From: Adam Jackson 
> Date: Tue,  8 Mar 2011 14:56:33 -0500
> 
> DMTModes is what xf86DefaultModes was always meant to be.

I'd say xf86DefaultModes is a better variable name than DMTModes for
an exported symbol though.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH 2/3] dix: Shrink PropertyRec on LP64

2011-03-08 Thread Adam Jackson
On Tue, 2011-03-08 at 19:37 +, Daniel Stone wrote:
> On Tue, Mar 08, 2011 at 02:13:47PM -0500, Adam Jackson wrote:
> > size needn't be a long.  No change on ILP32 but, combined with the
> > previous change, 56 -> 40 bytes on LP64.
> > 
> > Signed-off-by: Adam Jackson 
> > ---
> >  include/propertyst.h |4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/propertyst.h b/include/propertyst.h
> > index fd1148e..1edd11d 100644
> > --- a/include/propertyst.h
> > +++ b/include/propertyst.h
> > @@ -58,8 +58,8 @@ typedef struct _Property {
> >  struct _Property   *next;
> > ATOMpropertyName;
> > ATOMtype;   /* ignored by server */
> > -   short   format; /* format of data for swapping - 8,16,32 */
> > -   longsize;   /* size of data in (format/8) bytes */
> > +   uint32_tformat; /* format of data for swapping - 8,16,32 */
> > +   uint32_tsize;   /* size of data in (format/8) bytes */
> > pointer data;   /* private to client */
> > PrivateRec  *devPrivates;
> >  } PropertyRec;
> 
> Being really pedantic again, can't these two be uint8_t or something?
> You've just grown format from 16 to 32 bytes. :P

size pretty much needs to be uint32_t, MAX_BIG_REQUEST_SIZE is 4M so
even if you're using format32 you're looking at (1 << 20).  Once you've
got that, you're sticking format between two uint32_t, so making it
uint8_t would just give you 24 bits of hole.

If you really wanted to assume too much about bigreq sizing and/or throw
BadAlloc on excessively large properties, you could probably smash
format into the high bits of size, which would take you from 28 to 24
bytes per on ILP32, but wouldn't win you anything on LP64 (either you'd
be making a hole so the pointers are aligned, or you'd move it to the
end of the struct and still have padding off the end due to ABI rules).

Which seems... a little dirty, but if someone really wants that memory
back, I guess that's a thing we could do.

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] modes: Replace xf86DefaultModes with DMTModes

2011-03-08 Thread Adam Jackson
DMTModes is what xf86DefaultModes was always meant to be.

   textdata bss dec hex filename
1867137   72220   55392 1994749  1e6ffd hw/xfree86/Xorg-before
1852481   72180   55392 1980053  1e3695 hw/xfree86/Xorg-after

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/Makefile.am |   10 +---
 hw/xfree86/common/extramodes  |   27 
 hw/xfree86/common/modeline2c.awk  |   93 ---
 hw/xfree86/common/vesamodes   |  111 -
 hw/xfree86/common/xf86Config.c|5 +-
 hw/xfree86/common/xf86Priv.h  |4 +-
 hw/xfree86/ddc/xf86DDC.h  |2 -
 hw/xfree86/modes/xf86DisplayIDModes.c |1 +
 hw/xfree86/modes/xf86EdidModes.c  |3 +-
 hw/xfree86/modes/xf86Modes.c  |4 +-
 10 files changed, 11 insertions(+), 249 deletions(-)
 delete mode 100644 hw/xfree86/common/extramodes
 delete mode 100644 hw/xfree86/common/modeline2c.awk
 delete mode 100644 hw/xfree86/common/vesamodes

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index c031d4b..85169cc 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -21,14 +21,6 @@ RANDRSOURCES = xf86RandR.c
 
 BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
 
-MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
-
-xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
-   $(AM_V_GEN)cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f 
$(srcdir)/modeline2c.awk > $@
-   $(AM_V_GEN)echo >> $@
-
-BUILT_SOURCES = xf86DefModeSet.c
-
 AM_LDFLAGS = -r
 libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
   xf86Cursor.c $(DGASOURCES) xf86DPMS.c \
@@ -38,7 +30,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c 
xf86Bus.c xf86Config.c \
   xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
   xf86Mode.c xorgHelper.c \
   $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
-nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
+nodist_libcommon_la_SOURCES = xf86Build.h
 libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la
 
 INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes
deleted file mode 100644
index 4505026..000
--- a/hw/xfree86/common/extramodes
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Extra modes to include as default modes in the X server.
-//
-// $XFree86: xc/programs/Xserver/hw/xfree86/etc/extramodes,v 1.5 2002/06/05 
19:43:05 dawes Exp $
-//
-
-# 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) 
hsync: 49.725kHz
-ModeLine "832x624" 57.284 832  864  928 1152  624  625  628  667 -Hsync -Vsync
-
-# 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz
-ModeLine "1400x1050" 122.0 1400 1488 1640 1880   1050 1052 1064 1082 +hsync 
+vsync
-
-# 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz
-ModeLine "1400x1050" 155.8 1400 1464 1784 1912   1050 1052 1064 1090 +hsync 
+vsync
-
-# 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz
-Modeline "1920x1440" 341.35  1920 2072 2288 2656  1440 1441 1444 1512 -hsync 
+vsync
-
-# 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz
-Modeline "2048x1536" 266.95  2048 2200 2424 2800  1536 1537 1540 1589 -hsync 
+vsync
-
-# 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz
-Modeline "2048x1536" 340.48  2048 2216 2440 2832  1536 1537 1540 1603 -hsync 
+vsync
-
-# 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz
-Modeline "2048x1536" 388.04  2048 2216 2440 2832  1536 1537 1540 1612 -hsync 
+vsync
-
diff --git a/hw/xfree86/common/modeline2c.awk b/hw/xfree86/common/modeline2c.awk
deleted file mode 100644
index 038e7e9..000
--- a/hw/xfree86/common/modeline2c.awk
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/awk -f
-#
-# Copyright (c) 2007 Joerg Sonnenberger .
-# All rights reserved.
-#
-# Based on Perl script by Dirk Hohndel.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#notice, this list of conditions and the following disclaimer in
-#the documentation and/or other materials provided with the
-#distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
-# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSI

Re: [PATCH 2/3] dix: Shrink PropertyRec on LP64

2011-03-08 Thread Daniel Stone
On Tue, Mar 08, 2011 at 02:13:47PM -0500, Adam Jackson wrote:
> size needn't be a long.  No change on ILP32 but, combined with the
> previous change, 56 -> 40 bytes on LP64.
> 
> Signed-off-by: Adam Jackson 
> ---
>  include/propertyst.h |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/propertyst.h b/include/propertyst.h
> index fd1148e..1edd11d 100644
> --- a/include/propertyst.h
> +++ b/include/propertyst.h
> @@ -58,8 +58,8 @@ typedef struct _Property {
>  struct _Property   *next;
>   ATOMpropertyName;
>   ATOMtype;   /* ignored by server */
> - short   format; /* format of data for swapping - 8,16,32 */
> - longsize;   /* size of data in (format/8) bytes */
> + uint32_tformat; /* format of data for swapping - 8,16,32 */
> + uint32_tsize;   /* size of data in (format/8) bytes */
>   pointer data;   /* private to client */
>   PrivateRec  *devPrivates;
>  } PropertyRec;

Being really pedantic again, can't these two be uint8_t or something?
You've just grown format from 16 to 32 bytes. :P

Aside from that:
Reviewed-by: Daniel Stone 

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 3/3] dix: Define RESTYPE as uint32_t

2011-03-08 Thread Adam Jackson
long is needlessly long on LP64.

Before:
   textdata bss dec hex filename
1833242   69920   49696 1952858  1dcc5a hw/vfb/Xvfb

After:
   textdata bss dec hex filename
1832426   69920   49504 1951850  1dc86a hw/vfb/Xvfb

Signed-off-by: Adam Jackson 
---
 include/resource.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/resource.h b/include/resource.h
index 763aa99..772b7b8 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -56,7 +56,7 @@ SOFTWARE.
 
 /* classes for Resource routines */
 
-typedef unsigned long RESTYPE;
+typedef uint32_t RESTYPE;
 
 #define RC_VANILLA ((RESTYPE)0)
 #define RC_CACHED  ((RESTYPE)1<<31)
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 1/3] dix: Fix ATOM typedef

2011-03-08 Thread Adam Jackson
unsigned long is needlessly large on LP64.  Use uint32_t instead.

Signed-off-by: Adam Jackson 
---
 include/misc.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/misc.h b/include/misc.h
index 0717db6..386d295 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -79,6 +79,7 @@ OF THIS SOFTWARE.
 #include 
 
 #include 
+#include 
 
 #ifndef MAXSCREENS
 #define MAXSCREENS 16
@@ -91,7 +92,7 @@ OF THIS SOFTWARE.
 #define EXTENSION_EVENT_BASE 64
 #define EXTENSION_BASE 128
 
-typedef unsigned long ATOM;
+typedef uint32_t ATOM;
 
 #ifndef TRUE
 #define TRUE 1
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 2/3] dix: Shrink PropertyRec on LP64

2011-03-08 Thread Adam Jackson
size needn't be a long.  No change on ILP32 but, combined with the
previous change, 56 -> 40 bytes on LP64.

Signed-off-by: Adam Jackson 
---
 include/propertyst.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/propertyst.h b/include/propertyst.h
index fd1148e..1edd11d 100644
--- a/include/propertyst.h
+++ b/include/propertyst.h
@@ -58,8 +58,8 @@ typedef struct _Property {
 struct _Property   *next;
ATOMpropertyName;
ATOMtype;   /* ignored by server */
-   short   format; /* format of data for swapping - 8,16,32 */
-   longsize;   /* size of data in (format/8) bytes */
+   uint32_tformat; /* format of data for swapping - 8,16,32 */
+   uint32_tsize;   /* size of data in (format/8) bytes */
pointer data;   /* private to client */
PrivateRec  *devPrivates;
 } PropertyRec;
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PULL] xserver-next, 2011-03-08

2011-03-08 Thread Adam Jackson
The vbe fix and the memory leak are the only two real bugfixes here, the
rest is somewhat cosmetic.

---
The following changes since commit 628d16a92a7fa556fbb70bf4a4adf57ec05c190b:

  loader: Don't distribute sdksyms.c and make it depend on the config 
(2011-03-03 21:54:25 -0800)

are available in the git repository at:
  ssh://people.freedesktop.org/~ajax/xserver xserver-next

Adam Jackson (14):
  vbe: Fix malloc size bug
  dix: Remove usage_hint from pixmaps, store it in ->drawable.class
  dix: Remove deprecated.c
  dix: Remove PIXEL typedef
  xv: Use RESTYPE where appropriate
  xinerama: Use RESTYPE consistently
  xvmc: Use RESTYPE consistently
  xi: Use RESTYPE consistently
  glx: Remove unused _glapi_get_proc_offset and friends
  glx: unifdef SOLARIS_THREADS
  glx: unifdef USE_XTHREADS
  glx: unifdef BEOS_THREADS
  glx: Simplify _glapi_check_multithread
  glx: Remove unused _glapi_get_proc_name

Erkki Seppälä (1):
  xfree86/common: Remove a configScreen leak when conf_screen is NULL

 Xext/panoramiX.c   |   10 +-
 Xext/panoramiXsrv.h|   12 +-
 Xext/xvdix.h   |   12 +-
 Xext/xvmain.c  |   14 +--
 Xext/xvmc.c|6 +-
 Xi/exglobals.h |2 +-
 Xi/extinit.c   |2 +-
 dix/Makefile.am|1 -
 dix/deprecated.c   |  165 -
 exa/exa.h  |2 +-
 exa/exa_classic.c  |4 +-
 exa/exa_driver.c   |6 +-
 exa/exa_migration_mixed.c  |4 +-
 exa/exa_mixed.c|4 +-
 exa/exa_priv.h |6 +-
 fb/fb.h|4 +-
 fb/fb24_32.c   |2 +-
 fb/fbpixmap.c  |   10 +-
 glx/glapi.c|  205 +---
 glx/glapi.h|   22 
 glx/glthread.c |  162 -
 glx/glthread.h |   69 +---
 hw/dmx/dmxpixmap.c |5 +-
 hw/dmx/dmxpixmap.h |2 +-
 hw/xfree86/common/xf86Config.c |4 +-
 hw/xfree86/common/xf86VGAarbiter.c |4 +-
 hw/xfree86/common/xf86VGAarbiterPriv.h |2 +-
 hw/xfree86/vbe/vbe.c   |2 +-
 hw/xfree86/xaa/xaaInit.c   |   10 +-
 hw/xnest/Pixmap.c  |5 +-
 hw/xnest/XNPixmap.h|2 +-
 hw/xwin/win.h  |2 +-
 hw/xwin/winpixmap.c|7 +-
 include/dix.h  |   31 -
 include/misc.h |2 -
 include/pixmapstr.h|1 -
 include/resource.h |   29 -
 include/scrnintstr.h   |2 +-
 render/render.c|2 +-
 39 files changed, 77 insertions(+), 759 deletions(-)
 delete mode 100644 dix/deprecated.c

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] xfree86/common: Removed a configScreen leak when conf_screen is NULL

2011-03-08 Thread Adam Jackson
On Tue, 2011-03-08 at 13:10 +0200, Erkki Seppälä wrote:
> configScreen used a dynamically allocated buffer for XF86ConfScreenRec
> when conf_screen argument was NULL. This pointer was never stored
> anywhere, nor was it released, so this patch makes the function use
> automatically allocated storage in that situation.
> 
> Reviewed-by: Rami Ylimäki 
> Signed-off-by: Erkki Seppälä 

R-b, and merged to xserver-next.

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 14/14] glx: Fix _glapi_add_dispatch

2011-03-08 Thread Adam Jackson
We never need to generate stubs, because those conditions can't happen
in the server.  Yank that code out, but keep the bookkeeping for which
extension functions are registered so the DRI driver doesn't get
confused.

As a pleasant bonus, we're now friendlier for environments like selinux
that make runtime code generation difficult, and we're portable to more
arches since we don't have to port the assembly stubs.

Fixes the following clutter conformance tests (indirect rendering,
llvmpipe driver):

test-cogl-backface-culling
test-cogl-materials
test-cogl-readpixels
test-cogl-texture-mipmaps
test-cogl-texture-get-set-data
test-cogl-viewport
test-cogl-offscreen

Signed-off-by: Adam Jackson 
---
 glx/glapi.c |  220 ++-
 1 files changed, 20 insertions(+), 200 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index 4bb07e2..5f6ec75 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -51,9 +51,6 @@
 static void init_glapi_relocs(void);
 #endif
 
-static _glapi_proc generate_entrypoint(GLuint functionOffset);
-static void fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset);
-
 /**
  * \name Current dispatch and current context control variables
  *
@@ -114,23 +111,6 @@ PUBLIC void *_glapi_Context = NULL;
 #endif /* defined(GLX_USE_TLS) */
 /*@}*/
 
-
-/**
- * strdup() is actually not a standard ANSI C or POSIX routine.
- * Irix will not define it if ANSI mode is in effect.
- */
-static char *
-str_dup(const char *str)
-{
-   char *copy;
-   copy = (char*) malloc(strlen(str) + 1);
-   if (!copy)
-  return NULL;
-   strcpy(copy, str);
-   return copy;
-}
-
-
 /*
  * xserver's gl is not multithreaded, we promise.
  */
@@ -298,7 +278,6 @@ struct _glapi_function {
 */
const char * name;
 
-
/**
 * Text string that describes the types of the parameters passed to the
 * named function.   Parameter types are converted to characters using the
@@ -310,164 +289,17 @@ struct _glapi_function {
 */
const char * parameter_signature;
 
-
/**
 * Offset in the dispatch table where the pointer to the real function is
 * located.  If the driver has not requested that the named function be
 * added to the dispatch table, this will have the value ~0.
 */
unsigned dispatch_offset;
-
-
-   /**
-* Pointer to the dispatch stub for the named function.
-* 
-* \todo
-* The semantic of this field should be changed slightly.  Currently, it
-* is always expected to be non-\c NULL.  However, it would be better to
-* only allocate the entry-point stub when the application requests the
-* function via \c glXGetProcAddress.  This would save memory for all the
-* functions that the driver exports but that the application never wants
-* to call.
-*/
-   _glapi_proc dispatch_stub;
 };
 
-
 static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS];
 static GLuint NumExtEntryPoints = 0;
 
-#ifdef USE_SPARC_ASM
-extern void __glapi_sparc_icache_flush(unsigned int *);
-#endif
-
-/**
- * Generate a dispatch function (entrypoint) which jumps through
- * the given slot number (offset) in the current dispatch table.
- * We need assembly language in order to accomplish this.
- */
-static _glapi_proc
-generate_entrypoint(GLuint functionOffset)
-{
-#if defined(USE_X86_ASM)
-   /* 32 is chosen as something of a magic offset.  For x86, the dispatch
-* at offset 32 is the first one where the offset in the
-* "jmp OFFSET*4(%eax)" can't be encoded in a single byte.
-*/
-   const GLubyte * const template_func = gl_dispatch_functions_start 
- + (DISPATCH_FUNCTION_SIZE * 32);
-   GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE);
-
-
-   if ( code != NULL ) {
-  (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE);
-  fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset );
-   }
-
-   return (_glapi_proc) code;
-#elif defined(USE_SPARC_ASM)
-
-#ifdef __arch64__
-   static const unsigned int insn_template[] = {
-  0x0500,  /* sethi%uhi(_glapi_Dispatch), %g2  */
-  0x0300,  /* sethi%hi(_glapi_Dispatch), %g1   */
-  0x8410a000,  /* or   %g2, %ulo(_glapi_Dispatch), %g2 */
-  0x82106000,  /* or   %g1, %lo(_glapi_Dispatch), %g1  */
-  0x8528b020,  /* sllx %g2, 32, %g2*/
-  0xc2584002,  /* ldx  [%g1 + %g2], %g1*/
-  0x0500,  /* sethi%hi(8 * glapioffset), %g2   */
-  0x8410a000,  /* or   %g2, %lo(8 * glapioffset), %g2  */
-  0xc6584002,  /* ldx  [%g1 + %g2], %g3*/
-  0x81c0c000,  /* jmpl %g3, %g0*/
-  0x0100   /*  nop */
-   };
-#else
-   static const unsigned int insn_template[] = {
-  0x0300,  /* sethi%

[PATCH 13/14] glx: _glapi_get_proc_address is PUBLIC

2011-03-08 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 glx/glapi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index c3447f5..4bb07e2 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -649,7 +649,7 @@ _glapi_add_dispatch( const char * const * function_names,
  * glXGetProcAddress doesn't exist in the protocol, the drivers never call
  * this themselves, and neither does the server.  warn if it happens though.
  */
-_glapi_proc
+PUBLIC _glapi_proc
 _glapi_get_proc_address(const char *funcName)
 {
 ErrorF("_glapi_get_proc_address called!\n");
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 12/14] glx: Flatten -DXFree86Server

2011-03-08 Thread Adam Jackson
Always defined by the makefile, so, just get rid of it.

Signed-off-by: Adam Jackson 
---
 glx/Makefile.am |1 -
 glx/glapi.c |   43 ---
 2 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/glx/Makefile.am b/glx/Makefile.am
index 8c7f7a5..72531f2 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -11,7 +11,6 @@ AM_CFLAGS = \
@XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \
@DRIPROTO_CFLAGS@ \
-   -DXFree86Server \
@GLX_DEFINES@ \
@GLX_ARCH_DEFINES@
 
diff --git a/glx/glapi.c b/glx/glapi.c
index f421c24..c3447f5 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -231,9 +231,6 @@ _glapi_get_dispatch(void)
 # endif
 #endif
 
-#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && 
!defined(XGLServer)
-# define NEED_FUNCTION_POINTER
-#endif
 
 /* The code in this file is auto-generated with Python */
 #include "glprocs.h"
@@ -272,46 +269,6 @@ get_static_proc_offset(const char *funcName)
 }
 
 
-#if !defined(XFree86Server) && !defined(XGLServer)
-#ifdef USE_X86_ASM
-
-#if defined( GLX_USE_TLS )
-extern   GLubyte gl_dispatch_functions_start[];
-extern   GLubyte gl_dispatch_functions_end[];
-#else
-extern const GLubyte gl_dispatch_functions_start[];
-#endif
-
-#endif /* USE_X86_ASM */
-
-
-/**
- * Return dispatch function address for the named static (built-in) function.
- * Return NULL if function not found.
- */
-static _glapi_proc
-get_static_proc_address(const char *funcName)
-{
-   const glprocs_table_t * const f = find_entry( funcName );
-   if (f) {
-#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING)
-  return (f->Address == NULL)
-? (_glapi_proc) (gl_dispatch_functions_start
- + (DISPATCH_FUNCTION_SIZE * f->Offset))
- : f->Address;
-#elif defined(DISPATCH_FUNCTION_SIZE)
-  return (_glapi_proc) (gl_dispatch_functions_start 
-+ (DISPATCH_FUNCTION_SIZE * f->Offset));
-#else
-  return f->Address;
-#endif
-   }
-   else {
-  return NULL;
-   }
-}
-
-#endif /* !defined(XFree86Server) && !defined(XGLServer) */
 
 /**
  * Extension function management.
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 10/14] glx: Lobotomize _glapi_get_proc_address

2011-03-08 Thread Adam Jackson
This isn't a meaningful thing in the indirect glx loader, so just warn
if it ever happens and move on.

Signed-off-by: Adam Jackson 
---
 glx/glapi.c |   39 ++-
 1 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index a706438..de5e7ea 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -54,6 +54,7 @@
 
 #include 
 #include 
+#include 
 #define PUBLIC _X_EXPORT
 
 #else
@@ -713,43 +714,15 @@ _glapi_add_dispatch( const char * const * function_names,
return offset;
 }
 
-/**
- * Return pointer to the named function.  If the function name isn't found
- * in the name of static functions, try generating a new API entrypoint on
- * the fly with assembly language.
+/*
+ * glXGetProcAddress doesn't exist in the protocol, the drivers never call
+ * this themselves, and neither does the server.  warn if it happens though.
  */
 _glapi_proc
 _glapi_get_proc_address(const char *funcName)
 {
-   struct _glapi_function * entry;
-   GLuint i;
-
-#ifdef MANGLE
-   if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l')
-  return NULL;
-#else
-   if (funcName[0] != 'g' || funcName[1] != 'l')
-  return NULL;
-#endif
-
-   /* search extension functions first */
-   for (i = 0; i < NumExtEntryPoints; i++) {
-  if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
- return ExtEntryTable[i].dispatch_stub;
-  }
-   }
-
-#if !defined( XFree86Server ) && !defined( XGLServer )
-   /* search static functions */
-   {
-  const _glapi_proc func = get_static_proc_address(funcName);
-  if (func)
- return func;
-   }
-#endif /* !defined( XFree86Server ) */
-
-   entry = add_function_name(funcName);
-   return (entry == NULL) ? NULL : entry->dispatch_stub;
+ErrorF("_glapi_get_proc_address called!\n");
+return NULL;
 }
 
 /**
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 11/14] glx: Update some glapi comments

2011-03-08 Thread Adam Jackson
Reviewed-by: Julien Cristau 
Signed-off-by: Adam Jackson 
---
 glx/glapi.c |   38 ++
 1 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index de5e7ea..f421c24 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -22,47 +22,21 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-
 /*
- * This file manages the OpenGL API dispatch layer.
- * The dispatch table (struct _glapi_table) is basically just a list
- * of function pointers.
- * There are functions to set/get the current dispatch table for the
- * current thread and to manage registration/dispatch of dynamically
- * added extension functions.
- *
- * It's intended that this file and the other glapi*.[ch] files are
- * flexible enough to be reused in several places:  XFree86, DRI-
- * based libGL.so, and perhaps the SGI SI.
- *
- * NOTE: There are no dependencies on Mesa in this code.
+ * This file manages the OpenGL API dispatch layer.  There are functions
+ * to set/get the current dispatch table for the current thread and to
+ * manage registration/dispatch of dynamically added extension functions.
  *
- * Versions (API changes):
- *   2000/02/23  - original version for Mesa 3.3 and XFree86 4.0
- *   2001/01/16  - added dispatch override feature for Mesa 3.5
- *   2002/06/28  - added _glapi_set_warning_func(), Mesa 4.1.
- *   2002/10/01  - _glapi_get_proc_address() will now generate new entrypoints
- * itself (using offset ~0).  _glapi_add_entrypoint() can be
- * called afterward and it'll fill in the correct dispatch
- * offset.  This allows DRI libGL to avoid probing for DRI
- * drivers!  No changes to the public glapi interface.
+ * This code was originally general enough to be shared with Mesa, but
+ * they diverged long ago, so this is now just enough support to make
+ * indirect GLX work.
  */
 
-
-
-#ifdef HAVE_DIX_CONFIG_H
-
 #include 
 #include 
 #include 
 #define PUBLIC _X_EXPORT
 
-#else
-
-#include "glheader.h"
-
-#endif
-
 #include 
 #include 
 #ifdef DEBUG
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 09/14] glx: Remove unused _glapi_set_warning_func and friends

2011-03-08 Thread Adam Jackson
These could only have been hit from the (now-removed) noop dispatch
table.

Signed-off-by: Adam Jackson 
---
 glx/glapi.c  |   23 ---
 glx/glapi.h  |6 --
 hw/xquartz/GL/indirect.c |9 -
 3 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index 9c588a6..a706438 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -72,11 +72,6 @@
 #include "glapioffsets.h"
 #include "glapitable.h"
 
-/* BEGIN NO-OP DISPATCH */
-
-static GLboolean WarnFlag = GL_FALSE;
-static _glapi_warning_func warning_func;
-
 #if defined(PTHREADS) || defined(GLX_USE_TLS)
 static void init_glapi_relocs(void);
 #endif
@@ -84,24 +79,6 @@ static void init_glapi_relocs(void);
 static _glapi_proc generate_entrypoint(GLuint functionOffset);
 static void fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset);
 
-/*
- * Enable/disable printing of warning messages.
- */
-PUBLIC void
-_glapi_noop_enable_warnings(GLboolean enable)
-{
-   WarnFlag = enable;
-}
-
-/*
- * Register a callback function for reporting errors.
- */
-PUBLIC void
-_glapi_set_warning_func( _glapi_warning_func func )
-{
-   warning_func = func;
-}
-
 /**
  * \name Current dispatch and current context control variables
  *
diff --git a/glx/glapi.h b/glx/glapi.h
index 80b53aa..b6eedc7 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -107,12 +107,6 @@ extern struct _glapi_table *_glapi_Dispatch;
  **/
 
 extern void
-_glapi_noop_enable_warnings(GLboolean enable);
-
-extern void
-_glapi_set_warning_func(_glapi_warning_func func);
-
-extern void
 _glapi_check_multithread(void);
 
 extern void
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index bdc7c3d..1375bea 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -681,17 +681,8 @@ GLuint __glFloorLog2(GLuint val)
 return c;
 }
 
-void warn_func(void * p1, char *format, ...) {
-va_list v;
-va_start(v, format);
-vfprintf(stderr, format, v);
-va_end(v);
-}
-
 static void setup_dispatch_table(void) {
 struct _glapi_table *disp=_glapi_get_dispatch();
-_glapi_set_warning_func((_glapi_warning_func)warn_func);
-_glapi_noop_enable_warnings(TRUE);
 
 /* to update:
  * for f in $(grep 'define SET_' ../../../glx/dispatch.h  | cut -f2 -d' ' 
| cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v 
by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 07/14] glx: Remove unused _glapi_get_proc_name

2011-03-08 Thread Adam Jackson
Reviewed-by: Julien Cristau 
Signed-off-by: Adam Jackson 
---
 glx/glapi.c |   49 -
 glx/glapi.h |3 ---
 2 files changed, 0 insertions(+), 52 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index fde5d76..209ae50 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -426,26 +426,6 @@ get_static_proc_address(const char *funcName)
 
 #endif /* !defined(XFree86Server) && !defined(XGLServer) */
 
-
-
-/**
- * Return the name of the function at the given offset in the dispatch
- * table.  For debugging only.
- */
-static const char *
-get_static_proc_name( GLuint offset )
-{
-   GLuint i;
-   for (i = 0; static_functions[i].Name_offset >= 0; i++) {
-  if (static_functions[i].Offset == offset) {
-return gl_string_table + static_functions[i].Name_offset;
-  }
-   }
-   return NULL;
-}
-
-
-
 /**
  * Extension function management.
  */
@@ -860,35 +840,6 @@ _glapi_get_proc_address(const char *funcName)
return (entry == NULL) ? NULL : entry->dispatch_stub;
 }
 
-
-
-/**
- * Return the name of the function at the given dispatch offset.
- * This is only intended for debugging.
- */
-const char *
-_glapi_get_proc_name(GLuint offset)
-{
-   GLuint i;
-   const char * n;
-
-   /* search built-in functions */
-   n = get_static_proc_name(offset);
-   if ( n != NULL ) {
-  return n;
-   }
-
-   /* search added extension functions */
-   for (i = 0; i < NumExtEntryPoints; i++) {
-  if (ExtEntryTable[i].dispatch_offset == offset) {
- return ExtEntryTable[i].name;
-  }
-   }
-   return NULL;
-}
-
-
-
 /**
  * Return size of dispatch table struct as number of functions (or
  * slots).
diff --git a/glx/glapi.h b/glx/glapi.h
index 9911e50..80b53aa 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -146,7 +146,4 @@ _glapi_add_dispatch( const char * const * function_names,
 extern _glapi_proc
 _glapi_get_proc_address(const char *funcName);
 
-extern const char *
-_glapi_get_proc_name(GLuint offset);
-
 #endif
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 06/14] glx: Simplify _glapi_check_multithread

2011-03-08 Thread Adam Jackson
We can guarantee that the X server does not call DRI driver services
from multiple threads, so _glapi_check_multithread need never do
anything special.  As a result, ThreadSafe is always false, so remove it
and simplify expressions where it appeared to match.

Reviewed-by: Julien Cristau 
Signed-off-by: Adam Jackson 
---
 glx/glapi.c |   49 -
 1 files changed, 4 insertions(+), 45 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index 42bf6c1..fde5d76 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -175,12 +175,6 @@ static GLint NoOpUnused(void)
  * static dispatch functions access these variables via \c _glapi_get_dispatch
  * and \c _glapi_get_context.
  *
- * There is a race condition in setting \c _glapi_Dispatch to \c NULL.  It is
- * possible for the original thread to be setting it at the same instant a new
- * thread, perhaps running on a different processor, is clearing it.  Because
- * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
- * used to determine whether or not the application is multithreaded.
- * 
  * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
  * hardcoded to \c NULL.  Instead the TLS variables \c _glapi_tls_Dispatch and
  * \c _glapi_tls_Context are used.  Having \c _glapi_Dispatch and
@@ -204,7 +198,6 @@ PUBLIC const void *_glapi_Context = NULL;
 
 #if defined(THREADS)
 
-static GLboolean ThreadSafe = GL_FALSE;  /**< In thread-safe mode? */
 _glthread_TSD _gl_DispatchTSD;   /**< Per-thread dispatch pointer */
 static _glthread_TSD ContextTSD; /**< Per-thread context pointer */
 
@@ -243,37 +236,14 @@ str_dup(const char *str)
 }
 
 
-
-/**
- * We should call this periodically from a function such as glXMakeCurrent
- * in order to test if multiple threads are being used.
+/*
+ * xserver's gl is not multithreaded, we promise.
  */
 PUBLIC void
 _glapi_check_multithread(void)
 {
-#if defined(THREADS) && !defined(GLX_USE_TLS)
-   if (!ThreadSafe) {
-  static unsigned long knownID;
-  static GLboolean firstCall = GL_TRUE;
-  if (firstCall) {
- knownID = _glthread_GetID();
- firstCall = GL_FALSE;
-  }
-  else if (knownID != _glthread_GetID()) {
- ThreadSafe = GL_TRUE;
- _glapi_set_dispatch(NULL);
- _glapi_set_context(NULL);
-  }
-   }
-   else if (!_glapi_get_dispatch()) {
-  /* make sure that this thread's dispatch pointer isn't null */
-  _glapi_set_dispatch(NULL);
-   }
-#endif
 }
 
-
-
 /**
  * Set the current context pointer for this thread.
  * The context pointer is an opaque type which should be cast to
@@ -287,7 +257,7 @@ _glapi_set_context(void *context)
_glapi_tls_Context = context;
 #elif defined(THREADS)
_glthread_SetTSD(&ContextTSD, context);
-   _glapi_Context = (ThreadSafe) ? NULL : context;
+   _glapi_Context = context;
 #else
_glapi_Context = context;
 #endif
@@ -305,13 +275,6 @@ _glapi_get_context(void)
 {
 #if defined(GLX_USE_TLS)
return _glapi_tls_Context;
-#elif defined(THREADS)
-   if (ThreadSafe) {
-  return _glthread_GetTSD(&ContextTSD);
-   }
-   else {
-  return _glapi_Context;
-   }
 #else
return _glapi_Context;
 #endif
@@ -341,7 +304,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
_glapi_tls_Dispatch = dispatch;
 #elif defined(THREADS)
_glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch);
-   _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch;
+   _glapi_Dispatch = dispatch;
 #else /*THREADS*/
_glapi_Dispatch = dispatch;
 #endif /*THREADS*/
@@ -358,10 +321,6 @@ _glapi_get_dispatch(void)
struct _glapi_table * api;
 #if defined(GLX_USE_TLS)
api = _glapi_tls_Dispatch;
-#elif defined(THREADS)
-   api = (ThreadSafe)
- ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD)
- : _glapi_Dispatch;
 #else
api = _glapi_Dispatch;
 #endif
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 05/14] glx: unifdef BEOS_THREADS

2011-03-08 Thread Adam Jackson
We don't support BeOS, so, no.

Signed-off-by: Adam Jackson 
---
 glx/glthread.c |   41 -
 glx/glthread.h |2 +-
 2 files changed, 1 insertions(+), 42 deletions(-)

diff --git a/glx/glthread.c b/glx/glthread.c
index a2d95b5..5da7e43 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,49 +179,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-/*
- * BeOS threads
- */
-#ifdef BEOS_THREADS
-
-unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) find_thread(NULL);
-}
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   tsd->key = tls_allocate();
-   tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-   return tls_get(tsd->key);
-}
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-   tls_set(tsd->key, ptr);
-}
-
-#endif /* BEOS_THREADS */
-
-
-
 #else  /* THREADS */
 
-
 /*
  * no-op functions
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index 782a2a3..28793fc 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,7 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
+#if (defined(PTHREADS) || defined(WIN32_THREADS)) \
 && !defined(THREADS)
 # define THREADS
 #endif
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 04/14] glx: unifdef USE_XTHREADS

2011-03-08 Thread Adam Jackson
xthreads is an ancient wrapper around a half dozen or so common thread
APIs, including pthreads.  Just use pthreads directly if you have it; if
you don't, get with the times.

Reviewed-by: Julien Cristau 
Signed-off-by: Adam Jackson 
---
 glx/glthread.c |   51 ---
 glx/glthread.h |   46 +-
 2 files changed, 1 insertions(+), 96 deletions(-)

diff --git a/glx/glthread.c b/glx/glthread.c
index 2d76a49..a2d95b5 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,57 +179,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) xthread_self();
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if (xthread_key_create(&tsd->key, NULL) != 0) {
-  perror(INIT_TSD_ERROR);
-  exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void *ptr;
-   if (tsd->initMagic != INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-   xthread_get_specific(tsd->key, &ptr);
-   return ptr;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-   xthread_set_specific(tsd->key, ptr);
-}
-
-#endif /* XTHREAD */
-
-
-
 /*
  * BeOS threads
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index e7e2385..782a2a3 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,8 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || \
- defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) 
\
+#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
 && !defined(THREADS)
 # define THREADS
 #endif
@@ -154,49 +153,6 @@ typedef CRITICAL_SECTION _glthread_Mutex;
 
 #endif /* WIN32_THREADS */
 
-
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-#include 
-
-typedef struct {
-   xthread_key_t key;
-   int initMagic;
-} _glthread_TSD;
-
-typedef xthread_t _glthread_Thread;
-
-typedef xmutex_rec _glthread_Mutex;
-
-#ifdef XMUTEX_INITIALIZER
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name = XMUTEX_INITIALIZER
-#else
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name
-#endif
-
-#define _glthread_INIT_MUTEX(name) \
-   xmutex_init(&(name))
-
-#define _glthread_DESTROY_MUTEX(name) \
-   xmutex_clear(&(name))
-
-#define _glthread_LOCK_MUTEX(name) \
-   (void) xmutex_lock(&(name))
-
-#define _glthread_UNLOCK_MUTEX(name) \
-   (void) xmutex_unlock(&(name))
-
-#endif /* USE_XTHREADS */
-
-
-
 /*
  * BeOS threads. R5.x required.
  */
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 03/14] glx: unifdef SOLARIS_THREADS

2011-03-08 Thread Adam Jackson
Solaris 7 and older are not supported; Solaris 8 and later have (and
use) pthreads.

Acked-by: Alan Coopersmith 
Signed-off-by: Adam Jackson 
---
 glx/glthread.c |   70 
 glx/glthread.h |   25 +---
 2 files changed, 1 insertions(+), 94 deletions(-)

diff --git a/glx/glthread.c b/glx/glthread.c
index 8b9f618..2d76a49 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -114,76 +114,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* PTHREADS */
 
-
-
-/*
- * Solaris/Unix International Threads -- Use only if POSIX threads
- *   aren't available on your Unix platform.  Solaris 2.[34] are examples
- *   of platforms where this is the case.  Be sure to use -mt and/or
- *   -D_REENTRANT when compiling.
- */
-#ifdef SOLARIS_THREADS
-#define USE_LOCK_FOR_KEY   /* undef this to try a version without
-  lock for the global key... */
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   OsAbort();   /* XXX not implemented yet */
-   return (unsigned long) 0;
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
-  (errno = thr_keycreate(&(tsd->key), free)) != 0) {
-  perror(INIT_TSD_ERROR);
-  exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void* ret;
-   if (tsd->initMagic != INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-#ifdef USE_LOCK_FOR_KEY
-   mutex_lock(&tsd->keylock);
-   thr_getspecific(tsd->key, &ret);
-   mutex_unlock(&tsd->keylock);
-#else
-   if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
-  perror(GET_TSD_ERROR);
-  exit(-1);
-   }
-#endif
-   return ret;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-  _glthread_InitTSD(tsd);
-   }
-   if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
-  perror(SET_TSD_ERROR);
-  exit(-1);
-   }
-}
-
-#undef USE_LOCK_FOR_KEY
-#endif /* SOLARIS_THREADS */
-
-
-
 /*
  * Win32 Threads.  The only available option for Windows 95/NT.
  * Be sure that you compile using the Multithreaded runtime, otherwise
diff --git a/glx/glthread.h b/glx/glthread.h
index e2765ce..e7e2385 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,9 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-
-
-#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
+#if (defined(PTHREADS) || \
  defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) 
\
 && !defined(THREADS)
 # define THREADS
@@ -127,27 +125,6 @@ typedef pthread_mutex_t _glthread_Mutex;
  * Be sure to compile with -mt on the Solaris compilers, or
  * use -D_REENTRANT if using gcc.
  */
-#ifdef SOLARIS_THREADS
-#include 
-
-typedef struct {
-   thread_key_t key;
-   mutex_t  keylock;
-   int  initMagic;
-} _glthread_TSD;
-
-typedef thread_t _glthread_Thread;
-
-typedef mutex_t _glthread_Mutex;
-
-/* XXX need to really implement mutex-related macros */
-#define _glthread_DECLARE_STATIC_MUTEX(name)  static _glthread_Mutex name = 0
-#define _glthread_INIT_MUTEX(name)  (void) name
-#define _glthread_DESTROY_MUTEX(name) (void) name
-#define _glthread_LOCK_MUTEX(name)  (void) name
-#define _glthread_UNLOCK_MUTEX(name)  (void) name
-
-#endif /* SOLARIS_THREADS */
 
 
 
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 00/14] GLX cleanup, round two

2011-03-08 Thread Adam Jackson
Largely a resend of the last series, but patches 1 and 14 are novel.

The first is _wrong_, wrong wrong wrong, but it makes piglit actually
runnable in indirect contexts so in the spirit of showing one's work
it's included.  I don't know how I'm going to fix that particular issue
yet, but I believe it's sufficiently orthogonal from the rest of the
changes that they can be vetted for correctness anyway; nothing else in
the series has anything to do with context or drawable lifecycle, so.

Patch 14 makes a pile of clutter conformance tests start passing while
introducing no regressions.  That it's a portability win is also kind
of cool.

The entire series survives piglit/quick up to the point of
glean/texCombine, whereupon llvmpipe segfaults.  Simply applying the
first patch gets only as far as glean/blendFunc before llvmpipe
segfaults.  If we limit the test results to everything up to blendFunc:

Before  After
Pass   345368
Fail22  7
Skip   209202
Total  576577

Where "before" obviously includes patch 1; it's all sadness and despair
if you don't.

Thanks to James Jones for checking that my reading of the GLX spec
appears to match what NVIDIA implements.

- ajax

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH 02/14] glx: Remove unused _glapi_get_proc_offset and friends

2011-03-08 Thread Adam Jackson
Reviewed-by: Julien Cristau 
Signed-off-by: Adam Jackson 
---
 glx/glapi.c |  107 ---
 glx/glapi.h |   19 --
 2 files changed, 0 insertions(+), 126 deletions(-)

diff --git a/glx/glapi.c b/glx/glapi.c
index d6a568e..42bf6c1 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -336,11 +336,6 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
   /* use the no-op functions */
   dispatch = (struct _glapi_table *) __glapi_noop_table;
}
-#ifdef DEBUG
-   else {
-  _glapi_check_table(dispatch);
-   }
-#endif
 
 #if defined(GLX_USE_TLS)
_glapi_tls_Dispatch = dispatch;
@@ -867,26 +862,6 @@ _glapi_add_dispatch( const char * const * function_names,
return offset;
 }
 
-
-/**
- * Return offset of entrypoint for named function within dispatch table.
- */
-PUBLIC GLint
-_glapi_get_proc_offset(const char *funcName)
-{
-   /* search extension functions first */
-   GLuint i;
-   for (i = 0; i < NumExtEntryPoints; i++) {
-  if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
- return ExtEntryTable[i].dispatch_offset;
-  }
-   }
-   /* search static functions */
-   return get_static_proc_offset(funcName);
-}
-
-
-
 /**
  * Return pointer to the named function.  If the function name isn't found
  * in the name of static functions, try generating a new API entrypoint on
@@ -965,88 +940,6 @@ _glapi_get_dispatch_table_size(void)
return DISPATCH_TABLE_SIZE;
 }
 
-
-
-/**
- * Make sure there are no NULL pointers in the given dispatch table.
- * Intended for debugging purposes.
- */
-void
-_glapi_check_table(const struct _glapi_table *table)
-{
-#ifdef DEBUG
-   const GLuint entries = _glapi_get_dispatch_table_size();
-   const void **tab = (const void **) table;
-   GLuint i;
-   for (i = 1; i < entries; i++) {
-  assert(tab[i]);
-   }
-
-   /* Do some spot checks to be sure that the dispatch table
-* slots are assigned correctly.
-*/
-   {
-  GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
-  char *BeginFunc = (char*) &table->Begin;
-  GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
-  assert(BeginOffset == _gloffset_Begin);
-  assert(BeginOffset == offset);
-   }
-   {
-  GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
-  char *viewportFunc = (char*) &table->Viewport;
-  GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
-  assert(viewportOffset == _gloffset_Viewport);
-  assert(viewportOffset == offset);
-   }
-   {
-  GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
-  char *VertexPointerFunc = (char*) &table->VertexPointer;
-  GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
-  assert(VertexPointerOffset == _gloffset_VertexPointer);
-  assert(VertexPointerOffset == offset);
-   }
-   {
-  GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
-  char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
-  GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
-  assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
-  assert(ResetMinMaxOffset == offset);
-   }
-   {
-  GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor");
-  char *blendColorFunc = (char*) &table->BlendColor;
-  GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
-  assert(blendColorOffset == _gloffset_BlendColor);
-  assert(blendColorOffset == offset);
-   }
-   {
-  GLuint secondaryColor3fOffset = 
_glapi_get_proc_offset("glSecondaryColor3fEXT");
-  char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT;
-  GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *);
-  assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT);
-  assert(secondaryColor3fOffset == offset);
-   }
-   {
-  GLuint pointParameterivOffset = 
_glapi_get_proc_offset("glPointParameterivNV");
-  char *pointParameterivFunc = (char*) &table->PointParameterivNV;
-  GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
-  assert(pointParameterivOffset == _gloffset_PointParameterivNV);
-  assert(pointParameterivOffset == offset);
-   }
-   {
-  GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
-  char *setFenceFunc = (char*) &table->SetFenceNV;
-  GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
-  assert(setFenceOffset == _gloffset_SetFenceNV);
-  assert(setFenceOffset == offset);
-   }
-#else
-   (void) table;
-#endif
-}
-
-
 #if defined(PTHREADS) || defined(GLX_USE_TLS)
 /**
  * Perform platform-specific GL API entry-point fixups.
diff --git a/glx/glapi.h b/glx/glapi.h
index 8f2cf66..9911e50 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -115,57 +115,38 @@ _glapi_set_warning_func(_glapi_warning_func func);
 extern void
 _glapi_check_multithread(void);
 
-
 extern void
 _glapi_set_context(void 

[PATCH 01/14] glx: Do something unpleasant to current drawable tracking

2011-03-08 Thread Adam Jackson
This is wrong, very wrong.  Almost as wrong as what it replaces.  Do not
merge me, ever.
---
 glx/glxcmds.c |6 --
 glx/glxext.c  |   12 
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 9b4bc9e..59df1c8 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -643,8 +643,10 @@ DoMakeCurrent(__GLXclientState *cl,
/*
** Make the previous context not current.
*/
-   if (!(*prevglxc->loseCurrent)(prevglxc)) {
-   return __glXError(GLXBadContext);
+   if (prevglxc->readPriv && prevglxc->drawPriv) {
+   if (!(*prevglxc->loseCurrent)(prevglxc)) {
+   return __glXError(GLXBadContext);
+   }
}
__glXFlushContextCache();
if (!prevglxc->isDirect) {
diff --git a/glx/glxext.c b/glx/glxext.c
index 4bd5d6b..90711f4 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -145,6 +145,7 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
if (c == __glXLastContext)
__glXFlushContextCache();
 
+#if 0
for (i = 1; i < currentMaxClients; i++) {
if (clients[i]) {
__GLXclientState *cl = glxGetClient(clients[i]);
@@ -159,13 +160,16 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
}
}
}
+#endif
}
if (c->drawPriv == glxPriv)
c->drawPriv = NULL;
if (c->readPriv == glxPriv)
c->readPriv = NULL;
+#if 0
if (!c->idExists && !c->isCurrent)
__glXFreeContext(c);
+#endif
 }
 
 glxPriv->destroy(glxPriv);
@@ -439,6 +443,14 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, 
GLXContextTag tag,
*error = __glXError(GLXBadCurrentWindow);
return 0;
}
+   if (cx->readPriv == NULL) {
+   /*
+* hack of the century
+*/
+   __glXFlushContextCache();
+   *error = 0;
+   return NULL;
+   }
 }
 
 if (cx->wait && (*cx->wait)(cx, cl, error))
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] libXfixes v5: Pointer barriers

2011-03-08 Thread Adam Jackson
On Tue, 2011-03-08 at 11:13 +1000, Peter Hutterer wrote:

> > diff --git a/include/X11/extensions/Xfixes.h 
> > b/include/X11/extensions/Xfixes.h
> > index 0c00310..b39716a 100644
> > --- a/include/X11/extensions/Xfixes.h
> > +++ b/include/X11/extensions/Xfixes.h
> > @@ -1,5 +1,6 @@
> >  /*
> >   * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
> > + * Copyright 2010 Red Hat, Inc.
> 
> this should probably be 2011 by now
> 
> Reviewed-by: Peter Hutterer 

Pushed (with updated copyright date), thanks.

- ajax


signature.asc
Description: This is a digitally signed message part
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH modular 13/15] jhbuild: Add moduleset with tarballs used for 7.6 katamari

2011-03-08 Thread Dan Nicholson
On Tue, Mar 8, 2011 at 7:25 AM, Dirk Wallenstein  wrote:
> On Sun, Mar 06, 2011 at 09:29:58AM -0800, Dan Nicholson wrote:
>> Add a moduleset for the 7.6 katamari based on xorg.modules and
>> module-list.txt. This uses the module list from 7.6 with gzipped
>> tarballs and sha1sums from announce emails (when available).
>>
>> Modules not included in the katamari have been given their most recent
>> release. It might be a good idea to group typical addons such as xinit
>> in an "extras" metamodule.
>>
>> Originally some modules had autogen-sh="configure" specified in their
>> definitions. This forced configure to be used even if autogen.sh was
>> present. This has been fixed in jhbuild commit ff2211e6.
>>
>> Signed-off-by: Dan Nicholson 
>> ---
>>  xorg-7.6.modules | 2190 
>> ++
>>  1 files changed, 2190 insertions(+), 0 deletions(-)
>>  create mode 100644 xorg-7.6.modules
>
> The last time I somehow failed to realize that jhbuild checks the shas,
> so they are correct for the source locations.  What a revelation. ;)

Yeah, and I even took the step of stripping the sha1s from the
announcement emails and using those instead of just downloading all
the tarballs and computing the sha1s myself. So, congrats X.Org. The
tarballs on www.x.org are the ones that the developers put there. :)

> Reviewed-by: Dirk Wallenstein 
> Tested-by: Dirk Wallenstein 

Thanks for doing that. I'll repost the patches you made comments on
later today (hopefully).

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH modular 13/15] jhbuild: Add moduleset with tarballs used for 7.6 katamari

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:58AM -0800, Dan Nicholson wrote:
> Add a moduleset for the 7.6 katamari based on xorg.modules and
> module-list.txt. This uses the module list from 7.6 with gzipped
> tarballs and sha1sums from announce emails (when available).
> 
> Modules not included in the katamari have been given their most recent
> release. It might be a good idea to group typical addons such as xinit
> in an "extras" metamodule.
> 
> Originally some modules had autogen-sh="configure" specified in their
> definitions. This forced configure to be used even if autogen.sh was
> present. This has been fixed in jhbuild commit ff2211e6.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg-7.6.modules | 2190 
> ++
>  1 files changed, 2190 insertions(+), 0 deletions(-)
>  create mode 100644 xorg-7.6.modules

The last time I somehow failed to realize that jhbuild checks the shas,
so they are correct for the source locations.  What a revelation. ;)

Reviewed-by: Dirk Wallenstein 
Tested-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH inputproto xi 2.1] Updates for pointer emulation and more touch device modes

2011-03-08 Thread Chase Douglas
On 03/08/2011 12:41 AM, Peter Hutterer wrote:
> On Wed, Mar 02, 2011 at 11:35:41AM -0500, Chase Douglas wrote:
>> On 03/02/2011 05:58 AM, Daniel Stone wrote:
>>> On Tue, Feb 22, 2011 at 10:06:37AM -0500, Chase Douglas wrote:
 @@ -132,16 +133,16 @@
  /* Device event flags (common) */
  /* Device event flags (key events only) */
  #define XIKeyRepeat (1 << 16)
 -/* Device event flags (pointer events only) */
 +/* Device event flags (pointer and touch events only) */
  #define XIPointerEmulated   (1 << 16)
  /* Device event flags (touch events only) */
 -#define XITouchPendingEnd   (1 << 16)
 -/* Device event flags (touch end events only) */
 -#define XITouchAccepted (1 << 17)
 +#define XITouchPendingEnd   (1 << 17)
>>>
>>> Is there any particular reason to unify the two sets of flags? I guess
>>> it can't really hurt as we shouldn't be using sixteen flags between
>>> pointer and touch, but eh.
>>
>> We don't have to unify them per se, we could leave them independent.
>> However, we need XIPointerEmulated for both touch events and pointer
>> events. As an example, through Qt one can query which touch point is
>> associated with an emulated pointer event. To do this, we need a way to
>> designate that touch in the protocol. Reusing the XIPointerEmulated flag
>> for the associated touch seems to be a reasonable solution to me.
> 
> I'm not sure how well that works in practice given that pointer events may
> be held up by grabs, whereas touch events are delivered immediately. so even
> if you have both pointer and touch event flagged, you may not get one event
> until much later.

True, this may not actually be effective for matching up a pointer event
to a touch sequence. However, it's still useful in that it tells us if a
pointer event is emulated and whether a touch sequence has generated
emulated pointer events.

A more precise solution would be to give the touch id of the emulated
touch sequence in the pointer events, but there doesn't appear to be any
fields available for this. Further, it still won't help the fact that
you may receive the emulated pointer events without ever seeing the
touch sequence, in the case of an indirect device. I think this may be
the best we can do.

 @@ -205,62 +208,145 @@ to touch the device. The init and destroy stage of 
 this sequence are always
  present, while the move stage is optional. Within this document, the term
  "touch sequence" is used to describe the above chain of events. A client
  wishing to receive touch events must register for at least TouchBegin,
 -TouchOwnership, TouchUpdate, and TouchEnd simultaneously; it may also 
 select
 -for TouchUpdateUnowned events if it wants to receive the full touch 
 stream,
 -rather than just the final state.
 +TouchUpdate, and TouchEnd simultaneously. It may also select for
 +TouchUpdateUnowned and TouchOwnership events if it wants to receive the 
 full
 +touch stream while other clients own or have active grabs involving the 
 touch.
>>>
>>> I'm not particularly happy with this hunk, as it means we'll be
>>> delivering TouchOwnership events to clients who haven't selected for
>>> them.  I think it was fairly clear as it is: you must always select for
>>> TouchBegin, TouchOwnership, TouchUpdate and TouchEnd.  If you also want
>>> unowned events, you select for TouchUpdateUnowned as well.
>>
>> When would we ever need to send an ownership event if the client didn't
>> select for it? If you don't select for ownership and update unowned, you
>> won't receive any events until you have become the owner of the touch.
>> When you receive the begin event, you already know you're the owner, so
>> an ownership event isn't needed.
> 
> daniel's approach requires that the touchbegin is sent immediately to all
> clients, the ownership when a client receives the ownership. your approach
> holds the touch begin until the client becomes the owner, thus being
> more-or-less the equivalent of the ownership event in daniel's apparoch.

Correct, in the case of selecting only for owned events.

 +grab. When a client does not select for unowned and ownership events, it 
 will
 +receive a TouchBegin event when it becomes the owner of a touch stream.
 +TouchUpdate and TouchEnd events will be received in the same manner as 
 for touch
 +grabs.
>>>
>>> I think it could be clearer to state that:
>>> * clients always receive TouchBegin events immediately before they
>>>   start receiving any other events for that touch sequence
>>> * TouchUpdateUnowned events, if selected for, will be sent while the
>>>   client does not own the touch sequence
>>> * a TouchOwnership event will be sent when the client becomes the
>>>   owner of a touch stream, followed by a sequence of TouchUpdate
>>>  

[PATCH 3/3] Remove TriStrip and TriFan from the picture screen

2011-03-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen 

These functions no longer go through the screen vtable, so remove
them and fix up the various wrappers.

Signed-off-by: Soren Sandmann 
---
 hw/dmx/dmx.h |2 -
 hw/dmx/dmxpict.c |   87 --
 hw/dmx/dmxpict.h |   10 --
 miext/cw/cw.h|2 -
 miext/cw/cw_render.c |   64 
 render/mipict.c  |2 -
 render/mipict.h  |   20 ---
 render/mitri.c   |   24 --
 render/picturestr.h  |2 -
 9 files changed, 0 insertions(+), 213 deletions(-)

diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h
index bf4b92c..c6b6199 100644
--- a/hw/dmx/dmx.h
+++ b/hw/dmx/dmx.h
@@ -249,8 +249,6 @@ typedef struct _DMXScreenInfo {
 
 TrapezoidsProcPtr  Trapezoids;
 TrianglesProcPtr   Triangles;
-TriStripProcPtrTriStrip;
-TriFanProcPtr  TriFan;
 } DMXScreenInfo;
 
 /* Global variables available to all Xserver/hw/dmx routines. */
diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c
index bbde8fd..1fb5462 100644
--- a/hw/dmx/dmxpict.c
+++ b/hw/dmx/dmxpict.c
@@ -165,8 +165,6 @@ Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr 
formats, int nformats)
 
 DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps);
 DMX_WRAP(Triangles,  dmxTriangles,  dmxScreen, ps);
-DMX_WRAP(TriStrip,   dmxTriStrip,   dmxScreen, ps);
-DMX_WRAP(TriFan, dmxTriFan, dmxScreen, ps);
 
 return TRUE;
 }
@@ -1237,88 +1235,3 @@ void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr 
pDst,
 
 DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
 }
-
-/** Composite a triangle strip on the appropriate screen.  For a
- *  complete description see the protocol document of the RENDER
- *  library. */
-void dmxTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
-PictFormatPtr maskFormat,
-INT16 xSrc, INT16 ySrc,
-int npoint, xPointFixed *points)
-{
-ScreenPtr pScreen   = pDst->pDrawable->pScreen;
-DMXScreenInfo*dmxScreen = &dmxScreens[pScreen->myNum];
-PictureScreenPtr  ps= GetPictureScreen(pScreen);
-dmxPictPrivPtrpSrcPriv  = DMX_GET_PICT_PRIV(pSrc);
-dmxPictPrivPtrpDstPriv  = DMX_GET_PICT_PRIV(pDst);
-
-DMX_UNWRAP(TriStrip, dmxScreen, ps);
-#if 0
-if (ps->TriStrip)
-   ps->TriStrip(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points);
-#endif
-
-/* Draw trapezoids on back-end server */
-if (pDstPriv->pict) {
-   XRenderPictFormat *pFormat;
-
-   pFormat = dmxFindFormat(dmxScreen, maskFormat);
-   if (!pFormat) {
-   /* FIXME: Error! */
-   }
-
-   XRenderCompositeTriStrip(dmxScreen->beDisplay,
-op,
-pSrcPriv->pict,
-pDstPriv->pict,
-pFormat,
-xSrc, ySrc,
-(XPointFixed *)points,
-npoint);
-   dmxSync(dmxScreen, FALSE);
-}
-
-DMX_WRAP(TriStrip, dmxTriStrip, dmxScreen, ps);
-}
-
-/** Composite a triangle fan on the appropriate screen.  For a complete
- *  description see the protocol document of the RENDER library. */
-void dmxTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
-  PictFormatPtr maskFormat,
-  INT16 xSrc, INT16 ySrc,
-  int npoint, xPointFixed *points)
-{
-ScreenPtr pScreen   = pDst->pDrawable->pScreen;
-DMXScreenInfo*dmxScreen = &dmxScreens[pScreen->myNum];
-PictureScreenPtr  ps= GetPictureScreen(pScreen);
-dmxPictPrivPtrpSrcPriv  = DMX_GET_PICT_PRIV(pSrc);
-dmxPictPrivPtrpDstPriv  = DMX_GET_PICT_PRIV(pDst);
-
-DMX_UNWRAP(TriFan, dmxScreen, ps);
-#if 0
-if (ps->TriFan)
-   ps->TriFan(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points);
-#endif
-
-/* Draw trapezoids on back-end server */
-if (pDstPriv->pict) {
-   XRenderPictFormat *pFormat;
-
-   pFormat = dmxFindFormat(dmxScreen, maskFormat);
-   if (!pFormat) {
-   /* FIXME: Error! */
-   }
-
-   XRenderCompositeTriFan(dmxScreen->beDisplay,
-  op,
-  pSrcPriv->pict,
-  pDstPriv->pict,
-  pFormat,
-  xSrc, ySrc,
-  (XPointFixed *)points,
-  npoint);
-   dmxSync(dmxScreen, FALSE);
-}
-
-DMX_WRAP(TriFan, dmxTriFan, dmxScreen, ps);
-}
diff --git a/hw/dmx/dmxpict.h b/hw/dmx/dmxpict.h
index 3c8a09c..a732991 100644
--- a/hw/dmx/dmxpict.h
+++ b/hw/dmx/dmxpict.h
@@ -100,16 +100,6 @@ extern void dmxTriangles(CARD8 op,
 PictFormatPtr maskFormat,
 

[PATCH 2/3] Absorb miTriStrip() into CompositeTriStrip()

2011-03-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen 

There is no need to virtualize this function that nobody cares about.

Signed-off-by: Soren Sandmann 
---
 render/mitri.c   |   19 ---
 render/picture.c |   22 ++
 2 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/render/mitri.c b/render/mitri.c
index c74192c..2ca7cc4 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -77,25 +77,6 @@ miTriStrip (CARD8op,
int npoint,
xPointFixed *points)
 {
-ScreenPtr  pScreen = pDst->pDrawable->pScreen;
-PictureScreenPtrps = GetPictureScreen(pScreen);
-xTriangle  *tris, *tri;
-intntri;
-
-if (npoint < 3)
-   return;
-ntri = npoint - 2;
-tris = malloc(ntri * sizeof (xTriangle));
-if (!tris)
-   return;
-for (tri = tris; npoint >= 3; npoint--, points++, tri++)
-{
-   tri->p1 = points[0];
-   tri->p2 = points[1];
-   tri->p3 = points[2];
-}
-(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-free(tris);
 }
 
 void
diff --git a/render/picture.c b/render/picture.c
index e16163a..015d633 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1773,11 +1773,25 @@ CompositeTriStrip (CARD8op,
   int  npoints,
   xPointFixed  *points)
 {
-PictureScreenPtr   ps = GetPictureScreen(pDst->pDrawable->pScreen);
+ScreenPtr   pScreen = pDst->pDrawable->pScreen;
+PictureScreenPtrps = GetPictureScreen(pScreen);
+xTriangle   *tris, *tri;
+int ntri;
 
-ValidatePicture (pSrc);
-ValidatePicture (pDst);
-(*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+if (npoints < 3)
+return;
+ntri = npoints - 2;
+tris = malloc(ntri * sizeof (xTriangle));
+if (!tris)
+return;
+for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+{
+tri->p1 = points[0];
+tri->p2 = points[1];
+tri->p3 = points[2];
+}
+CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+free(tris);
 }
 
 void
-- 
1.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/3] Absorb miTriFan() into CompositeTriFan()

2011-03-08 Thread Søren Sandmann
From: Søren Sandmann Pedersen 

There is no need to virtualize this function that nobody cares about.

Signed-off-by: Soren Sandmann 
---
 render/mitri.c   |   21 -
 render/picture.c |   23 +++
 2 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/render/mitri.c b/render/mitri.c
index b258c21..c74192c 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -108,25 +108,4 @@ miTriFan (CARD8op,
  int   npoint,
  xPointFixed   *points)
 {
-ScreenPtr  pScreen = pDst->pDrawable->pScreen;
-PictureScreenPtrps = GetPictureScreen(pScreen);
-xTriangle  *tris, *tri;
-xPointFixed*first;
-intntri;
-
-if (npoint < 3)
-   return;
-ntri = npoint - 2;
-tris = malloc(ntri * sizeof (xTriangle));
-if (!tris)
-   return;
-first = points++;
-for (tri = tris; npoint >= 3; npoint--, points++, tri++)
-{
-   tri->p1 = *first;
-   tri->p2 = points[0];
-   tri->p3 = points[1];
-}
-(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-free(tris);
 }
diff --git a/render/picture.c b/render/picture.c
index 0028cc7..e16163a 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1790,11 +1790,26 @@ CompositeTriFan (CARD8  op,
 intnpoints,
 xPointFixed*points)
 {
-PictureScreenPtr   ps = GetPictureScreen(pDst->pDrawable->pScreen);
+ScreenPtr  pScreen = pDst->pDrawable->pScreen;
+xTriangle  *tris, *tri;
+xPointFixed*first;
+intntri;
 
-ValidatePicture (pSrc);
-ValidatePicture (pDst);
-(*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+if (npoints < 3)
+   return;
+ntri = npoints - 2;
+tris = malloc(ntri * sizeof (xTriangle));
+if (!tris)
+   return;
+first = points++;
+for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+{
+   tri->p1 = *first;
+   tri->p2 = points[0];
+   tri->p3 = points[1];
+}
+CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+free(tris);
 }
 
 void
-- 
1.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[libXt:PATCH] XtAsprintf: Fix memory corruption.

2011-03-08 Thread Cyril Brulebois
Don't write the null terminator to a random place, this can trigger some
segfault in XtOpenDisplay() and other annoyances.

Debian Bug #617208 

Signed-off-by: Cyril Brulebois 
---
 src/Alloc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Alan Coopersmith wrote:
> I can't see why that would make XtAsprintf operate any differently though.

Apparently, having HOME=/ makes the memory corruption hit XtOpenDisplay()'s
%esi register, where app happens to be stored. And right after writing the
null terminator at the wrong place, %esi becomes 0 in XtOpenDisplay()'s
frame. Kaboom.


diff --git a/src/Alloc.c b/src/Alloc.c
index 67413ab..be643a8 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -147,7 +147,7 @@ Cardinal XtAsprintf(
 if (len < sizeof(buf))
 {
strncpy(*new_string, buf, len);
-   new_string[len] = '\0';
+   (*new_string)[len] = '\0';
 }
 else
 {
-- 
1.7.4.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 15/15] release.sh: Update jhbuild moduleset with --moduleset

2011-03-08 Thread Dirk Wallenstein
On Tue, Mar 08, 2011 at 05:19:38AM -0800, Dan Nicholson wrote:
> On Tue, Mar 8, 2011 at 1:11 AM, Dirk Wallenstein  wrote:
> > On Sun, Mar 06, 2011 at 09:30:00AM -0800, Dan Nicholson wrote:
> >> In order to keep the katamari moduleset up to date with current tarball
> >> information, have release.sh update the file when new releases are made.
> >> This is enabled by passing a module file with --moduleset.
> >>
> >> Signed-off-by: Dan Nicholson 
> >> ---
> >>  release.sh |   23 +++
> >>  1 files changed, 23 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/release.sh b/release.sh
> >> index ea4d9c9..a88a0c0 100755
> >> --- a/release.sh
> >> +++ b/release.sh
> >> @@ -12,6 +12,7 @@ host_xorg=xorg.freedesktop.org
> >>  host_dri=dri.freedesktop.org
> >>  user=
> >>  remote=origin
> >> +moduleset=
> >>
> >>  usage()
> >>  {
> >> @@ -24,6 +25,7 @@ Options:
> >>    --help        this help message
> >>    --ignore-local-changes        don't abort on uncommitted local changes
> >>    --remote      git remote where the change should be pushed (default 
> >> "origin")
> >> +  --moduleset   jhbuild moduleset to update with relase info
> >>  HELP
> >>  }
> >>
> >> @@ -107,6 +109,11 @@ while [ $# != 0 ]; do
> >>          remote=$1
> >>          shift
> >>          ;;
> >> +    --moduleset)
> >> +        shift
> >> +        moduleset=$1
> >> +        shift
> >> +        ;;
> >>      --*)
> >>          echo "error: unknown option"
> >>          usage
> >> @@ -198,6 +205,14 @@ if [ -z "$tag_previous" ] ||
> >>      exit 1
> >>  fi
> >>
> >> +if [ -n "$moduleset" ]; then
> >> +    echo "checking for moduleset"
> >> +    if ! [ -w "$moduleset" ]; then
> >> +        echo "moduleset $moduleset does not exist or is not writable"
> >> +        exit 1
> >> +    fi
> >> +fi
> >> +
> >>  if [ "$section" = "libdrm" ]; then
> >>      section_path="libdrm"
> >>      srv_path="/srv/$host_dri/www/$section_path"
> >> @@ -236,6 +251,14 @@ echo "generating announce mail template, remember to 
> >> sign it"
> >>  gen_announce_mail >$announce
> >>  echo "    at: $announce"
> >>
> >> +if [ -n "$moduleset" ]; then
> >> +    echo "updating moduleset $moduleset"
> >> +    modulardir=`dirname "$0"`
> >> +    # pass sha1sum output as 2 arguments
> >> +    sha1sum=`cd $tarball_dir && $SHA1SUM $targz`
> >> +    $modulardir/update-moduleset.sh $moduleset $sha1sum
> >
> > The $targz argument is missing here.
> 
> I tried to explain this in the comment. The output of sha1sum is 2
> pieces: the hash and the file. So, $targz is built into $sha1sum. That
Oh, I see.
> may seem a little too magical, but it also seemed silly to split the
> sha1sum output only to tack back on the tarball. This is also why I
> reordered the arguments in update-moduleset.sh. What do you think?

I think it really would serve clarity to have only the sha1sum in there.
Alternatively, maybe rename the variable to sha1sum_output or similar,
but my preference is clearly on just the sha1sum.

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Xi: fix XI2 passive grab reply length calculation

2011-03-08 Thread Daniel Stone
On Tue, Mar 08, 2011 at 02:44:02PM +1000, Peter Hutterer wrote:
> If modifiers failed, the reply length was 4 bytes too short.
> 
> Signed-off-by: Peter Hutterer 

This only works because xXIGrabModifierInfo is a multiple of 32, else
rounding would ruin your day, but:
Reviewed-by: Daniel Stone 

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] xfree86: block signals between EnableDevice and first CheckMotion()

2011-03-08 Thread Daniel Stone
On Tue, Mar 08, 2011 at 11:18:50AM +1000, Peter Hutterer wrote:
> Devices usually enable SIGIO processing in EnableDevice. CheckMotion
> initialises the pointer sprite, sends Enter/Leave events, etc. This leaves
> us with a small window where events may be processed without the sprite or
> pointer position (as seen from the protocol) is valid.
> Block signals during this window.
> 
> Signed-off-by: Peter Hutterer 

Reviewed-by: Daniel Stone 


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH modular] build.sh: add support for git submodules

2011-03-08 Thread Gaetan Nadon
Currently xcb/util is the first package to use a git submodule.
When cloning, the script will init and update the submodule.
Older versions of git do not have --recursive option for git clone.

When using -p (pull rebase), the script will update the submodule.

Signed-off-by: Gaetan Nadon 
---
 build.sh |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/build.sh b/build.sh
index 0a20a4d..b2d124b 100755
--- a/build.sh
+++ b/build.sh
@@ -309,6 +309,27 @@ clone() {
 clonefailed_components="$clonefailed_components $module/$component"
 return 1
 fi
+   old_pwd=`pwd`
+   cd $DIR
+   if [ $? -ne 0 ]; then
+echo "Failed to cd to $module module component $component. 
Ignoring."
+clonefailed_components="$clonefailed_components $module/$component"
+return 1
+   return 1
+   fi
+   git submodule init
+if [ $? -ne 0 ]; then
+echo "Failed to initialize $module module component $component 
submodule. Ignoring."
+clonefailed_components="$clonefailed_components $module/$component"
+return 1
+fi
+   git submodule update
+if [ $? -ne 0 ]; then
+echo "Failed to update $module module component $component 
submodule. Ignoring."
+clonefailed_components="$clonefailed_components $module/$component"
+return 1
+fi
+   cd ${old_pwd}
 else
 echo "git cannot clone into an existing directory $module/$component"
return 1
@@ -390,6 +411,12 @@ process() {
cd $old_pwd
return 1
fi
+   # The parent module knows which commit the submodule should be at
+   git submodule update
+if [ $? -ne 0 ]; then
+   failed "git submodule update" $module $component
+return 1
+fi
 fi
 
 # Build outside source directory
-- 
1.6.0.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: RandR 1.4 restart

2011-03-08 Thread Soeren Sandmann
James Jones  writes:

> Interesting.  I'm not really sold on the switch to InputOnly windows though.  
> It sounds very elegant in theory, but I don't like the idea of apps needing 
> to 
> use a separate codepath depending on whether a composite manager is running, 
> and I'm not convinced it doesn't have other side effects.  I'll definitely 
> have to give it some more thought though.

It will require changes to the applications, yes. For GTK+ I think the
main complication is the fact applications can create subwindows, and
then ask for an XID for those subwindows. These applications will expect
that XID to be an InputOutput window, which would be impossible if the
toplevel was an InputOnly.

This issue is not insurmountable though, since getting the XID for a
GTK+ window is a rarely-used feature and increasingly considered
somewhat deprecated.


Soren
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 05/15] jhbuild: Build openchrome driver from svn

2011-03-08 Thread Dan Nicholson
On Mon, Mar 7, 2011 at 7:05 AM, Dirk Wallenstein  wrote:
> On Mon, Mar 07, 2011 at 05:13:42AM -0800, Dan Nicholson wrote:
>> On Mon, Mar 7, 2011 at 3:15 AM, Dirk Wallenstein  wrote:
>> > On Sun, Mar 06, 2011 at 09:29:50AM -0800, Dan Nicholson wrote:
>> >> Since the openchrome driver is being distributed in the katamari, it
>> >> makes sense to build it here even if it's not under X.Org.
>> >>
>> >> Signed-off-by: Dan Nicholson 
>> >> ---
>> >>  xorg.modules |   11 +++
>> >>  1 files changed, 11 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/xorg.modules b/xorg.modules
>> >> index deef23e..817e6b9 100644
>> >> --- a/xorg.modules
>> >> +++ b/xorg.modules
>> >> @@ -7,6 +7,8 @@
>> >>  
>> >>    > >>                href="git://anongit.freedesktop.org/git/"/>
>> >> +  > >> +              href="http://svn.openchrome.org/"/>
>> >>
>> >>    
>> >>      > >> @@ -1285,6 +1287,14 @@
>> >>      
>> >>    
>> >>
>> >> +  
>> >> +    > >
>> > This should be:
>> >       >
>> I actually should have said something about this in the commit
>> message. The openchrome svn setup is a little unusual in that it
>> doesn't have it's own project subdirectory. Instead, it's the root
>> directory.  jhbuild will take the trunk branch by default. If the root
>> of the openchrome repository is http://svn.openchrome.org/, then
>> adding on the module subdirectory of "svn" and the revision
>> subdirectory (implicitly) of "trunk", then the path will be
>> http://svn.openchrome.org/svn/trunk. This allows you to set revision
>> in the branch definition and get resolved correctly to a branch or
>> tag. I actually had to do a bit of trial and error to get it right. I
>> was comparing it to this abiword definition in gnome-apps-3.0.modules.
>>
>> http://git.gnome.org/browse/jhbuild/tree/modulesets/gnome-apps-3.0.modules
>>
>> But I think you've worked with jhbuild a lot more than I have. What's
>> the right way to handle svn repos?
>
> Oh, actually this is the only svn-repo I experimented with myself --
> also trial and error.  It's just that it did not work without explicit
> 'trunk', but that might be a fault of my patched jhbuild version.
> If it works with a standard jhbuild it's probably ok.

I'm apparently on a December 9 commit.

$ git describe
2.30.2-626-g4f1d851

I'll try this out with the last released version (2.30.2) as well as a
more current master when I get the chance.

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXt 3/3] Convert ALLOCATE_LOCAL + sprintf to XtAsprintf

2011-03-08 Thread walter harms

the only place where a change is, is  CombineAppUserDefaults()
can you set XAPPLRESDIR to see if both paths generate the same error ?


re,
 wh

Am 08.03.2011 12:45, schrieb Cyril Brulebois:
> Alan Coopersmith  (07/03/2011):
>> Perhaps a difference in the setting of $HOME or one of the other
>> environment variables that GetRootDirName checks for the homedir?
> 
> Indeed, '/' when starting from init, '/root' when starting later as
> root. I tried unsetting a few variables (HOME, USER, etc.), but I
> couldn't reproduce this behaviour after init; so I configured root's
> homedir to be '/', and could reproduce the issue with just running
> 'xdm'. yay.
> 
>> I can't see why that would make XtAsprintf operate any differently
>> though.
> 
> Now, both XtAsprintf and asprintf return the same path, which is
> nice. But I *think* there's some side effect somewhere.
> 
> The core left behind says:
> | Program terminated with signal 11, Segmentation fault.
> | #0  XtOpenDisplay (app=0x0, displayName=0x9a0d788 ":0", applName=0x80660b9 
> "xlogin",
> | className=0x80660b2 "Xlogin", urlist=0x0, num_urs=0, argc=0x8069ef0, 
> argv=0x8067c2c)
> | at ../../src/Display.c:313
> | 313 UNLOCK_APP(app);
> 
> So, one may ask (and Julien did): “WTH would app be NULL as this point?”
> 
> The codepath, from XtOpenDisplay is (all of those under src/):
>   ...   XtAsprintf or asprintf
>   Initialize.c: CombineAppUserDefaults
>   Initialize.c: XtScreenDatabase
>   Initialize.c: _XtDisplayInitialize
>   Display.c:XtOpenDisplay
> 
> So, let's add a check in Display.c:
> | XtOpenDisplay(…) {
> | …
> | fprintf(stderr, "[before init] app=%p\n", app);
> | _XtDisplayInitialize(d, pd, applName, urlist, num_urs, argc, 
> argv);
> | fprintf(stderr, "[after  init] app=%p\n", app);
> | …
> | }
> (xdm.log has the output.)
> 
> And tada!
>  1. app is non-NULL before calling _XtDisplayInitialize
>  2. app is non-NULL (and the same value, woot) afterwards, if using
> asprintf().
>  3. app is NULL afterwards, if using XtAsprintf().
> 
> KiBi.
> 
> 
> 
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH modular 01/15] jhbuild: Clean up formatting of xorg.modules

2011-03-08 Thread Dan Nicholson
On Tue, Mar 8, 2011 at 1:01 AM, Dirk Wallenstein  wrote:
> On Sun, Mar 06, 2011 at 09:29:46AM -0800, Dan Nicholson wrote:
>> Signed-off-by: Dan Nicholson 
>> ---
>>  xorg.modules |  748 
>> +++---
>>  1 files changed, 555 insertions(+), 193 deletions(-)
>
> Reviewed-by: Dirk Wallenstein 

Thanks for all the reviews!

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH modular 15/15] release.sh: Update jhbuild moduleset with --moduleset

2011-03-08 Thread Dan Nicholson
On Tue, Mar 8, 2011 at 1:11 AM, Dirk Wallenstein  wrote:
> On Sun, Mar 06, 2011 at 09:30:00AM -0800, Dan Nicholson wrote:
>> In order to keep the katamari moduleset up to date with current tarball
>> information, have release.sh update the file when new releases are made.
>> This is enabled by passing a module file with --moduleset.
>>
>> Signed-off-by: Dan Nicholson 
>> ---
>>  release.sh |   23 +++
>>  1 files changed, 23 insertions(+), 0 deletions(-)
>>
>> diff --git a/release.sh b/release.sh
>> index ea4d9c9..a88a0c0 100755
>> --- a/release.sh
>> +++ b/release.sh
>> @@ -12,6 +12,7 @@ host_xorg=xorg.freedesktop.org
>>  host_dri=dri.freedesktop.org
>>  user=
>>  remote=origin
>> +moduleset=
>>
>>  usage()
>>  {
>> @@ -24,6 +25,7 @@ Options:
>>    --help        this help message
>>    --ignore-local-changes        don't abort on uncommitted local changes
>>    --remote      git remote where the change should be pushed (default 
>> "origin")
>> +  --moduleset   jhbuild moduleset to update with relase info
>>  HELP
>>  }
>>
>> @@ -107,6 +109,11 @@ while [ $# != 0 ]; do
>>          remote=$1
>>          shift
>>          ;;
>> +    --moduleset)
>> +        shift
>> +        moduleset=$1
>> +        shift
>> +        ;;
>>      --*)
>>          echo "error: unknown option"
>>          usage
>> @@ -198,6 +205,14 @@ if [ -z "$tag_previous" ] ||
>>      exit 1
>>  fi
>>
>> +if [ -n "$moduleset" ]; then
>> +    echo "checking for moduleset"
>> +    if ! [ -w "$moduleset" ]; then
>> +        echo "moduleset $moduleset does not exist or is not writable"
>> +        exit 1
>> +    fi
>> +fi
>> +
>>  if [ "$section" = "libdrm" ]; then
>>      section_path="libdrm"
>>      srv_path="/srv/$host_dri/www/$section_path"
>> @@ -236,6 +251,14 @@ echo "generating announce mail template, remember to 
>> sign it"
>>  gen_announce_mail >$announce
>>  echo "    at: $announce"
>>
>> +if [ -n "$moduleset" ]; then
>> +    echo "updating moduleset $moduleset"
>> +    modulardir=`dirname "$0"`
>> +    # pass sha1sum output as 2 arguments
>> +    sha1sum=`cd $tarball_dir && $SHA1SUM $targz`
>> +    $modulardir/update-moduleset.sh $moduleset $sha1sum
>
> The $targz argument is missing here.

I tried to explain this in the comment. The output of sha1sum is 2
pieces: the hash and the file. So, $targz is built into $sha1sum. That
may seem a little too magical, but it also seemed silly to split the
sha1sum output only to tack back on the tarball. This is also why I
reordered the arguments in update-moduleset.sh. What do you think?

--
Dan
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXt 3/3] Convert ALLOCATE_LOCAL + sprintf to XtAsprintf

2011-03-08 Thread Cyril Brulebois
Alan Coopersmith  (07/03/2011):
> Perhaps a difference in the setting of $HOME or one of the other
> environment variables that GetRootDirName checks for the homedir?

Indeed, '/' when starting from init, '/root' when starting later as
root. I tried unsetting a few variables (HOME, USER, etc.), but I
couldn't reproduce this behaviour after init; so I configured root's
homedir to be '/', and could reproduce the issue with just running
'xdm'. yay.

> I can't see why that would make XtAsprintf operate any differently
> though.

Now, both XtAsprintf and asprintf return the same path, which is
nice. But I *think* there's some side effect somewhere.

The core left behind says:
| Program terminated with signal 11, Segmentation fault.
| #0  XtOpenDisplay (app=0x0, displayName=0x9a0d788 ":0", applName=0x80660b9 
"xlogin",
| className=0x80660b2 "Xlogin", urlist=0x0, num_urs=0, argc=0x8069ef0, 
argv=0x8067c2c)
| at ../../src/Display.c:313
| 313 UNLOCK_APP(app);

So, one may ask (and Julien did): “WTH would app be NULL as this point?”

The codepath, from XtOpenDisplay is (all of those under src/):
  ...   XtAsprintf or asprintf
  Initialize.c: CombineAppUserDefaults
  Initialize.c: XtScreenDatabase
  Initialize.c: _XtDisplayInitialize
  Display.c:XtOpenDisplay

So, let's add a check in Display.c:
| XtOpenDisplay(…) {
| …
| fprintf(stderr, "[before init] app=%p\n", app);
| _XtDisplayInitialize(d, pd, applName, urlist, num_urs, argc, 
argv);
| fprintf(stderr, "[after  init] app=%p\n", app);
| …
| }
(xdm.log has the output.)

And tada!
 1. app is non-NULL before calling _XtDisplayInitialize
 2. app is non-NULL (and the same value, woot) afterwards, if using
asprintf().
 3. app is NULL afterwards, if using XtAsprintf().

KiBi.


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:libXt] Bug 34715: XtAppMainLoop doesn't work without a Display

2011-03-08 Thread walter harms


Am 07.03.2011 22:19, schrieb Alan Coopersmith:
> On 03/ 7/11 03:00 AM, walter harms wrote:
>>
>>
>> Am 06.03.2011 21:53, schrieb Alan Coopersmith:
>>> From: Jordan Hayes 
>>>
>>> https://bugs.freedesktop.org/show_bug.cgi?id=34715
>>>
>>> XtAppNextEvent() doesn't return until there's an actual XEvent to be
>>> handled; it handles Xt-internal events (inputs, timers, signals)
>>> itself, but doesn't return (because of course, those aren't XEvents).
>>> Which means that the exit flag doesn't get a chance to break the loop
>>> until/unless there's an actual XEvent.
>>>
>>> Signed-off-by: Alan Coopersmith 
>>
>> looks ok to me
>>
>> Signed-off-by: Walter Harms 
> 
> Do you mean Reviewed-by ?
> 
> http://www.x.org/wiki/Development/Documentation/SubmittingPatches#Signingoffandreviewing
> 
> I added signed-off-by as the committer doing the integration (and I did
> change one more line than jordan - deleting the now unused event variable).
> Ideally Jordan as original author would also reply with his Signed-off-by
> as well.


yes, sorry my fault.

re,
 wh
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration

2011-03-08 Thread Erkki Seppälä
There were two memory leaks in the function: one was the lack of free
for "enabled", the other was the full lack of releasing anything when
configuration was too small. The first issue was fixed by adding the
missing free, the other was addressed by replacing the duplicate
memory releasing sequences with one that is gotoed into.

Reviewed-by: Rami Ylimäki 
Signed-off-by: Erkki Seppälä 
---
 hw/xfree86/modes/xf86Crtc.c |   21 -
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 9a5e50a..7eaecdb 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2353,6 +2353,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 inti = scrn->scrnIndex;
 Bool have_outputs = TRUE;
 Bool ret;
+Bool success = FALSE;
 
 /* Set up the device options */
 config->options = xnfalloc (sizeof (xf86DeviceOptions));
@@ -2411,11 +2412,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
  * Set the position of each output
  */
 if (!xf86InitialOutputPositions (scrn, modes))
-{
-   free(crtcs);
-   free(modes);
-   return FALSE;
-}
+   goto bailout;
 
 /*
  * Set initial panning of each output
@@ -2426,11 +2423,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
  * Assign CRTCs to fit output configuration
  */
 if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
-{
-   free(crtcs);
-   free(modes);
-   return FALSE;
-}
+   goto bailout;
 
 /* XXX override xf86 common frame computation code */
 
@@ -2507,7 +2500,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
  * Make sure the configuration isn't too small.
  */
 if (width < config->minWidth || height < config->minHeight)
-   return FALSE;
+   goto bailout;
 
 /*
  * Limit the crtc config to virtual[XY] if the driver can't grow the
@@ -2530,10 +2523,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool 
canGrow)
   xf86CVTMode(width, height, 60, 0, 0));
 }
 
-
+success = TRUE;
+ bailout:
 free(crtcs);
 free(modes);
-return TRUE;
+free(enabled);
+return success;
 }
 
 /*
-- 
1.7.0.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] xfree86/common: Removed a configScreen leak when conf_screen is NULL

2011-03-08 Thread Erkki Seppälä
configScreen used a dynamically allocated buffer for XF86ConfScreenRec
when conf_screen argument was NULL. This pointer was never stored
anywhere, nor was it released, so this patch makes the function use
automatically allocated storage in that situation.

Reviewed-by: Rami Ylimäki 
Signed-off-by: Erkki Seppälä 
---
 hw/xfree86/common/xf86Config.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 28786ba..906d4bd 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1829,9 +1829,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr 
conf_screen, int scrnum,
 XF86ConfDisplayPtr dispptr;
 XF86ConfAdaptorLinkPtr conf_adaptor;
 Bool defaultMonitor = FALSE;
+XF86ConfScreenRec local_conf_screen; /* used only if conf_screen is NULL */
 
 if (!conf_screen) {
-conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+memset(&local_conf_screen, 0, sizeof(local_conf_screen));
+conf_screen = &local_conf_screen;
 conf_screen->scrn_identifier = "Default Screen Section";
 xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
 }
-- 
1.7.0.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH v2 evdev 3/3] Remove constness of device filename to avoid warning when freed.

2011-03-08 Thread Rami Ylimäki
A warning from free() can be avoided by casting the constness away
from its argument pointer or by not declaring the pointer as const in
the first place.

Signed-off-by: Rami Ylimäki 
---
 src/evdev.c |2 +-
 src/evdev.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index db62375..474d20d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2171,7 +2171,7 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int 
flags)
 /* Release strings allocated in EvdevAddKeyClass. */
 XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE);
 /* Release string allocated in EvdevOpenDevice. */
-free((void *)pEvdev->device); /* (const char *) */
+free(pEvdev->device);
 pEvdev->device = NULL;
 }
 xf86DeleteInput(pInfo, flags);
diff --git a/src/evdev.h b/src/evdev.h
index f640fdd..80e4580 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -116,7 +116,7 @@ typedef struct {
 } EventQueueRec, *EventQueuePtr;
 
 typedef struct {
-const char *device;
+char *device;
 int grabDevice; /* grab the event device? */
 
 int num_vals;   /* number of valuators */
-- 
1.6.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH v2 evdev 2/3] Release leaked device identifier on input device disconnect.

2011-03-08 Thread Rami Ylimäki
Signed-off-by: Rami Ylimäki 
Reviewed-by: Erkki Seppälä 
---
 src/evdev.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 18b7246..db62375 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2170,6 +2170,9 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int 
flags)
 {
 /* Release strings allocated in EvdevAddKeyClass. */
 XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE);
+/* Release string allocated in EvdevOpenDevice. */
+free((void *)pEvdev->device); /* (const char *) */
+pEvdev->device = NULL;
 }
 xf86DeleteInput(pInfo, flags);
 }
-- 
1.6.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH v2 evdev 1/3] Release leaked XKB options on input device disconnect.

2011-03-08 Thread Rami Ylimäki
Currently the XKB options duplicated in EvdevAddKeyClass are never
released. For example, connecting and disconnecting a bluetooth
keyboard repeatedly causes a steadily growing memory leak.

Signed-off-by: Rami Ylimäki 
Reviewed-by: Erkki Seppälä 
---
 src/evdev.c |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 45873c1..18b7246 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2162,6 +2162,18 @@ EvdevOpenDevice(InputInfoPtr pInfo)
 return Success;
 }
 
+static void
+EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+EvdevPtr pEvdev = pInfo ? pInfo->private : NULL;
+if (pEvdev)
+{
+/* Release strings allocated in EvdevAddKeyClass. */
+XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE);
+}
+xf86DeleteInput(pInfo, flags);
+}
+
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
 static int NewEvdevPreInit(InputDriverPtr, InputInfoPtr, int);
 
@@ -2198,7 +2210,7 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 }
 
 
-xf86DeleteInput(pInfo, 0);
+EvdevUnInit(drv, pInfo, 0);
 return NULL;
 }
 
@@ -2277,7 +2289,7 @@ _X_EXPORT InputDriverRec EVDEV = {
 "evdev",
 NULL,
 EvdevPreInit,
-NULL,
+EvdevUnInit,
 NULL,
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
 evdevDefaults
-- 
1.6.3.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH v2 evdev 0/3] Memory leak fixes.

2011-03-08 Thread Rami Ylimäki
v2:

XKB options are now released with XkbFreeRMLVOSet.

The first version of these patches assigned a dynamically allocated
device filename to a const pointer. Calling free with this pointer
causes a warning, but this warning was suppressed by casting its
constness away when calling free. The warning could be alternatively
avoided by not using a const pointers in the first place.

In my opinion, using const pointer in this case is completely
fine. Removing the constness just because the string is dynamically
allocated isn't necessary. Therefore I prefer keeping the cast instead
of removing the constness of device filename string.

However, patch 3 of this series can be squashed with the 2nd patch to
remove the constness. Otherwise the 3rd patch could be just dropped.

Rami Ylimäki (3):
  Release leaked XKB options on input device disconnect.
  Release leaked device identifier on input device disconnect.
  Remove constness of device filename to avoid warning when freed.

 src/evdev.c |   19 +--
 src/evdev.h |2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Xi: fix XI2 passive grab reply length calculation

2011-03-08 Thread Julien Cristau
On Tue, Mar  8, 2011 at 14:44:02 +1000, Peter Hutterer wrote:

> If modifiers failed, the reply length was 4 bytes too short.
> 
> Signed-off-by: Peter Hutterer 
> ---
>  Xi/xipassivegrab.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
> index 8663d12..3319ef9 100644
> --- a/Xi/xipassivegrab.c
> +++ b/Xi/xipassivegrab.c
> @@ -191,7 +191,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
>  info->status = status;
>  info->modifiers = *modifiers;
>  rep.num_modifiers++;
> -rep.length++;
> +rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
>  }
>  }
>  
> @@ -199,7 +199,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
>  if (rep.num_modifiers)
>  {
>   client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
> -WriteSwappedDataToClient(client, rep.num_modifiers * 4, 
> (char*)modifiers_failed);
> +WriteSwappedDataToClient(client, rep.length * 4, 
> (char*)modifiers_failed);
>  }
>  free(modifiers_failed);
>  return ret;

Reviewed-by: Julien Cristau 

I have a doubt about the swap function though.  Swap32Write seems fine
for xXIGrabModifierInfo::modifiers, not so much for ::status?

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: Memory corruption with xbindkeys and xcb 1.7-2 (debian)

2011-03-08 Thread Oliver McFadden
On Mon, 2011-03-07 at 12:04 -0500, ext Peter Harris wrote:
> On 2011-03-07 11:28, Oliver McFadden wrote:
> > I am not sure whether this is a known issue, but anyway, I am seeing
> > xbindkeys crashing after a few button presses. Perhaps this should go to
> > the xbindkeys developers, but I'm reasonably sure this is a bug in xcb.
> 
> This looks a lot like a known (not xcb) issue:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=32072
> 
> which references:
> 
> https://bugs.archlinux.org/task/21924
> 
> which says it's fixed in xbindkeys 1.8.4. Debian is still on 1.8.3.

Yes, you're right. I just upgraded to xbindkeys from Git (1.8.4) and the
problem has disappeared.

Thanks Peter!
--
Oliver McFadden.

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 15/15] release.sh: Update jhbuild moduleset with --moduleset

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:30:00AM -0800, Dan Nicholson wrote:
> In order to keep the katamari moduleset up to date with current tarball
> information, have release.sh update the file when new releases are made.
> This is enabled by passing a module file with --moduleset.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  release.sh |   23 +++
>  1 files changed, 23 insertions(+), 0 deletions(-)
> 
> diff --git a/release.sh b/release.sh
> index ea4d9c9..a88a0c0 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -12,6 +12,7 @@ host_xorg=xorg.freedesktop.org
>  host_dri=dri.freedesktop.org
>  user=
>  remote=origin
> +moduleset=
>  
>  usage()
>  {
> @@ -24,6 +25,7 @@ Options:
>--helpthis help message
>--ignore-local-changesdon't abort on uncommitted local changes
>--remote  git remote where the change should be pushed (default 
> "origin")
> +  --moduleset   jhbuild moduleset to update with relase info
>  HELP
>  }
>  
> @@ -107,6 +109,11 @@ while [ $# != 0 ]; do
>  remote=$1
>  shift
>  ;;
> +--moduleset)
> +shift
> +moduleset=$1
> +shift
> +;;
>  --*)
>  echo "error: unknown option"
>  usage
> @@ -198,6 +205,14 @@ if [ -z "$tag_previous" ] ||
>  exit 1
>  fi
>  
> +if [ -n "$moduleset" ]; then
> +echo "checking for moduleset"
> +if ! [ -w "$moduleset" ]; then
> +echo "moduleset $moduleset does not exist or is not writable"
> +exit 1
> +fi
> +fi
> +
>  if [ "$section" = "libdrm" ]; then
>  section_path="libdrm"
>  srv_path="/srv/$host_dri/www/$section_path"
> @@ -236,6 +251,14 @@ echo "generating announce mail template, remember to 
> sign it"
>  gen_announce_mail >$announce
>  echo "at: $announce"
>  
> +if [ -n "$moduleset" ]; then
> +echo "updating moduleset $moduleset"
> +modulardir=`dirname "$0"`
> +# pass sha1sum output as 2 arguments
> +sha1sum=`cd $tarball_dir && $SHA1SUM $targz`
> +$modulardir/update-moduleset.sh $moduleset $sha1sum

The $targz argument is missing here.

> +fi
> +
>  echo "installing release into server"
>  scp $tarball_dir/$targz $tarball_dir/$tarbz2 $user$host_people:$srv_path
>  
> -- 
> 1.7.3.4
> 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 12/15] jhbuild: Don't build broken impact driver

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:57AM -0800, Dan Nicholson wrote:
> xf86-video-impact has been broken for a while and isn't built by
> build.sh. Move it to the unmaintained metamodule until someone cares.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 11/15] jhbuild: Group external modules at top of moduleset

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:56AM -0800, Dan Nicholson wrote:
> A few of the non-X.Org modules such as pixman and libdrm were mixed in
> with the X.Org libraries. Instead, they should be at the top of the
> moduleset with the rest of the external modules such as fontconfig.
> 
> This also adds comments to mark each section separately.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |  100 
> ++
>  1 files changed, 52 insertions(+), 48 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 09/15] jhbuild: Add definitions for remaining font modules

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:54AM -0800, Dan Nicholson wrote:
> The rest of the X.Org font modules aren't built as part of the xorg-fonts
> metamodule, but they should be buildable from jhbuild.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |  264 
> ++
>  1 files changed, 264 insertions(+), 0 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 08/15] jhbuild: Reorder and rename font modules sanely

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:53AM -0800, Dan Nicholson wrote:
> The font modules seemed to be in a random order and had inconsistent
> names. adobe-75dpi corresponds to the tarball font-adobe-75dpi, yet
> fonts-cursor corresponds to the tarball font-cursor-misc. Instead, the
> tarball names will be used.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |  122 
> +-
>  1 files changed, 61 insertions(+), 61 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 07/15] jhbuild: No xserver DDXs require xkbui anymore

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:52AM -0800, Dan Nicholson wrote:
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/xorg.modules b/xorg.modules
> index 3976837..052f044 100644
> --- a/xorg.modules
> +++ b/xorg.modules
> @@ -1858,7 +1858,6 @@
>
>
>
> -  
>
>
>
> -- 
> 1.7.3.4
> 

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 03/15] jhbuild: Remove duplicate xtrans module

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:48AM -0800, Dan Nicholson wrote:
> All the other modules depend on the one with the "libxtrans" id.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |5 -
>  1 files changed, 0 insertions(+), 5 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 02/15] jhbuild: Use git.freedesktop.org as default repository

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:47AM -0800, Dan Nicholson wrote:
> Since all the modules use fdo's git, the moduleset can be a lot cleaner.
> 
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |  551 +++--
>  1 files changed, 184 insertions(+), 367 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH modular 01/15] jhbuild: Clean up formatting of xorg.modules

2011-03-08 Thread Dirk Wallenstein
On Sun, Mar 06, 2011 at 09:29:46AM -0800, Dan Nicholson wrote:
> Signed-off-by: Dan Nicholson 
> ---
>  xorg.modules |  748 
> +++---
>  1 files changed, 555 insertions(+), 193 deletions(-)

Reviewed-by: Dirk Wallenstein 

-- 
Greetings,
Dirk
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel