[PULL] hw/xwin warning fixes

2015-07-07 Thread Jon Turney
Hi Keith,

Some patches to fix format warnings in hw/xwin.

Please consider pulling into master.

I'm not sure what the status is of 1.18, so I can resend this later, if you 
prefer.

Thanks.


The following changes since commit 732e3b9c08532f40656010eac9d128601cc88c3f:

  Instead of one glTexSubImage2D call for each glyph. (2015-07-06 18:45:51 
-0700)

are available in the git repository at:

  git://people.freedesktop.org/~jturney/xserver 

for you to fetch changes up to 0cd228073ad3b7eb72cef8b61128324895ee6cd4:

  hw/xwin: printf format fixes for Pixel type (2015-07-07 16:52:53 +0100)


Jon TURNEY (13):
  hw/xwin: Remove GetTickCount() from various pieces of debugging output
  hw/xwin: Ensure format warnings in winclipboard/
  hw/xwin: printf format fixes for HWND type
  hw/xwin: printf format fixes for XID type
  hw/xwin: printf format fixes in winConfigKeyboard()
  hw/xwin: printf format fixes in winAllocatePrivates()
  hw/xwin: printf format fix in winCreateDefColormap()
  hw/xwin: printf format fix in winProcessXEventsTimeout()
  hw/xwin: printf format fixes in xevents.c
  hw/xwin: printf format fixes for DWORD type
  hw/xwin: printf format fixes for LONG type
  hw/xwin: printf format fixes for WPARAM and LPARAM types
  hw/xwin: printf format fixes for Pixel type

 hw/xwin/glx/indirect.c| 12 +-
 hw/xwin/glx/winpriv.c |  2 +-
 hw/xwin/winallpriv.c  |  4 ++--
 hw/xwin/winclipboard/internal.h   |  4 ++--
 hw/xwin/winclipboard/wndproc.c| 12 +-
 hw/xwin/winclipboard/xevents.c| 16 ++---
 hw/xwin/wincmap.c | 10 
 hw/xwin/winconfig.c   |  2 +-
 hw/xwin/wincreatewnd.c|  9 +++
 hw/xwin/windialogs.c  |  8 +++
 hw/xwin/winkeybd.c|  4 ++--
 hw/xwin/winkeyhook.c  |  2 +-
 hw/xwin/winmsg.c  |  8 +++
 hw/xwin/winmultiwindowicons.c |  9 +++
 hw/xwin/winmultiwindowwindow.c| 50 ---
 hw/xwin/winmultiwindowwm.c|  4 ++--
 hw/xwin/winmultiwindowwndproc.c   | 39 +++---
 hw/xwin/winrandr.c|  5 ++--
 hw/xwin/winscrinit.c  |  4 ++--
 hw/xwin/winshadddnl.c | 15 +++-
 hw/xwin/winshadgdi.c  | 10 
 hw/xwin/winwin32rootlesswndproc.c | 18 +-
 hw/xwin/winwndproc.c  |  2 +-
 23 files changed, 125 insertions(+), 124 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: [PULL] hw/xwin warning fixes

2015-07-07 Thread Keith Packard
Jon Turney jon.tur...@dronecode.org.uk writes:

 Jon TURNEY (13):
   hw/xwin: Remove GetTickCount() from various pieces of debugging output
   hw/xwin: Ensure format warnings in winclipboard/
   hw/xwin: printf format fixes for HWND type
   hw/xwin: printf format fixes for XID type
   hw/xwin: printf format fixes in winConfigKeyboard()
   hw/xwin: printf format fixes in winAllocatePrivates()
   hw/xwin: printf format fix in winCreateDefColormap()
   hw/xwin: printf format fix in winProcessXEventsTimeout()
   hw/xwin: printf format fixes in xevents.c
   hw/xwin: printf format fixes for DWORD type
   hw/xwin: printf format fixes for LONG type
   hw/xwin: printf format fixes for WPARAM and LPARAM types
   hw/xwin: printf format fixes for Pixel type

Merged.
   732e3b9..0cd2280  master - master

-- 
-keith


