[PATCH xserver] ramdac: Check ScreenPriv != NULL in xf86ScreenSetCursor()

2017-10-24 Thread Alex Goins
Similar to change cba5a10f, xf86ScreenSetCursor() would dereference ScreenPriv
without NULL checking it. If Option "SWCursor" is specified, ScreenPriv == NULL.

Without this fix, it is observed that setting Option "SWCursor" "on" on the
modesetting driver in a PRIME configuration will segfault the server.

It is important to return success rather than failure in the instance that
ScreenPriv == NULL and pCurs == NullCursor, because otherwise xf86SetCursor()
can fall into infinite recursion: xf86SetCursor(pCurs) calls
xf86ScreenSetCursor(pCurs), and if FALSE, calls xf86SetCursor(NullCursor). If
xf86ScreenSetCursor(NullCursor) returns FALSE, it calls
xf86SetCursor(NullCursor) again and this repeats forever.

Signed-off-by: Alex Goins 
---
 hw/xfree86/ramdac/xf86HWCurs.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 2e4c9e5..366837c 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -181,9 +181,16 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, 
int x, int y)
 xf86CursorScreenPtr ScreenPriv =
 (xf86CursorScreenPtr) dixLookupPrivate(>devPrivates,
xf86CursorScreenKey);
-xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+xf86CursorInfoPtr infoPtr;
 unsigned char *bits;
 
