Re: [PATCH xserver 02/10] glamor: Require that 16bpp pixmap depths match for Render copies.

2016-09-22 Thread Michel Dänzer
On 23/09/16 11:08 AM, Michel Dänzer wrote:
> On 22/09/16 05:45 PM, Eric Anholt wrote:
>> The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd
>> replicated a bug from last time we did a copy optimization, and didn't
>> get rendercheck run on it.  This is effectively a re-cherry-pick of
>> 510c8605641803f1f5b5d2de6d3bb422b148e0e7.
>>
>> Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4
>>
>> Signed-off-by: Eric Anholt 
>> ---
>>  glamor/glamor_render.c | 6 ++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
>> index c590580412c9..26dee05b5ce1 100644
>> --- a/glamor/glamor_render.c
>> +++ b/glamor/glamor_render.c
>> @@ -1423,6 +1423,12 @@ glamor_composite_clipped_region(CARD8 op,
>>  /* Is the composite operation equivalent to a copy? */
>>  if (!mask && !source->alphaMap && !dest->alphaMap
>>  && source->pDrawable && !source->transform
>> +&& source->pDrawable->depth == dest->pDrawable->depth
> 
> This clause ensures the depths match...
> 
> 
>> +/* We can't do direct copies between different depths at 16bpp
>> + * because r,g,b are allocated to different bits.
>> + */
>> +&& !(dest->pDrawable->bitsPerPixel == 16 &&
>> + dest->pDrawable->depth != source->pDrawable->depth)
> 
> So this clause will always be true?
> 
> 
> Anyway, this patch doesn't fix
> 
>  rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4
> 
> for me.

Correction: It does fix it with llvmpipe[0]. Also without the second
clause above, so with that removed,

Reviewed-and-Tested-by: Michel Dänzer 


[0] I typo'd LIBGL_ALWAYS_SOFTWARE... and it looks like there's a
radeonsi bug affecting that test as well.

-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 02/10] glamor: Require that 16bpp pixmap depths match for Render copies.

2016-09-22 Thread Michel Dänzer
On 22/09/16 05:45 PM, Eric Anholt wrote:
> The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd
> replicated a bug from last time we did a copy optimization, and didn't
> get rendercheck run on it.  This is effectively a re-cherry-pick of
> 510c8605641803f1f5b5d2de6d3bb422b148e0e7.
> 
> Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4
> 
> Signed-off-by: Eric Anholt 
> ---
>  glamor/glamor_render.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
> index c590580412c9..26dee05b5ce1 100644
> --- a/glamor/glamor_render.c
> +++ b/glamor/glamor_render.c
> @@ -1423,6 +1423,12 @@ glamor_composite_clipped_region(CARD8 op,
>  /* Is the composite operation equivalent to a copy? */
>  if (!mask && !source->alphaMap && !dest->alphaMap
>  && source->pDrawable && !source->transform
> +&& source->pDrawable->depth == dest->pDrawable->depth

This clause ensures the depths match...


> +/* We can't do direct copies between different depths at 16bpp
> + * because r,g,b are allocated to different bits.
> + */
> +&& !(dest->pDrawable->bitsPerPixel == 16 &&
> + dest->pDrawable->depth != source->pDrawable->depth)

So this clause will always be true?


Anyway, this patch doesn't fix

 rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4

for me. Am I missing another patch? (Patch 1 of this series is a NOP,
right?)


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xbitmaps] Install pkgconfig file into arch-dependent location

2016-09-22 Thread Heiko Becker
Signed-off-by: Heiko Becker 
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 060112d..9a89bbe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-pkgconfigdir = $(datadir)/pkgconfig
+pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xbitmaps.pc
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
-- 
2.10.0

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

[PATCH 1/1] Simplify, statement is always true.

2016-09-22 Thread Maya Rashish
pVideo->bus is uint8_t, always less than 256.

Signed-off-by: Maya Rashish 
---
 hw/xfree86/common/xf86pciBus.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 8158c2b..bed4434 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1457,11 +1457,7 @@ xf86PciConfigureNewDev(void *busData, struct pci_device 
*pVideo,
 
 pVideo = (struct pci_device *) busData;
 
-if (pVideo->bus < 256)
-snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
-else
-snprintf(busnum, sizeof(busnum), "%d@%d",
- pVideo->bus & 0x00ff, pVideo->bus >> 8);
+snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
 
 XNFasprintf(, "PCI:%s:%d:%d",
 busnum, pVideo->dev, pVideo->func);
-- 
2.9.0

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

Re: [PATCH x11proto] Fix typo __has_extenstion -> __has_extension

2016-09-22 Thread Jeremy Sequoia
Crap, my bad.  Sorry.

Reviewed-by: Jeremy Huddleston Sequoia 

Sent from my iPhone...

> On Sep 22, 2016, at 16:38, Keith Packard  wrote:
> 
> Signed-off-by: Keith Packard 
> ---
> Xfuncproto.h.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in
> index 8715c9d..b88493d 100644
> --- a/Xfuncproto.h.in
> +++ b/Xfuncproto.h.in
> @@ -83,7 +83,7 @@ in this Software without prior written authorization from 
> The Open Group.
> # define __has_feature(x) 0/* Compatibility with non-clang compilers. */
> #endif
> #ifndef __has_extension
> -# define __has_extenstion(x) 0 /* Compatibility with non-clang compilers. */
> +# define __has_extension(x) 0  /* Compatibility with non-clang compilers. */
> #endif
> 
> /* Added in X11R6.9, so available in any version of modular xproto */
> -- 
> 2.9.3
> 
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PULL] XQuartz cleanup related to inputthread changes

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> [ Unknown signature status ]
> Thanks for the reviews.  Here is a pull request for the changes I've
> got lined up for XQuartz.  Note that I still have a few pending
> patches out for review (which aren't part of this PR):

There was a typo in x11proto which I've sent a patch for; I'll need to
pend pushing this merge until that's resolved. Sorry for not catching it
in my review...

-- 
-keith


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

[PATCH x11proto] Fix typo __has_extenstion -> __has_extension

2016-09-22 Thread Keith Packard
Signed-off-by: Keith Packard 
---
 Xfuncproto.h.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in
index 8715c9d..b88493d 100644
--- a/Xfuncproto.h.in
+++ b/Xfuncproto.h.in
@@ -83,7 +83,7 @@ in this Software without prior written authorization from The 
Open Group.
 # define __has_feature(x) 0/* Compatibility with non-clang compilers. */
 #endif
 #ifndef __has_extension
-# define __has_extenstion(x) 0 /* Compatibility with non-clang compilers. */
+# define __has_extension(x) 0  /* Compatibility with non-clang compilers. */
 #endif
 
 /* Added in X11R6.9, so available in any version of modular xproto */
-- 
2.9.3

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

Re: [PATCH] remove dead code in dummy driver

2016-09-22 Thread Bob Terek



On 09/21/2016 10:22 AM, Aaron Plattner wrote:

On 09/20/2016 02:07 AM, Eric Engestrom wrote:

On Tue, Sep 20, 2016 at 01:34:40PM +0700, Antoine Martin wrote:

Signed-off-by: Antoine Martin 


Reviewed-by: Eric Engestrom 


Looks good to me too (although I'm cheating since this chunk is identical to 
part of
https://patchwork.freedesktop.org/patch/41058/)


Shouldn't the first 5 of Aaron's patches be applied, since they are all 
cleanup items?


https://lists.x.org/archives/xorg-devel/2015-January/045395.html

Patch 6 supposedly caused a server crash, but the first 5 should be ok?

--
Bob Terek

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

[PATCH xserver 2/2] Eliminate coordinate mode in PolyPoint, PolyLines and FillPolygon ops

2016-09-22 Thread Keith Packard
Doing this in DIX makes the drivers all simpler and fixes bugs in
a couple of wrappers which got CoordModePrevious wrong.

Signed-off-by: Keith Packard 
---
 dix/dispatch.c |  36 ++--
 exa/exa_accel.c|  26 +++--
 exa/exa_priv.h |   4 +-
 exa/exa_unaccel.c  |  10 ++--
 fb/fb.h|  15 ++---
 fb/fbbits.h|   5 +-
 fb/fbline.c|  27 ++---
 fb/fbpoint.c   |  15 +
 fb/wfbrename.h |   1 -
 glamor/glamor_dash.c   |   6 +-
 glamor/glamor_lines.c  |  35 
 glamor/glamor_points.c |  20 ++-
 glamor/glamor_priv.h   |   6 +-
 hw/dmx/dmxgcops.c  |  12 ++--
 hw/dmx/dmxgcops.h  |   6 +-
 hw/xfree86/common/xf86VGAarbiter.c |  12 ++--
 hw/xfree86/common/xf86VGAarbiterPriv.h |   6 +-
 hw/xnest/GCOps.c   |  12 ++--
 hw/xnest/GCOps.h   |   6 +-
 include/gcstruct.h |   3 -
 mi/mi.h|   7 ---
 mi/mipoly.c|  14 +
 mi/mipolypnt.c |  17 +-
 mi/mipolyrect.c|   4 +-
 mi/mipolyseg.c |   2 +-
 mi/miwideline.c|  63 -
 mi/mizerarc.c  |   4 +-
 mi/mizerline.c |  10 +---
 miext/damage/damage.c  |  92 +-
 miext/rootless/rootlessGC.c| 100 ++---
 30 files changed, 182 insertions(+), 394 deletions(-)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 26a461b..277f821 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1683,6 +1683,21 @@ SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID 
drawable,
 }
 }
 
+static void
+FixCoordModePrevious(int npt, xPoint *ppt)
+{
+int x, y;
+
+x = ppt->x;
+y = ppt->y;
+npt--;
+while (npt--) {
+ppt++;
+x = (ppt->x += x);
+y = (ppt->y += y);
+}
+}
+
 int
 ProcCopyArea(ClientPtr client)
 {
@@ -1785,9 +1800,12 @@ ProcPolyPoint(ClientPtr client)
 }
 VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
-if (npoint)
-(*pGC->ops->PolyPoint) (pDraw, pGC, stuff->coordMode, npoint,
+if (npoint) {
+if (stuff->coordMode == CoordModePrevious)
+FixCoordModePrevious(npoint, (xPoint *) [1]);
+(*pGC->ops->PolyPoint) (pDraw, pGC, npoint,
 (xPoint *) [1]);
+}
 return Success;
 }
 
@@ -1808,9 +1826,12 @@ ProcPolyLine(ClientPtr client)
 }
 VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
-if (npoint > 1)
-(*pGC->ops->Polylines) (pDraw, pGC, stuff->coordMode, npoint,
+if (npoint > 1) {
+if (stuff->coordMode == CoordModePrevious)
+FixCoordModePrevious(npoint, (xPoint *) [1]);
+(*pGC->ops->Polylines) (pDraw, pGC, npoint,
 (DDXPointPtr) [1]);
+}
 return Success;
 }
 
@@ -1898,10 +1919,13 @@ ProcFillPoly(ClientPtr client)
 
 VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
 things = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
-if (things)
+if (things > 2) {
+if (stuff->coordMode == CoordModePrevious)
+FixCoordModePrevious(things, (xPoint *) [1]);
 (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
-  stuff->coordMode, things,
+  things,
   (DDXPointPtr) [1]);
+}
 return Success;
 }
 
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index b26d5c8..ae23928 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -611,7 +611,7 @@ exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr 
pDstDrawable, GCPtr pGC,
 }
 
 static void
-exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int npt,
  DDXPointPtr ppt)
 {
 ExaScreenPriv(pDrawable->pScreen);
@@ -622,7 +622,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, 
int npt,
  * points.
  */
 if (pExaScr->fallback_counter || pGC->fillStyle != FillSolid) {
-ExaCheckPolyPoint(pDrawable, pGC, mode, npt, ppt);
+ExaCheckPolyPoint(pDrawable, pGC, npt, ppt);
 return;
 }
 
@@ -630,10 +630,6 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, 
int npt,
 for (i = 0; i < npt; i++) {
 prect[i].x = ppt[i].x;
 

[PATCH xserver 0/2] Simplify GC ops interface

2016-09-22 Thread Keith Packard
Removing miTranslate from the GC and support for CoordModePrevious in
points/lines/polygons makes drivers simpler and fixes bugs in
CoordModePrevious support for dots in damage and rootless.

My eventual goal is to make the primitive coordinates parameters
const, which will eliminate the need to save/restore them in Xinerama
and also allow for some future damage-related improvements.

(just to be clear, this is post-1.19 work)

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

[PATCH xserver 1/2] Eliminate miTranslate

2016-09-22 Thread Keith Packard
miTranslate is expensive to provide for, and not that expensive to
handle in the driver.

Signed-off-by: Keith Packard 
---
 fb/fbfillsp.c|  6 --
 fb/fbgc.c|  2 --
 glamor/glamor_glyphblt.c |  6 ++
 glamor/glamor_spans.c|  4 ++--
 hw/xnest/GC.c|  2 --
 include/gcstruct.h   |  1 -
 mi/miarc.c   | 19 ---
 mi/mibitblt.c|  8 
 mi/midispcur.c   | 23 ++-
 mi/mifillarc.c   | 20 
 mi/mifillrct.c   | 21 -
 mi/miglblt.c |  5 -
 mi/mipoly.c  | 36 ++--
 mi/mipolypnt.c   | 13 -
 mi/miwideline.c  | 24 
 mi/mizerarc.c| 13 -
 mi/mizerline.c   | 26 +-
 miext/damage/damage.c| 18 --
 18 files changed, 29 insertions(+), 218 deletions(-)

diff --git a/fb/fbfillsp.c b/fb/fbfillsp.c
index 4debe1e..6992e57 100644
--- a/fb/fbfillsp.c
+++ b/fb/fbfillsp.c
@@ -36,6 +36,8 @@ fbFillSpans(DrawablePtr pDrawable,
 int extentX1, extentX2, extentY1, extentY2;
 int fullX1, fullX2, fullY1;
 int partX1, partX2;
+int x_draw = pDrawable->x;
+int y_draw = pDrawable->y;
 
 pextent = RegionExtents(pClip);
 extentX1 = pextent->x1;
@@ -43,8 +45,8 @@ fbFillSpans(DrawablePtr pDrawable,
 extentX2 = pextent->x2;
 extentY2 = pextent->y2;
 while (n--) {
-fullX1 = ppt->x;
-fullY1 = ppt->y;
+fullX1 = ppt->x + x_draw;
+fullY1 = ppt->y + y_draw;
 fullX2 = fullX1 + (int) *pwidth;
 ppt++;
 pwidth++;
diff --git a/fb/fbgc.c b/fb/fbgc.c
index 19c6131..f1f77b8 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -67,8 +67,6 @@ fbCreateGC(GCPtr pGC)
 pGC->ops = (GCOps *) 
 pGC->funcs = (GCFuncs *) 
 
-/* fb wants to translate before scan conversion */
-pGC->miTranslate = 1;
 pGC->fExpose = 1;
 
 fbGetGCPrivate(pGC)->bpp = BitsPerPixel(pGC->depth);
diff --git a/glamor/glamor_glyphblt.c b/glamor/glamor_glyphblt.c
index b21aa06..2adf5a8 100644
--- a/glamor/glamor_glyphblt.c
+++ b/glamor/glamor_glyphblt.c
@@ -196,10 +196,8 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
   _offset);
 num_points = 0;
 
-/* Note that because fb sets miTranslate in the GC, our incoming X
- * and Y are in screen coordinate space (same for spans, but not
- * other operations).
- */
+x += drawable->x;
+y += drawable->y;
 
 for (yy = 0; yy < h; yy++) {
 uint8_t *bitmap_row = bitmap_data + yy * bitmap_stride;
diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c
index 5217d04..f0dc5c6 100644
--- a/glamor/glamor_spans.c
+++ b/glamor/glamor_spans.c
@@ -80,8 +80,8 @@ glamor_fill_spans_gl(DrawablePtr drawable,
   4 * sizeof (GLshort), vbo_offset);
 
 for (c = 0; c < n; c++) {
-v[0] = points->x;
-v[1] = points->y;
+v[0] = points->x + drawable->x;
+v[1] = points->y + drawable->y;
 v[2] = *widths++;
 points++;
 v += 4;
diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c
index ecfa61e..d5e4314 100644
--- a/hw/xnest/GC.c
+++ b/hw/xnest/GC.c
@@ -76,8 +76,6 @@ xnestCreateGC(GCPtr pGC)
 pGC->funcs = 
 pGC->ops = 
 
-pGC->miTranslate = 1;
-
 xnestGCPriv(pGC)->gc = XCreateGC(xnestDisplay,
  xnestDefaultDrawables[pGC->depth],
  0L, NULL);
diff --git a/include/gcstruct.h b/include/gcstruct.h
index e48d610..e28950f 100644
--- a/include/gcstruct.h
+++ b/include/gcstruct.h
@@ -254,7 +254,6 @@ typedef struct _GC {
 unsigned int arcMode:1;
 unsigned int subWindowMode:1;
 unsigned int graphicsExposures:1;
-unsigned int miTranslate:1; /* should mi things translate? */
 unsigned int tileIsPixel:1; /* tile is solid pixel */
 unsigned int fExpose:1; /* Call exposure handling */
 unsigned int freeCompClip:1;/* Free composite clip */
diff --git a/mi/miarc.c b/mi/miarc.c
index 2588ee4..ca6ad73 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -260,11 +260,6 @@ miArcSegment(DrawablePtr pDraw,
 return;
 }
 
-if (pGC->miTranslate) {
-tarc.x += pDraw->x;
-tarc.y += pDraw->y;
-}
-
 a0 = tarc.angle1;
 a1 = tarc.angle2;
 if (a1 > FULLCIRCLE)
@@ -795,11 +790,6 @@ miFillWideEllipse(DrawablePtr pDraw, GCPtr pGC, xArc * 
parc)
 xorg = parc->x + (parc->width >> 1);
 yorgu = parc->y + (parc->height >> 1);
 yorgl = yorgu + (parc->height & 1);
-if (pGC->miTranslate) {
-xorg += pDraw->x;
-yorgu += pDraw->y;
-yorgl += pDraw->y;
-}
 yorgu -= spdata->k;
 yorgl += spdata->k;
 if (spdata->top) {
@@ -967,10 +957,6 @@ miWideArc(DrawablePtr 

[PULL] XQuartz cleanup related to inputthread changes

2016-09-22 Thread Jeremy Huddleston Sequoia
Thanks for the reviews.  Here is a pull request for the changes I've got lined 
up for XQuartz.  Note that I still have a few pending patches out for review 
(which aren't part of this PR):

  os/connection: Improve abstraction for launchd secure sockets
  randr: Initialize RandR even if there are currently no screens attached
  glx: Initialize glx even if there are currently no screens attached

Thanks,
Jeremy

---

The following changes since commit d0c5d205a919fc1d2eb599356090b58b1bf0176d:

  dix: Make InitCoreDevices() failures more verbose. (2016-09-21 21:11:40 +1000)

are available in the git repository at:

  https://github.com/XQuartz/xorg-server.git 

for you to fetch changes up to f72ff1f7ac784f3911fe2f8d746f62f7709f0edc:

  XQuartz: Silence an expected TSan warning (2016-09-22 14:55:03 -0700)


Jeremy Huddleston Sequoia (6):
  dix: Silence TSan warnings when checking for pending input
  XQuartz: Don't respond to SIGALRM on the AppKit thread
  XQuartz: Remove X11ApplicationFatalError
  XQuartz: pbproxy shouldn't need to wait for server initialization.
  XQuartz: Adopt input_lock() and input_unlock()
  XQuartz: Silence an expected TSan warning

Keith Packard (2):
  os: Ready clients with pending output aren't flushed, so set 
NewOutputPending
  os: Clear saved poll events in listen so that edge triggering works

 configure.ac  |   2 +-
 dix/dispatch.c|   7 +++
 dix/main.c|  21 -
 hw/xquartz/X11Application.h   |   3 ---
 hw/xquartz/X11Application.m   |  55 
++-
 hw/xquartz/darwin.c   |   1 -
 hw/xquartz/darwinEvents.c | 125 
+
 hw/xquartz/pbproxy/app-main.m |   3 ---
 hw/xquartz/pbproxy/main.m |  18 --
 hw/xquartz/quartzStartup.c|   9 +
 include/dix.h |   6 ++
 mi/mieq.c |  22 --
 mi/mipointer.c|  12 
 os/WaitFor.c  |   2 +-
 os/io.c   |   3 ++-
 os/ospoll.c   |   8 ++--
 test/ddxstubs.c   |  16 
 17 files changed, 71 insertions(+), 242 deletions(-)



smime.p7s
Description: S/MIME cryptographic signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> Ok, sent update for a final r-b.

Done.

> This also requires an updated release of xproto for the macros.  I
> sent that series out a few days ago but haven't had a review yet.

Done.

> Are there any other changes to xproto that might be useful to make at
> the same time?  If not, I'll tag and release xproto once I get
> feedback on the xproto series.

I'd say that anything which is ready should be on master, so go ahead
and release at will.

-- 
-keith


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

Re: [PATCH xproto 1/4] Xfuncproto.h: Define __has_feature() if it isn't already

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> Signed-off-by: Jeremy Huddleston Sequoia 

for the series:

Reviewed-by: Keith Packard 

-- 
-keith


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

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> V2: Moves InputCheckPending() into dix.h
>
> Bumps required version of xproto to 7.0.30

LGTM.

Reviewed-by: Keith Packard 

-- 
-keith


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

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Jeremy Huddleston Sequoia

> On Sep 22, 2016, at 11:26, Keith Packard  wrote:
> 
> Jeremy Huddleston Sequoia  writes:
> 
>> I would've but we're post API freeze at this point, yes?  Would that be ok?
> 
> Yeah, better than duplicating, and it doesn't affect the actual ABI/API
> seen to drivers.

Ok, sent update for a final r-b.

This also requires an updated release of xproto for the macros.  I sent that 
series out a few days ago but haven't had a review yet.

Are there any other changes to xproto that might be useful to make at the same 
time?  If not, I'll tag and release xproto once I get feedback on the xproto 
series.

Thanks,
Jeremy




smime.p7s
Description: S/MIME cryptographic signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Jeremy Huddleston Sequoia
V2: Moves InputCheckPending() into dix.h

Bumps required version of xproto to 7.0.30

==
WARNING: ThreadSanitizer: data race (pid=4943)
  Read of size 4 at 0x00010c4e3854 by thread T8:
#0 WaitForSomething WaitFor.c:237 (X11.bin+0x00010049216c)
#1 Dispatch dispatch.c:413 (X11.bin+0x000100352ed9)
#2 dix_main main.c:287 (X11.bin+0x00010036e894)
#3 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63)

  Previous write of size 4 at 0x00010c4e3854 by thread T12 (mutexes: write 
M856, write M1976):
#0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448d14)
#1 DarwinSendDDXEvent darwinEvents.c:641 (X11.bin+0x000100033613)
#2 DarwinProcessFDAdditionQueue_thread darwinEvents.c:338 
(X11.bin+0x000100032039)

  Location is global 'miEventQueue' at 0x00010c4e3850 (X11.bin+0x0001005ab854)

  Mutex M856 (0x00010c4c8c80) created at:
#0 pthread_mutex_lock :144 
(libclang_rt.tsan_osx_dynamic.dylib+0x000321fe)
#1 DarwinListenOnOpenFD darwinEvents.c:300 (X11.bin+0x000100031607)
#2 socket_handoff bundle-main.c:288 (X11.bin+0x00012b40)
#3 __do_request_fd_handoff_socket_block_invoke bundle-main.c:379 
(X11.bin+0x000129ba)
#4 __tsan::invoke_and_release_block(void*) :144 
(libclang_rt.tsan_osx_dynamic.dylib+0x0005d97b)
#5 _dispatch_client_callout :33 (libdispatch.dylib+0x20ef)

  Mutex M1976 (0x00010c4e3d68) created at:
#0 pthread_mutex_init :144 
(libclang_rt.tsan_osx_dynamic.dylib+0x000253c3)
#1 input_lock inputthread.c:103 (X11.bin+0x00010049fd10)
#2 TimerSet WaitFor.c:343 (X11.bin+0x0001004926c2)
#3 RootlessQueueRedisplay rootlessScreen.c:594 (X11.bin+0x000100065d7f)
#4 RootlessInstallColormap rootlessScreen.c:514 (X11.bin+0x000100069f1a)
#5 miSpriteInstallColormap misprite.c:562 (X11.bin+0x000100467095)
#6 miCreateDefColormap micmap.c:270 (X11.bin+0x000100440399)
#7 DarwinScreenInit darwin.c:285 (X11.bin+0x0001000303bb)
#8 AddScreen dispatch.c:3908 (X11.bin+0x00010036c417)
#9 InitOutput darwin.c:671 (X11.bin+0x00010002fdeb)
#10 dix_main main.c:197 (X11.bin+0x00010036e228)
#11 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63)

  Thread T8 (tid=4198779, running) created by main thread at:
#0 pthread_create :144 
(libclang_rt.tsan_osx_dynamic.dylib+0x00024490)
#1 create_thread quartzStartup.c:78 (X11.bin+0x000100039dad)
#2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039c16)
#3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cde4)
#4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a642)
#5 server_main quartzStartup.c:136 (X11.bin+0x00010003a03b)
#6 do_start_x11_server bundle-main.c:436 (X11.bin+0x00012eb5)
#7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x00014e99)
#8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x00015734)
#9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x00012186)
#10 start :29 (libdyld.dylib+0x5254)

  Thread T12 (tid=4198797, running) created by thread T8 at:
#0 pthread_create :144 
(libclang_rt.tsan_osx_dynamic.dylib+0x00024490)
#1 create_thread darwinEvents.c:121 (X11.bin+0x000100031ecf)
#2 DarwinEQInit darwinEvents.c:365 (X11.bin+0x000100031860)
#3 InitInput darwin.c:571 (X11.bin+0x00010002ea09)
#4 dix_main main.c:261 (X11.bin+0x00010036e7ce)
#5 server_thread quartzStartup.c:66 (X11.bin+0x000100039e63)

SUMMARY: ThreadSanitizer: data race WaitFor.c:237 in WaitForSomething
==
==
WARNING: ThreadSanitizer: data race (pid=22841)
  Write of size 4 at 0x000105bbd864 by main thread (mutexes: write M1945):
#0 mieqEnqueue mieq.c:263 (X11.bin+0x000100448cf4)
#1 DarwinSendDDXEvent darwinEvents.c:642 (X11.bin+0x000100033693)
#2 -[X11Controller set_window_menu:] X11Controller.m:275 
(X11.bin+0x0001000222fd)
#3 -[X11Application set_window_menu:] X11Application.m:486 
(X11.bin+0x000100018b44)
#4 -[X11Application handleMachMessage:] X11Application.m:177 
(X11.bin+0x000100016678)
#5 __NSFireMachPort :69 (Foundation+0x0009b62b)
#6 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5f2)
#7 server_main quartzStartup.c:136 (X11.bin+0x000100039ffb)
#8 do_start_x11_server bundle-main.c:436 (X11.bin+0x00012e65)
#9 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x00014e49)
#10 mach_startup_server mach_startupServer.c:399 (X11.bin+0x000156e4)
#11 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x00012186)
#12 start :29 (libdyld.dylib+0x5254)

  Previous read of size 4 at 0x000105bbd864 by thread T7:
#0 Dispatch dispatch.c:434 (X11.bin+0x000100352fc8)
#1 dix_main main.c:287 (X11.bin+0x00010036e874)
#2 server_thread quartzStartup.c:66 (X11.bin+0x000100039e23)

  Location is global 'miEventQueue' at 0x000105bbd860 (X11.bin+0x0001005ab864)

  Mutex M1945 (0x000105bbdd78) created at:
#0 

Re: modesetting: allow switching from software to hardware cursors (v4)

2016-09-22 Thread Michael Thayer

On 16.09.2016 17:49, Michael Thayer wrote:

Split this up into the three following patches as suggested by Hans.
Many thanks for your patience!


Polite ping.

Regards,

Michael
--
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister 
der Handelskammer Midden-Nederland, Nr. 30143697

Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> I would've but we're post API freeze at this point, yes?  Would that be ok?

Yeah, better than duplicating, and it doesn't affect the actual ABI/API
seen to drivers.

-- 
-keith


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

Re: [PATCH xserver 0/2] os: Fix write block handling in poll(2) path

2016-09-22 Thread Jeremy Huddleston Sequoia
Series is:

Reviewed-by: Jeremy Huddleston Sequoia 
Tested-by: Jeremy Huddleston Sequoia 

I'd still like to get rid of the large NewOutputPending hammer, but this is 
good for now.

Thanks,
Jeremy

> On Sep 21, 2016, at 16:53, Keith Packard  wrote:
> 
> My previous attempt to fix this just hit the wrong variable to fix
> edge triggering; it should have reset the POLLOUT bit in
> ospoll->osfds[pos].revents instead of ospoll->fds[pos].revents. With
> that fixed, it looks like the poll(2) path is working.
> 



smime.p7s
Description: S/MIME cryptographic signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Jeremy Huddleston Sequoia

> On Sep 22, 2016, at 00:22, Keith Packard  wrote:
> 
> Jeremy Huddleston Sequoia  writes:
> 
>> +static inline _X_NOTSAN Bool
>> +InputCheckPending(void)
>> +{
>> +return (*checkForInput[0] != *checkForInput[1]);
>> +}
> 
>> +static inline _X_NOTSAN Bool
>> +InputCheckPending(void)
>> +{
>> +return (*checkForInput[0] != *checkForInput[1]);
>> +}
> 
> You should stick this in dix.h, or some other suitable header
> file.

I would've but we're post API freeze at this point, yes?  Would that be ok?



smime.p7s
Description: S/MIME cryptographic signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver] xwayland: Clear up x_cursor on UnrealizeCursor()

2016-09-22 Thread Jonas Ådahl
On Thu, Sep 22, 2016 at 08:34:59AM +0200, Olivier Fourdan wrote:
> In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only
> when a device value is provided to the UnrealizeCursor() routine, but
> if the device is NULL as called from FreeCursor(), the corresponding
> x_cursor for the xwl_seat is left untouched.
> 
> This might cause a segfault when trying to access the unrealized
> cursor's devPrivates in xwl_seat_set_cursor().
> 
> A possible occurrence of this is the client changing the cursor, the
> Xserver calling FreeCursor() which does UnrealizeCursor() and then
> the Wayland server sending a pointer enter event, which invokes
> xwl_seat_set_cursor() while the seat's x_cursor has just been
> unrealized.
> 
> To avoid this, walk through all the xwl_seats and clear up all x_cursor
> matching the cursor being unrealized.
> 
> Signed-off-by: Olivier Fourdan 
> ---
>  hw/xwayland/xwayland-cursor.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
> index 7d14a3d..0f22b5d 100644
> --- a/hw/xwayland/xwayland-cursor.c
> +++ b/hw/xwayland/xwayland-cursor.c
> @@ -76,7 +76,8 @@ static Bool
>  xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
>  {
>  PixmapPtr pixmap;
> -struct xwl_seat *xwl_seat;
> +struct xwl_screen *xwl_screen;
> +struct xwl_seat *xwl_seat, *next_xwl_seat;
>  
>  pixmap = dixGetPrivate(>devPrivates, _cursor_private_key);
>  if (!pixmap)
> @@ -85,9 +86,10 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr 
> screen, CursorPtr cursor)
>  dixSetPrivate(>devPrivates, _cursor_private_key, NULL);
>  
>  /* When called from FreeCursor(), device is always NULL */
> -if (device) {
> -xwl_seat = device->public.devicePrivate;
> -if (xwl_seat && cursor == xwl_seat->x_cursor)
> +xwl_screen = xwl_screen_get(screen);
> +xorg_list_for_each_entry_safe(xwl_seat, next_xwl_seat,
> +  _screen->seat_list, link) {

No need to use _safe() here. We only change a field of the xwl_seat, we
never unlink it.

Other than that, this is

Reviewed-by: Jonas Ådahl 


Jonas

> +if (cursor == xwl_seat->x_cursor)
>  xwl_seat->x_cursor = NULL;
>  }
>  
> -- 
> 2.9.3
> 
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xf86-video-dummy v2] Remove pointless empty functions

2016-09-22 Thread Aaron Plattner
These functions might be useful in a real driver, but with no
hardware, they're pointless.  Get rid of them.

v2: Rebase, get rid of pointless calls to DUMMYAdjustFrame, return TRUE from
DUMMYSwitchMode.

Signed-off-by: Aaron Plattner 
---
 src/dummy_driver.c | 44 +---
 1 file changed, 1 insertion(+), 43 deletions(-)

diff --git a/src/dummy_driver.c b/src/dummy_driver.c
index cf150539e10b..265660280549 100644
--- a/src/dummy_driver.c
+++ b/src/dummy_driver.c
@@ -65,9 +65,6 @@ static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, 
DisplayModePtr mode,
 static BoolDUMMYSaveScreen(ScreenPtr pScreen, int mode);
 
 /* Internally used functions */
-static Bool dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
-static voiddummySave(ScrnInfoPtr pScrn);
-static voiddummyRestore(ScrnInfoPtr pScrn, Bool restoreText);
 static BooldummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
pointer ptr);
 
@@ -461,14 +458,6 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
 static Bool
 DUMMYEnterVT(VT_FUNC_ARGS_DECL)
 {
-SCRN_INFO_PTR(arg);
-
-/* Should we re-save the text mode on each VT enter? */
-if(!dummyModeInit(pScrn, pScrn->currentMode))
-  return FALSE;
-
-DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
-
 return TRUE;
 }
 
@@ -476,8 +465,6 @@ DUMMYEnterVT(VT_FUNC_ARGS_DECL)
 static void
 DUMMYLeaveVT(VT_FUNC_ARGS_DECL)
 {
-SCRN_INFO_PTR(arg);
-dummyRestore(pScrn, TRUE);
 }
 
 static void
@@ -535,15 +522,6 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
 
 if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
return FALSE;
-
-/*
- * next we save the current state and setup the first mode
- */
-dummySave(pScrn);
-
-if (!dummyModeInit(pScrn,pScrn->currentMode))
-   return FALSE;
-DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
 
 /*
  * Reset visual list.
@@ -665,8 +643,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
 Bool
 DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
 {
-SCRN_INFO_PTR(arg);
-return dummyModeInit(pScrn, mode);
+return TRUE;
 }
 
 /* Mandatory */
@@ -683,7 +660,6 @@ DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL)
 DUMMYPtr dPtr = DUMMYPTR(pScrn);
 
 if(pScrn->vtSema){
-   dummyRestore(pScrn, TRUE);
free(dPtr->FBBase);
 }
 
@@ -725,24 +701,6 @@ DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, 
Bool verbose, int flags)
 return(MODE_OK);
 }
 
-static void
-dummySave(ScrnInfoPtr pScrn)
-{
-}
-
-static void 
-dummyRestore(ScrnInfoPtr pScrn, Bool restoreText)
-{
-}
-
-static Bool
-dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
-dummyRestore(pScrn, FALSE);
-
-return(TRUE);
-}
-
 Atom VFB_PROP  = 0;
 #define  VFB_PROP_NAME  "VFB_IDENT"
 
-- 
2.10.0

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

Re: [PATCH xserver 0/2] os: Fix write block handling in poll(2) path

2016-09-22 Thread Matthieu Herrb
On Thu, Sep 22, 2016 at 02:53:44AM +0300, Keith Packard wrote:
> My previous attempt to fix this just hit the wrong variable to fix
> edge triggering; it should have reset the POLLOUT bit in
> ospoll->osfds[pos].revents instead of ospoll->fds[pos].revents. With
> that fixed, it looks like the poll(2) path is working.
> 

Tested-by: Matthieu Herrb 

Thanks !
-- 
Matthieu Herrb


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

Re: [PATCH xserver 06/10] test: Make the piglit-running script callable with an arbitrary server.

2016-09-22 Thread Julien Cristau
On Thu, Sep 22, 2016 at 11:45:07 +0300, Eric Anholt wrote:

> diff --git a/test/scripts/xvfb-piglit.sh b/test/scripts/run-piglit.sh
> similarity index 90%
> copy from test/scripts/xvfb-piglit.sh
> copy to test/scripts/run-piglit.sh
> index b775239e34f5..ab37ee3b92ad 100755
> --- a/test/scripts/xvfb-piglit.sh
> +++ b/test/scripts/run-piglit.sh
> @@ -14,6 +14,12 @@ if test "x$PIGLIT_DIR" = "x"; then
>  exit 77
>  fi
>  
> +if test "x$PIGLIT_RESULTS_DIR" = "x"; then
> +echo "PIGLIT_RESULTS_DIR must be set to where to output piglit results."
> +# Exit as a real failure because it should always be set.
> +exit 1
> +fi
> +
>  if test "x$XSERVER_DIR" = "x"; then
>  echo "XSERVER_DIR must be set to the directory of the xserver 
> repository."
>  # Exit as a real failure because it should always be set.
> @@ -26,14 +32,10 @@ if test "x$XSERVER_BUILDDIR" = "x"; then
>  exit 1
>  fi
>  
> -export PIGLIT_RESULTS_DIR=$PIGLIT_DIR/results/xvfb
> -
>  startx \
>  $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
>  -- \
> -$XSERVER_BUILDDIR/hw/vfb/Xvfb \
> --noreset \
> --screen scrn 1280x1024x24
> +$SERVER_COMMAND
>  
>  # Write out piglit-summaries.
>  SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary

Should this check up-front that SERVER_COMMAND is set, like the other
variables?

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

Re: [PATCH xserver 05/10] test: Add a little xinit-like program for starting servers for testing.

2016-09-22 Thread Julien Cristau
On Thu, Sep 22, 2016 at 11:45:06 +0300, Eric Anholt wrote:

> +asprintf(_string, "%d", displayfd);
> +if (!displayfd_string)
> +exit(1);

I think you need to check the return value from asprintf, not
displayfd_string:

   When  successful,  these  functions return the number of bytes printed,
   just like sprintf(3).  If memory allocation wasn't  possible,  or  some
   other error occurs, these functions will return -1, and the contents of
   strp are undefined.

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

Re: [PATCH] remove dead code in dummy driver

2016-09-22 Thread Antoine Martin
On 22/09/16 03:22, Aaron Plattner wrote:
> On 09/20/2016 02:07 AM, Eric Engestrom wrote:
>> On Tue, Sep 20, 2016 at 01:34:40PM +0700, Antoine Martin wrote:
>>> Signed-off-by: Antoine Martin 
>>
>> Reviewed-by: Eric Engestrom 
> 
> Looks good to me too (although I'm cheating since this chunk is identical to 
> part of https://patchwork.freedesktop.org/patch/41058/)
That one is even better.

You can add to that one:
Reviewed-by: Antoine Martin 

Cheers
Antoine



> 
> Pushed:
> remote: Updating patchwork state for 
> https://patchwork.freedesktop.org/project/Xorg/list/
> remote: I: patch #111435 updated using rev 
> 367c778240b4266958f33cec3653d5389e283557.
> remote: I: 1 patch(es) updated to state Accepted.
> To git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-dummy
>8706f60ab457..367c778240b4  HEAD -> master
> 
>>> ---
>>>  src/dummy_driver.c | 19 ---
>>>  1 file changed, 19 deletions(-)
>>>
>>> diff --git a/src/dummy_driver.c b/src/dummy_driver.c
>>> index c84000f..ec1acf3 100644
>>> --- a/src/dummy_driver.c
>>> +++ b/src/dummy_driver.c
>>> @@ -700,25 +700,6 @@ DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
>>>  void
>>>  DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL)
>>>  {
>>> -SCRN_INFO_PTR(arg);
>>> -int Base; 
>>> -
>>> -Base = (y * pScrn->displayWidth + x) >> 2;
>>> -
>>> -/* Scale Base by the number of bytes per pixel. */
>>> -switch (pScrn->depth) {
>>> -case  8 :
>>> -   break;
>>> -case 15 :
>>> -case 16 :
>>> -   Base *= 2;
>>> -   break;
>>> -case 24 :
>>> -   Base *= 3;
>>> -   break;
>>> -default :
>>> -   break;
>>> -}
>>>  }
>>>  
>>>  /* Mandatory */
>>> -- 
>>> 2.7.4
> 

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

[PATCH xserver 2/2] os: Clear saved poll events in listen so that edge triggering works

2016-09-22 Thread Keith Packard
When a client is marked as write blocked, clear any old 'write ready'
bit in the osfds structure so that a new indication of write ready
(which is marked as edge trigggered) will trigger the callback.

Signed-off-by: Keith Packard 
---
 os/ospoll.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/os/ospoll.c b/os/ospoll.c
index b00d422..51bd02d 100644
--- a/os/ospoll.c
+++ b/os/ospoll.c
@@ -352,10 +352,14 @@ ospoll_listen(struct ospoll *ospoll, int fd, int xevents)
 epoll_mod(ospoll, osfd);
 #endif
 #if POLL
-if (xevents & X_NOTIFY_READ)
+if (xevents & X_NOTIFY_READ) {
 ospoll->fds[pos].events |= POLLIN;
-if (xevents & X_NOTIFY_WRITE)
+ospoll->osfds[pos].revents &= ~POLLIN;
+}
+if (xevents & X_NOTIFY_WRITE) {
 ospoll->fds[pos].events |= POLLOUT;
+ospoll->osfds[pos].revents &= ~POLLOUT;
+}
 #endif
 }
 }
-- 
2.9.3

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

[PATCH xserver 0/2] os: Fix write block handling in poll(2) path

2016-09-22 Thread Keith Packard
My previous attempt to fix this just hit the wrong variable to fix
edge triggering; it should have reset the POLLOUT bit in
ospoll->osfds[pos].revents instead of ospoll->fds[pos].revents. With
that fixed, it looks like the poll(2) path is working.

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

[PATCH xserver 1/2] os: Ready clients with pending output aren't flushed, so set NewOutputPending

2016-09-22 Thread Keith Packard
When a client with pending output is ready (has request data pending),
FlushAllOutput will skip it to get all of the requests processed
before sending any queued output. That means FlushAllOutput is going
to return with some output pending to a client which isn't known to be
write blocked. And that means NewOutputPending needs to be set so that
FlushAllOutput will get called again to actually go flush this client.

It might be interesting to try just flushing the client to send any
queued data along the way. This patch just restores the server
behavior to what it was before the ospoll changes.

Signed-off-by: Keith Packard 
---
 os/io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/os/io.c b/os/io.c
index ff0ec3d..5ba1e86 100644
--- a/os/io.c
+++ b/os/io.c
@@ -615,7 +615,8 @@ FlushAllOutput(void)
 if (!client_is_ready(client)) {
 oc = (OsCommPtr) client->osPrivate;
 (void) FlushClient(client, oc, (char *) NULL, 0);
-}
+} else
+NewOutputPending = TRUE;
 }
 }
 