signature.asc
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

Re: [PATCH v3] configurable maximum number of clients

2015-07-07 Thread Olivier Fourdan

Adding the dependency on xproto 7.0.28 that has been released last Wednesday 
which includes the patch to increase the number of file descriptors.

This is required for the second (dependent) patch which has already been 
reviewed by Adam, thus adding the R-b: Adam Jackson a...@redhat.com to that 
second patch.

Cheers,
Olivier
___
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] Fix NO_LOCAL_CLIENT_CRED build

2015-07-07 Thread Ray Strode
Hi,

On Mon, Jul 6, 2015 at 6:08 PM, Keith Packard kei...@keithp.com wrote:
 I liked your first version a lot better; looks a lot simpler. An
 autoconf test might make sense if there was some reason to override it?

To be clear, I primarily gave feedback because touched it last.  I
think it makes more sense to consolidate platform checks in
configure.ac (overridable or static) because the configure script is
what does the lion's share of platform checks.  Still, it's no doubt a
style question, and I'll defer on style matters to Keith/those more
intimately involved in the project than me.

--Ray
___
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/2] configurable maximum number of clients

2015-07-07 Thread Olivier Fourdan
Make the maximum number of clients user configurable, either from the command
line or from xorg.conf

This patch works by using the MAXCLIENTS (raised to 512) as the maximum
allowed number of clients, but allowing the actual limit to be set by the
user to a lower value (keeping the default of 256).

There is a limit size of 29 bits to be used to store both the client ID and
the X resources ID, so by reducing the number of clients allowed to connect to
the X server, the user can increase the number of X resources per client or
vice-versa.

Parts of this patch are based on a similar patch from Adam Jackson
a...@redhat.com

Signed-off-by: Adam Jackson a...@redhat.com
Signed-off-by: Olivier Fourdan ofour...@redhat.com
Reviewed-by: Adam Jackson a...@redhat.com
---
 v2: Use the user set client limit in multiple places instead of MAXCLIENTS,
 Bump value for MAXCLIENTS, MAXSELECT, MAXSOCKS and OPEN_MAX to 512,
 Requires an updated Xproto.
 v3: Fix 256 limit still remaining in InitConnectionLimits()

 configure.ac   |  2 +-
 dix/colormap.c | 28 ++--
 dix/dispatch.c |  4 ++--
 dix/main.c |  2 +-
 dix/resource.c | 33 -
 hw/dmx/glxProxy/glxext.c   |  2 +-
 hw/xfree86/common/xf86Config.c | 16 
 hw/xfree86/man/xorg.conf.man   |  4 
 include/misc.h |  3 ++-
 include/opaque.h   |  1 +
 include/resource.h | 15 ++-
 man/Xserver.man|  5 +
 os/connection.c|  6 +++---
 os/osdep.h |  8 
 os/osinit.c|  3 +++
 os/utils.c | 14 ++
 16 files changed, 101 insertions(+), 45 deletions(-)

diff --git a/configure.ac b/configure.ac
index 16d2123..28d31ef7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -400,7 +400,7 @@ case $host_os in
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
;;
   cygwin*|mingw*)
-   CFLAGS=$CFLAGS -DFD_SETSIZE=256
+   CFLAGS=$CFLAGS -DFD_SETSIZE=512
;;
 esac
 
diff --git a/dix/colormap.c b/dix/colormap.c
index a3e5a2c..80928b4 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -249,7 +249,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr 
pVisual,
 
 size = pVisual-ColormapEntries;
 sizebytes = (size * sizeof(Entry)) +
-(MAXCLIENTS * sizeof(Pixel *)) + (MAXCLIENTS * sizeof(int));
+(LimitClients * sizeof(Pixel *)) + (LimitClients * sizeof(int));
 if ((class | DynamicClass) == DirectColor)
 sizebytes *= 3;
 sizebytes += sizeof(ColormapRec);
