[PATCH xserver 1/2] modesetting: Ignore alpha channel when importing BOs for modesetting

2018-03-28 Thread Louis-Francis Ratté-Boulianne
Fixes a regression caused by modifiers support. For some hw to
continue working even if not supporting ARGB and ARGB2101010
formats, we assume that all imported BOs are opaque.

Signed-off-by: Louis-Francis Ratté-Boulianne 
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 47c11adce..e010eae21 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -70,12 +70,28 @@ modifiers_ptr(struct drm_format_modifier_blob *blob)
 return (struct drm_format_modifier *)(((char *)blob) + 
blob->modifiers_offset);
 }
 
+static uint32_t
+get_opaque_format(uint32_t format)
+{
+switch (format) {
+case DRM_FORMAT_ARGB:
+return DRM_FORMAT_XRGB;
+case DRM_FORMAT_ARGB2101010:
+return DRM_FORMAT_XRGB2101010;
+default:
+return format;
+}
+}
+
 Bool
 drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t 
modifier)
 {
 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
 int c, i, j;
 
+/* BO are imported as opaque surface, so let's pretend there is no alpha */
+format = get_opaque_format(format);
+
 for (c = 0; c < xf86_config->num_crtc; c++) {
 xf86CrtcPtr crtc = xf86_config->crtc[c];
 drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -123,6 +139,9 @@ get_modifiers_set(ScrnInfoPtr scrn, uint32_t format, 
uint64_t **modifiers,
 int c, i, j, k, count_modifiers = 0;
 uint64_t *tmp, *ret = NULL;
 
+/* BOs are imported as opaque surfaces, so pretend the same thing here */
+format = get_opaque_format(format);
+
 *modifiers = NULL;
 for (c = 0; c < xf86_config->num_crtc; c++) {
 xf86CrtcPtr crtc = xf86_config->crtc[c];
@@ -684,6 +703,7 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo,
 memset(modifiers, 0, sizeof(modifiers));
 
 format = gbm_bo_get_format(bo->gbm);
+format = get_opaque_format(format);
 for (i = 0; i < num_fds; i++) {
 handles[i] = gbm_bo_get_handle_for_plane(bo->gbm, i).u32;
 strides[i] = gbm_bo_get_stride_for_plane(bo->gbm, i);
-- 
2.14.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 2/2] modesetting: Fix reported size when using atomic modesetting

2018-03-28 Thread Louis-Francis Ratté-Boulianne
The framebuffer can include multiple CRTCs in multi-monitors
setup. So we shouldn't use the buffer size but the CRTC size
instead. Rotated displays are shadowed, so we don't need to
worry about it there.

Signed-off-by: Louis-Francis Ratté-Boulianne 
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e010eae21..a70b4c6b4 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -562,15 +562,15 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc, DisplayModePtr 
mode, uint32_t fb_id,
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x << 16);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y << 16);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W,
-  drmmode->front_bo.width << 16);
+  crtc->mode.HDisplay << 16);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H,
-  drmmode->front_bo.height << 16);
+  crtc->mode.VDisplay << 16);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W,
-  drmmode->front_bo.width);
+  crtc->mode.HDisplay);
 ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H,
-  drmmode->front_bo.height);
+  crtc->mode.VDisplay);
 
 if (ret == 0)
 ret = drmModeAtomicCommit(ms->fd, req, flags, data);
-- 
2.14.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] modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*

2018-03-28 Thread Mario Kleiner
A new crasher, this time while trying to play with the non-desktop property.

