Subject: xorg-server: Changes to 'debian-unstable'



Xi/exevents.c | 22 +++++++++++++---------
Xi/xichangehierarchy.c | 6 ++++--
composite/compalloc.c | 6 +++---
composite/compint.h | 2 +-
composite/compwindow.c | 9 ++++++---
configure.ac | 6 +++---
debian/changelog | 11 +++++++++--
debian/compat | 2 +-
debian/control | 3 ++-
debian/rules | 2 +-
dix/Makefile.am | 4 ++--
dix/dispatch.c | 10 ++++++++++
dix/getevents.c | 5 ++++-
glamor/glamor.c | 11 ++++++++---
glamor/glamor_egl.c | 4 ++++
glamor/glamor_egl.h | 6 +-----
hw/xfree86/common/xf86AutoConfig.c | 9 +++++++++
hw/xfree86/common/xf86Option.c | 2 +-
hw/xfree86/modes/xf86EdidModes.c | 5 +++++
hw/xfree86/parser/read.c | 16 +++++++++++++++-
hw/xfree86/parser/xf86Parser.h | 1 +
hw/xwayland/xwayland-input.c | 25 +++++++++++++++----------
include/dixstruct.h | 6 ++++++
os/Makefile.am | 4 ++--
os/WaitFor.c | 4 +++-
os/connection.c | 4 ++++
present/present.c | 5 ++++-
randr/rrcrtc.c | 10 ++++++++--
randr/rrprovider.c | 3 +++
randr/rrxinerama.c | 7 +++++++
test/Makefile.am | 4 ++--
31 files changed, 157 insertions(+), 57 deletions(-)

New commits:
commit 8cb93829587c7c6ee5ca728827b598d3f9e26eb6
Author: Andreas Boll <[email protected]>
Date: Thu Jan 12 11:32:31 2017 +0100

Close bugs fixed by the new upstream release.

diff --git a/debian/changelog b/debian/changelog
index 508c2ef..11438eb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,10 @@ xorg-server (2:1.19.1-1) UNRELEASED; urgency=medium

[ Andreas Boll ]
* New upstream release.
+ - AttendClient of grab-pervious client must queue to
+ saved_ready_clients [v2] (Closes: #846779, #850940).
+ - present: Only call present_flip_notify if vblank->queued == FALSE
+ (Closes: #849250).

-- Emilio Pozuelo Monfort <[email protected]> Mon, 19 Dec 2016 19:58:57 +0100


commit c4900251dadb8284bb6590ea03973ca73159e29e
Author: Andreas Boll <[email protected]>
Date: Thu Jan 12 11:17:34 2017 +0100

Bump changelog

diff --git a/debian/changelog b/debian/changelog
index 6e2bd4b..508c2ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,15 @@
-xorg-server (2:1.19.0-4) UNRELEASED; urgency=medium
+xorg-server (2:1.19.1-1) UNRELEASED; urgency=medium

+ [ Emilio Pozuelo Monfort ]
* Switch to dh.
* Drop build-deps on automake and libtool, dh-autoreconf depends on
them for us.
* rules: use install consistently.
* Drop pre-wheezy Breaks.

+ [ Andreas Boll ]
+ * New upstream release.
+
-- Emilio Pozuelo Monfort <[email protected]> Mon, 19 Dec 2016 19:58:57 +0100

xorg-server (2:1.19.0-3) unstable; urgency=medium

commit 3830cd550a08de7d228dfe3150dea88c21a60b77
Author: Andreas Boll <[email protected]>
Date: Thu Jan 12 10:56:17 2017 +0100

Revert "Bump debhelper compat to 10"

This reverts commit 8a395effc9b55b828349a86f189d453d0b0138f3.

Conflicts:
debian/changelog

Add build-dep on dh-autoreconf and explictly enable parallel build for
compat 9.

diff --git a/debian/changelog b/debian/changelog
index 33a96f3..6e2bd4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,6 @@ xorg-server (2:1.19.0-4) UNRELEASED; urgency=medium
* Switch to dh.
* Drop build-deps on automake and libtool, dh-autoreconf depends on
them for us.
- * Bump debhelper compat to 10.
* rules: use install consistently.
* Drop pre-wheezy Breaks.

diff --git a/debian/compat b/debian/compat
index f599e28..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-10
+9
diff --git a/debian/control b/debian/control
index 8268068..fd230a5 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: x11
Priority: optional
Maintainer: Debian X Strike Force <[email protected]>
Build-Depends:
- debhelper (>= 10),
+ debhelper (>= 9),
+ dh-autoreconf,
po-debconf,
dpkg-dev (>= 1.16.1),
quilt,
diff --git a/debian/rules b/debian/rules
index 1a424db..782c076 100755
--- a/debian/rules
+++ b/debian/rules
@@ -168,7 +168,7 @@ confflags_udeb = \
$(void)

%:
- dh $@ --with quilt,autoreconf
+ dh $@ --with quilt,autoreconf --parallel

build-source-stamp:
mkdir -p build-source

commit ad2facda30f453d749492c51d29f2626aee6326a
Author: Adam Jackson <[email protected]>
Date: Wed Jan 11 16:15:57 2017 -0500

xserver 1.19.1

Signed-off-by: Adam Jackson <[email protected]>

diff --git a/configure.ac b/configure.ac
index f7ab48c..b0daff9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.

AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.19.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2016-11-15"
-RELEASE_NAME="Cioppino"
+AC_INIT([xorg-server], 1.19.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2017-01-11"
+RELEASE_NAME="Maeuntang"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])

commit 82dcb68a8782d0cce6e6ce1a375cda05c91fe8c3
Author: Keith Packard <[email protected]>
Date: Mon Jan 9 18:10:21 2017 -0800

AttendClient of grab-pervious client must queue to saved_ready_clients [v2]

A client which is attended while a grab is blocking execution of its
requests needs to be placed in the saved_ready_clients list so that it
will get scheduled once the grab terminates. Otherwise, if the client
never sends another request, there is no way for it to be placed in
the ready_clients list.

v2: Wrap comment above mark_client_saved_ready.
Remove test for OS_COMM_IGNORED which will always be true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99333
Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Keith Packard <[email protected]>
(cherry picked from commit 785053d033e73d2deb0ded4b97eabfd881991978)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 3d0fe26..78ac095 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -266,6 +266,16 @@ mark_client_ready(ClientPtr client)
xorg_list_append(&client->ready, &ready_clients);
}