-- 
2.9.3

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

Re: [PATCH xserver v2] xwayland: Clear up x_cursor on UnrealizeCursor()

2016-09-22 Thread Hans de Goede

Hi,

On 09/22/2016 10:38 AM, Olivier Fourdan wrote:

In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only
when a device value is provided to the UnrealizeCursor() routine, but
if the device is NULL as called from FreeCursor(), the corresponding
x_cursor for the xwl_seat is left untouched.

This might cause a segfault when trying to access the unrealized
cursor's devPrivates in xwl_seat_set_cursor().

A possible occurrence of this is the client changing the cursor, the
Xserver calling FreeCursor() which does UnrealizeCursor() and then
the Wayland server sending a pointer enter event, which invokes
xwl_seat_set_cursor() while the seat's x_cursor has just been
unrealized.

To avoid this, walk through all the xwl_seats and clear up all x_cursor
matching the cursor being unrealized.

Signed-off-by: Olivier Fourdan 
Reviewed-by: Jonas Ådahl 


Also LGTM:

Reviewed-by: Hans de Goede 

Regards,

Hans



---
 v2: Use xorg_list_for_each_entry() instead of xorg_list_for_each_entry_safe()
 as suggested by Jonas and add his r-b as per his review.

 hw/xwayland/xwayland-cursor.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index 7d14a3d..b2ae93f 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -76,6 +76,7 @@ static Bool
 xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
 {
 PixmapPtr pixmap;
+struct xwl_screen *xwl_screen;
 struct xwl_seat *xwl_seat;

 pixmap = dixGetPrivate(>devPrivates, _cursor_private_key);
@@ -85,9 +86,9 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, 
CursorPtr cursor)
 dixSetPrivate(>devPrivates, _cursor_private_key, NULL);

 /* When called from FreeCursor(), device is always NULL */