On Thu, Mar 22, 2018 at 7:47 PM, Adam Jackson  wrote:
> Signed-off-by: Adam Jackson 
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 75 
> +---
>  hw/xfree86/drivers/modesetting/present.c |  1 -
>  2 files changed, 41 insertions(+), 35 deletions(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index 6f636ba7bd..47c11adced 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c

 snip ...

> @@ -2244,18 +2247,19 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
>  {
>  drmmode_output_private_ptr drmmode_output = output->driver_private;
>  xf86CrtcPtr crtc = output->crtc;
> +modesettingPtr ms = modesettingPTR(crtc->scrn);

--> This assignment above makes the X-Server crash, if output->crtc is
NULL, and therefore crtc->scrn is a NULL ptr deref.
output->crtc == NULL can happen from some call paths, e.g., whenever
xf86DisableUnusedFunctions() gets called and decides to dpms off an
output.

[ 12732.278] (EE) Backtrace:
[ 12732.278] (EE) 0: /usr/bin/X (OsSigHandler+0x29) [0x591c19]
[ 12732.279] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0
(__restore_rt+0x0) [0x7f3ecf20d38f]
[ 12732.280] (EE) 2:
/usr/local/lib/xorg/modules/drivers/modesetting_drv.so
(drmmode_output_dpms+0x10) [0x7f3ecb2bcc60]
[ 12732.280] (EE) 3: /usr/bin/X (xf86DisableUnusedFunctions+0x13c) [0x4b10dc]
[ 12732.280] (EE) 4: /usr/bin/X (xf86RandR12CrtcSet+0x4ca) [0x4b941a]
[ 12732.281] (EE) 5: /usr/bin/X (RRCrtcSet+0x2ce) [0x4f2eee]
[ 12732.281] (EE) 6: /usr/bin/X (ProcRRSetCrtcConfig+0x420) [0x4f4740]
[ 12732.282] (EE) 7: /usr/bin/X (Dispatch+0x28b) [0x43e41b]
[ 12732.282] (EE) 8: /usr/bin/X (dix_main+0x398) [0x4424f8]
[ 12732.283] (EE) 9: /lib/x86_64-linux-gnu/libc.so.6
(__libc_start_main+0xf0) [0x7f3ecee52830]
[ 12732.283] (EE) 10: /usr/bin/X (_start+0x29) [0x42c4e9]
[ 12732.284] (EE) 11: ? (?+0x0) [0x0]
[ 12732.284] (EE)
[ 12732.284] (EE) Segmentation fault at address 0x8

How i triggered this in my case:

1. Have a VR HMD connected during server startup, which gets set to
"Output disconnected" due to having the new "non-desktop" property set
to true,
therefore the HMD on HDMI-3 stays dark.

2. xrandr --output HDMI-3 --set 'non-desktop' 0because i want to
enable the HMD on my desktop to use it without a dedicated VR
compositor.
3. Boom!

thanks,
-mario
___
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: [ANNOUNCE] xorg-server 1.19.99.902

2018-03-28 Thread Thomas Klausner
I see a new compilation error compared to the previous beta release (on NetBSD):


gmake[4]: Entering directory 
'/scratch/wip/modular-xorg-server-devel/work/xorg-server-1.19.99.902/hw/xfree86'
  CC   sdksyms.o
sdksyms.c:1773:15: error: expected expression before ',' token
 (void *) &,  /* 
../../dri3/dri3.h:110 */
   ^
Makefile:821: recipe for target 'sdksyms.o' failed


Line 110 in dri3/dri3.h is
dri3_send_open_reply(ClientPtr client, int fd);

not sure what the connection to the error is.
 Thomas
___
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

[ANNOUNCE] xorg-server 1.19.99.902

2018-03-28 Thread Adam Jackson
This merges the DRI3 1.2 support (with an asterisk) and per-window
flips for Xwayland, along with the usual collection of miscellaneous
fixes. In particular the meson build is much closer to production-
ready. The asterisk for DRI3 is that the modesetting driver has some
known issues still, so the code to enable planes and modifiers is
hidden behind an xorg.conf option:

Section "ServerFlags"
Option "Debug" "dmabuf_capable"
EndSection

Thanks to all for testing and debugging.

Adam Jackson (30):
  randr: Fix a crash on initialization with GPU screens
  os: Define {ReadFdFrom,WriteFdTo}Client unconditionally
  travis: Switch linux build from stretch to rawhide
  travis: Update OSX build
  appveyor: Switch to xorgproto
  ci: Ignore builds for branches aimed at other CI services
  meson: Add the x(org)proto headers to the include path
  appveyor: use meson
  travis: Bump rawhide image
  travis: Drop Xcode 8.2
  modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*
  autotools: Stop caring about XORG_DATE
  man: s/__/@/g
  meson: Add libdrm to hw/xfree86/common's dependencies
  meson: Fix installing protocol.txt
  meson: Build Xorg suid wrapper
  meson: Install man pages
  meson: Build cvt and gtf
  meson: Install the dmx utilities
  meson: Generate xorg-server.pc
  meson: Install xorg-server.m4
  meson: Fix install path for 10-quirks.conf
  autotools: Fix excessive \-escaping that broke the build
  suid touchup
  Revert "suid touchup"
  meson: Add option to set default font path (v2)
  xfree86: Add Option "Debug" to ServerFlags
  glamor: Hide new DRI behind Option "Debug" "dmabuf_capable"
  autotools: Derive xkb configuration from xkbcomp.pc
  xserver 1.20 RC2

Alan Coopersmith (1):
  Revert "modesetting: Remove #ifdefs XF86_PDEV_SERVER_FD"

Alexander Volkov (1):
  Xext/shm: Downgrade from error to debug log output about success

Antoine Martin (1):
  os: Fix -logfile when used with -displayfd

Daniel Stone (1):
  modesetting/drmmode: Remove unused flink call

Emil Velikov (7):
  present: cap the version returned to the client
  dri3: cap the version returned to the client
  configure: remove libdrm version check
  Remove always true GLAMOR_HAS_DRM_* guards
  modesetting: remove always true defined(DRM_CAP_PRIME) guards
  modesetting: remove always true DRM_IOCTL_CRTC_QUEUE_SEQUENCE guard
  modesetting: remove fallback DRM_CAP_* defines

Eric Engestrom (1):
  exa: promise not to touch the data when swapping pointers

Jon Turney (1):
  meson: Require libdrm for dri1/2/3 when configured 'auto' as well as 
'true'

Keith Packard (2):
  Require libdrm 2.4.89 or newer
  Xext/saver: Swap ScreenSaverSuspend 'suspend' field. Handle old XCB 
clients.

Kyle Brenneman (1):
  Don't delete GLX's extensionInitCallback list during a reset.

Laurent Carlier (4):
  meson: Make APM support optional
  meson: Make ACPI support optional
  meson: get rid of useless HAVE_SYSV_IPC
  meson: Make SHM extension optional

Louis-Francis Ratté-Boulianne (12):
  dri3: Add multi-planar/modifier buffer requests
  present: Send PresentCompleteModeSuboptimalCopy appropriately
  modesetting: Use atomic modesetting API for pageflip if available
  modesetting: Add support for multi-plane pixmaps when page-flipping
  modesetting: Use atomic modesetting to configure output/CRTCs
  modesetting: Get supported formats/modifiers for scanout
  modesetting: Create scanout buffers using supported modifiers
  modesetting: Check if buffer format is supported when flipping
  glamor: Implement PixmapFromBuffers and BuffersFromPixmap
  glamor: Implement GetSupportedModifiers
  glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation
  dri3: Enable DRI3 version 1.2

Mario Kleiner (2):
  glamor/xwayland: Add depth 30 format mapping for DRI 3.2 as well.
  modesetting: Fix page flipping under DRI 3.2.

Michel Dänzer (2):
  glamor: Restore glamor_fd_from_pixmap and glamor_pixmap_from_fd
  randr: Initialize RROuptutRec::nonDesktop

Nicolai Hähnle (4):
  os: move xf86PrivsElevated here
  os: use PrivsElevated instead of a manual check
  xfree86: replace all uses of xf86PrivsElevated with PrivsElevated
  glx: honor LIBGL_DRIVERS_PATH when loading DRI drivers

Olivier Fourdan (1):
  automake: Fix 'make dist'

Rodrigo Vivi (1):
  dri2: Sync i965_pci_ids.h from Mesa.

Roman Gilg (23):
  present: Move screen flip functionality in separate file
  present: Preliminary internal flip mode API
  present: Move vblank functionality in seperate file
  present: Add flip mode API hooks for several functions
  present: Refactor execute in separate file
  present: Add flip mode API hook for present_pixmap
  present: Add flip mode API hook for 

[ANNOUNCE] xorg-server 1.19.99.902

2018-03-28 Thread Adam Jackson
This merges the DRI3 1.2 support (with an asterisk) and per-window
flips for Xwayland, along with the usual collection of miscellaneous
fixes. In particular the meson build is much closer to production-
ready. The asterisk for DRI3 is that the modesetting driver has some
known issues still, so the code to enable planes and modifiers is
hidden behind an xorg.conf option:

Section "ServerFlags"
Option "Debug" "dmabuf_capable"
EndSection

Thanks to all for testing and debugging.

Adam Jackson (30):
  randr: Fix a crash on initialization with GPU screens
  os: Define {ReadFdFrom,WriteFdTo}Client unconditionally
  travis: Switch linux build from stretch to rawhide
  travis: Update OSX build
  appveyor: Switch to xorgproto
  ci: Ignore builds for branches aimed at other CI services
  meson: Add the x(org)proto headers to the include path
  appveyor: use meson
  travis: Bump rawhide image
  travis: Drop Xcode 8.2
  modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*
  autotools: Stop caring about XORG_DATE
  man: s/__/@/g
  meson: Add libdrm to hw/xfree86/common's dependencies
  meson: Fix installing protocol.txt
  meson: Build Xorg suid wrapper
  meson: Install man pages
  meson: Build cvt and gtf
  meson: Install the dmx utilities
  meson: Generate xorg-server.pc
  meson: Install xorg-server.m4
  meson: Fix install path for 10-quirks.conf
  autotools: Fix excessive \-escaping that broke the build
  suid touchup
  Revert "suid touchup"
  meson: Add option to set default font path (v2)
  xfree86: Add Option "Debug" to ServerFlags
  glamor: Hide new DRI behind Option "Debug" "dmabuf_capable"
  autotools: Derive xkb configuration from xkbcomp.pc
  xserver 1.20 RC2

Alan Coopersmith (1):
  Revert "modesetting: Remove #ifdefs XF86_PDEV_SERVER_FD"

Alexander Volkov (1):
  Xext/shm: Downgrade from error to debug log output about success

Antoine Martin (1):
  os: Fix -logfile when used with -displayfd

Daniel Stone (1):
  modesetting/drmmode: Remove unused flink call

Emil Velikov (7):
  present: cap the version returned to the client
  dri3: cap the version returned to the client
  configure: remove libdrm version check
  Remove always true GLAMOR_HAS_DRM_* guards
  modesetting: remove always true defined(DRM_CAP_PRIME) guards
  modesetting: remove always true DRM_IOCTL_CRTC_QUEUE_SEQUENCE guard
  modesetting: remove fallback DRM_CAP_* defines

Eric Engestrom (1):
  exa: promise not to touch the data when swapping pointers

Jon Turney (1):
  meson: Require libdrm for dri1/2/3 when configured 'auto' as well as 
'true'

Keith Packard (2):
  Require libdrm 2.4.89 or newer
  Xext/saver: Swap ScreenSaverSuspend 'suspend' field. Handle old XCB 
clients.

Kyle Brenneman (1):
  Don't delete GLX's extensionInitCallback list during a reset.

Laurent Carlier (4):
  meson: Make APM support optional
  meson: Make ACPI support optional
  meson: get rid of useless HAVE_SYSV_IPC
  meson: Make SHM extension optional

Louis-Francis Ratté-Boulianne (12):
  dri3: Add multi-planar/modifier buffer requests
  present: Send PresentCompleteModeSuboptimalCopy appropriately
  modesetting: Use atomic modesetting API for pageflip if available
  modesetting: Add support for multi-plane pixmaps when page-flipping
  modesetting: Use atomic modesetting to configure output/CRTCs
  modesetting: Get supported formats/modifiers for scanout
  modesetting: Create scanout buffers using supported modifiers
  modesetting: Check if buffer format is supported when flipping
  glamor: Implement PixmapFromBuffers and BuffersFromPixmap
  glamor: Implement GetSupportedModifiers
  glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation
  dri3: Enable DRI3 version 1.2

Mario Kleiner (2):
  glamor/xwayland: Add depth 30 format mapping for DRI 3.2 as well.
  modesetting: Fix page flipping under DRI 3.2.

Michel Dänzer (2):
  glamor: Restore glamor_fd_from_pixmap and glamor_pixmap_from_fd
  randr: Initialize RROuptutRec::nonDesktop

Nicolai Hähnle (4):
  os: move xf86PrivsElevated here
  os: use PrivsElevated instead of a manual check
  xfree86: replace all uses of xf86PrivsElevated with PrivsElevated
  glx: honor LIBGL_DRIVERS_PATH when loading DRI drivers

Olivier Fourdan (1):
  automake: Fix 'make dist'

Rodrigo Vivi (1):
  dri2: Sync i965_pci_ids.h from Mesa.

Roman Gilg (23):
  present: Move screen flip functionality in separate file
  present: Preliminary internal flip mode API
  present: Move vblank functionality in seperate file
  present: Add flip mode API hooks for several functions
  present: Refactor execute in separate file
  present: Add flip mode API hook for present_pixmap
  present: Add flip mode API hook for 

Re: [PATCH xserver 2/2] glamor: Hide new DRI for behind Option "Debug" "dmabuf_capable"

2018-03-28 Thread Adam Jackson
On Wed, 2018-03-28 at 13:40 -0400, Adam Jackson wrote:
> On Wed, 2018-03-28 at 12:46 -0400, Adam Jackson wrote:
> 
> > @@ -960,7 +961,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
> >  "EGL_EXT_image_dma_buf_import") &&
> >  epoxy_has_egl_extension(glamor_egl->display,
> >  "EGL_EXT_image_dma_buf_import_modifiers"))
> > -glamor_egl->dmabuf_capable = TRUE;
> > +glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
> > +  "dmabuf_capable");
> >  #endif
> 
> Obviously this should check if xf86Info.debug is non-null first, and
> probably there should be better API than this.