+/*
+ * Client has requests queued or data on the network, but awaits a
+ * server grab release
+ */
+void mark_client_saved_ready(ClientPtr client)
+{
+ if (xorg_list_is_empty(&client->ready))
+ xorg_list_append(&client->ready, &saved_ready_clients);
+}
+
/* Client has no requests queued and no data on network */
void
mark_client_not_ready(ClientPtr client)
diff --git a/include/dixstruct.h b/include/dixstruct.h
index d71b0ac..21a6b8a 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -143,6 +143,12 @@ extern void SmartScheduleStopTimer(void);
/* Client has requests queued or data on the network */
void mark_client_ready(ClientPtr client);

+/*
+ * Client has requests queued or data on the network, but awaits a
+ * server grab release
+ */
+void mark_client_saved_ready(ClientPtr client);
+
/* Client has no requests queued and no data on network */
void mark_client_not_ready(ClientPtr client);

diff --git a/os/connection.c b/os/connection.c
index a901ebf..62e2980 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1067,6 +1067,10 @@ AttendClient(ClientPtr client)
set_poll_client(client);
if (listen_to_client(client))
mark_client_ready(client);
+ else {
+ /* grab active, mark ready when grab goes away */
+ mark_client_saved_ready(client);
+ }
}

/* make client impervious to grabs; assume only executing client calls this */

commit 14516988e095ed748e738c14a87c3656006846f7
Author: Qiang Yu <[email protected]>
Date: Tue Jan 10 18:51:55 2017 +0800

randr: fix xserver crash when xrandr setprovideroutputsource