+if (!ScreenPriv) { /* NULL if Option "SWCursor" */
+return (pCurs == NullCursor);
+}
+
+infoPtr = ScreenPriv->CursorInfoPtr;
+
 if (pCurs == NullCursor) {
 (*infoPtr->HideCursor) (infoPtr->pScrn);
 return TRUE;
-- 
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

Re: [PATCH xserver] meson: Use [ true, false, auto ] for tristate values

2017-10-24 Thread Peter Hutterer
On Tue, Oct 24, 2017 at 01:03:09PM -0400, Adam Jackson wrote:
> For symmetry with the boolean options. I really do not want to care
> whether an option is a tristate if I'm trying to set it explicitly.
> 
> Signed-off-by: Adam Jackson 

Reviewed-by: Peter Hutterer 

Cheers,
   Peter

> ---
>  meson.build   | 42 +-
>  meson_options.txt | 28 ++--
>  2 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 6e7fc06646..c028cc8aa7 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -76,9 +76,9 @@ compositeproto_dep = dependency('compositeproto', version: 
> '>= 0.4')
>  recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1')
>  scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1')
>  resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0')
> -xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: 
> get_option('dri1') == 'yes')
> -dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: 
> get_option('dri2') == 'yes')
> -dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: 
> get_option('dri3') == 'yes')
> +xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: 
> get_option('dri1') == 'true')
> +dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: 
> get_option('dri2') == 'true')
> +dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: 
> get_option('dri3') == 'true')
>  xineramaproto_dep = dependency('xineramaproto')
>  xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
>  xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', 
> required: false)
> @@ -93,7 +93,7 @@ xkbfile_dep = dependency('xkbfile')
>  xfont2_dep = dependency('xfont2', version: '>= 2.0')
>  nettle_dep = dependency('nettle')
>  
> -dbus_required = get_option('systemd_logind') == 'yes'
> +dbus_required = get_option('systemd_logind') == 'true'
>  dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
>  
>  # Resolve default values of some options
> @@ -118,13 +118,13 @@ glamor_option = get_option('glamor')
>  build_udev = get_option('udev')
>  if host_machine.system() == 'windows'
>  build_udev = false
> -hal_option = 'no'
> +hal_option = 'false'
>  endif
>  
>  if get_option('systemd_logind') == 'auto'
>  build_systemd_logind = build_udev and dbus_dep.found()
>  else
> -build_systemd_logind = get_option('systemd_logind') == 'yes'
> +build_systemd_logind = get_option('systemd_logind') == 'true'
>  endif
>  
>  build_xorg = false
> @@ -134,7 +134,7 @@ if (host_machine.system() != 'darwin' and
>  build_xorg = (host_machine.system() != 'darwin' and
>host_machine.system() != 'windows')
>  else
> -build_xorg = get_option('xorg') == 'yes'
> +build_xorg = get_option('xorg') == 'true'
>  endif
>  endif
>  xorgsdkdir = join_paths(get_option('prefix'), get_option('includedir'), 
> 'xorg')
> @@ -142,8 +142,8 @@ xorgsdkdir = join_paths(get_option('prefix'), 
> get_option('includedir'), 'xorg')
>  build_xwayland = false
>  if (host_machine.system() != 'darwin' and
>  host_machine.system() != 'windows')
> -if get_option('xwayland') != 'no'
> -xwayland_required = get_option('xwayland') == 'yes'
> +if get_option('xwayland') != 'false'
> +xwayland_required = get_option('xwayland') == 'true'
>  
>  xwayland_dep = [
>  dependency('wayland-client', version: '>= 1.3.0', required: 
> xwayland_required),
> @@ -165,8 +165,8 @@ endif
>  build_xnest = false
>  if (host_machine.system() != 'darwin' and
>  host_machine.system() != 'windows')
> -if get_option('xnest') != 'no'
> -xnest_required = get_option('xnest') == 'yes'
> +if get_option('xnest') != 'false'
> +xnest_required = get_option('xnest') == 'true'
>  
>  xnest_dep = [
>  dependency('xext', version: '>= 1.0.99.4', required: 
> xnest_required),
> @@ -191,7 +191,7 @@ if get_option('xwin') == 'auto'
>  build_xwin = true
>  endif
>  else
> -build_xwin = get_option('xwin') == 'yes'
> +build_xwin = get_option('xwin') == 'true'
>  endif
>  
>  # XXX: Finish these.
> @@ -200,7 +200,7 @@ build_xquartz = false
>  if get_option('ipv6') == 'auto'
>  build_ipv6 = cc.has_function('getaddrinfo')
>  else
> -build_ipv6 = get_option('ipv6') == 'yes'
> +build_ipv6 = get_option('ipv6') == 'true'
>  endif
>  
>  int10 = get_option('int10')
> @@ -223,7 +223,7 @@ if hal_option == 'auto'
>  build_hal = false
>  endif
>  else
> -build_hal = hal_option == 'yes'
> +build_hal = hal_option == 'true'
>  if build_hal
>  hal_dep = dependency('hal')
>  endif
> @@ -253,7 +253,7 @@ endif
>  if glamor_option == 'auto'
>  build_glamor = 

Re: [PATCH app/bdftopcf] Import libXfont's BDF-to-PCF code

2017-10-24 Thread Adam Jackson
On Tue, 2017-10-24 at 20:45 +0200, Julien Cristau wrote:
> On Tue, Oct 24, 2017 at 13:54:47 -0400, Adam Jackson wrote:
> 
> > bdftopcf is the only consumer of libXfont 1.x's read/write support, and
> > we'd like 1.x to go away entirely. Copy in the BDF read and PCF write
> > support so there's one fewer consumer of 1.x.
> > 
> > Signed-off-by: Adam Jackson 
> 
> Yes please.
> 
> Acked-by: Julien Cristau 

remote: E: failed to find patch for rev 
102696da8737fcb324034f673cd5815f28923311.
remote: I: 0 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/app/bdftopcf
   e12c03d..102696d  master -> master

Failed to find patch because git fixed whitespace errors in the
original.

- ajax
___
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 1/2] dix: Don't vary the ClientRec ABI at build time

2017-10-24 Thread Julien Cristau
On Tue, Oct 24, 2017 at 14:38:12 -0400, Adam Jackson wrote:

> Just no.
> 
> Signed-off-by: Adam Jackson 
> ---
>  include/dixstruct.h | 2 --
>  1 file changed, 2 deletions(-)
> 
for the series:
Reviewed-by: Julien Cristau 

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 app/bdftopcf] Import libXfont's BDF-to-PCF code

2017-10-24 Thread Julien Cristau
On Tue, Oct 24, 2017 at 13:54:47 -0400, Adam Jackson wrote:

> bdftopcf is the only consumer of libXfont 1.x's read/write support, and
> we'd like 1.x to go away entirely. Copy in the BDF read and PCF write
> support so there's one fewer consumer of 1.x.
> 
> Signed-off-by: Adam Jackson 

Yes please.

Acked-by: Julien Cristau 

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

[PATCH xserver 1/2] dix: Don't vary the ClientRec ABI at build time

2017-10-24 Thread Adam Jackson
Just no.

Signed-off-by: Adam Jackson 
---
 include/dixstruct.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/dixstruct.h b/include/dixstruct.h
index 70f87959e..28bff66f8 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -111,9 +111,7 @@ typedef struct _Client {
 
 DeviceIntPtr clientPtr;
 ClientIdPtr clientIds;
-#if XTRANS_SEND_FDS
 int req_fds;
-#endif
 } ClientRec;
 
 #if XTRANS_SEND_FDS
-- 
2.14.2

___
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] dix: Don't track the XKB client versions in the ClientRec

2017-10-24 Thread Adam Jackson
XKB stores some stuff in the ClientRec that, style-wise, should probably
be in a client private.  vMinor tracks the client's idea of the XKB
minor version, but is never read, we can just nuke it.  vMajor is only
used for a bug-compat workaround for X11R6.0-vintage clients.  We're
only using though (1<<4) for xkbClientFlags in the protocol, so we can
pack that field down to a u8 and store the bug-compat flag there.

Signed-off-by: Adam Jackson 
---
 include/dixstruct.h | 3 +--
 include/xkbsrv.h| 3 ++-
 xkb/xkb.c   | 7 ---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/dixstruct.h b/include/dixstruct.h