@@ -274,7 +274,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr 
pVisual,
 sizebytes = size * sizeof(Entry);
 pmap-clientPixelsRed = (Pixel **) ((char *) pmap-red + sizebytes);
 pmap-numPixelsRed = (int *) ((char *) pmap-clientPixelsRed +
-  (MAXCLIENTS * sizeof(Pixel *)));
+  (LimitClients * sizeof(Pixel *)));
 pmap-mid = mid;
 pmap-flags = 0;/* start out with all flags clear */
 if (mid == pScreen-defColormap)
@@ -286,8 +286,8 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr 
pVisual,
 size = NUMRED(pVisual);
 pmap-freeRed = size;
 memset((char *) pmap-red, 0, (int) sizebytes);
-memset((char *) pmap-numPixelsRed, 0, MAXCLIENTS * sizeof(int));
-for (pptr = pmap-clientPixelsRed[MAXCLIENTS];
+memset((char *) pmap-numPixelsRed, 0, LimitClients * sizeof(int));
+for (pptr = pmap-clientPixelsRed[LimitClients];
  --pptr = pmap-clientPixelsRed;)
 *pptr = (Pixel *) NULL;
 if (alloc == AllocAll) {
@@ -310,26 +310,26 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr 
pVisual,
 if ((class | DynamicClass) == DirectColor) {
 pmap-freeGreen = NUMGREEN(pVisual);
 pmap-green = (EntryPtr) ((char *) pmap-numPixelsRed +
-  (MAXCLIENTS * sizeof(int)));
+  (LimitClients * sizeof(int)));
 pmap-clientPixelsGreen = (Pixel **) ((char *) pmap-green + 
sizebytes);
 pmap-numPixelsGreen = (int *) ((char *) pmap-clientPixelsGreen +
-(MAXCLIENTS * sizeof(Pixel *)));
+(LimitClients * sizeof(Pixel *)));
 pmap-freeBlue = NUMBLUE(pVisual);
 pmap-blue = (EntryPtr) ((char *) pmap-numPixelsGreen +
- (MAXCLIENTS * sizeof(int)));
+ (LimitClients * sizeof(int)));
 pmap-clientPixelsBlue = (Pixel **) ((char *) pmap-blue + sizebytes);
 pmap-numPixelsBlue = (int *) ((char *) pmap-clientPixelsBlue +
-   (MAXCLIENTS * sizeof(Pixel *)));
+   (LimitClients * sizeof(Pixel *)));
 

[PATCH 1/2] Require at least xproto 7.0.28

2015-07-07 Thread Olivier Fourdan
To make sure we have enough file descriptors to manage at most 512
clients.

Signed-off-by: Olivier Fourdan ofour...@redhat.com
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 328563e..16d2123 100644
--- a/configure.ac
+++ b/configure.ac
@@ -771,7 +771,7 @@ APPLEWMPROTO=applewmproto = 1.4
 LIBXSHMFENCE=xshmfence = 1.1
 
 dnl Required modules
-XPROTO=xproto = 7.0.26
+XPROTO=xproto = 7.0.28
 RANDRPROTO=randrproto = 1.5.0
 RENDERPROTO=renderproto = 0.11
 XEXTPROTO=xextproto = 7.2.99.901
-- 
2.4.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 4/4] glamor: Drop a bunch of glamor_priv == NULL checks.

2015-07-07 Thread Eric Anholt
Now that it's always non-null when the pixmap is non-null, we don't
need so much of this.  glamor_get_pixmap_private() itself still
accepts a NULL pixmap and returns NULL, because of glamor_render.c

Signed-off-by: Eric Anholt e...@anholt.net
---
 glamor/glamor.c | 17 ++---
 glamor/glamor_core.c|  3 +--
 glamor/glamor_egl.c |  4 ++--
 glamor/glamor_picture.c |  9 -
 glamor/glamor_priv.h| 12 ++--
 glamor/glamor_utils.h   |  4 ++--
 6 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index 2470a8d..04c548d 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -207,13 +207,10 @@ void
 glamor_destroy_textured_pixmap(PixmapPtr pixmap)
 {
 if (pixmap-refcnt == 1) {
-glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
-if (pixmap_priv != NULL) {
 #if GLAMOR_HAS_GBM
-glamor_egl_destroy_pixmap_image(pixmap);
+glamor_egl_destroy_pixmap_image(pixmap);
 #endif
-glamor_pixmap_destroy_fbo(pixmap);
-}
+glamor_pixmap_destroy_fbo(pixmap);
 }
 }
 