-if (device) {
-xwl_seat = device->public.devicePrivate;
-if (xwl_seat && cursor == xwl_seat->x_cursor)
+xwl_screen = xwl_screen_get(screen);
+xorg_list_for_each_entry(xwl_seat, _screen->seat_list, link) {
+if (cursor == xwl_seat->x_cursor)
 xwl_seat->x_cursor = NULL;
 }



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

Re: [PATCH xserver] os: Eliminate NewOutputPending

2016-09-22 Thread Hans de Goede

Hi,

On 09/22/2016 11:34 AM, Keith Packard wrote:

By removing clients from output_pending_clients list when flushing is
attempted, that list now becomes the list of clients that need
flushing, which is equivalent to what NewOutputPending was used for.

Clients are added to output_pending_clients when data are added to
their output buffer and when write blocked clients become writable.

Signed-off-by: Keith Packard 


Patch LGTM:

Reviewed-by: Hans de Goede 

Regards,

Hans



---
 os/WaitFor.c|  2 +-
 os/connection.c |  3 +--
 os/io.c | 16 
 os/osdep.h  |  2 --
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 024df35..cde2c8c 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -213,7 +213,7 @@ WaitForSomething(Bool are_ready)
 timeout = check_timers();

 BlockHandler();
-if (NewOutputPending)
+if (any_output_pending())
 FlushAllOutput();
 /* keep this check close to select() call to minimize race */
 if (dispatchException)
diff --git a/os/connection.c b/os/connection.c
index a901ebf..52b5067 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -121,7 +121,6 @@ SOFTWARE.
 struct ospoll   *server_poll;

 int MaxClients = 0;
-Bool NewOutputPending;  /* not yet attempted to write some new output 
*/
 Bool NoListenAll;   /* Don't establish any listening sockets */

 static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
@@ -712,7 +711,7 @@ ClientReady(int fd, int xevents, void *data)
 mark_client_ready(client);
 if (xevents & X_NOTIFY_WRITE) {
 ospoll_mute(server_poll, fd, X_NOTIFY_WRITE);
-NewOutputPending = TRUE;
+output_pending_mark(client);
 }
 }