xrandr --setprovideroutputsource <screen> <gpu screen>
Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU:
Assertion `new->isGPU' failed.

GPUScreen is not allowed to be sink output.

Signed-off-by: Qiang Yu <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Peter Hutterer <[email protected]>
(cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6)

diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index f9df67e..e4bc2bf 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -338,6 +338,9 @@ ProcRRSetProviderOutputSource(ClientPtr client)
pScreen = provider->pScreen;
pScrPriv = rrGetScrPriv(pScreen);

+ if (!pScreen->isGPU)
+ return BadValue;
+
pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider);

RRInitPrimeSyncProps(pScreen);

commit 3381e2c26b2ac40b1dd909439bf72559b80d0d86
Author: Qiang Yu <[email protected]>
Date: Tue Jan 10 18:51:54 2017 +0800

xfree86: fix wrong usage of xf86optionListMerge

Signed-off-by: Qiang Yu <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Peter Hutterer <[email protected]>
(cherry picked from commit 1012510620de7dadd0ab18b19a8e11facd884601)

diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 0e8bc1f..e9393fa 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -84,7 +84,7 @@ xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts)
if (device && device->options) {
tmp = xf86optionListDup(device->options);
if (pScrn->options)
- xf86optionListMerge(pScrn->options, tmp);
+ pScrn->options = xf86optionListMerge(pScrn->options, tmp);
else
pScrn->options = tmp;
}

commit 27a2772cf3a1bcd656efdf653a7504597911dbc4
Author: Michel Dänzer <[email protected]>
Date: Fri Nov 25 17:34:05 2016 +0900

present: Only call present_flip_notify if vblank->queued == FALSE

We are no longer using the present_flip_queue list only for presents
which have already been submitted to the driver for page flipping, but
also for those which we are queueing up to be flipped later, marked
with vblank->queued == TRUE. We were incorrectly calling
present_flip_notify for such entries, failing the assertion in
present_flip_notify (or presumably resulting in other undesirable
behaviour with assertions disabled).

Reproduction recipe: Run the JavaFX test case referenced by
https://bugs.freedesktop.org/show_bug.cgi?id=98831#c6 and alt-tab out
of it while it's fullscreen. May take a few attempts to hit the
assertion failure.

Fixes: bab0f450a719 ("present: Fix presentation of flips out of order")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98854
Reviewed-by: Alex Deucher <[email protected]>
(cherry picked from commit e473b2bc016adacfe3fa47fdf6a8ce9f8cddff62)

diff --git a/present/present.c b/present/present.c
index a7ca06e..ef89045 100644
--- a/present/present.c
+++ b/present/present.c
@@ -536,7 +536,10 @@ present_event_notify(uint64_t event_id, uint64_t ust,
uint64_t msc)
}
xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) {
if (vblank->event_id == event_id) {
- present_flip_notify(vblank, ust, msc);
+ if (vblank->queued)
+ present_execute(vblank, ust, msc);
+ else
+ present_flip_notify(vblank, ust, msc);
return;
}
}

commit 943e3cbeb0139d719589fc07c4f471195e4efe0a
Author: Kai-Heng Feng <[email protected]>
Date: Thu Dec 15 13:56:38 2016 +0800

edid: Add quirk for ADA 1024x600 7" display.

Detailed mode reports 108 mm x 68 mm which is for smaller display.
Maximum image size reports 15 cm x 10 cm which aligns with its physical
size, use this size instead.

Signed-off-by: Kai-Heng Feng <[email protected]>
Acked-by: Alex Deucher <[email protected]>
(cherry picked from commit 9874f73e88678c9eacbcba05e52336fc63a32712)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index f24294e..f0e1e97 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -153,6 +153,11 @@ quirk_detailed_v_in_cm(int scrnIndex, xf86MonPtr DDC)
static Bool
quirk_detailed_use_maximum_size(int scrnIndex, xf86MonPtr DDC)
{
+ /* ADA 1024x600 7" display */
+ if (memcmp(DDC->vendor.name, "ADA", 4) == 0 &&
+ DDC->vendor.prod_id == 4)
+ return TRUE;
+
/* Bug #21324: Iiyama Vision Master 450 */
if (memcmp(DDC->vendor.name, "IVM", 4) == 0 && DDC->vendor.prod_id == 6400)
return TRUE;

commit cb3057da2254f9b6434a9c40486c72865cd1ab5e
Author: Peter Hutterer <[email protected]>
Date: Thu Dec 8 14:32:06 2016 +1000

os: return 0 from check_timers if we touched any of them

Fixes a regression introduced in 0b2f30834b1a9f. If a driver posts input
events during a timer function (wacom and synaptics do this during tap
timeouts), ProcessInputEvents() is not called for these events. There are no
new events on any fds, so the events just sit in the queue waiting for
something else to happen.

Fix this by simply returning 0 from check_timers if we ran at least one of
them or reset them all. This way the callers ospoll_wait will exit and
continue with normal processing.

Signed-off-by: Peter Hutterer <[email protected]>
Reviewed-by: Keith Packard <[email protected]>

diff --git a/os/WaitFor.c b/os/WaitFor.c
index ff1c85e..613608f 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -143,7 +143,7 @@ check_timers(void)
{
OsTimerPtr timer;

- while ((timer = first_timer()) != NULL) {
+ if ((timer = first_timer()) != NULL) {
CARD32 now = GetTimeInMillis();
int timeout = timer->expires - now;

@@ -157,6 +157,8 @@ check_timers(void)
/* time has rewound. reset the timers. */
CheckAllTimers();
}
+
+ return 0;
}
return -1;
}

commit db03742cd33d6d54834bb138886a4f84bc452a85
Author: Michal Srb <[email protected]>
Date: Mon Dec 12 17:45:22 2016 +0200

xinerama: Swap the response in RRXineramaWriteMonitor

Reviewed-by: Adam Jackson <[email protected]>

diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index b6e9586..8f499df 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -260,6 +260,13 @@ RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr
monitor)
scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1;
scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1;

+ if (client->swapped) {
+ swaps(&scratch.x_org);
+ swaps(&scratch.y_org);
+ swaps(&scratch.width);
+ swaps(&scratch.height);
+ }
+
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
}


commit 862c1c43c10eda955db1440cc72ff0387e24a35f
Author: Hans De Goede <[email protected]>
Date: Tue Dec 20 13:00:43 2016 +0100

glamor: Trust eglGetPlatformDisplayEXT if it exists

If the libEGL we are using has eglGetPlatformDisplayEXT, yet it still
returns NULL, then this very likely means that it does not support the
type (e.g. EGL_PLATFORM_GBM_MESA) passed in, and then returning NULL is
the right thing to do.

This avoids falling back to an eglGetDisplay() implementation which does
not understands the passed in gbm handle, treats it as a pointer to
something else completely, followed by a crash sooner or later.

Specifically this fixes using the nvidia binary driver, with nvidia's
libEGL + the modesetting driver on a secondary GPU crashing inside
glamor_egl_init() sometimes.

[1.19: squash in typo fix from 29a4f3db - ajax]

Cc: Eric Anholt <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
(cherry picked from commit 05e19644250698aa126a60bc671e85425df784d1)

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 9cc0f8d..4bde637 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -769,6 +769,10 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)

glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA,
glamor_egl->gbm);
+ if (!glamor_egl->display) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n");
+ goto error;
+ }
#else
glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd);
#endif
diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h
index 6b05f57..6bb1185 100644
--- a/glamor/glamor_egl.h
+++ b/glamor/glamor_egl.h
@@ -60,16 +60,12 @@
static inline EGLDisplay
glamor_egl_get_display(EGLint type, void *native)
{
- EGLDisplay dpy = NULL;
-
/* In practise any EGL 1.5 implementation would support the EXT extension
*/
if (epoxy_has_egl_extension(NULL, "EGL_EXT_platform_base")) {
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT =
(void *) eglGetProcAddress("eglGetPlatformDisplayEXT");
if (getPlatformDisplayEXT)
- dpy = getPlatformDisplayEXT(type, native, NULL);
- if (dpy)
- return dpy;
+ return getPlatformDisplayEXT(type, native, NULL);
}

/* Welp, everything is awful. */

commit 8790bd993ac2f8f8dd54a1946312e6b6dc929e00
Author: Mihail Konev <[email protected]>
Date: Thu Dec 29 12:37:18 2016 +0500

os,dix: Depend custom libs on libs, not objects

The custom os/os.O library reuses *.o files of os/libos.la.

The current rule assumes automake puts all the objects into per-target
am__*_la_OBJECTS variable. At least with AC_REPLACE_FUNCS, this no
longer holds (as wanted objects are put into LTLIBOBJS instead).

Depend on automake's result, the *.la library instead, to express demand
of any its dependencies being built.

Should be fixing randomly occuring "undefined reference to `strlcpy'"
errors when linking Xvfb and other DDX-es that could use os.O.

Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Mihail Konev <[email protected]>
(cherry picked from commit 5b74e260e009d8bdf26433724495802b85cce7c3)