@@ -761,12 +758,11 @@ _X_EXPORT int
 glamor_fd_from_pixmap(ScreenPtr screen,
   PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
 {
-glamor_pixmap_private *pixmap_priv;
+glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
 glamor_screen_private *glamor_priv =
 glamor_get_screen_private(pixmap-drawable.pScreen);
 
-pixmap_priv = glamor_get_pixmap_private(pixmap);
-if (pixmap_priv == NULL || !glamor_priv-dri3_enabled)
+if (!glamor_priv-dri3_enabled)
 return -1;
 switch (pixmap_priv-type) {
 case GLAMOR_TEXTURE_DRM:
@@ -786,12 +782,11 @@ glamor_fd_from_pixmap(ScreenPtr screen,
 int
 glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
 {
-glamor_pixmap_private *pixmap_priv;
+glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
 glamor_screen_private *glamor_priv =
 glamor_get_screen_private(pixmap-drawable.pScreen);
 
-pixmap_priv = glamor_get_pixmap_private(pixmap);
-if (pixmap_priv == NULL || !glamor_priv-dri3_enabled)
+if (!glamor_priv-dri3_enabled)
 return -1;
 switch (pixmap_priv-type) {
 case GLAMOR_TEXTURE_DRM:
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 79f5981b..0104b88 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -42,8 +42,7 @@ glamor_get_drawable_location(const DrawablePtr drawable)
 glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
 glamor_screen_private *glamor_priv =
 glamor_get_screen_private(drawable-pScreen);
-if (pixmap_priv == NULL ||
-pixmap_priv-gl_fbo == GLAMOR_FBO_UNATTACHED)
+if (pixmap_priv-gl_fbo == GLAMOR_FBO_UNATTACHED)
 return 'm';
 if (pixmap_priv-fbo-fb == glamor_priv-screen_fbo)
 return 's';
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index e01f723..753fb34 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -452,7 +452,7 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr 
pixmap)
 glamor_get_pixmap_private(pixmap);
 
 pixmap_priv = glamor_get_pixmap_private(pixmap);
-if (pixmap_priv == NULL || !glamor_priv-dri3_enabled)
+if (!glamor_priv-dri3_enabled)
 return NULL;
 switch (pixmap_priv-type) {
 case GLAMOR_TEXTURE_DRM:
@@ -604,7 +604,7 @@ glamor_egl_destroy_pixmap_image(PixmapPtr pixmap)
 struct glamor_pixmap_private *pixmap_priv =
 glamor_get_pixmap_private(pixmap);
 
-if (pixmap_priv  pixmap_priv-image) {
+if (pixmap_priv-image) {
 ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap-drawable.pScreen);
 struct glamor_egl_screen_private *glamor_egl =
 glamor_egl_get_screen_private(scrn);
diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c
index 53b032c..20b9de2 100644
--- a/glamor/glamor_picture.c
+++ b/glamor/glamor_picture.c
@@ -61,15 +61,6 @@ glamor_create_picture(PicturePtr picture)
 
 pixmap = glamor_get_drawable_pixmap(picture-pDrawable);
 pixmap_priv = glamor_get_pixmap_private(pixmap);
-if (!pixmap_priv) {
-/* We must create a pixmap priv to track the picture format even
- * if the pixmap is a pure in memory pixmap. The reason is that
- * we may need to upload this pixmap to a texture on the fly. During
- * the uploading, we need to know the picture format. */
-glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY);
-pixmap_priv = glamor_get_pixmap_private(pixmap);
-}
-
 pixmap_priv-is_picture = 1;
 pixmap_priv-picture = picture;
 
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index fe65d9b..d085ff2 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -419,7 +419,7 @@ glamor_pixmap_drm_only(PixmapPtr pixmap)
 {
 glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
 
-   

[PATCH 2/4] glamor: Drop dead glamor_is_large_picture().

2015-07-07 Thread Eric Anholt
It died as of keithp's new glyphs code.

Signed-off-by: Eric Anholt e...@anholt.net
---
 glamor/glamor_utils.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
index cef62c5..0a7de82 100644
--- a/glamor/glamor_utils.h
+++ b/glamor/glamor_utils.h
@@ -946,18 +946,6 @@ glamor_is_large_pixmap(PixmapPtr pixmap)
 }
 
 inline static Bool
-glamor_is_large_picture(PicturePtr picture)
-{
-PixmapPtr pixmap;
-
-if (picture-pDrawable) {
-pixmap = glamor_get_drawable_pixmap(picture-pDrawable);
-return glamor_is_large_pixmap(pixmap);
-}
-return FALSE;
-}
-
-inline static Bool
 glamor_tex_format_is_readable(GLenum format)
 {
 return ((format == GL_RGBA || format == GL_RGB || format == GL_ALPHA));
-- 
2.1.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/4] glamor: Ask the server to always allocate our private.

2015-07-07 Thread Eric Anholt
This avoids a lot of screwing around to attach our privates later.  It
means that non-glamor pixmaps now gain 120 bytes of glamor privates on
64-bit (which has quite a bit of fixable bloat), and glamor pixmaps
take one less pointer of storage (not counting malloc overhead).

Note that privates start out zero-filled, which matches the callocs we
were doing when making our own privates, and in the case of an fb
pixmap that has a priv where it didn't before, the type ends up being
GLAMOR_MEMORY as we would want.

Signed-off-by: Eric Anholt e...@anholt.net
---
 glamor/glamor.c  | 43 ++-
 glamor/glamor_fbo.c  |  6 --
 glamor/glamor_priv.h | 15 ++-
 3 files changed, 12 insertions(+), 52 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index 50d85ff..2470a8d 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -80,12 +80,7 @@ glamor_set_pixmap_type(PixmapPtr pixmap, 
glamor_pixmap_type_t type)
 {
 glamor_pixmap_private *pixmap_priv;
 
-pixmap_priv = dixLookupPrivate(pixmap-devPrivates,
-   glamor_pixmap_private_key);
-if (pixmap_priv == NULL) {
-pixmap_priv = calloc(sizeof(*pixmap_priv), 1);
-glamor_set_pixmap_private(pixmap, pixmap_priv);
-}
+pixmap_priv = glamor_get_pixmap_private(pixmap);
 pixmap_priv-type = type;
 glamor_init_pixmap_private_small(pixmap, pixmap_priv);
 }
@@ -171,13 +166,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int 
depth,
 else
 pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
 
-pixmap_priv = calloc(1, sizeof(*pixmap_priv));
-
-if (!pixmap_priv) {
-fbDestroyPixmap(pixmap);
-return fbCreatePixmap(screen, w, h, depth, usage);
-}
-glamor_set_pixmap_private(pixmap, pixmap_priv);
+pixmap_priv = glamor_get_pixmap_private(pixmap);
 
 format = gl_iformat_for_pixmap(pixmap);
 
@@ -223,7 +212,7 @@ glamor_destroy_textured_pixmap(PixmapPtr pixmap)
 #if GLAMOR_HAS_GBM
 glamor_egl_destroy_pixmap_image(pixmap);
 #endif
-glamor_set_pixmap_private(pixmap, NULL);
+glamor_pixmap_destroy_fbo(pixmap);
 }
 }
 }
@@ -455,7 +444,8 @@ glamor_init(ScreenPtr screen, unsigned int flags)
 
 glamor_set_screen_private(screen, glamor_priv);
 
-if (!dixRegisterPrivateKey(glamor_pixmap_private_key, PRIVATE_PIXMAP, 0)) 
{
+if (!dixRegisterPrivateKey(glamor_pixmap_private_key, PRIVATE_PIXMAP,
+   sizeof(struct glamor_pixmap_private))) {
 LogMessage(X_WARNING,
glamor%d: Failed to allocate pixmap private\n,
screen-myNum);
@@ -705,27 +695,6 @@ glamor_release_screen_priv(ScreenPtr screen)
 glamor_set_screen_private(screen, NULL);
 }
 
-_X_EXPORT void
-glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv)
-{
-glamor_pixmap_private *old_priv;
-
-old_priv = dixGetPrivate(pixmap-devPrivates, glamor_pixmap_private_key);
-
-if (priv) {
-assert(old_priv == NULL);
-}
-else {
-if (old_priv == NULL)
-return;
-
glamor_pixmap_destroy_fbo(glamor_get_screen_private(pixmap-drawable.pScreen),
-  old_priv);
-free(old_priv);
-}
-
-dixSetPrivate(pixmap-devPrivates, glamor_pixmap_private_key, priv);
-}
-
 Bool
 glamor_close_screen(ScreenPtr screen)
 {
@@ -759,7 +728,7 @@ glamor_close_screen(ScreenPtr screen)
 screen-SetWindowPixmap = glamor_priv-saved_procs.set_window_pixmap;
 
 screen_pixmap = screen-GetScreenPixmap(screen);
-glamor_set_pixmap_private(screen_pixmap, NULL);
+glamor_pixmap_destroy_fbo(screen_pixmap);
 
 glamor_release_screen_priv(screen);
 
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 84f3b22..1eee304 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -471,9 +471,11 @@ glamor_pixmap_attach_fbo(PixmapPtr pixmap, 
glamor_pixmap_fbo *fbo)
 }
 
 void
-glamor_pixmap_destroy_fbo(glamor_screen_private *glamor_priv,
-  glamor_pixmap_private *priv)
+glamor_pixmap_destroy_fbo(PixmapPtr pixmap)
 {
+ScreenPtr screen = pixmap-drawable.pScreen;
+glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
 glamor_pixmap_fbo *fbo;
 
 if (glamor_pixmap_priv_is_large(priv)) {
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 66e5012..fe65d9b 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -405,22 +405,12 @@ extern DevPrivateKeyRec glamor_pixmap_private_key;
 static inline glamor_pixmap_private *
 glamor_get_pixmap_private(PixmapPtr pixmap)
 {
-glamor_pixmap_private *priv;
-
 if (pixmap == NULL)
 return NULL;
 
-priv = dixLookupPrivate(pixmap-devPrivates, glamor_pixmap_private_key);
-if (!priv) {
-glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY);
-

[PATCH 1/4] glamor: Reuse the glamor_is_memory helper.

2015-07-07 Thread Eric Anholt
Signed-off-by: Eric Anholt e...@anholt.net
---
 glamor/glamor_composite_glyphs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c
index cd88524..389c8f4 100644
--- a/glamor/glamor_composite_glyphs.c
+++ b/glamor/glamor_composite_glyphs.c
@@ -376,14 +376,12 @@ glamor_composite_glyphs(CARD8 op,
 if (glyph-info.width  glyph-info.height) {
 PicturePtr glyph_pict = GlyphPicture(glyph)[screen_num];
 DrawablePtr glyph_draw = glyph_pict-pDrawable;
-glamor_pixmap_private *glyph_pix_priv =
-glamor_get_pixmap_private((PixmapPtr) glyph_draw);
 
 /* Need to draw with slow path?
  */
 if (_X_UNLIKELY(glyph_draw-width  glyph_max_dim ||
 glyph_draw-height  glyph_max_dim ||
-(glyph_pix_priv != 0  glyph_pix_priv-type 
!= GLAMOR_MEMORY)))
+
!glamor_pixmap_is_memory((PixmapPtr)glyph_draw)))
 {
 if (glyphs_queued) {
 glamor_glyphs_flush(op, src, dst, prog, glyph_atlas, 
glyphs_queued);
-- 
2.1.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

glamor: Always allocate pixmap privates

2015-07-07 Thread Eric Anholt
The commit message in #3 has the meat of the series, but for further
explanation, note that this reduces the glamor library by 8588 bytes
(4.8%) on my x86-64 build, and I've only got 94 client-allocated
pixmaps on my desktop at the moment according to xrestop.

___
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/1] randr: make RROutputChanged change the main protocol screen not the gpu screen

2015-07-07 Thread Timo Aaltonen
On 14.01.2014 00:37, Alberto Milone wrote:
 On 16/12/13 09:52, Alberto Milone wrote:
 On 12/12/13 10:00, Alberto Milone wrote:
 We only set changes on the main protocol screen as, for example
 in RRSetChanged() and RRTellChanged(), therefore we should follow
 the same logic when reporting that an output changed in
 RROutputChanged().

 This means that RRTellChanged() will then update the relevant
 timestamps also when events come from gpu screens.

 Reviewed-by: Dave Airlie airl...@redhat.com
 Signed-off-by: Alberto Milone alberto.mil...@canonical.com

 Keith, please let me know if there's anything else I should modify in
 the patch or if it's ok for inclusion now.

 Thank,

 
 If there are no further objections, can you commit the patch, please?

Hi Keith, this old reviewed patch is still not merged, could you add it
please?


-- 
t
___
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 xf86-input-libinput] Add a property for tap drag lock

2015-07-07 Thread Peter Hutterer
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 configure.ac  |  2 +-
 include/libinput-properties.h |  6 +++
 man/libinput.man  |  9 +
 src/libinput.c| 94 +++
 4 files changed, 110 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e477ffd..5faaa36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ XORG_DEFAULT_OPTIONS
 
 # Obtain compiler/linker options from server and required extensions
 PKG_CHECK_MODULES(XORG, [xorg-server = 1.10] xproto [inputproto = 2.2])
-PKG_CHECK_MODULES(LIBINPUT, [libinput = 0.14.0])
+PKG_CHECK_MODULES(LIBINPUT, [libinput = 0.19.0])
 
 # Define a configure option for an alternate input module directory
 AC_ARG_WITH(xorg-module-dir,
diff --git a/include/libinput-properties.h b/include/libinput-properties.h
index 6760b50..6135dc8 100644
--- a/include/libinput-properties.h
+++ b/include/libinput-properties.h
@@ -30,6 +30,12 @@
 /* Tapping default enabled/disabled: BOOL, 1 value, read-only */
 #define LIBINPUT_PROP_TAP_DEFAULT libinput Tapping Enabled Default
 
+/* Tap drag lock enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP_DRAG_LOCK libinput Tapping Drag Lock Enabled
+
+/* Tap drag lock default enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT libinput Tapping Drag Lock 
Enabled Default
+
 /* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
 #define LIBINPUT_PROP_CALIBRATION libinput Calibration Matrix
 
diff --git a/man/libinput.man b/man/libinput.man
index df202a9..f781c59 100644
--- a/man/libinput.man
+++ b/man/libinput.man
@@ -109,6 +109,12 @@ mouse is connected.
 .TP 7
 .BI Option \*qTapping\*q \*q bool \*q
 Enables or disables tap-to-click behavior.
+.TP 7
+.BI Option \*qTappingDragLock\*q \*q bool \*q
+Enables or disables drag lock during tapping behavior. When enabled, a
+finger up during tap-and-drag will not immediately release the button. If
+the finger is set down again within the timeout, the draging process
+continues.
 .PP
 For all options, the options are only parsed if the device supports that
 configuration option. For all options, the default value is the one used by
@@ -126,6 +132,9 @@ driver.
 .BI libinput Tapping Enabled
 1 boolean value (8 bit, 0 or 1). 1 enables tapping
 .TP 7
+.BI libinput Tapping Drag Lock Enabled
+1 boolean value (8 bit, 0 or 1). 1 enables drag lock during tapping
+.TP 7
 .BI libinput Calibration Matrix
 9 32-bit float values, representing a 3x3 calibration matrix, order is row
 1, row 2, row 3
diff --git a/src/libinput.c b/src/libinput.c
index a06e44f..0733d35 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -98,6 +98,7 @@ struct xf86libinput {
 
struct options {
BOOL tapping;
+   BOOL tap_drag_lock;
BOOL natural_scrolling;
BOOL left_handed;
BOOL middle_emulation;
@@ -262,6 +263,13 @@ LibinputApplyConfig(DeviceIntPtr dev)
Failed to set Tapping to %d\n,
driver_data-options.tapping);
 
+   if (libinput_device_config_tap_get_finger_count(device)  0 
+   libinput_device_config_tap_set_drag_lock_enabled(device,
+
driver_data-options.tap_drag_lock) != LIBINPUT_CONFIG_STATUS_SUCCESS)
+   xf86IDrvMsg(pInfo, X_ERROR,
+   Failed to set Tapping DragLock to %d\n,
+   driver_data-options.tap_drag_lock);
+
if (libinput_device_config_calibration_has_matrix(device) 
libinput_device_config_calibration_set_matrix(device,
  
driver_data-options.matrix) != LIBINPUT_CONFIG_STATUS_SUCCESS)
@@ -1032,6 +1040,30 @@ xf86libinput_parse_tap_option(InputInfoPtr pInfo,
return tap;
 }
 
+static inline BOOL
+xf86libinput_parse_tap_drag_lock_option(InputInfoPtr pInfo,
+   struct libinput_device *device)
+{
+   BOOL drag_lock;
+
+   if (libinput_device_config_tap_get_finger_count(device) == 0)
+   return FALSE;
+
+   drag_lock = xf86SetBoolOption(pInfo-options,
+ TappingDragLock,
+ 
libinput_device_config_tap_get_drag_lock_enabled(device));
+
+   if (libinput_device_config_tap_set_drag_lock_enabled(device, drag_lock) 
!=
+   LIBINPUT_CONFIG_STATUS_SUCCESS) {
+   xf86IDrvMsg(pInfo, X_ERROR,
+   Failed to set Tapping Drag Lock to %d\n,
+   drag_lock);
+   drag_lock = 
libinput_device_config_tap_get_drag_lock_enabled(device);
+   }
+
+   return drag_lock;
+}
+
 static inline double
 xf86libinput_parse_accel_option(InputInfoPtr pInfo,
struct libinput_device *device)
@@ 

Re: [PATCH 4/4] glamor: Drop a bunch of glamor_priv == NULL checks.

2015-07-07 Thread Michel Dänzer
On 08.07.2015 09:26, Eric Anholt wrote:
 
 diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
 index 0a7de82..a923b7a 100644
 --- a/glamor/glamor_utils.h
 +++ b/glamor/glamor_utils.h
 @@ -756,8 +756,8 @@ glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, 
 int dy)
   || _depth_ == 30\
   || _depth_ == 32)
  
 -#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv  
 pixmap_priv-is_picture == 1)
 -#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)(pixmap_priv  
 pixmap_priv-gl_fbo == GLAMOR_FBO_NORMAL)
 +#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv-is_picture 
 == 1)
 +#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)(pixmap_priv-gl_fbo == 
 GLAMOR_FBO_NORMAL)

I guess these macros could be removed now, but that's for later.

The series is

Reviewed-by: Michel Dänzer michel.daen...@amd.com


-- 
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: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Fix NO_LOCAL_CLIENT_CRED build

2015-07-07 Thread Jon TURNEY

On 06/07/2015 23:08, Keith Packard wrote:

Jon TURNEY writes:

On 04/07/2015 05:21, Ray Strode wrote:

On Thu, Jul 2, 2015 at 12:40 PM, Jon TURNEY wrote:

Makes sense. Revised patch attached.

LGTM


I'm going to choose to assume that is a Reviewed-by:

Keith,

Please consider applying to master.


I liked your first version a lot better; looks a lot simpler. An
autoconf test might make sense if there was some reason to override it?


I'm ambivalent.

The first version has the virtue of simplicity, but doing the test at 
effectively a random point in a header leaves things open to the same 
problem (of a check preceding the definition) occurring again, although 
given how rarely this piece of code is changed, the likelihood of that 
seems low.


Please consider picking a version you like and applying it, or let me 
know how I can make this patch acceptable.


___
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