Merged these in the name of a vaguely usable RC2.

- 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 v2] fixing -logfile when used with -displayfd

2018-03-28 Thread Adam Jackson
On Sun, 2018-03-25 at 21:09 -0700, Alan Coopersmith wrote:
> Reviewed-by: Alan Coopersmith 

Patchwork hated this patch, for whatever reason. Applied by hand and
fixed up the commit message a bit, thanks:

remote: E: failed to find patch for rev 
c95361465ee98dd97a99778d8a31be88fe9e4c4f.
remote: I: 0 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   b355e55f50..c95361465e  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] automake: Fix 'make dist'

2018-03-28 Thread Adam Jackson
On Wed, 2018-03-28 at 14:08 +0200, Thierry Reding wrote:
> On Wed, Mar 28, 2018 at 12:17:48PM +0200, Olivier Fourdan wrote:
> > Automake would skip a few meson files that would prevent to build with
> > meson a dist file previously generated by automake.
> > 
> > Signed-off-by: Olivier Fourdan 
> > ---
> >  Makefile.am | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 5ddfd5b84..32d4d21e7 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -140,6 +140,7 @@ distcheck-hook:
> >  EXTRA_DIST += \
> > meson_options.txt \
> > include/xorg-config.h.meson.in \
> > +   include/xwin-config.h.meson.in \
> 
> Just a thought: there's a Makefile.am in the include subdirectory, so
> maybe add this line there? Could be a follow-up patch, though, so:
> 
> Reviewed-by: Thierry Reding 

Yeah, might be a nice cleanup but it's no worse than what's already
there. Merged, thanks:

remote: I: patch #213386 updated using rev 
b355e55f500c18d55d0ac241e5f7e826ed62f555.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   16639ab77d..b355e55f50  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] Don't delete GLX's extensionInitCallback list during a reset.

2018-03-28 Thread Adam Jackson
On Fri, 2018-03-02 at 17:58 -0700, Kyle Brenneman wrote:
> When a callback list is initialized using CreateCallbackList via AddCallback,
> the list gets added to the listsToCleanup array, and as a result the list gets
> deleted at the end of the server generation.
> 
> But, vendor libraries add themselves to that callback list only once, not once
> per generation, so if you delete the list, then no vendor will register itself
> on the next generation, and GLX breaks.
> 
> Instead, use a static CallbackListRec for the extensionInitCallback list. That
> way, it doesn't get added to listsToCleanup, and doesn't get deleted during a
> reset.

Yeah, this works. This is kind of why I'd wanted to see each screen
register its own provider during init, though the swrast fallback
problem makes that less awesome. Still, merged, thanks:

remote: I: patch #207871 updated using rev 
16639ab77d14cecb7d03fd2d5c796c2fb1714c18.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   7004a7c3c9..16639ab77d  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 0/3] Use DRM GetFB2 ioctl

2018-03-28 Thread Adam Jackson
On Fri, 2018-03-23 at 13:50 +, Daniel Stone wrote:
> Hi,
> This short patchset makes modesetting use the shiny, new, and completely
> not at all merged GetFB2 DRM ioctl:
> https://lists.freedesktop.org/archives/dri-devel/2018-March/170512.html
> 
> When starting Xorg with -background none, it uses GetFB to interrogate
> the current framebuffer, importing it into a Glamor texture so it can
> copy back to its own storage. Unfortunately, if your buffer was
> multi-planar (e.g. new Intel with auxiliary compression buffer), or just
> too exotic to be described without a modifier (etnaviv in tiled mode),
> GetFB fell short of what we actually needed.
> 
> GetFB2 is the equivalent to AddFB2 (or AddFB2WithModifiers; both the
> same from an ioctl point of view), so this ports modesetting to use that
> where available and use with more complex buffers.
> 
> The kernel ABI rules require positive review from real userspace (not
> random hacked-up libdrm tests) before merging. Given that, I'd
> appreciate someone taking a look at the use of GetFB2 here, and
> following up with a statement that they think the ABI is actually good
> and long-term usable for what Xorg needs. (Or, well, some kind of
> constructive criticism.)

ABI looks plausible to me. I've merged 1/3 as it's obviously good:

remote: I: patch #212502 updated using rev 
7004a7c3c983b4453756b92341bf22790b1eb98d.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   be087778a0..7004a7c3c9  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 v3 23/24] xwayland: Cut off upper 32bit of queued vblank delay

2018-03-28 Thread Adam Jackson
On Wed, 2018-03-14 at 11:02 +0100, Michel Dänzer wrote:

> However, since I've been unable to reproduce the issue you described
> with Steam, despite kind of going out of my way to do so, I'm really
> reluctant to add this workaround without getting more information about
> the problem from someone who can reproduce it. Without understanding the
> problem, the workaround might turn out to be too strict or too lenient,
> and clients might accidentally become dependent on the workaround.

Yeah, I'm not thrilled with this workaround either, and I've not been
able to trigger it. We can revisit this later if necessary.

The rest of the series I've been running with for a while now with no
issues, so, merged:

remote: I: patch #210201 updated using rev 
dda7efec36b495e100e670e057d7ef5022ef3976.
remote: I: patch #210202 updated using rev 
c5c50c6db1e71e976596750277b1a618704c04aa.
remote: I: patch #210203 updated using rev 
5365ece70a75a05df3d6351767d19c3edcf0305d.
remote: I: patch #201328 updated using rev 
1e7d8902bfe7cfb79c41b14fc6b50bcbe4f7c800.
remote: I: patch #210205 updated using rev 
679ffbf5f39822ea508e50f1b7c92a2a9e79f7bb.
remote: I: patch #210206 updated using rev 
1db7cf0429eabf33f8e2b55a15db4d1f87e1fb95.
remote: I: patch #210208 updated using rev 
84112a1d0b221c00d7d3c23fd5b97687e6e3749a.
remote: I: patch #210207 updated using rev 
6a338b5959ca5a9e5260d71b6a739a5c672d77e7.
remote: I: patch #210210 updated using rev 
6d813bbd5ea0fc38a8114c08368a7954eeb2ef37.
remote: I: patch #201332 updated using rev 
3c0be573fb09a206966075d81ebe0510ca23.
remote: I: patch #207397 updated using rev 
84e47f3fe68f05f7b0b762e96acd4c95fa8000ca.
remote: I: patch #210212 updated using rev 
92b91b8cf34a38de39281044d8441b6cabe87a85.
remote: I: patch #207396 updated using rev 
7b071b4e440313254398f06eb59b1596a6d3e8fe.
remote: I: patch #210218 updated using rev 
8d370fcdcaed210d9f4afc1650aa8b161c7fbb44.
remote: I: patch #210214 updated using rev 
029608dd80204ac96423ef79ec46c1a18bbdd5ff.
remote: I: patch #207399 updated using rev 
66a5c0bccb222ad8b9b57b10490c3041e1b3f05e.
remote: I: patch #201340 updated using rev 
a337949f99bc473ea0ae0af64736eae3d5b39399.
remote: I: patch #201341 updated using rev 
902429f077325b98e30ede2710bd7a88440d2937.
remote: I: patch #210219 updated using rev 
8fba2a03f1410f3bc7504e218ac1e5c964279ea2.
remote: I: patch #210220 updated using rev 
0fb2cca193e60b731c8e75a2a7e795477fb5fd8f.
remote: I: patch #207404 updated using rev 
86df366973de1c10da5fbdc57d1ff12b681c321f.
remote: I: patch #210221 updated using rev 
07750ff3c084c6549a5612d1f935a9a3ab3df67c.
remote: I: patch #210224 updated using rev 
be087778a0eae3093ffdbba3ff7c9f3863d8e1d4.
remote: I: 23 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   4303deae78..be087778a0  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] modesetting: Fix page flipping under DRI 3.2.

2018-03-28 Thread Mario Kleiner
The approach in the patch looks good to me, same as we use in weston.
I'll test in a few hours and let you know.

thanks,
-mario


On Wed, Mar 28, 2018 at 5:58 AM, Louis-Francis Ratté-Boulianne
 wrote:
> Hi Mario,
>
> Could you try with the following patch and let me know how things are
> working out:
>
> https://gitlab.collabora.com/lfrb/xserver/commit/d26b45afc19547ab3ff689
> 581db2b01abb4e1ed2
>
> It shouldn't differ much from your patch though and I still don't
> understand why pageflip would fail for you. I've tested again today and
>  it works fine for me (for Mutter and glmark2-es2).
>
> What client are you using for testing? Keep in mind that the buffer
> swapping needs to be synchronized with vblank because Intel driver
> doesn't support async page flip.
>
> Thank you,
>
> --
> Louis-Francis
>
> On Tue, 2018-03-27 at 10:10 +0200, Olivier Fourdan wrote:
>> Hi,
>>
>> On Mon, Mar 26, 2018 at 7:54 PM, Mario Kleiner > l.com> wrote:
>> > [...]
>> > I haven't had time to retest with the latest patch on master of
>> > Adam
>> > "modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*"
>> > yet, so maybe that makes a positive difference? My testing was with
>> > master as of "modesetting: Fix page flipping under DRI 3.2." plus
>> > the
>> > argb -> xrgb snippet to make modesetting work at all on
>> > Ivybridge/Ironlake.
>>
>> commit  ba0c75177 (ajax latest commit) makes no difference for the
>> incompatible format issue, it's more about clean-up and being able to
>> work if atomic modesetting is not available, which is not the case
>> here.
>>
>> The funny thing is, I noticed it works (as in “a mode is set”) when
>> using drmModeAddFB() (as“before”) instead of
>> drmModeAddFB2WithModifiers() in drmmode_bo_import() - Thus the
>> perceived regression, it worked before.
>>
>> drmModeAddFB() and drmModeAddFB2WithModifiers()  translate
>> respectively as drm_mode_addfb() and drm_mode_addfb2() in the kernel
>> (drivers/gpu/drm/drm_framebuffer.c), and drm_mode_addfb() will
>> eventually call drm_mode_addfb2() after determining itself the format
>> to use with drm_mode_legacy_fb_format() [1].
>>
>> drm_mode_legacy_fb_format() is defined in
>> drivers/gpu/drm/drm_fourcc.c [2] and will use DRM_FORMAT_XRGB for
>> depth 24 and DRM_FORMAT_XRGB2101010 for depth 30, and
>> DRM_FORMAT_ARGB for anything else.
>>
>> Cheers,
>> Olivier
>>
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi
>> t/tree/drivers/gpu/drm/drm_framebuffer.c#n95
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi
>> t/tree/drivers/gpu/drm/drm_fourcc.c#n38
>>
>>
>> ___
>> 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: [PATCH xserver 2/2] glamor: Hide new DRI for behind Option "Debug" "dmabuf_capable"

2018-03-28 Thread Adam Jackson
On Wed, 2018-03-28 at 12:46 -0400, Adam Jackson wrote:

> @@ -960,7 +961,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
>  "EGL_EXT_image_dma_buf_import") &&
>  epoxy_has_egl_extension(glamor_egl->display,
>  "EGL_EXT_image_dma_buf_import_modifiers"))
> -glamor_egl->dmabuf_capable = TRUE;
> +glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
> +  "dmabuf_capable");
>  #endif

Obviously this should check if xf86Info.debug is non-null first, and
probably there should be better API than this.

- 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

[PATCH xserver 2/2] glamor: Hide new DRI for behind Option "Debug" "dmabuf_capable"

2018-03-28 Thread Adam Jackson
... for xfree86, at least for now. Things appear to work for Xwayland
but not yet for modesetting. Hopefully we can fix that before 1.20 but
in the meantime this makes testing both paths easier than a rebuild.

Signed-off-by: Adam Jackson 
---
 glamor/glamor_egl.c  | 4 +++-
 hw/xfree86/man/xorg.conf.man | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 2ea3efc58e..4a550932a0 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #define EGL_DISPLAY_NO_X_MESA
 
@@ -960,7 +961,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
 "EGL_EXT_image_dma_buf_import") &&
 epoxy_has_egl_extension(glamor_egl->display,
 "EGL_EXT_image_dma_buf_import_modifiers"))