diff --git a/dix/Makefile.am b/dix/Makefile.am
index e7ca236..a4171d7 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -61,13 +61,13 @@ endif

if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libdix
-dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
+dtrace-dix.o: $(top_srcdir)/dix/Xserver.d libdix.la
$(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d
$(am_libdix_la_OBJECTS:%.lo=.libs/%.o)

noinst_PROGRAMS = dix.O

dix_O_SOURCES =
-dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
+dix.O: dtrace-dix.o libdix.la
$(AM_V_GEN)ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
endif

diff --git a/os/Makefile.am b/os/Makefile.am
index b5fb9d0..c6e78cb 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -58,12 +58,12 @@ EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)

if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libos & libdix
-dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS)
+dtrace.o: $(top_srcdir)/dix/Xserver.d libos.la
$(AM_V_GEN)$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d
.libs/*.o ../dix/.libs/*.o

noinst_PROGRAMS = os.O

os_O_SOURCES =
-os.O: dtrace.o $(am_libos_la_OBJECTS)
+os.O: dtrace.o libos.la
$(AM_V_GEN)ld -r -o $@ dtrace.o .libs/*.o
endif

commit 8cf47472bff1d5ca3de6ff83a80f0d2820c3fb93
Author: Ben Crocker <[email protected]>
Date: Tue Nov 15 16:34:38 2016 -0500

Fix a segfault that occurs if xorg.conf.d is absent:

In InitOutput, if xf86HandleConfigFile returns CONFIG_NOFILE
(which it does if no config file or directory is present), the
autoconfig flag is set, causing xf86AutoConfig to be called
later on.

xf86AutoConfig calls xf86OutputClassDriverList via the
call tree:

xf86AutoConfig =>
listPossibleVideoDrivers =>
xf86PlatformMatchDriver =>
xf86OutputClassDriverList

and xf86OutputClassDriverList attempts to traverse a linked list
that is a member of the XF86ConfigRec struct pointed to by the
global xf86configptr, which is NULL at this point because the
XF86ConfigRec struct is only allocated (by xf86readConfigFile)
AFTER the config file and directory have been successfully
opened; the CONFIG_NOFILE return from xf86HandleConfigFile
occurs BEFORE the call to xf86readConfigFile which allocates
the XF86ConfigRec struct.

Rx: In read.c (for symmetry with xf86freeConfig, which already
appears in this file), add a new function xf86allocateConfig
which tests the value of xf86configptr and, if it's NULL,
allocates the XF86ConfigRec struct and deposits the pointer
in xf86configptr. In xf86Parser.h, add a prototype for the
new xf86allocateConfig function.

Back in read.c, #include "xf86Config.h". In xf86readConfigFile,
change the open-code call to calloc to a call to the new
xf86allocateConfig function.

In xf86AutoConfig.c, add a call to the new xf86allocateConfig function
to the beginning of xf86AutoConfig to make sure the XF86ConfigRec struct
is allocated.

Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Ben Crocker <[email protected]>
(cherry picked from commit 8b335d9068fe4e1f1423a4d86c22b69ffcb819a5)

diff --git a/hw/xfree86/common/xf86AutoConfig.c
b/hw/xfree86/common/xf86AutoConfig.c
index 9402651..c3e17be 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -149,6 +149,15 @@ xf86AutoConfig(void)
char buf[1024];
ConfigStatus ret;

+ /* Make sure config rec is there */
+ if (xf86allocateConfig() != NULL) {
+ ret = CONFIG_OK; /* OK so far */
+ }
+ else {
+ xf86Msg(X_ERROR, "Couldn't allocate Config record.\n");
+ return FALSE;
+ }
+
listPossibleVideoDrivers(deviceList, 20);