diff --git a/os/io.c b/os/io.c
index 5ba1e86..7b95118 100644
--- a/os/io.c
+++ b/os/io.c
@@ -596,9 +596,8 @@ FlushAllOutput(void)
 {
 OsCommPtr oc;
 register ClientPtr client, tmp;
-Bool newoutput = NewOutputPending;

-if (!newoutput)
+if (!any_output_pending())
 return;

 /*
@@ -607,7 +606,6 @@ FlushAllOutput(void)
  * simply wait for the select to tell us when he's ready to receive.
  */
 CriticalOutputPending = FALSE;
-NewOutputPending = FALSE;

 xorg_list_for_each_entry_safe(client, tmp, _pending_clients, 
output_pending) {
 if (client->clientGone)
@@ -615,8 +613,7 @@ FlushAllOutput(void)
 if (!client_is_ready(client)) {
 oc = (OsCommPtr) client->osPrivate;
 (void) FlushClient(client, oc, (char *) NULL, 0);
-} else
-NewOutputPending = TRUE;
+}
 }
 }

@@ -759,16 +756,12 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
 }
 #endif
 if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
-output_pending_clear(who);
-if (!any_output_pending()) {
+if (!any_output_pending())
 CriticalOutputPending = FALSE;
-NewOutputPending = FALSE;
-}

 return FlushClient(who, oc, buf, count);
 }

-NewOutputPending = TRUE;
 output_pending_mark(who);
 memmove((char *) oco->buf + oco->count, buf, count);
 oco->count += count;
@@ -802,6 +795,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)
 long notWritten;
 long todo;

+output_pending_clear(who);
 if (!oco)
return 0;
 written = 0;