index 28bff66f8..ad3352ae5 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -100,10 +100,9 @@ typedef struct _Client {
 CARD32 req_len; /* length of current request */
 unsigned int replyBytesRemaining;
 PrivateRec *devPrivates;
-unsigned short xkbClientFlags;
 unsigned short mapNotifyMask;
 unsigned short newKeyboardNotifyMask;
-unsigned short vMajor, vMinor;
+unsigned char xkbClientFlags;
 KeyCode minKC, maxKC;
 
 int smart_start_tick;
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 2870f3987..fbb5427e1 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -235,7 +235,8 @@ typedef struct _XkbSrvLedInfo {
  * Settings for xkbClientFlags field (used by DIX)
  * These flags _must_ not overlap with XkbPCF_*
  */
-#define_XkbClientInitialized   (1<<15)
+#define _XkbClientInitialized   (1<<7)
+#define _XkbClientIsAncient (1<<6)
 
 #define_XkbWantsDetectableAutoRepeat(c)\
((c)->xkbClientFlags_DetectableAutoRepeatMask)
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 678f82368..392023f4c 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -172,8 +172,8 @@ ProcXkbUseExtension(ClientPtr client)
 
 if ((supported) && (!(client->xkbClientFlags & _XkbClientInitialized))) {
 client->xkbClientFlags = _XkbClientInitialized;
-client->vMajor = stuff->wantedMajor;
-client->vMinor = stuff->wantedMinor;
+if (stuff->wantedMajor == 0)
+client->xkbClientFlags |= _XkbClientIsAncient;
 }
 else if (xkbDebugFlags & 0x1) {
 ErrorF
@@ -2388,7 +2388,8 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, 
xkbSetMapReq * req,
 
 if ((xkb->min_key_code != req->minKeyCode) ||
 (xkb->max_key_code != req->maxKeyCode)) {
-if (client->vMajor != 1) {  /* pre 1.0 versions of Xlib have a bug 
*/
+if (client->xkbClientFlags & _XkbClientIsAncient) {
+/* pre 1.0 versions of Xlib have a bug */
 req->minKeyCode = xkb->min_key_code;
 req->maxKeyCode = xkb->max_key_code;
 }
-- 
2.14.2

___
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] xres: Return the atom naming the type, not its internal type number

2017-10-24 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 Xext/xres.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/Xext/xres.c b/Xext/xres.c
index 02421588a..7a7aabc9b 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -274,6 +274,24 @@ ResFindAllRes(void *value, XID id, RESTYPE type, void 
*cdata)
 counts[(type & TypeMask) - 1]++;
 }
 
+static CARD32
+resourceTypeAtom(int i)
+{
+CARD32 ret;
+
+const char *name = LookupResourceName(i);
+if (strcmp(name, XREGISTRY_UNKNOWN))
+ret = MakeAtom(name, strlen(name), TRUE);
+else {
+char buf[40];
+
+snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
+ret = MakeAtom(buf, strlen(buf), TRUE);
+}
+
+return ret;
+}
+
 static int
 ProcXResQueryClientResources(ClientPtr client)
 {
@@ -318,22 +336,12 @@ ProcXResQueryClientResources(ClientPtr client)
 
 if (num_types) {
 xXResType scratch;
-const char *name;
 
 for (i = 0; i < lastResourceType; i++) {
 if (!counts[i])
 continue;
 
-name = LookupResourceName(i + 1);
-if (strcmp(name, XREGISTRY_UNKNOWN))
-scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
-else {
-char buf[40];
-
-snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
-scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
-}
-
+scratch.resource_type = resourceTypeAtom(i + 1);
 scratch.count = counts[i];
 
 if (client->swapped) {
@@ -693,7 +701,7 @@ AddSubResourceSizeSpec(void *value,
 sizeFunc(value, id, );
 
 crossRef->spec.resource = id;
-crossRef->spec.type = type;
+crossRef->spec.type = resourceTypeAtom(type);
 crossRef->bytes = size.resourceSize;
 crossRef->refCount = size.refCnt;
 crossRef->useCount = 1;
@@ -766,7 +774,7 @@ AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void 
*cdata)
 sizeFunc(ptr, id, );
 
 value->size.spec.resource = id;
-value->size.spec.type = type;
+value->size.spec.type = resourceTypeAtom(type);
 value->size.bytes = size.resourceSize;
 value->size.refCount = size.refCnt;
 value->size.useCount = 1;
-- 
2.14.2

___
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/3] glamor: Unconditionalize GLAMOR_PIXMAP_DYNAMIC_UPLOAD

2017-10-24 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 glamor/glamor_priv.h   |  8 
 glamor/glamor_render.c | 14 +-
 2 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index b828350cd..5da400a37 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -910,14 +910,6 @@ void glamor_xv_render(glamor_port_private *port_priv);
 
 #include "glamor_utils.h"
 
-/* Dynamic pixmap upload to texture if needed.
- * Sometimes, the target is a gl texture pixmap/picture,
- * but the source or mask is in cpu memory. In that case,
- * upload the source/mask to gl texture and then avoid
- * fallback the whole process to cpu. Most of the time,
- * this will increase performance obviously. */
-
-#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 #define GLAMOR_TEXTURED_LARGE_PIXMAP 1
 #if 0
 #define MAX_FBO_SIZE 32 /* For test purpose only. */
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 1a54aa9ec..7a96c82dd 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -762,7 +762,7 @@ glamor_set_normalize_tcoords_generic(PixmapPtr pixmap,
 /**
  * Returns whether the general composite path supports this picture
  * format for a pixmap that is permanently stored in an FBO (as
- * opposed to the GLAMOR_PIXMAP_DYNAMIC_UPLOAD path).
+ * opposed to the dynamic upload path).
  *
  * We could support many more formats by using GL_ARB_texture_view to
  * parse the same bits as different formats.  For now, we only support
@@ -915,12 +915,7 @@ glamor_composite_choose_shader(CARD8 op,
 glamor_fallback("source == dest\n");
 }
 if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
-#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 source_needs_upload = TRUE;
-#else
-glamor_fallback("no texture in source\n");
-goto fail;
-#endif
 }
 }
 
@@ -931,16 +926,10 @@ glamor_composite_choose_shader(CARD8 op,
 goto fail;
 }
 if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
-#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 mask_needs_upload = TRUE;
-#else
-glamor_fallback("no texture in mask\n");
-goto fail;
-#endif
 }
 }
 
-#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 if (source_needs_upload && mask_needs_upload
 && source_pixmap == mask_pixmap) {
 
@@ -1010,7 +999,6 @@ glamor_composite_choose_shader(CARD8 op,
 }
 }
 }
-#endif
 
 /* If the source and mask are two differently-formatted views of
  * the same pixmap bits, and the pixmap was already uploaded (so
-- 
2.14.2

___
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 3/3] glamor: Unconditionalize GLAMOR_TEXTURED_LARGE_PIXMAP

2017-10-24 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 glamor/glamor.c  | 4 +---
 glamor/glamor_priv.h | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index c55ba249e..b70759b65 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -183,9 +183,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int 
depth,
  w <= glamor_priv->glyph_max_dim &&
  h <= glamor_priv->glyph_max_dim)
  || (w == 0 && h == 0)
- || !glamor_check_pixmap_fbo_depth(depth))
-|| (!GLAMOR_TEXTURED_LARGE_PIXMAP &&
-!glamor_check_fbo_size(glamor_priv, w, h)))
+ || !glamor_check_pixmap_fbo_depth(depth)))
 return fbCreatePixmap(screen, w, h, depth, usage);
 else
 pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 5da400a37..ad54b3197 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -910,7 +910,6 @@ void glamor_xv_render(glamor_port_private *port_priv);
 
 #include "glamor_utils.h"
 
-#define GLAMOR_TEXTURED_LARGE_PIXMAP 1
 #if 0
 #define MAX_FBO_SIZE 32 /* For test purpose only. */
 #endif
-- 
2.14.2

___
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 app/bdftopcf] Import libXfont's BDF-to-PCF code

2017-10-24 Thread Adam Jackson
bdftopcf is the only consumer of libXfont 1.x's read/write support, and
we'd like 1.x to go away entirely. Copy in the BDF read and PCF write
support so there's one fewer consumer of 1.x.

Signed-off-by: Adam Jackson 
---
 Makefile.am  |  21 +-
 atom.c   | 250 +++
 bdfread.c| 992 +++
 bdfutils.c   | 337 
 bitmap.c | 161 ++
 bitmaputil.c | 229 ++
 bufio.c  | 205 
 configure.ac |   3 -
 defaults.c   |  74 +
 fileio.c |  67 
 filewr.c |  64 
 fontaccel.c  | 104 +++
 fontink.c| 216 +
 pcfwrite.c   | 481 +
 private.c| 105 +++
 stubs.h  |  79 +
 utilbitmap.c | 185 +++
 17 files changed, 3567 insertions(+), 6 deletions(-)
 create mode 100644 atom.c
 create mode 100644 bdfread.c
 create mode 100644 bdfutils.c
 create mode 100644 bitmap.c
 create mode 100644 bitmaputil.c
 create mode 100644 bufio.c
 create mode 100644 defaults.c
 create mode 100644 fileio.c
 create mode 100644 filewr.c
 create mode 100644 fontaccel.c
 create mode 100644 fontink.c
 create mode 100644 pcfwrite.c
 create mode 100644 private.c
 create mode 100644 stubs.h
 create mode 100644 utilbitmap.c

diff --git a/Makefile.am b/Makefile.am
index a4f2c74..1265065 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,10 +22,25 @@
 SUBDIRS = man
 bin_PROGRAMS = bdftopcf
 
-AM_CFLAGS = $(CWARNFLAGS) @BDFTOPCF_CFLAGS@
-bdftopcf_LDADD  = @BDFTOPCF_LIBS@
+AM_CFLAGS = $(CWARNFLAGS)
 
-bdftopcf_SOURCES = bdftopcf.c
+bdftopcf_SOURCES = \
+   atom.c \
+   bdfread.c \
+   bdfutils.c \
+   bitmap.c \
+   bitmaputil.c \
+   bufio.c \
+   defaults.c \
+   fileio.c \
+   filewr.c \
+   fontaccel.c \
+   fontink.c \
+   pcfwrite.c \
+   private.c \
+   stubs.h \
+   utilbitmap.c \
+   bdftopcf.c
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 
diff --git a/atom.c b/atom.c
new file mode 100644
index 000..5f7f1c6
--- /dev/null
+++ b/atom.c
@@ -0,0 +1,250 @@
+/*
+
+Copyright 1990, 1994, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice 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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+/*
+ * Author:  Keith Packard, MIT X Consortium
+ */
+
+/* lame atom replacement routines for font applications */
+
+#ifdef HAVE_CONFIG_H
+#include 
+#endif
+#include 
+#include "stubs.h"
+
+typedef struct _AtomList {
+char   *name;
+intlen;
+inthash;
+Atom   atom;
+} AtomListRec, *AtomListPtr;
+
+static AtomListPtr  *hashTable;
+
+static int hashSize, hashUsed;
+static int hashMask;
+static int rehash;
+
+static AtomListPtr  *reverseMap;
+static int reverseMapSize;
+static AtomlastAtom;
+
+static int
+Hash(const char *string, int len)
+{
+inth;
+
+h = 0;
+while (len--)
+   h = (h << 3) ^ *string++;
+if (h < 0)
+   return -h;
+return h;
+}
+
+static int
+ResizeHashTable (void)
+{
+intnewHashSize;
+intnewHashMask;
+AtomListPtr*newHashTable;
+inti;
+inth;
+intnewRehash;
+intr;
+
+if (hashSize == 0)
+   newHashSize = 1024;
+else
+   newHashSize = hashSize * 2;
+newHashTable = calloc (newHashSize, sizeof (AtomListPtr));
+if (!newHashTable) {
+   fprintf(stderr, "ResizeHashTable(): Error: Couldn't allocate"
+   " newHashTable (%ld)\n",
+   newHashSize * (unsigned long)sizeof (AtomListPtr));
+   return FALSE;
+}
+newHashMask = newHashSize - 1;
+newRehash = (newHashMask - 2);
+for (i = 0; i < hashSize; i++)
+{
+   if (hashTable[i])
+   {
+   h = (hashTable[i]->hash) & newHashMask;
+   

Re: [PATCH xserver] configure.ac: unconditionally enable kdrive

2017-10-24 Thread Matt Turner
Reviewed-by: Matt Turner 
___
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] meson: Use [ true, false, auto ] for tristate values

2017-10-24 Thread Adam Jackson
For symmetry with the boolean options. I really do not want to care
whether an option is a tristate if I'm trying to set it explicitly.

Signed-off-by: Adam Jackson 
---
 meson.build   | 42 +-
 meson_options.txt | 28 ++--
 2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/meson.build b/meson.build
index 6e7fc06646..c028cc8aa7 100644
--- a/meson.build
+++ b/meson.build
@@ -76,9 +76,9 @@ compositeproto_dep = dependency('compositeproto', version: 
'>= 0.4')
 recordproto_dep = dependency('recordproto', version: '>= 1.13.99.1')
 scrnsaverproto_dep = dependency('scrnsaverproto', version: '>= 1.1')
 resourceproto_dep = dependency('resourceproto', version: '>= 1.2.0')
-xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: 
get_option('dri1') == 'yes')
-dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: 
get_option('dri2') == 'yes')
-dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: 
get_option('dri3') == 'yes')
+xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', required: 
get_option('dri1') == 'true')
+dri2proto_dep = dependency('dri2proto', version: '>= 2.8', required: 
get_option('dri2') == 'true')
+dri3proto_dep = dependency('dri3proto', version: '>= 1.0', required: 
get_option('dri3') == 'true')
 xineramaproto_dep = dependency('xineramaproto')
 xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
 xf86dgaproto_dep = dependency('xf86dgaproto', version: '>= 2.0.99.1', 
required: false)
@@ -93,7 +93,7 @@ xkbfile_dep = dependency('xkbfile')
 xfont2_dep = dependency('xfont2', version: '>= 2.0')
 nettle_dep = dependency('nettle')
 
-dbus_required = get_option('systemd_logind') == 'yes'
+dbus_required = get_option('systemd_logind') == 'true'
 dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
 
 # Resolve default values of some options
@@ -118,13 +118,13 @@ glamor_option = get_option('glamor')
 build_udev = get_option('udev')
 if host_machine.system() == 'windows'
 build_udev = false
-hal_option = 'no'
+hal_option = 'false'
 endif
 
 if get_option('systemd_logind') == 'auto'
 build_systemd_logind = build_udev and dbus_dep.found()
 else
-build_systemd_logind = get_option('systemd_logind') == 'yes'
+build_systemd_logind = get_option('systemd_logind') == 'true'
 endif
 
 build_xorg = false
@@ -134,7 +134,7 @@ if (host_machine.system() != 'darwin' and
 build_xorg = (host_machine.system() != 'darwin' and
   host_machine.system() != 'windows')
 else
-build_xorg = get_option('xorg') == 'yes'
+build_xorg = get_option('xorg') == 'true'
 endif
 endif
 xorgsdkdir = join_paths(get_option('prefix'), get_option('includedir'), 'xorg')
@@ -142,8 +142,8 @@ xorgsdkdir = join_paths(get_option('prefix'), 
get_option('includedir'), 'xorg')
 build_xwayland = false
 if (host_machine.system() != 'darwin' and
 host_machine.system() != 'windows')
-if get_option('xwayland') != 'no'
-xwayland_required = get_option('xwayland') == 'yes'
+if get_option('xwayland') != 'false'
+xwayland_required = get_option('xwayland') == 'true'
 
 xwayland_dep = [
 dependency('wayland-client', version: '>= 1.3.0', required: 
xwayland_required),
@@ -165,8 +165,8 @@ endif
 build_xnest = false
 if (host_machine.system() != 'darwin' and
 host_machine.system() != 'windows')
-if get_option('xnest') != 'no'
-xnest_required = get_option('xnest') == 'yes'
+if get_option('xnest') != 'false'
+xnest_required = get_option('xnest') == 'true'
 
 xnest_dep = [
 dependency('xext', version: '>= 1.0.99.4', required: 
xnest_required),
@@ -191,7 +191,7 @@ if get_option('xwin') == 'auto'
 build_xwin = true
 endif
 else
-build_xwin = get_option('xwin') == 'yes'
+build_xwin = get_option('xwin') == 'true'
 endif
 
 # XXX: Finish these.
@@ -200,7 +200,7 @@ build_xquartz = false
 if get_option('ipv6') == 'auto'
 build_ipv6 = cc.has_function('getaddrinfo')
 else
-build_ipv6 = get_option('ipv6') == 'yes'
+build_ipv6 = get_option('ipv6') == 'true'
 endif
 
 int10 = get_option('int10')
@@ -223,7 +223,7 @@ if hal_option == 'auto'
 build_hal = false
 endif
 else
-build_hal = hal_option == 'yes'
+build_hal = hal_option == 'true'
 if build_hal
 hal_dep = dependency('hal')
 endif
@@ -253,7 +253,7 @@ endif
 if glamor_option == 'auto'
 build_glamor = build_xorg or build_xwayland
 else
-build_glamor = get_option('glamor') == 'yes'
+build_glamor = get_option('glamor') == 'true'
 endif
 
 gbm_dep = dependency('', required:false)
@@ -274,19 +274,19 @@ build_glx = get_option('glx')
 if get_option('dri1') == 'auto'
 build_dri1 = xf86driproto_dep.found()
 else
-build_dri1 = get_option('dri1') == 'yes'
+build_dri1 = 

Re: [Mesa-dev] XDC 2017 feedback

2017-10-24 Thread Andres Gomez
Hi,

Just chipping in to leave a couple of additional notes.

As other have said before me, I also think the organization was very
good.

Things mentioned before:

 * Tables layout: kind of agree it was not great for following the
   talks but they were also making it easier to talk with other
   attendees. I have mixed feelings.
 * I agree more power strips would have been welcome.
 * The microphones were having some small problems but it was not too
   bad.

Positive things also mentioned:

 * WiFi worked great.
 * 1 single big room and more time for hallway conversations was good.
 * Food, beverage, snacks, etc. were very good.
 * Google's facilities and staff were great: organization, catering and
   security people. I hope they pass this feedback to them ☺

Additionally:

 * In the "not so good" part; the details (timetable) of the Program
   were published very late (no more than 1 week before the
   conference). I would have liked to know way in advance at what hour
   in the morning the conference was starting. The same with regards to
   the "Social events". I only got to know that there was a "Pre-
   conference social event" the previous evening to the start of the
   conference after that had already happened, for example.

Finally, I took the freedom to complete the Program page with the
missing video links:

https://www.x.org/wiki/Events/XDC2017/Program/


I hope my comments are helpful.

Thanks again for a great conference.

Br.


On Wed, 2017-09-27 at 10:32 -0700, Miguel Angel Vico wrote:
> Hi,
> 
> In general, I think the organization was great. I agree having
> everything happen in a single room was a good point. Here's some of my
> personal feedback:
> 
>  * I didn't like the tables layout at all. I found it to be extremely
>uncomfortable to have to look sideways in order to see the screens
>and presenter.
> 
>  * There were a very few power strips, and not well distributed along
>the tables.
> 
> 
> Also, this is what I've been able to gather from some of my colleagues
> here at NVIDIA::
> 
>  * Some people watching the conference remotely complained about the
>stream quality, and the recordings wouldn't include the presenter.
> 
>In one of the hallway conversations, Martin mentioned in XDC2016
>they had a team of camera experts doing the job, and will try to
>improve that part in future XDC's.
> 
>  * The microphone/audio situation wasn't great either.  I don't know
>how practical it is with something the size of XDC, but at Khronos
>meetings, they usually set up microphones for the audience too, with
>tap-on/tap-off switches, and a ratio of 1:2 or 1:3 for
>microphones:people.  That makes Q a lot easier.  Alternatively,
>having a question queue rather than running mics around the room can
>speed things up, but makes cross-talk harder.
> 
>  * The table/chair layout was really cumbersome. Beyond just the
>orientation, some people had a lot of trouble getting in/out to use
>the restroom, grab snacks, etc.
> 
> 
> On a positive note:
> 
>  * More time for hallway conversations was in general a good thing.
>Some of us got a ton of useful feedback talking to others.
> 
>  * The food was great, and having food on-site gave us even more time
>for hallway-tracking.
> 
>  * Surprisingly, parking was not an issue.
> 
>  * Signage was good, and the security guards were polite/helpful. It
>was easy to find the room and get our badges.
> 
>  * The wifi worked great in general, which is a rarity at conferences.
>It was pretty spotty at XDC 2016.
> 
> 
> Thank you.
> 
> On Tue, 26 Sep 2017 11:49:10 -0700
> Manasi Navare wrote:
> 
> > Hi,
> > 
> > XDC was a really great conference and loved the fact that it was
> > in just one room which kept all the hallway conversations in that room 
> > resulting
> > into more networking.
> > But I agree with Andres that for the videos, it would be great to split the
> > huge youtube video stream per presentation and have seperate links for each
> > talk somewhere on the XDC page.
> > 
> > Regards
> > Manasi
> > 
> > 
> > 
> > On Tue, Sep 26, 2017 at 01:25:15PM -0400, Andres Rodriguez wrote:
> > > Hi,
> > > 
> > > A small piece of feedback from those of us watching remotely. It would be
> > > nice to have a simple to access index for the long livestream videos.
> > > 
> > > I think the XDC 2017 wiki page would be a good place for this 
> > > information. A
> > > brief example:
> > > 
> > > Presentation Title | Presenter Name | Link with timestamp
> > > ---||-
> > > ...| ...| youtu.be/video-id?t=XhYmZs
> > > 
> > > Or alternatively, a list of hyperlinks with the presentation title as text
> > > that point to the correct timestamp in the video would also be sufficient.
> > > 
> > > Really enjoyed the talks, and would like them to be slightly easier to
> > > access and share with others.

Re: [PATCH xserver] meson: Don't use '' in link_with, ever

2017-10-24 Thread Adam Jackson
On Tue, 2017-10-24 at 12:19 +0100, Jon Turney wrote:
> On 23/10/2017 21:21, Lyude Paul wrote:
> 
> > Signed-off-by: Lyude Paul 
> 
> Reviewed-by: Jon Turney 

remote: I: patch #184369 updated using rev 
4d53e30651c0fe5f7be38ae8529fa49846d39549.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   5893e72a20..4d53e30651  master -> master

- ajax
___
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] travis: Fix OSX build

2017-10-24 Thread Adam Jackson
On Tue, 2017-10-24 at 12:07 +0100, Jon Turney wrote:
> Turn off homebrew autoupdating before installing ccache, to avoid:
> 
> /usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `': Homebrew must
> be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)
> 
> Signed-off-by: Jon Turney 

Just noticed this too, thanks. Merged:

remote: E: failed to find patch for rev 
5893e72a20ffa5cfcd6d0c7c5c934b92546d76c3.
remote: I: 0 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   f44935cdb7..5893e72a20  master -> master

- ajax
___
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] meson: Don't use '' in link_with, ever

2017-10-24 Thread Jon Turney

On 23/10/2017 21:21, Lyude Paul wrote:

String arguments as elements in the array passed to the link_with
argument in meson's executable() functions are not valid and will end up
causing the build file generation to file. This actually ended up
exposing a bug in meson that caused it not to report where in the
meson.build file it was failing:

https://github.com/mesonbuild/meson/pull/2527

The proper way to have a variable that can contain either an empty link
target or an actual link target is:

some_target = []
if some_cond
 some_target = static_library(...)
endif

This way if some_cond is False, some_target gets set to [], gets passed
to executable() in the link_with array, and then gets removed by array
flattening.

This also unbreaks Xwayland builds with -Dglx=false, the thing that
originally made me notice this.

Signed-off-by: Lyude Paul 
---
  glx/meson.build| 2 +-
  hw/dmx/meson.build | 2 +-
  meson.build| 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)


Reviewed-by: Jon Turney 
___
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] travis: Fix OSX build

2017-10-24 Thread Jon Turney
Turn off homebrew autoupdating before installing ccache, to avoid:

/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `': Homebrew must
be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)

Signed-off-by: Jon Turney 
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 498391d1d..bc54f3bc1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,7 @@ before_install:
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull 
jturney/xserver-travis:v2 ; fi
 
 install:
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ; fi
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_NO_AUTO_UPDATE=1 brew 
install ccache ; fi
 
 before_script:
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM 
jturney/xserver-travis:v2 > Dockerfile ; fi
-- 
2.14.2

___
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] modesetting: fail PreInit() if the device has zero connectors

2017-10-24 Thread Tobias Jakobi
Hello Hans,


Hans de Goede wrote:
> Hi,
> 
> On 20-10-17 19:08, tobias.jako...@uni-bielefeld.de wrote:
>> On laptop systems with a dedicated (powerful) GPU A, you usually
>> have all connectors routed to another (less-powerful) GPU B.
>>
>> With my setup (GPU A = Nvidia, GPU B = Intel) I keep GPU A switched
>> off by not loading the nouveau kernel driver during boot.
>>
>> Loading nouveau while X is running then crashes the server:
>> [   540.775] (EE) 0: /usr/bin/X (xorg_backtrace+0x41) [0x57fa31]
>> [   540.775] (EE) 1: /usr/bin/X (0x40+0x183429) [0x583429]
>> [   540.775] (EE) 2: /lib64/libpthread.so.0 (0x7ff02d508000+0x10ec0)
>> [0x7ff02d518ec0]
>> [   540.775] (EE) 3: /lib64/libc.so.6 (gsignal+0x38) [0x7ff02d1a2178]
>> [   540.775] (EE) 4: /lib64/libc.so.6 (abort+0x16a) [0x7ff02d1a35fa]
>> [   540.775] (EE) 5: /lib64/libc.so.6 (0x7ff02d16f000+0x2c0b7) 
>> [0x7ff02d19b0b7]
>> [   540.775] (EE) 6: /lib64/libc.so.6 (0x7ff02d16f000+0x2c162) 
>> [0x7ff02d19b162]
>> [   540.775] (EE) 7: /usr/bin/X (dixRegisterPrivateKey+0x247) [0x452197]
>> [   540.775] (EE) 8: /usr/lib64/xorg/modules/libglamoregl.so
>> (glamor_init+0x160) [0x7ff00ee564d0]
>> [   540.775] (EE) 9: /usr/lib64/xorg/modules/drivers/modesetting_drv.so
>> (0x7ff01c19a000+0x83e1) [0x7ff01c1a23e1]
>> [   540.775] (EE) 10: /usr/bin/X (AddGPUScreen+0xf3) [0x4348b3]
>> [   540.775] (EE) 11: /usr/bin/X (0x40+0x90271) [0x490271]
>> [   540.775] (EE) 12: /usr/bin/X (0x40+0x9547b) [0x49547b]
>> [   540.775] (EE) 13: /usr/bin/X (0x40+0x905d7) [0x4905d7]
>> [   540.775] (EE) 14: /usr/bin/X (xf86VTEnter+0x1bb) [0x47399b]
>> [   540.775] (EE) 15: /usr/bin/X (WakeupHandler+0xda) [0x438e3a]
>> [   540.775] (EE) 16: /usr/bin/X (WaitForSomething+0x1ce) [0x57d6fe]
>> [   540.775] (EE) 17: /usr/bin/X (0x40+0x34221) [0x434221]
>> [   540.775] (EE) 18: /usr/bin/X (0x40+0x382f8) [0x4382f8]
>> [   540.775] (EE) 19: /lib64/libc.so.6 (__libc_start_main+0xf0) 
>> [0x7ff02d18f670]
>> [   540.776] (EE) 20: /usr/bin/X (_start+0x29) [0x4235b9]
>>
>> In particular note that GLAMOR is initialized for GPU A, which
>> makes no sense since it has no connectors.
>>
>> Fix this by bailing out early in the modesetting DDX when a setup
>> with zero connectors is detected.
>>
>> Signed-off-by: Tobias Jakobi 
> 
> Sorry, but NACK. The modesetting driver actually had such a check before
> and I removed it because not having a driver breaks rendering on
> the dedicated GPU with "DRI_PRIME=1" for dri2 clients.
sorry, I didn't consider DRI2 in this scenario.


> I guess that there is some sort of assumption in the code for dealing
> with glamor failure that it only happens on coldplug, if you really
> want to be able to modprobe nouveau later you should figure out what
> is exactly going wrong and fix that.
OK, I'll try to get to the bottom of this.


> Note BTW that nouveau should runtime suspend the GPU, even with Xorg
> running and there really is no need to not load nouveau.
No, sadly this is not true on my system. The system has a dual cooling solution,
where cooler A is attached to the CPU, and cooler B to the GPU. When never
inserting nouveau.ko after boot, cooler B stays off the entire time. Once I've
inserted the module, cooler B comes up from time to time _even_ if the GPU is
runtime suspended at that time (and has been since hours).

- Tobias


> 
> Regards,
> 
> Hans

___
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