for (p = deviceList; *p; p++) {
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
index ec038ae..d7e7312 100644
--- a/hw/xfree86/parser/read.c
+++ b/hw/xfree86/parser/read.c
@@ -56,6 +56,7 @@
#include <xorg-config.h>
#endif

+#include "xf86Config.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
@@ -91,7 +92,7 @@ xf86readConfigFile(void)
int token;
XF86ConfigPtr ptr = NULL;

- if ((ptr = calloc(1, sizeof(XF86ConfigRec))) == NULL) {
+ if ((ptr = xf86allocateConfig()) == NULL) {
return NULL;
}

@@ -270,6 +271,19 @@ xf86itemNotSublist(GenericListPtr list_1, GenericListPtr
list_2)
return (!(last_1 == last_2));
}

+/*
+ * Conditionally allocate config struct, but only allocate it
+ * if it's not already there. In either event, return the pointer
+ * to the global config struct.
+ */
+XF86ConfigPtr xf86allocateConfig(void)
+{
+ if (!xf86configptr) {
+ xf86configptr = calloc(1, sizeof(XF86ConfigRec));
+ }
+ return xf86configptr;
+}
+
void
xf86freeConfig(XF86ConfigPtr p)
{
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index ff35846..9c4b403 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -449,6 +449,7 @@ extern char *xf86openConfigDirFiles(const char *path, const
char *cmdline,
extern void xf86setBuiltinConfig(const char *config[]);
extern XF86ConfigPtr xf86readConfigFile(void);
extern void xf86closeConfigFile(void);
+extern XF86ConfigPtr xf86allocateConfig(void);
extern void xf86freeConfig(XF86ConfigPtr p);
extern int xf86writeConfigFile(const char *, XF86ConfigPtr);
extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident,

commit 06a3e7ef3bf9a907f1fba84a3601870a5697f657
Author: Pekka Paalanen <[email protected]>
Date: Wed Dec 7 15:43:06 2016 +0200

test: fix distributing scripts

Fix the following error on 'make distcheck':

make[6]: *** No rule to make target 'scripts/xvfb-piglit.sh', needed by
'scripts/xvfb-piglit.sh.log'. Stop.
make[6]: Leaving directory
'/home/pq/git/xserver/xorg-server-1.19.99.1/_build/sub/test'
Makefile:1367: recipe for target 'check-TESTS' failed

The setup to trigger this is:
$ ./configure --prefix=/home/pq/local --disable-docs
--disable-devel-docs --enable-xwayland --disable-xorg --disable-xvfb
--disable-xnest --disable-xquartz --disable-xwin --enable-debug

SCRIPT_TESTS is populated conditionally, but we should distribute the
scripts in any case.

Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Pekka Paalanen <[email protected]>
(cherry picked from commit b365c5d16894a259dbf29db4ca2640d8ed768063)

diff --git a/test/Makefile.am b/test/Makefile.am
index b8a0f4d..064e1c5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -166,7 +166,8 @@ libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD)
endif

EXTRA_DIST = \
- $(SCRIPT_TESTS) \
+ scripts/xvfb-piglit.sh \
+ scripts/xephyr-glamor-piglit.sh \
scripts/xinit-piglit-session.sh \
scripts/run-piglit.sh \
ddxstubs.c \

commit 543287e60af5e9d91b5fc7e4a42e51eafa63db21
Author: Adam Jackson <[email protected]>
Date: Tue Dec 6 14:11:11 2016 -0500

composite: Fix repaint of borders (v2)

When going from border width zero to a non-zero border width, the
Composite extension is informed via the ConfigNotify callback. The
call-chain looks like this: compConfigNotify -> compReallocPixmap ->
compSetPixmap -> TraverseTree -> compSetPixmapVisitWindow. However, at
this time, pWindow->borderWidth was not yet updated. Thus, HasBorder()
is false and the window border will not be repainted.

To fix this, thread the new bw through to the window visitor, and
inspect that rather than HasBorder(). For the other callers of
compSetPixmap the border does not change size, so we can pass
pWin->borderWidth instead.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499
Signed-off-by: Adam Jackson <[email protected]>
Reviewed-by: Keith Packard <[email protected]>
(cherry picked from commit f31875510d818ba517f082e124adb294db906e51)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index e6a203f..05ffc7e 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -612,7 +612,7 @@ compAllocPixmap(WindowPtr pWin)
else
pWin->redirectDraw = RedirectDrawManual;

- compSetPixmap(pWin, pPixmap);
+ compSetPixmap(pWin, pPixmap, bw);
cw->oldx = COMP_ORIGIN_INVALID;
cw->oldy = COMP_ORIGIN_INVALID;
cw->damageRegistered = FALSE;
@@ -651,7 +651,7 @@ compSetParentPixmap(WindowPtr pWin)
RegionCopy(&pWin->borderClip, &cw->borderClip);
pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent);
pWin->redirectDraw = RedirectDrawNone;
- compSetPixmap(pWin, pParentPixmap);
+ compSetPixmap(pWin, pParentPixmap, pWin->borderWidth);
}