-glamor_egl->dmabuf_capable = TRUE;
+glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
+  "dmabuf_capable");
 #endif
 
 glamor_egl->saved_free_screen = scrn->FreeScreen;
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 46ddd0ec9c..958926243c 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -498,6 +498,9 @@ The options recognised by this section are:
 .BI "Option \*qDebug\*q  \*q" string \*q
 This comma-separated list provides a way to control various debugging switches
 from the config file.
+At the moment the only defined value is
+.B dmabuf_capable
+which instructs glamor to enable some unstable buffer management code.
 .TP 7
 .BI "Option \*qDefaultServerLayout\*q  \*q" layout\-id \*q
 This specifies the default
-- 
2.16.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 1/2] xfree86: Add Option "Debug" to ServerFlags

2018-03-28 Thread Adam Jackson
This provides a generic way to control obscure runtime behavior knobs
without making interface promises.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Config.c  | 5 +
 hw/xfree86/common/xf86Privstr.h | 1 +
 hw/xfree86/man/xorg.conf.man| 4 
 3 files changed, 10 insertions(+)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 05991d319d..2c1d335dcc 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -645,6 +645,7 @@ typedef enum {
 FLAG_AUTO_ADD_GPU,
 FLAG_MAX_CLIENTS,
 FLAG_IGLX,
+FLAG_DEBUG,
 } FlagValues;
 
 /**
@@ -702,6 +703,8 @@ static OptionInfoRec FlagOptions[] = {
  {0}, FALSE },
 {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN,
  {0}, FALSE},
+{FLAG_DEBUG, "Debug", OPTV_STRING,
+ {0}, FALSE},
 {-1, NULL, OPTV_NONE,
  {0}, FALSE},
 };
@@ -850,6 +853,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr 
layoutopts)
 }
 #endif
 
+xf86Info.debug = xf86GetOptValString(FlagOptions, FLAG_DEBUG);
+
 /* if we're not hotplugging, force some input devices to exist */
 xf86Info.forceInputDevices = !(xf86Info.autoAddDevices &&
xf86Info.autoEnableDevices);
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 0842e1ebbd..21c2e1fe49 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -97,6 +97,7 @@ typedef struct {
 MessageType dri2From;
 
 Bool autoAddGPU;
+const char *debug;
 } xf86InfoRec, *xf86InfoPtr;
 
 /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 518d5bb78c..46ddd0ec9c 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -495,6 +495,10 @@ Options with command line equivalents are overridden when 
their command
 line equivalent is used.
 The options recognised by this section are:
 .TP 7
+.BI "Option \*qDebug\*q  \*q" string \*q
+This comma-separated list provides a way to control various debugging switches
+from the config file.
+.TP 7
 .BI "Option \*qDefaultServerLayout\*q  \*q" layout\-id \*q
 This specifies the default
 .B ServerLayout
-- 
2.16.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 7/7] meson: Properly extract ABI versions for xorg-server.pc

2018-03-28 Thread Adam Jackson
On Wed, 2018-03-28 at 14:04 +0200, Thierry Reding wrote:
> From: Thierry Reding 
> 
> The newline in the middle of the awk expression confuses Meson and
> causes it to pass only the string before the newline to awk, which will
> subsequently fail because it encounters an unterminated string.
> 
> One fix would be to escape the newlines ('\\n'), but that causes the
> newline to end up in the pkg-config file and separate the ABI version
> lines by blank lines.
> 
> Instead, simply drop the newlines to make the generated pkg-config file
> look more like the one generated as part of the autotools-based build.
> 
> Signed-off-by: Thierry Reding 

Merged the series, thanks:

remote: I: patch #213395 updated using rev 
66402fcd8280b393d3992121c0bcff9c646c97ed.
remote: I: patch #213396 updated using rev 
c62a8b60b9a07092ebebf9aeb67a0c39c583aabe.
remote: I: patch #213397 updated using rev 
b04ff31b9d471822fe96ed63eda93fc4cd8c22d0.
remote: I: patch #213398 updated using rev 
0babe78ed5afec8a06a517346f39b5ebd003773c.
remote: I: patch #213399 updated using rev 
d905e3330fd4f9b15a0277b22d608705787cb8bc.
remote: I: patch #213400 updated using rev 
465b38cadd573ce50eca959f4b56bf4a6a638d91.
remote: I: patch #213401 updated using rev 
4303deae78c4e2a60856be87bf87cd1643c268f5.
remote: I: 7 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   0a7dabc86c..4303deae78  master -> master

If you could, please run:

git config --local format.subjectPrefix "PATCH xserver"

in your xserver checkout.

- 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] modesetting: Fix page flipping under DRI 3.2.

2018-03-28 Thread Olivier Fourdan
Hi,

On Wed, Mar 28, 2018 at 2:59 PM, Olivier Fourdan 
wrote:

>
> It definitely improves the situation yet there is probably more to it
> because with this added on top of the current git master, only the laptop
> output works, the external monitor connected to the docking station via
> HDMI shows the same content as the laptop monitor without the cursor,
> whereas for the Xserver (As reported by xrandr) it's rightfully placed to
> the right of the laptop monitor (i.e it's not configured as a mirror), so
> the drm config applied doesn't match the Xserver config.
>
> I'm looking through the drm logs but I fail to spot what's wrong (so
> far)...
>

Found out:

[   27.882134] [drm:drm_atomic_check_only [drm]] checking 0de255a3
[   27.882146] [drm:drm_atomic_check_only [drm]] Invalid source coordinates
3840.00x1200.00+1920.00+0.00 (fb 3840x1200)
[   27.882156] [drm:drm_atomic_check_only [drm]] [PLANE:38:primary B]
atomic core check failed
[   27.882167] [drm:drm_atomic_state_default_clear [drm]] Clearing atomic
state 0de255a3
[   27.882178] [drm:__drm_atomic_state_free [drm]] Freeing atomic state
0de255a3
___
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] modesetting: Fix page flipping under DRI 3.2.

2018-03-28 Thread Olivier Fourdan
Hi,

On Wed, Mar 28, 2018 at 9:03 AM, Olivier Fourdan 
wrote:

> On Wed, Mar 28, 2018 at 5:58 AM, Louis-Francis Ratté-Boulianne <
> l...@collabora.com> wrote:
>
>> Could you try with the following patch and let me know how things are
>> working out:
>>
>> https://gitlab.collabora.com/lfrb/xserver/commit/d26b45afc19547ab3ff689
>> 581db2b01abb4e1ed2
>> 
>>
>
> That requires a login apparently, could you please send your patch to the
> ML instead?
>

The patch is now accessible, thanks :)

It definitely improves the situation yet there is probably more to it
because with this added on top of the current git master, only the laptop
output works, the external monitor connected to the docking station via
HDMI shows the same content as the laptop monitor without the cursor,
whereas for the Xserver (As reported by xrandr) it's rightfully placed to
the right of the laptop monitor (i.e it's not configured as a mirror), so
the drm config applied doesn't match the Xserver config.

I'm looking through the drm logs but I fail to spot what's wrong (so far)...

Cheers,
Olivier
___
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] automake: Fix 'make dist'

2018-03-28 Thread Thierry Reding
On Wed, Mar 28, 2018 at 12:17:48PM +0200, Olivier Fourdan wrote:
> Automake would skip a few meson files that would prevent to build with
> meson a dist file previously generated by automake.
> 
> Signed-off-by: Olivier Fourdan 
> ---
>  Makefile.am | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 5ddfd5b84..32d4d21e7 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -140,6 +140,7 @@ distcheck-hook:
>  EXTRA_DIST += \
>   meson_options.txt \
>   include/xorg-config.h.meson.in \
> + include/xwin-config.h.meson.in \