@@ -868,7 +862,6 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)
 /* If we've arrived here, then the client is stuffed to the gills
and not ready to accept more.  Make a note of it and buffer
the rest. */
-output_pending_mark(who);

 if (written < oco->count) {
 if (written > 0) {
@@ -932,7 +925,6 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)

 /* everything was flushed out */
 oco->count = 0;
-output_pending_clear(who);

 if (oco->size > BUFWATERMARK) {
 free(oco->buf);
diff --git a/os/osdep.h b/os/osdep.h
index 90a247f..9c8bd48 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -165,8 +165,6 @@ extern void SetConnectionTranslation(int conn, int client);
 extern void ClearConnectionTranslation(void);
 #endif

-extern Bool NewOutputPending;
-
 extern WorkQueuePtr workQueue;

 /* in WaitFor.c */


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

[PATCH xserver] xwayland: Clear up x_cursor on UnrealizeCursor()

2016-09-22 Thread Olivier Fourdan
In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only
when a device value is provided to the UnrealizeCursor() routine, but
if the device is NULL as called from FreeCursor(), the corresponding
x_cursor for the xwl_seat is left untouched.

This might cause a segfault when trying to access the unrealized
cursor's devPrivates in xwl_seat_set_cursor().

A possible occurrence of this is the client changing the cursor, the
Xserver calling FreeCursor() which does UnrealizeCursor() and then
the Wayland server sending a pointer enter event, which invokes
xwl_seat_set_cursor() while the seat's x_cursor has just been
unrealized.

To avoid this, walk through all the xwl_seats and clear up all x_cursor
matching the cursor being unrealized.

Signed-off-by: Olivier Fourdan 
---
 hw/xwayland/xwayland-cursor.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index 7d14a3d..0f22b5d 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -76,7 +76,8 @@ static Bool
 xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
 {
 PixmapPtr pixmap;
-struct xwl_seat *xwl_seat;
+struct xwl_screen *xwl_screen;
+struct xwl_seat *xwl_seat, *next_xwl_seat;
 
 pixmap = dixGetPrivate(>devPrivates, _cursor_private_key);
 if (!pixmap)
@@ -85,9 +86,10 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, 
CursorPtr cursor)
 dixSetPrivate(>devPrivates, _cursor_private_key, NULL);
 
 /* When called from FreeCursor(), device is always NULL */
-if (device) {
-xwl_seat = device->public.devicePrivate;
-if (xwl_seat && cursor == xwl_seat->x_cursor)
+xwl_screen = xwl_screen_get(screen);
+xorg_list_for_each_entry_safe(xwl_seat, next_xwl_seat,
+  _screen->seat_list, link) {
+if (cursor == xwl_seat->x_cursor)
 xwl_seat->x_cursor = NULL;
 }
 
-- 
2.9.3

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

[PATCH xserver v2] xwayland: Clear up x_cursor on UnrealizeCursor()

2016-09-22 Thread Olivier Fourdan
In Xwayland's xwl_unrealize_cursor(), the x_cursor is cleared up only
when a device value is provided to the UnrealizeCursor() routine, but
if the device is NULL as called from FreeCursor(), the corresponding
x_cursor for the xwl_seat is left untouched.

This might cause a segfault when trying to access the unrealized
cursor's devPrivates in xwl_seat_set_cursor().

A possible occurrence of this is the client changing the cursor, the
Xserver calling FreeCursor() which does UnrealizeCursor() and then
the Wayland server sending a pointer enter event, which invokes
xwl_seat_set_cursor() while the seat's x_cursor has just been
unrealized.

To avoid this, walk through all the xwl_seats and clear up all x_cursor
matching the cursor being unrealized.

Signed-off-by: Olivier Fourdan 
Reviewed-by: Jonas Ådahl 
---
 v2: Use xorg_list_for_each_entry() instead of xorg_list_for_each_entry_safe()
 as suggested by Jonas and add his r-b as per his review.

 hw/xwayland/xwayland-cursor.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index 7d14a3d..b2ae93f 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -76,6 +76,7 @@ static Bool
 xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
 {
 PixmapPtr pixmap;
+struct xwl_screen *xwl_screen;
 struct xwl_seat *xwl_seat;
 
 pixmap = dixGetPrivate(>devPrivates, _cursor_private_key);
@@ -85,9 +86,9 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, 
CursorPtr cursor)
 dixSetPrivate(>devPrivates, _cursor_private_key, NULL);
 
 /* When called from FreeCursor(), device is always NULL */
-if (device) {
-xwl_seat = device->public.devicePrivate;
-if (xwl_seat && cursor == xwl_seat->x_cursor)
+xwl_screen = xwl_screen_get(screen);
+xorg_list_for_each_entry(xwl_seat, _screen->seat_list, link) {
+if (cursor == xwl_seat->x_cursor)
 xwl_seat->x_cursor = NULL;
 }
 
-- 
2.9.3

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

[PATCH xserver 08/10] test: Update piglit HTML even when tests all pass.

2016-09-22 Thread Eric Anholt
I was confused by the behavior I'd written before.  keithp and
mattst88 responded with shock that I would have made it so surprising,
as well.

Signed-off-by: Eric Anholt 
---
 test/scripts/run-piglit.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/scripts/run-piglit.sh b/test/scripts/run-piglit.sh
index 601579c2e60c..eb6ccca35dbb 100755
--- a/test/scripts/run-piglit.sh
+++ b/test/scripts/run-piglit.sh
@@ -60,15 +60,15 @@ if ! grep "^ *crash: *0$" $SHORT_SUMMARY > /dev/null; then
 status=1
 fi
 
-if test $status != 0; then
-$PIGLIT_DIR/piglit-summary-html.py \
+$PIGLIT_DIR/piglit-summary-html.py \
--overwrite \
$PIGLIT_RESULTS_DIR/html \
$PIGLIT_RESULTS_DIR
 
+if test $status != 0; then
 echo "Some piglit tests failed."
 echo "The list of failing tests can be found in $LONG_SUMMARY."
-echo "An html page of the failing tests can be found at 
$PIGLIT_RESULTS_DIR/html/problems.html"
 fi
+echo "An html page of the test status can be found at 
$PIGLIT_RESULTS_DIR/html/problems.html"
 
 exit $status
-- 
2.9.3

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

[PATCH xserver 09/10] test: Switch our testing X server to being spawned with simple-xinit.

2016-09-22 Thread Eric Anholt
Once I introduced a second X server being tested, I found that startx
hit races in choosing a display.

Signed-off-by: Eric Anholt 
---
 test/scripts/run-piglit.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/scripts/run-piglit.sh b/test/scripts/run-piglit.sh
index eb6ccca35dbb..80d0faab6b21 100755
--- a/test/scripts/run-piglit.sh
+++ b/test/scripts/run-piglit.sh
@@ -32,7 +32,7 @@ if test "x$XSERVER_BUILDDIR" = "x"; then
 exit 1
 fi
 
-startx \
+$XSERVER_BUILDDIR/test/simple-xinit \
 $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
 -- \
 $SERVER_COMMAND
-- 
2.9.3

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

[PATCH xserver 04/10] test: Handle srcdir != builddir in Xvfb testing.

2016-09-22 Thread Eric Anholt
Signed-off-by: Eric Anholt 
---
 test/Makefile.am| 3 ++-
 test/scripts/xvfb-piglit.sh | 8 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 5a35e2bb198f..4ccadf5b0005 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -26,7 +26,8 @@ TESTS = \
$(NULL)
 
 TESTS_ENVIRONMENT = \
-   XSERVER_DIR=$(abs_top_builddir) \
+   XSERVER_DIR=$(abs_top_srcdir) \
+   XSERVER_BUILDDIR=$(abs_top_builddir) \
$(XORG_MALLOC_DEBUG_ENV) \
$(NULL)
 
diff --git a/test/scripts/xvfb-piglit.sh b/test/scripts/xvfb-piglit.sh
index 2a4e9405268d..b775239e34f5 100755
--- a/test/scripts/xvfb-piglit.sh
+++ b/test/scripts/xvfb-piglit.sh
@@ -20,12 +20,18 @@ if test "x$XSERVER_DIR" = "x"; then
 exit 1
 fi
 
+if test "x$XSERVER_BUILDDIR" = "x"; then
+echo "XSERVER_BUILDDIR must be set to the build directory of the xserver 
repository."
+# Exit as a real failure because it should always be set.
+exit 1
+fi
+
 export PIGLIT_RESULTS_DIR=$PIGLIT_DIR/results/xvfb
 
 startx \
 $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
 -- \
-$XSERVER_DIR/hw/vfb/Xvfb \
+$XSERVER_BUILDDIR/hw/vfb/Xvfb \
 -noreset \
 -screen scrn 1280x1024x24
 
-- 
2.9.3

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

[PATCH xserver 05/10] test: Add a little xinit-like program for starting servers for testing.

2016-09-22 Thread Eric Anholt
The normal xinit is racy because it doesn't use -displayfd.  This
implements the bare minimum for testing purposes, using -displayfd to
sequence starting the client, and avoids adding yet another dependency
to the server.

Signed-off-by: Eric Anholt 
---
 test/.gitignore |   1 +
 test/Makefile.am|  13 +++-
 test/simple-xinit.c | 216 
 3 files changed, 226 insertions(+), 4 deletions(-)
 create mode 100644 test/simple-xinit.c

diff --git a/test/.gitignore b/test/.gitignore
index a62fc3d70651..c44fc827ac13 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -11,5 +11,6 @@ xfree86
 xkb
 xtest
 signal-logging
+simple-xinit
 *.log
 *.trs
diff --git a/test/Makefile.am b/test/Makefile.am
index 4ccadf5b0005..24bfc35bc88a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,17 +1,22 @@
 if ENABLE_UNIT_TESTS
 SUBDIRS= .
-noinst_PROGRAMS = list string
+TEST_PROGS = list string
 if XORG
 # Tests that require at least some DDX functions in order to fully link
 # For now, requires xf86 ddx, could be adjusted to use another
 SUBDIRS += xi1 xi2
-noinst_PROGRAMS += xkb input xtest misc fixes xfree86 signal-logging touch
+TEST_PROGS += xkb input xtest misc fixes xfree86 signal-logging touch
 if RES
-noinst_PROGRAMS += hashtabletest
+TEST_PROGS += hashtabletest
 endif
 endif
 check_LTLIBRARIES = libxservertest.la
 
+noinst_PROGRAMS = \
+   simple-xinit \
+   $(TEST_PROGS) \
+   $(NULL)
+
 if XVFB
 XVFB_TESTS = scripts/xvfb-piglit.sh
 endif
@@ -21,7 +26,7 @@ SCRIPT_TESTS = \
$(NULL)
 
 TESTS = \
-   $(noinst_PROGRAMS) \
+   $(TEST_PROGS) \
$(SCRIPT_TESTS) \
$(NULL)
 
diff --git a/test/simple-xinit.c b/test/simple-xinit.c
new file mode 100644
index ..d078a9c3a004
--- /dev/null
+++ b/test/simple-xinit.c
@@ -0,0 +1,216 @@
+/*
+ * Copyright © 2016 Broadcom
+ *
+ * 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include 
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void
+kill_server(int serverpid)
+{
+int ret = kill(serverpid, SIGTERM);
+int wstatus;
+
+if (ret) {
+fprintf(stderr, "Failed to send kill to the server: %s\n",
+strerror(errno));
+exit(1);
+}
+
+ret = waitpid(serverpid, , 0);
+if (ret < 0) {
+fprintf(stderr, "Failed to wait for X to die: %s\n", strerror(errno));
+exit(1);
+}
+}
+
+static void
+usage(int argc, char **argv)
+{
+fprintf(stderr, "%s  -- \n", argv[0]);
+exit(1);
+}
+
+/* Starts the X server, returning its pid. */
+static int
+start_server(char *const *server_args)
+{
+int serverpid = fork();
+
+if (serverpid != 0) {
+/* Continue along the main process that will exec the client. */
+return serverpid;
+}
+
+/* Execute the server.  This only returns if an error occurred. */
+execvp(server_args[0], server_args);
+fprintf(stderr, "Error starting the server: %s\n", strerror(errno));
+exit(1);
+}
+
+/* Reads the display number out of the started server's display socket. */
+static int
+get_display(int displayfd)
+{
+char display_string[10];
+ssize_t ret;
+
+ret = read(displayfd, display_string, sizeof(display_string - 1));
+if (ret <= 0) {
+fprintf(stderr, "Failed reading displayfd: %s\n", strerror(errno));
+exit(1);
+}
+
+/* We've read in the display number as a string terminated by
+ * '\n', but not '\0'.  Cap it and parse the number.
+ */
+display_string[ret] = '\0';
+return atoi(display_string);
+}
+
+static int
+start_client(char *const *client_args, int display)
+{
+char *display_string;
+int ret;
+int client_pid;
+
+asprintf(_string, ":%d", display);
+ret = setenv("DISPLAY", display_string, true);
+if (ret) {
+   

[PATCH xserver 01/10] glamor: Fix some awful formatting of some fallback debug code.

2016-09-22 Thread Eric Anholt
This was clearly x-indent.sh damage.

Signed-off-by: Eric Anholt 
---
 glamor/glamor_render.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 64141ac0f324..c590580412c9 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1712,12 +1712,12 @@ glamor_composite(CARD8 op,
  source, source->pDrawable,
  source->pDrawable ? source->pDrawable->width : 0,
  source->pDrawable ? source->pDrawable->height : 0, mask,
- (!mask) ? NULL : mask->pDrawable, (!mask
-|| !mask->pDrawable) ? 0 :
- mask->pDrawable->width, (!mask
-  || !mask->pDrawable) ? 0 : mask->
- pDrawable->height, glamor_get_picture_location(source),
- glamor_get_picture_location(mask), dest, dest->pDrawable,
+ (!mask) ? NULL : mask->pDrawable,
+ (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->width,
+ (!mask || !mask->pDrawable) ? 0 : mask->pDrawable->height,
+ glamor_get_picture_location(source),
+ glamor_get_picture_location(mask),
+ dest, dest->pDrawable,
  dest->pDrawable->width, dest->pDrawable->height,
  glamor_get_picture_location(dest));
 
-- 
2.9.3

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

[PATCH xserver 10/10] test: Run xts against Xephyr -glamor when present.

2016-09-22 Thread Eric Anholt
Signed-off-by: Eric Anholt 
---
 test/Makefile.am |  6 ++
 test/scripts/xephyr-glamor-piglit.sh | 29 +
 2 files changed, 35 insertions(+)
 create mode 100755 test/scripts/xephyr-glamor-piglit.sh

diff --git a/test/Makefile.am b/test/Makefile.am
index cf19beca96ff..c89915c41348 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,10 +19,16 @@ noinst_PROGRAMS = \
 
 if XVFB
 XVFB_TESTS = scripts/xvfb-piglit.sh
+if XEPHYR
+if GLAMOR
+XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh
+endif
+endif
 endif
 
 SCRIPT_TESTS = \
$(XVFB_TESTS) \
+   $(XEPHYR_GLAMOR_TESTS) \
$(NULL)
 
 TESTS = \
diff --git a/test/scripts/xephyr-glamor-piglit.sh 
b/test/scripts/xephyr-glamor-piglit.sh
new file mode 100755
index ..9dd77695ba1d
--- /dev/null
+++ b/test/scripts/xephyr-glamor-piglit.sh
@@ -0,0 +1,29 @@
+# Start a Xephyr server using glamor.  Since the test environment is
+# headless, we start an Xvfb first to host the Xephyr.
+export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor
+
+# The composite test is broken for reasons I haven't debugged yet:
+#
+#  Beginning composite mask test on a8r8g8b8
+#  Src composite test error of 255. at (0, 0) --
+# R G B A
+#  got:   0.000 0.000 0.000 0.000
+#  expected:  1.000 1.000 1.000 1.000
+#  src color: 1.00 1.00 1.00 1.00
+#  msk color: 1.00 1.00 1.00 1.00
+#  dst color: 1.00 1.00 1.00 1.00
+#  src: 1x1R a8r8g8b8, mask: 1x1R x8r8g8b8, dst: a8r8g8b8
+export PIGLIT_ARGS="$PIGLIT_ARGS -x composite@all@x8r8g8b8"
+
+export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
+-glamor \
+-glamor-skip-present \
+-noreset \
+-schedMax 2000 \
+-screen 1280x1024"
+
+$XSERVER_BUILDDIR/test/simple-xinit \
+$XSERVER_DIR/test/scripts/run-piglit.sh \
+-- \
+$XSERVER_BUILDDIR/hw/vfb/Xvfb \
+-screen scrn 1280x1024x24
-- 
2.9.3

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

[PATCH xserver 06/10] test: Make the piglit-running script callable with an arbitrary server.

2016-09-22 Thread Eric Anholt
Signed-off-by: Eric Anholt 
---
 test/.gitignore|  1 +
 test/Makefile.am   |  1 +
 test/scripts/{xvfb-piglit.sh => run-piglit.sh} | 12 +++--
 test/scripts/xvfb-piglit.sh| 73 ++
 4 files changed, 13 insertions(+), 74 deletions(-)
 copy test/scripts/{xvfb-piglit.sh => run-piglit.sh} (90%)

diff --git a/test/.gitignore b/test/.gitignore
index c44fc827ac13..47f766c5f620 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -11,6 +11,7 @@ xfree86
 xkb
 xtest
 signal-logging
+piglit-results
 simple-xinit
 *.log
 *.trs
diff --git a/test/Makefile.am b/test/Makefile.am
index 24bfc35bc88a..cf19beca96ff 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -163,6 +163,7 @@ endif
 EXTRA_DIST = \
$(SCRIPT_TESTS) \
scripts/xinit-piglit-session.sh \
+   scripts/run-piglit.sh \
ddxstubs.c \
$(NULL)
 
diff --git a/test/scripts/xvfb-piglit.sh b/test/scripts/run-piglit.sh
similarity index 90%
copy from test/scripts/xvfb-piglit.sh
copy to test/scripts/run-piglit.sh
index b775239e34f5..ab37ee3b92ad 100755
--- a/test/scripts/xvfb-piglit.sh
+++ b/test/scripts/run-piglit.sh
@@ -14,6 +14,12 @@ if test "x$PIGLIT_DIR" = "x"; then
 exit 77
 fi
 
+if test "x$PIGLIT_RESULTS_DIR" = "x"; then
+echo "PIGLIT_RESULTS_DIR must be set to where to output piglit results."
+# Exit as a real failure because it should always be set.
+exit 1
+fi
+
 if test "x$XSERVER_DIR" = "x"; then
 echo "XSERVER_DIR must be set to the directory of the xserver repository."
 # Exit as a real failure because it should always be set.
@@ -26,14 +32,10 @@ if test "x$XSERVER_BUILDDIR" = "x"; then
 exit 1
 fi
 
-export PIGLIT_RESULTS_DIR=$PIGLIT_DIR/results/xvfb
-
 startx \
 $XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
 -- \
-$XSERVER_BUILDDIR/hw/vfb/Xvfb \
--noreset \
--screen scrn 1280x1024x24
+$SERVER_COMMAND
 
 # Write out piglit-summaries.
 SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary
diff --git a/test/scripts/xvfb-piglit.sh b/test/scripts/xvfb-piglit.sh
index b775239e34f5..799f2850057a 100755
--- a/test/scripts/xvfb-piglit.sh
+++ b/test/scripts/xvfb-piglit.sh
@@ -1,72 +1,7 @@
-#!/bin/sh
-
-set -e
-
-if test "x$XTEST_DIR" = "x"; then
-echo "XTEST_DIR must be set to the directory of the xtest repository."
-# Exit as a "skip" so make check works even without piglit.
-exit 77
-fi
-
-if test "x$PIGLIT_DIR" = "x"; then
-echo "PIGLIT_DIR must be set to the directory of the piglit repository."
-# Exit as a "skip" so make check works even without piglit.
-exit 77
-fi
-
-if test "x$XSERVER_DIR" = "x"; then
-echo "XSERVER_DIR must be set to the directory of the xserver repository."
-# Exit as a real failure because it should always be set.
-exit 1
-fi
-
-if test "x$XSERVER_BUILDDIR" = "x"; then
-echo "XSERVER_BUILDDIR must be set to the build directory of the xserver 
repository."
-# Exit as a real failure because it should always be set.
-exit 1
-fi
-
-export PIGLIT_RESULTS_DIR=$PIGLIT_DIR/results/xvfb
-
-startx \
-$XSERVER_DIR/test/scripts/xinit-piglit-session.sh \
--- \
-$XSERVER_BUILDDIR/hw/vfb/Xvfb \
+export SERVER_COMMAND="$XSERVER_DIR/hw/vfb/Xvfb \
 -noreset \
--screen scrn 1280x1024x24
-
-# Write out piglit-summaries.
-SHORT_SUMMARY=$PIGLIT_RESULTS_DIR/summary
-LONG_SUMMARY=$PIGLIT_RESULTS_DIR/long-summary
-$PIGLIT_DIR/piglit-summary.py -s $PIGLIT_RESULTS_DIR > $SHORT_SUMMARY
-$PIGLIT_DIR/piglit-summary.py $PIGLIT_RESULTS_DIR > $LONG_SUMMARY
-
-# Write the short summary to make check's log file.
-cat $SHORT_SUMMARY
-
-# Parse the piglit summary to decide on our exit status.
-status=0
-# "pass: 0" would mean no tests actually ran.
-if grep "pass:.*0" $SHORT_SUMMARY > /dev/null; then
-status=1
-fi
-# Fails or crashes should be failures from make check's perspective.
-if ! grep "fail:.*0" $SHORT_SUMMARY > /dev/null; then
-status=1
-fi
-if ! grep "crash:.*0" $SHORT_SUMMARY > /dev/null; then
-status=1
-fi
-
-if test $status != 0; then
-$PIGLIT_DIR/piglit-summary-html.py \
-   --overwrite \
-   $PIGLIT_RESULTS_DIR/html \
-   $PIGLIT_RESULTS_DIR
+-screen scrn 1280x1024x24"
+export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb
 
-echo "Some piglit tests failed."
-echo "The list of failing tests can be found in $LONG_SUMMARY."
-echo "An html page of the failing tests can be found at 
$PIGLIT_RESULTS_DIR/html/problems.html"
-fi
+exec $XSERVER_DIR/test/scripts/run-piglit.sh
 
-exit $status
-- 
2.9.3

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

[PATCH xserver 02/10] glamor: Require that 16bpp pixmap depths match for Render copies.

2016-09-22 Thread Eric Anholt
The copy optimization in d37329cba42fa8e72fe4be8a7be18e512268b5bd
replicated a bug from last time we did a copy optimization, and didn't
get rendercheck run on it.  This is effectively a re-cherry-pick of
510c8605641803f1f5b5d2de6d3bb422b148e0e7.

Fixes rendercheck -t blend -o src -f x4r4g4b4,x3r4g4b4

Signed-off-by: Eric Anholt 
---
 glamor/glamor_render.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index c590580412c9..26dee05b5ce1 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1423,6 +1423,12 @@ glamor_composite_clipped_region(CARD8 op,
 /* Is the composite operation equivalent to a copy? */
 if (!mask && !source->alphaMap && !dest->alphaMap
 && source->pDrawable && !source->transform
+&& source->pDrawable->depth == dest->pDrawable->depth
+/* We can't do direct copies between different depths at 16bpp
+ * because r,g,b are allocated to different bits.
+ */
+&& !(dest->pDrawable->bitsPerPixel == 16 &&
+ dest->pDrawable->depth != source->pDrawable->depth)
 && ((op == PictOpSrc
  && (source->format == dest->format
  || (PICT_FORMAT_COLOR(dest->format)
-- 
2.9.3

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

[PATCH xserver 00/10] Automated glamor testing

2016-09-22 Thread Eric Anholt
Here's a series that gets us automated headless make check of glamor.
The run takes about 10 minutes with llvmpipe on new hardware.

Along the way, I had to fix glamor so that more of its tests pass, and
fix test result reporting (oops), and hack Xephyr to make the testing
fast enough (I do really need to fix the BlockHandler flush frequency
problem).

Eric Anholt (10):
  glamor: Fix some awful formatting of some fallback debug code.
  glamor: Require that 16bpp pixmap depths match for Render copies.
  ephyr: Add a mode for skipping redisplay in glamor.
  test: Handle srcdir != builddir in Xvfb testing.
  test: Add a little xinit-like program for starting servers for
testing.
  test: Make the piglit-running script callable with an arbitrary
server.
  test: Fix parsing of piglit results.
  test: Update piglit HTML even when tests all pass.
  test: Switch our testing X server to being spawned with simple-xinit.
  test: Run xts against Xephyr -glamor when present.

 glamor/glamor_render.c |  18 ++-
 hw/kdrive/ephyr/ephyr_glamor_glx.c |   8 +
 hw/kdrive/ephyr/ephyrinit.c|   7 +-
 test/.gitignore|   2 +
 test/Makefile.am   |  23 ++-
 test/scripts/{xvfb-piglit.sh => run-piglit.sh} |  30 ++--
 test/scripts/xephyr-glamor-piglit.sh   |  29 
 test/scripts/xvfb-piglit.sh|  67 +---
 test/simple-xinit.c| 216 +
 9 files changed, 314 insertions(+), 86 deletions(-)
 copy test/scripts/{xvfb-piglit.sh => run-piglit.sh} (65%)
 create mode 100755 test/scripts/xephyr-glamor-piglit.sh
 create mode 100644 test/simple-xinit.c

-- 
2.9.3

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

[PATCH xserver 07/10] test: Fix parsing of piglit results.

2016-09-22 Thread Eric Anholt
The "dmesg-fail" line was matching our "fail" regex, so if you didn't
have those we would ignore fails.

Signed-off-by: Eric Anholt 
---
 test/scripts/run-piglit.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/scripts/run-piglit.sh b/test/scripts/run-piglit.sh
index ab37ee3b92ad..601579c2e60c 100755
--- a/test/scripts/run-piglit.sh
+++ b/test/scripts/run-piglit.sh
@@ -49,14 +49,14 @@ cat $SHORT_SUMMARY
 # Parse the piglit summary to decide on our exit status.
 status=0
 # "pass: 0" would mean no tests actually ran.
-if grep "pass:.*0" $SHORT_SUMMARY > /dev/null; then
+if grep "^ *pass: *0$" $SHORT_SUMMARY > /dev/null; then
 status=1
 fi
 # Fails or crashes should be failures from make check's perspective.
-if ! grep "fail:.*0" $SHORT_SUMMARY > /dev/null; then
+if ! grep "^ *fail: *0$" $SHORT_SUMMARY > /dev/null; then
 status=1
 fi
-if ! grep "crash:.*0" $SHORT_SUMMARY > /dev/null; then
+if ! grep "^ *crash: *0$" $SHORT_SUMMARY > /dev/null; then
 status=1
 fi
 
-- 
2.9.3

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

[PATCH xserver 03/10] ephyr: Add a mode for skipping redisplay in glamor.

2016-09-22 Thread Eric Anholt
This speeds up headless testing of Xephyr -glamor with softpipe from
"a test per minute or so" to "a test every few seconds".

Signed-off-by: Eric Anholt 
---
 hw/kdrive/ephyr/ephyr_glamor_glx.c | 8 
 hw/kdrive/ephyr/ephyrinit.c| 7 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c 
b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 2f219141eccc..007123c31e48 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -57,6 +57,7 @@ static Display *dpy;
 static XVisualInfo *visual_info;
 static GLXFBConfig fb_config;
 Bool ephyr_glamor_gles2;
+Bool ephyr_glamor_skip_present;
 /** @} */
 
 /**
@@ -220,6 +221,13 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
 {
 GLint old_vao;
 
+/* Skip presenting the output in this mode.  Presentation is
+ * expensive, and if we're just running the X Test suite headless,
+ * nobody's watching.
+ */
+if (ephyr_glamor_skip_present)
+return;
+
 glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx);
 
 if (glamor->vao) {
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 149ea981ee4d..7632c2643210 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -36,7 +36,7 @@ extern Bool EphyrWantResize;
 extern Bool EphyrWantNoHostGrab;
 extern Bool kdHasPointer;
 extern Bool kdHasKbd;
-extern Bool ephyr_glamor, ephyr_glamor_gles2;
+extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present;
 
 extern Bool ephyrNoXV;
 
@@ -148,6 +148,7 @@ ddxUseMsg(void)
 #ifdef GLAMOR
 ErrorF("-glamor  Enable 2D acceleration using glamor\n");
 ErrorF("-glamor_gles2Enable 2D acceleration using glamor (with 
GLES2 only)\n");
+ErrorF("-glamor-skip-present Skip presenting the output when using glamor 
(for internal testing optimization)\n");
 #endif
 ErrorF
 ("-fakexa  Simulate acceleration using software 
rendering\n");
@@ -288,6 +289,10 @@ ddxProcessArgument(int argc, char **argv, int i)
 ephyrFuncs.finiAccel = ephyr_glamor_fini;
 return 1;
 }
+else if (!strcmp (argv[i], "-glamor-skip-present")) {
+ephyr_glamor_skip_present = TRUE;
+return 1;
+}
 #endif
 else if (!strcmp(argv[i], "-fakexa")) {
 ephyrFuncs.initAccel = ephyrDrawInit;
-- 
2.9.3

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

[PATCH xserver] os: Eliminate NewOutputPending

2016-09-22 Thread Keith Packard
By removing clients from output_pending_clients list when flushing is
attempted, that list now becomes the list of clients that need
flushing, which is equivalent to what NewOutputPending was used for.

Clients are added to output_pending_clients when data are added to
their output buffer and when write blocked clients become writable.

Signed-off-by: Keith Packard 
---
 os/WaitFor.c|  2 +-
 os/connection.c |  3 +--
 os/io.c | 16 
 os/osdep.h  |  2 --
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 024df35..cde2c8c 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -213,7 +213,7 @@ WaitForSomething(Bool are_ready)
 timeout = check_timers();
 
 BlockHandler();
-if (NewOutputPending)
+if (any_output_pending())
 FlushAllOutput();
 /* keep this check close to select() call to minimize race */
 if (dispatchException)
diff --git a/os/connection.c b/os/connection.c
index a901ebf..52b5067 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -121,7 +121,6 @@ SOFTWARE.
 struct ospoll   *server_poll;
 
 int MaxClients = 0;
-Bool NewOutputPending;  /* not yet attempted to write some new output 
*/
 Bool NoListenAll;   /* Don't establish any listening sockets */
 
 static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
@@ -712,7 +711,7 @@ ClientReady(int fd, int xevents, void *data)
 mark_client_ready(client);
 if (xevents & X_NOTIFY_WRITE) {
 ospoll_mute(server_poll, fd, X_NOTIFY_WRITE);
-NewOutputPending = TRUE;
+output_pending_mark(client);
 }
 }
 
diff --git a/os/io.c b/os/io.c
index 5ba1e86..7b95118 100644
--- a/os/io.c
+++ b/os/io.c
@@ -596,9 +596,8 @@ FlushAllOutput(void)
 {
 OsCommPtr oc;
 register ClientPtr client, tmp;
-Bool newoutput = NewOutputPending;
 
-if (!newoutput)
+if (!any_output_pending())
 return;
 
 /*
@@ -607,7 +606,6 @@ FlushAllOutput(void)
  * simply wait for the select to tell us when he's ready to receive.
  */
 CriticalOutputPending = FALSE;
-NewOutputPending = FALSE;
 
 xorg_list_for_each_entry_safe(client, tmp, _pending_clients, 
output_pending) {
 if (client->clientGone)
@@ -615,8 +613,7 @@ FlushAllOutput(void)
 if (!client_is_ready(client)) {
 oc = (OsCommPtr) client->osPrivate;
 (void) FlushClient(client, oc, (char *) NULL, 0);
-} else
-NewOutputPending = TRUE;
+}
 }
 }
 
@@ -759,16 +756,12 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
 }
 #endif
 if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
-output_pending_clear(who);
-if (!any_output_pending()) {
+if (!any_output_pending())
 CriticalOutputPending = FALSE;
-NewOutputPending = FALSE;
-}
 
 return FlushClient(who, oc, buf, count);
 }
 
-NewOutputPending = TRUE;
 output_pending_mark(who);
 memmove((char *) oco->buf + oco->count, buf, count);
 oco->count += count;
@@ -802,6 +795,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)
 long notWritten;
 long todo;
 
+output_pending_clear(who);
 if (!oco)
return 0;
 written = 0;
@@ -868,7 +862,6 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)
 /* If we've arrived here, then the client is stuffed to the gills
and not ready to accept more.  Make a note of it and buffer
the rest. */
-output_pending_mark(who);
 
 if (written < oco->count) {
 if (written > 0) {
@@ -932,7 +925,6 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void 
*__extraBuf, int extraCount)
 
 /* everything was flushed out */
 oco->count = 0;
-output_pending_clear(who);
 
 if (oco->size > BUFWATERMARK) {
 free(oco->buf);
diff --git a/os/osdep.h b/os/osdep.h
index 90a247f..9c8bd48 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -165,8 +165,6 @@ extern void SetConnectionTranslation(int conn, int client);
 extern void ClearConnectionTranslation(void);
 #endif
 
-extern Bool NewOutputPending;
-
 extern WorkQueuePtr workQueue;
 
 /* in WaitFor.c */
-- 
2.9.3

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

Re: [PATCH 1/1] dix: Silence TSan warnings when checking for pending input

2016-09-22 Thread Keith Packard
Jeremy Huddleston Sequoia  writes:

> +static inline _X_NOTSAN Bool
> +InputCheckPending(void)
> +{
> +return (*checkForInput[0] != *checkForInput[1]);
> +}

> +static inline _X_NOTSAN Bool
> +InputCheckPending(void)
> +{
> +return (*checkForInput[0] != *checkForInput[1]);
> +}

You should stick this in dix.h, or some other suitable header
file.

Otherwise, this looks good.

-- 
-keith


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