/*
@@ -682,7 +682,7 @@ compReallocPixmap(WindowPtr pWin, int draw_x, int draw_y,
if (!pNew)
return FALSE;
cw->pOldPixmap = pOld;
- compSetPixmap(pWin, pNew);
+ compSetPixmap(pWin, pNew, bw);
}
else {
pNew = pOld;
diff --git a/composite/compint.h b/composite/compint.h
index 09241f2..f05c2d8 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -274,7 +274,7 @@ void
#endif

void
- compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap);
+ compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap, int bw);

Bool
compCheckRedirect(WindowPtr pWin);
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 344138a..bcd230c 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -89,6 +89,7 @@ compCheckTree(ScreenPtr pScreen)
typedef struct _compPixmapVisit {
WindowPtr pWindow;
PixmapPtr pPixmap;
+ int bw;
} CompPixmapVisitRec, *CompPixmapVisitPtr;

static Bool
@@ -126,19 +127,20 @@ compSetPixmapVisitWindow(WindowPtr pWindow, void *data)
*/
SetWinSize(pWindow);
SetBorderSize(pWindow);
- if (HasBorder(pWindow))
+ if (pVisit->bw)
QueueWorkProc(compRepaintBorder, serverClient,
(void *) (intptr_t) pWindow->drawable.id);
return WT_WALKCHILDREN;
}