Just a thought: there's a Makefile.am in the include subdirectory, so
maybe add this line there? Could be a follow-up patch, though, so:

Reviewed-by: Thierry Reding 


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 2/7] xorg: Remove unused definitions from xorg-server.h.in

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

There is no code around that will ever define values for the XLOADABLE,
WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end
up commented out and are therefore completely useless.

Signed-off-by: Thierry Reding 
---
 include/xorg-server.h.in | 9 -
 1 file changed, 9 deletions(-)

diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
index aae2faed6a5c..e2a0ba0d079b 100644
--- a/include/xorg-server.h.in
+++ b/include/xorg-server.h.in
@@ -101,9 +101,6 @@
 /* Support UNIX socket connections */
 #undef UNIXCONN
 
-/* unaligned word accesses behave as expected */
-#undef WORKING_UNALIGNED_INT
-
 /* Support XCMisc extension */
 #undef XCMISC
 
@@ -128,9 +125,6 @@
 /* XKB default rules */
 #undef XKB_DFLT_RULES
 
-/* Support loadable input and output drivers */
-#undef XLOADABLE
-
 /* Build DRI extension */
 #undef XF86DRI
 
@@ -140,9 +134,6 @@
 /* Build Xorg server */
 #undef XORGSERVER
 
-/* Vendor release */
-#undef XORG_RELEASE
-
 /* Current Xorg version */
 #undef XORG_VERSION_CURRENT
 
-- 
2.16.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 4/7] meson: Generate xorg-server.h

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

Some drivers (such as xf86-input-libinput) require the xorg-server.h to
build. Generate it and install it so that it can be used by users.

Signed-off-by: Thierry Reding 
---
 include/Makefile.am|   1 +
 include/meson.build|   5 +-
 include/xorg-server.h.meson.in | 222 +
 3 files changed, 227 insertions(+), 1 deletion(-)
 create mode 100644 include/xorg-server.h.meson.in

diff --git a/include/Makefile.am b/include/Makefile.am
index afd6db2cfd41..0ce7faa6ea54 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -79,4 +79,5 @@ EXTRA_DIST =  \
swapreq.h \
systemd-logind.h \
 vidmodestr.h \
+   xorg-server.h.meson.in \
xsha1.h
diff --git a/include/meson.build b/include/meson.build
index 4a2798514500..0e8465e825fa 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -216,7 +216,10 @@ conf_data.set_quoted('BUILDERSTRING', 
get_option('builder_string'))
 configure_file(output : 'dix-config.h',
configuration : conf_data)
 
-
+configure_file(output : 'xorg-server.h',
+   input : 'xorg-server.h.meson.in',
+   configuration : conf_data,
+   install_dir: xorgsdkdir)
 
 version_data = configuration_data()
 version_data.set('VENDOR_RELEASE', '@0@'.format(release))
diff --git a/include/xorg-server.h.meson.in b/include/xorg-server.h.meson.in
new file mode 100644
index ..093801cad687
--- /dev/null
+++ b/include/xorg-server.h.meson.in
@@ -0,0 +1,222 @@
+/* xorg-server.h.in-*- c -*-
+ *
+ * This file is the template file for the xorg-server.h file which gets
+ * installed as part of the SDK.  The #defines in this file overlap
+ * with those from config.h, but only for those options that we want
+ * to export to external modules.  Boilerplate autotool #defines such
+ * as HAVE_STUFF and PACKAGE_NAME is kept in config.h
+ *
+ * It is still possible to update config.h.in using autoheader, since
+ * autoheader only creates a .h.in file for the first
+ * AM_CONFIG_HEADER() line, and thus does not overwrite this file.
+ *
+ * However, it should be kept in sync with this file.
+ */
+
+#ifndef _XORG_SERVER_H_
+#define _XORG_SERVER_H_
+
+#ifdef HAVE_XORG_CONFIG_H
+#error Include xorg-config.h when building the X server
+#endif
+
+/* Support BigRequests extension */
+#mesondefine BIGREQS
+
+/* Default font path */
+#mesondefine COMPILEDDEFAULTFONTPATH
+
+/* Support Composite Extension */
+#mesondefine COMPOSITE
+
+/* Build DPMS extension */
+#mesondefine DPMSExtension
+
+/* Build DRI3 extension */
+#mesondefine DRI3
+
+/* Build GLX extension */
+#mesondefine GLXEXT
+
+/* Support XDM-AUTH*-1 */
+#mesondefine HASXDMAUTH
+
+/* Support SHM */
+#mesondefine HAS_SHM
+
+/* Define to 1 if you have the `reallocarray' function. */
+#mesondefine HAVE_REALLOCARRAY
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#mesondefine HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#mesondefine HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strlcat' function. */
+#mesondefine HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#mesondefine HAVE_STRLCPY
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#mesondefine HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strndup' function. */
+#mesondefine HAVE_STRNDUP
+
+/* Support IPv6 for TCP connections */
+#mesondefine IPv6
+
+/* Support MIT-SHM Extension */
+#mesondefine MITSHM
+
+/* Internal define for Xinerama */
+#mesondefine PANORAMIX
+
+/* Support Present extension */
+#mesondefine PRESENT
+
+/* Support RANDR extension */
+#mesondefine RANDR
+
+/* Support RENDER extension */
+#mesondefine RENDER
+
+/* Support X resource extension */
+#mesondefine RES
+
+/* Support MIT-SCREEN-SAVER extension */
+#mesondefine SCREENSAVER
+
+/* Support SHAPE extension */
+#mesondefine SHAPE
+
+/* Define to 1 on systems derived from System V Release 4 */
+#mesondefine SVR4
+
+/* Support TCP socket connections */
+#mesondefine TCPCONN
+
+/* Support UNIX socket connections */
+#mesondefine UNIXCONN
+
+/* Support XCMisc extension */
+#mesondefine XCMISC
+
+/* Support Xdmcp */
+#mesondefine XDMCP
+
+/* Build XFree86 BigFont extension */
+#mesondefine XF86BIGFONT
+
+/* Support XFree86 Video Mode extension */
+#mesondefine XF86VIDMODE
+
+/* Build XDGA support */
+#mesondefine XFreeXDGA
+
+/* Support Xinerama extension */
+#mesondefine XINERAMA
+
+/* Support X Input extension */
+#mesondefine XINPUT
+
+/* XKB default rules */
+#mesondefine XKB_DFLT_RULES
+
+/* Build DRI extension */
+#mesondefine XF86DRI
+
+/* Build DRI2 extension */
+#mesondefine DRI2
+
+/* Build Xorg server */
+#mesondefine XORGSERVER
+
+/* Current Xorg version */
+#mesondefine XORG_VERSION_CURRENT
+
+/* Build Xv Extension */
+#mesondefine XvExtension
+
+/* Build XvMC Extension */
+#mesondefine 

[PATCH 1/7] meson: Fix build if Xdmcp is missing

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

Xdmcp is an optional dependency, so make sure the build succeeds if it
is missing.

Signed-off-by: Thierry Reding 
---
 include/meson.build | 4 ++--
 meson.build | 8 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/meson.build b/include/meson.build
index c64af59f5ccf..4a2798514500 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -91,7 +91,7 @@ conf_data.set_quoted('COMPILEDDEFAULTFONTPATH', 
default_font_path)
 
 conf_data.set('XORG_VERSION_CURRENT', release)
 
-conf_data.set('HASXDMAUTH', get_option('xdm-auth-1'))
+conf_data.set('HASXDMAUTH', has_xdm_auth)
 conf_data.set('SECURE_RPC', get_option('secure-rpc'))
 
 conf_data.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
@@ -182,7 +182,7 @@ conf_data.set('SHAPE', '1')
 conf_data.set('XACE', build_xace)
 conf_data.set('XCMISC', '1')
 conf_data.set('XCSECURITY', build_xsecurity)
-conf_data.set('XDMCP', get_option('xdmcp'))
+conf_data.set('XDMCP', xdmcp_dep.found())
 conf_data.set('XF86BIGFONT', build_xf86bigfont)
 conf_data.set('XF86DRI', build_dri1)
 conf_data.set('XF86VIDMODE', build_xf86vidmode)
diff --git a/meson.build b/meson.build
index 46803892be23..b1af0a3debc5 100644
--- a/meson.build
+++ b/meson.build
@@ -288,11 +288,17 @@ endif
 # XXX: Add more sha1 options, because Linux is about choice
 sha1_dep = nettle_dep
 
-xdmcp_dep = []
+xdmcp_dep = dependency('', required : false)
 if get_option('xdmcp')
 xdmcp_dep = dependency('xdmcp')
 endif
 
+has_xdm_auth = get_option('xdm-auth-1')
+
+if not xdmcp_dep.found()
+  has_xdm_auth = false
+endif
+
 build_glx = get_option('glx')
 
 libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)
-- 
2.16.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 7/7] meson: Properly extract ABI versions for xorg-server.pc

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

The newline in the middle of the awk expression confuses Meson and
causes it to pass only the string before the newline to awk, which will
subsequently fail because it encounters an unterminated string.

One fix would be to escape the newlines ('\\n'), but that causes the
newline to end up in the pkg-config file and separate the ABI version
lines by blank lines.

Instead, simply drop the newlines to make the generated pkg-config file
look more like the one generated as part of the autotools-based build.

Signed-off-by: Thierry Reding 
---
 meson.build | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index cb819b27aedf..56f3fce7d5d4 100644
--- a/meson.build
+++ b/meson.build
@@ -601,25 +601,25 @@ if build_xorg
 
 sdkconfig.set('abi_ansic',
 run_command(awk, '-F', '[(,)]',
-'/^#define ABI_ANSIC.*SET/ { printf "%d.%d\n", $2, $3 }',
+'/^#define ABI_ANSIC.*SET/ { printf "%d.%d", $2, $3 }',
 files('hw/xfree86/common/xf86Module.h')
 ).stdout()
 )
 sdkconfig.set('abi_videodrv',
 run_command(awk, '-F', '[(,)]',
-'/^#define ABI_VIDEODRV.*SET/ { printf "%d.%d\n", $2, $3 
}',
+'/^#define ABI_VIDEODRV.*SET/ { printf "%d.%d", $2, $3 }',
 files('hw/xfree86/common/xf86Module.h')
 ).stdout()
 )
 sdkconfig.set('abi_xinput',
 run_command(awk, '-F', '[(,)]',
-'/^#define ABI_XINPUT.*SET/ { printf "%d.%d\n", $2, $3 }',
+'/^#define ABI_XINPUT.*SET/ { printf "%d.%d", $2, $3 }',
 files('hw/xfree86/common/xf86Module.h')
 ).stdout()
 )
 sdkconfig.set('abi_extension',
 run_command(awk, '-F', '[(,)]',
-'/^#define ABI_EXTENSION.*SET/ { printf "%d.%d\n", $2, $3 
}',
+'/^#define ABI_EXTENSION.*SET/ { printf "%d.%d", $2, $3 }',
 files('hw/xfree86/common/xf86Module.h')
 ).stdout()
 )
-- 
2.16.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 6/7] meson: Fix generation of xorg-server.pc

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

Meson stores relative paths for includedir, libdir and friends. These
have to be concatenated with the ${prefix} or ${exec_prefix} variables
to create a working pkg-config file.

While at it, set a default value for the module_dir option so that it
points to the same location as used in the autotools-based build.

Signed-off-by: Thierry Reding 
---
 meson.build   | 14 +++---
 meson_options.txt |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index b1af0a3debc5..cb819b27aedf 100644
--- a/meson.build
+++ b/meson.build
@@ -591,13 +591,13 @@ if build_xorg
 awk = find_program('awk')
 
 sdkconfig.set('prefix', get_option('prefix'))