void
-compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap)
+compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap, int bw)
{
CompPixmapVisitRec visitRec;

visitRec.pWindow = pWindow;
visitRec.pPixmap = pPixmap;
+ visitRec.bw = bw;
TraverseTree(pWindow, compSetPixmapVisitWindow, (void *) &visitRec);
compCheckTree(pWindow->drawable.pScreen);
}
@@ -463,7 +465,8 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
* Reset pixmap pointers as appropriate
*/
if (pWin->parent && pWin->redirectDraw == RedirectDrawNone)
- compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent));
+ compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent),
+ pWin->borderWidth);
/*
* Call down to next function
*/

commit c24c9cc956038a61922f8b11ee68b8b0fc6b9f83
Author: Hans de Goede <[email protected]>
Date: Tue Nov 22 14:53:20 2016 +0100

randr: rrCheckPixmapBounding: do not shrink the screen_pixmap

The purpose of rrCheckPixmapBounding is to make sure that the
screen_pixmap is *large* enough for the slave-output which crtc is
being configured.

However until now rrCheckPixmapBounding would also shrink the
screen_pixmap in certain scenarios leading to various problems.

For example: Take a laptop with its internalscreen on a slave-output and
currently disabled and an external monitor at 1920x1080+0+0.
Now lets say that we want to drive the external monitor at its native
resolution of 2560x1440 and have the internal screen mirror the top left
part of the external monitor, so we run:

$ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \
--mode 2560x1440 --pos 0x0

Here xrandr utility first calls RRSetScreenSize to 2560x1440, then it
calls RRSetCrtc 1920x1080+0+0 on the eDP, since this is a slave output,
rrCheckPixmapBounding gets called and resizes the screen_pixmap to
1920x1080, undoing the RRSetScreenSize. Then RRSetCrtc 2560x1440+0+0
gets called on the HDMI, depending on crtc->transforms this will
either result in a BadValue error from ProcRRSetCrtcConfig; or
it will succeed, but the monitor ends up running at 2560x1440
while showing a 1920x1080 screen_pixmap + black borders on the right
and bottom. Neither of which is what we want.

This commit removes the troublesome shrinking behavior, fixing this.

Note:

1) One could argue that this will leave us with a too large screen_pixmap
in some cases, but rrCheckPixmapBounding only gets called for slave
outputs, so xrandr clients already must manually shrink the screen_pixmap
after disabling crtcs in normal setups.

2) An alternative approach would be to also call rrCheckPixmapBounding
on RRSetCrtc on normal (non-slave) outputs, but that would result in
2 unnecessary resizes of the screen_pixmap in the above example, which
seems undesirable.

Cc: Nikhil Mahale <[email protected]>
Cc: Dave Airlie <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
(cherry picked from commit a46afee84d45fbff4e4dad9376afc95bbcc31d7c)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index ac853ea..d1a51f0 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -689,6 +689,12 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
new_width = newsize->x2;
new_height = newsize->y2;

+ if (new_width < screen_pixmap->drawable.width)
+ new_width = screen_pixmap->drawable.width;
+
+ if (new_height < screen_pixmap->drawable.height)
+ new_height = screen_pixmap->drawable.height;
+
if (new_width == screen_pixmap->drawable.width &&
new_height == screen_pixmap->drawable.height) {
} else {

commit 26132f57ee6fae9376955e7990ac2fbad5b49fac
Author: Hans de Goede <[email protected]>
Date: Tue Nov 22 14:48:14 2016 +0100

randr: rrCheckPixmapBounding: Do not substract crtc non 0 x,y from screen
size

The purpose of rrCheckPixmapBounding is to make sure that the
screen_pixmap is large enough for the slave-output which crtc is
being configured.

This should include crtc->x and crtc->y, otherwise the crtc might
still end up scanning out an area outside of the screen-pixmap.

For example: Take a laptop with an external monitor on a slave-output at
1920x1080+0+0 and its internal-screen at 3840x2160+1920+0 and in
gnome-settings-daemon move the external monitor to be on the ri ght of
the internal screen rather then on the left. First g-s-d will do a
RRSetScreenSize to 5760*2160 (which is a nop), then it calls RRSetCrtc
to move the slave output to 1920x1080+3840+0, since this is a slave
output, rrCheckPixmapBounding gets called, since the 2 crtcs now overlap
the code before this commit would shrinks the screen_pixmap to 3180*2160.
Then g-s-d calls RRSetCrtc to move the internal screen to 3180*2160+0+0.

And we end up with the slave-output configured to scan-out an area
which completely falls outside of the screen-pixmap (and end up with
a black display on the external monitor).

This commit fixes this by not substracting the x1 and y1 coordinates
of the union-ed region when determining the new screen_pixmap size.

Cc: Nikhil Mahale <[email protected]>
Cc: Dave Airlie <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
(cherry picked from commit 3b624aa9a9df86dc7d48149e0f18ca223b4355f1)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 5d404e8..ac853ea 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -686,8 +686,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
}

newsize = RegionExtents(&total_region);
- new_width = newsize->x2 - newsize->x1;
- new_height = newsize->y2 - newsize->y1;
+ new_width = newsize->x2;
+ new_height = newsize->y2;

if (new_width == screen_pixmap->drawable.width &&
new_height == screen_pixmap->drawable.height) {

commit 6c51845e6b0f313a90e4375f2821f1da9cc53014
Author: Olivier Fourdan <[email protected]>
Date: Wed Nov 30 09:42:43 2016 +0100

xwayland: Fix use after free of cursors

Sometimes, Xwayland will try to use a cursor that has just been freed,
leading to a crash when trying to access that cursor data either in
miPointerUpdateSprite() or AnimCurTimerNotify().

CheckMotion() updates the pointer's cursor based on which xwindow
XYToWindow() returns, and Xwayland implements its own xwl_xy_to_window()
to fake a crossing to the root window when the pointer has left the
Wayland surface but is still within the xwindow.

But after an xwindow is unrealized, the last xwindow used to match the
xwindows is cleared so two consecutive calls to xwl_xy_to_window() may
not return the same xwindow.

To avoid this issue, update the last_xwindow based on enter and leave
notifications instead of xwl_xy_to_window(), and check if the xwindow
found by the regular miXYToWindow() is a child of the known last
xwindow, so that multiple consecutive calls to xwl_xy_to_window()
return the same xwindow, being either the one found by miXYToWindow()
or the root window.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1385258
Signed-off-by: Olivier Fourdan <[email protected]>
Tested-by: Vít Ondruch <[email protected]>
Tested-by: Satish Balay <[email protected]>
Reviewed-by: Jonas Ådahl <[email protected]>
(cherry picked from commit 59ad0e6a416d8e23f9d962af67a16ee28ec7867b)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 4d0a457..ecf0b7a 100644
--- a/hw/xwayland/xwayland-input.c



Programming list archiving by: Enterprise Git Hosting