-sdkconfig.set('exec_prefix', get_option('prefix'))
-sdkconfig.set('libdir', get_option('libdir'))
-sdkconfig.set('includedir', get_option('includedir'))
-sdkconfig.set('datarootdir', get_option('datadir'))
-sdkconfig.set('moduledir', get_option('module_dir'))
-sdkconfig.set('sdkdir', join_paths(get_option('includedir'), 'include'))
-sdkconfig.set('sysconfigdir', join_paths(get_option('datadir'), 
'X11/xorg.conf.d'))
+sdkconfig.set('exec_prefix', '${prefix}')
+sdkconfig.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
+sdkconfig.set('includedir', join_paths('${prefix}', 
get_option('includedir')))
+sdkconfig.set('datarootdir', join_paths('${prefix}', 
get_option('datadir')))
+sdkconfig.set('moduledir', join_paths('${exec_prefix}', 
get_option('module_dir')))
+sdkconfig.set('sdkdir', join_paths('${prefix}', get_option('includedir'), 
'xorg'))
+sdkconfig.set('sysconfigdir', join_paths('${datarootdir}', 
'X11/xorg.conf.d'))
 
 sdkconfig.set('abi_ansic',
 run_command(awk, '-F', '[(,)]',
diff --git a/meson_options.txt b/meson_options.txt
index ce1ae80bd43a..5c7be0e26ce5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,7 +19,7 @@ option('builder_addr', type: 'string', description: 'Builder 
address', value: 'x
 option('builder_string', type: 'string', description: 'Additional builder 
string')
 
 option('log_dir', type: 'string')
-option('module_dir', type: 'string',
+option('module_dir', type: 'string', value: 'xorg/modules',
description: 'X.Org modules directory')
 option('default_font_path', type: 'string')
 
-- 
2.16.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 5/7] meson: Fill in missing data for xorg-server.h

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

Provide more values for the definitions in xorg-server.h for Meson
builds. The only missing defines left after this are _BSD_SOURCE,
_POSIX_SOURCE and _XOPEN_SOURCE, but Meson seems to already define
these via the command-line if necessary.

Signed-off-by: Thierry Reding 
---
 include/meson.build | 55 +
 1 file changed, 55 insertions(+)

diff --git a/include/meson.build b/include/meson.build
index 0e8465e825fa..fdec1f306f59 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -213,6 +213,61 @@ conf_data.set_quoted('OSVENDOR', get_option('os_vendor'))
 conf_data.set_quoted('BUILDERADDR', get_option('builder_addr'))
 conf_data.set_quoted('BUILDERSTRING', get_option('builder_string'))
 
+#
+# for xorg-server.h only
+#
+defines_svr4 = '''#if !defined(SVR4) && !defined(__svr4__) && !defined(__SVR4)
+#error "I am not SVR4"
+#endif
+'''
+
+# BSD specifics
+supports_pccons = false
+supports_pcvt = false
+supports_syscons = false
+supports_wscons = false
+csrg_based = false
+
+if host_machine.system() == 'freebsd' or host_machine.system() == 
'dragonflybsd'
+  supports_pccons = true
+  supports_pcvt = true
+  supports_syscons = true
+  csrg_based = true
+endif
+
+if host_machine.system() == 'kfreebsd'
+  supports_pccons = true
+  supports_pcvt = true
+  supports_syscons = true
+endif
+
+if host_machine.system() == 'netbsd'
+  supports_pccons = true
+  supports_pcvt = true
+  supports_wscons = true
+  csrg_based = true
+endif
+
+if host_machine.system() == 'openbsd'
+  supports_pcvt = true
+  supports_wscons = true
+  csrg_based = true
+endif
+
+conf_data.set('SVR4', cc.compiles(defines_svr4))
+conf_data.set_quoted('XKB_DFLT_RULES', get_option('xkb_default_rules'))
+conf_data.set('XORGSERVER', build_xorg)
+conf_data.set_quoted('XCONFIGFILE', join_paths(get_option('sysconfdir'), 
'xorg.conf'))
+conf_data.set_quoted('__XSERVERNAME__', 'Xorg')
+conf_data.set('WITH_VGAHW', build_vgahw)
+conf_data.set('CSRG_BASED', csrg_based)
+conf_data.set('PCCONS_SUPPORT', supports_pccons)
+conf_data.set('PCVT_SUPPORT', supports_pcvt)
+conf_data.set('SYSCONS_SUPPORT', supports_syscons)
+conf_data.set('WSCONS_SUPPORT', supports_wscons)
+conf_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess'))
+conf_data.set('XSERVER_PLATFORM_BUS', build_udev)
+
 configure_file(output : 'dix-config.h',
configuration : conf_data)
 
-- 
2.16.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 3/7] dix: Remove unused definitions from dix-config.h.in

2018-03-28 Thread Thierry Reding
From: Thierry Reding 

There is no code around that will ever define values for the
WORKING_UNALIGNED_INT or XORG_RELEASE symbols, so they will always end
up commented out and are therefore completely useless.

Signed-off-by: Thierry Reding 
---
 include/dix-config.h.in | 6 --
 1 file changed, 6 deletions(-)

diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 69fc5e3fba5a..c64321ef1372 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -310,9 +310,6 @@
 /* Support UNIX socket connections */
 #undef UNIXCONN
 
-/* unaligned word accesses behave as expected */
-#undef WORKING_UNALIGNED_INT
-
 /* Build X string registry */
 #undef XREGISTRY
 
@@ -346,9 +343,6 @@
 /* Support Xinerama extension */
 #undef XINERAMA
 
-/* Vendor release */
-#undef XORG_RELEASE
-
 /* Current Xorg version */
 #undef XORG_VERSION_CURRENT
 
-- 
2.16.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] automake: Fix 'make dist'

2018-03-28 Thread Olivier Fourdan
Automake would skip a few meson files that would prevent to build with
meson a dist file previously generated by automake.

Signed-off-by: Olivier Fourdan 
---
 Makefile.am | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 5ddfd5b84..32d4d21e7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,6 +140,7 @@ distcheck-hook:
 EXTRA_DIST += \
meson_options.txt \
include/xorg-config.h.meson.in \
+   include/xwin-config.h.meson.in \
hw/xfree86/loader/symbol-test.c \
hw/xfree86/common/xf86Build.sh \
composite/meson.build \
@@ -204,8 +205,10 @@ EXTRA_DIST += \
record/meson.build \
render/meson.build \
test/bigreq/meson.build \
+   test/bigreq/request-length.c \
test/meson.build \
test/sync/meson.build \
+   test/sync/sync.c \
Xext/meson.build \
xfixes/meson.build \
Xi/meson.build \
-- 
2.17.0.rc1

___
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: Add the x(org)proto headers to the include path

2018-03-28 Thread Thierry Reding
On Tue, Mar 20, 2018 at 02:00:33PM -0400, Adam Jackson wrote:
> Without this meson won't properly use headers installed into a
> non-default location.
> 
> Signed-off-by: Adam Jackson 
> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meson.build b/meson.build
> index 32d72045b..47385ab03 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -455,6 +455,7 @@ inc = include_directories(
>  'randr',
>  'render',
>  'xfixes',
> +xproto_dep.get_pkgconfig_variable('includedir')
>  )
>  
>  glx_inc = include_directories('glx')
> -- 
> 2.16.2

Hi Adam,

this break cross-compilation for me. The reason is that pkg-config will
return the value of a variable "on the target" (i.e. /usr/include). For
cross-compilation this will mess things up because now -I/usr/include
shows up in the command-line, which causes the compiler to pick up most
headers from there, and those leak build system information into the
build.

On ARM cross builds this produces confusing errors about Float128 not
being supported on the architecture.

If I revert this, cross-builds are back to normal. The reason why that
doesn't cause problems is because pkg-config will prepend the value of
the PKG_CONFIG_SYSROOT_DIR environment variable to paths in -I and -L
options, which makes them point to the correct directories within the
cross-compile sysroot.

I'm wondering why you needed this fix in the first place. Shouldn't the
regular CPPFLAGS or CFLAGS from pkg-config include the correct include
directories for xorgproto headers, irrespective of where they were
installed? That is, if pkg-config finds the xproto dependency, the value
of includedir should already show up in the CFLAGS. Perhaps the real
reason why this isn't working is because we're missing a place where
xproto_dep needs to be explicitly mentioned?

Thierry


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: [Xcb] [PATCH xcb/proto] screensaver: Use CARD32 encoding for ScreenSaverSuspend 'suspend'

2018-03-28 Thread Uli Schlachter
Ah, that explains why Keith pushed a patch on 14th that was never on the
mailing list. (= This patch is already merged.)

Oh and while we are at it:
I cannot find the exact definition of the struct that the X server uses
for this, but it definitely only compares the "suspend" member of the
incoming request against "TRUE" and "FALSE". Presumably, these have
values 0 and 1. I see two problems with this:

a) SProcScreenSaverSuspend() only swaps the request length, not the boolean
b) What happens if I just send directly a value of 42?

For (b), it seems like the behaviour depends on whether the sending
client already suspended the screen saver before or not. In the first
case, 42 is interpreted as FALSE while in the second as TRUE.

Cheers,
Uli

On 20.03.2018 20:56, Julien Cristau wrote:
> I think this belongs on xcb@.
> 
> Cheers,
> Julien
> 
> On Mon, Mar 12, 2018 at 12:03:19 -0700, Keith Packard wrote:
> 
>> This was set to BOOL, but the protocol headers used Bool, presumably a
>> 32-bit type. We're switching everything to CARD32 as the best option
>> for compatibility.
>>
>> Signed-off-by: Keith Packard 
>> ---
>>  src/screensaver.xml | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/src/screensaver.xml b/src/screensaver.xml
>> index 8d5abb4..c546f94 100644
>> --- a/src/screensaver.xml
>> +++ b/src/screensaver.xml
>> @@ -168,8 +168,7 @@ Draft Standard Version 1.1
>>
>>
>>
>> -
>> -
>> +
>>
>>  
>>
>> -- 
>> 2.16.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
> ___
> Xcb mailing list
> x...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xcb
> 


-- 
99 little bugs in the code
99 little bugs in the code
Take one down, patch it around
117 little bugs in the code
  -- @irqed
___
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] modesetting: Fix page flipping under DRI 3.2.

2018-03-28 Thread Olivier Fourdan
Hi,

On Wed, Mar 28, 2018 at 5:58 AM, Louis-Francis Ratté-Boulianne <
l...@collabora.com> wrote:

> Could you try with the following patch and let me know how things are
> working out:
>
> https://gitlab.collabora.com/lfrb/xserver/commit/d26b45afc19547ab3ff689
> 581db2b01abb4e1ed2
>

That requires a login apparently, could you please send your patch to the
ML instead?

Cheers,
Olivier
___
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