Browse Source

xorg-x11-server package update

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 6 years ago
parent
commit
056aec0a60
  1. 37
      SOURCES/0001-Always-install-vbe-and-int10-sdk-headers.patch
  2. 52
      SOURCES/0001-Enable-PAM-support.patch
  3. 71
      SOURCES/0001-dix-Fix-GrabPointer-to-not-wrongly-succeed-on-redire.patch
  4. 25
      SOURCES/0001-handle-NullCursor-to-avoid-crash.patch
  5. 26
      SOURCES/0001-link-with-z-now.patch
  6. 419
      SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch
  7. 46
      SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch
  8. 61
      SOURCES/0001-modesetting-software-cursor-hack.patch
  9. 185
      SOURCES/0001-mustard-Don-t-probe-for-drivers-not-shipped-in-RHEL7.patch
  10. 26
      SOURCES/0001-mustard-Enable-indirect-GLX-by-default.patch
  11. 28
      SOURCES/0001-rpath-hack.patch
  12. 35
      SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch
  13. 26
      SOURCES/0001-xf86AddBusDeviceToConfigure-Store-device-in-DevToCon.patch
  14. 105
      SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch
  15. 111
      SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch
  16. 26
      SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch
  17. 36
      SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch
  18. 56
      SOURCES/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
  19. 73
      SOURCES/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch
  20. 135
      SOURCES/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch
  21. 41
      SOURCES/0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch
  22. 70
      SOURCES/0002-animcur-Use-fixed-size-screen-private.patch
  23. 167
      SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch
  24. 166
      SOURCES/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch
  25. 37
      SOURCES/0003-animcur-Return-the-next-interval-directly-from-the-t.patch
  26. 71
      SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch
  27. 173
      SOURCES/0003-xwayland-Listen-for-wp_tablet_seat-events.patch
  28. 187
      SOURCES/0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch
  29. 211
      SOURCES/0004-xwayland-Handle-wp_tablet-events.patch
  30. 77
      SOURCES/0005-animcur-Fix-transitions-between-animated-cursors.patch
  31. 374
      SOURCES/0005-xwayland-Handle-tablet_tool-events.patch
  32. 78
      SOURCES/0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch
  33. 121
      SOURCES/0006-xwayland-handle-button-events-after-motion-events.patch
  34. 213
      SOURCES/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch
  35. 208
      SOURCES/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch
  36. 511
      SOURCES/0009-xwayland-add-tablet-pad-support.patch
  37. 74
      SOURCES/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch
  38. 39
      SOURCES/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch
  39. 78
      SOURCES/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch
  40. 30
      SOURCES/06_use-intel-only-on-pre-gen4.diff
  41. 54
      SOURCES/10-quirks.conf
  42. 46
      SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch
  43. 58
      SOURCES/driver-abi-rebuild.sh
  44. 306
      SOURCES/gitignore
  45. 48
      SOURCES/xserver-1.4.99-ssh-isnt-local.patch
  46. 302
      SOURCES/xserver-autobind-hotplug.patch
  47. 14
      SOURCES/xserver-sdk-abi-requires.git
  48. 19
      SOURCES/xserver-sdk-abi-requires.release
  49. 5
      SOURCES/xserver.pamd
  50. 200
      SOURCES/xvfb-run.sh
  51. 87
      SPECS/xorg-x11-server.spec

37
SOURCES/0001-Always-install-vbe-and-int10-sdk-headers.patch

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
From e96a83d9b1b5a52a41213c7a4840dc96b4f5b06f Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 15 Aug 2012 12:35:21 -0400
Subject: [PATCH] Always install vbe and int10 sdk headers

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/Makefile.am | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index b876b79..a170b58 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -26,17 +26,9 @@ if VGAHW
VGAHW_SUBDIR = vgahw
endif
-if VBE
-VBE_SUBDIR = vbe
-endif
-
-if INT10MODULE
-INT10_SUBDIR = int10
-endif
-
-SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
+SUBDIRS = common ddc x86emu int10 os-support parser \
ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \
+ $(DRI2_SUBDIR) . vbe i2c dixmods \
fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \
$(GLAMOR_EGL_SUBDIR) drivers
--
2.13.6

52
SOURCES/0001-Enable-PAM-support.patch

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
From 62b9fa5973d71f3525af29f04f03e05bbaf196e6 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 27 Jun 2011 12:42:28 -0400
Subject: [PATCH 05/15] Enable PAM support

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
configure.ac | 2 ++
hw/dmx/Makefile.am | 1 +
os/utils.c | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3808542..32571e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,6 +307,8 @@ AC_CHECK_HEADER([execinfo.h],[
])]
)
+SYS_LIBS="-lpam_misc -lpam"
+
dnl ---------------------------------------------------------------------------
dnl Bus options and CPU capabilities. Replaces logic in
dnl hw/xfree86/os-support/bus/Makefile.am, among others.
diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index fb727e6..ff76806 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -78,6 +78,7 @@ Xdmx_SOURCES = dmx.c \
XDMX_LIBS = \
$(GLX_LIBS) \
@XDMX_LIBS@ \
+ -lpam_misc -lpam \
input/libdmxinput.a \
config/libdmxconfig.a
diff --git a/os/utils.c b/os/utils.c
index d902523..86730c5 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1838,6 +1838,7 @@ CheckUserParameters(int argc, char **argv, char **envp)
* usually only done for setuid servers (uid != euid).
*/
+#define USE_PAM 1
#ifdef USE_PAM
#include <security/pam_appl.h>
#include <security/pam_misc.h>
--
1.7.7.6

71
SOURCES/0001-dix-Fix-GrabPointer-to-not-wrongly-succeed-on-redire.patch

@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
From 19573148ff40b6b4eb335e92cb97ac97ec191450 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 12 Aug 2014 13:32:07 -0400
Subject: [PATCH] dix: Fix GrabPointer to not wrongly succeed on redirected
windows

Not correct, but correcter. See upstream discussion for more details,
hopefully this will get resolved properly in 1.16.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
dix/events.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index b8c67fd..9300a3c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3616,10 +3616,38 @@ ProcWarpPointer(ClientPtr client)
return Success;
}
+/*
+ * this is better but still wrong. upstream discussion:
+ * http://lists.freedesktop.org/archives/xorg-devel/2014-July/043374.html
+ *
+ * in the meantime all we're doing is amending the redirected window path
+ * to check whether borderClip (total window area) overlaps the root window
+ * space at all.
+ *
+ * note that the redirect path doesn't need to account for panoramix'
+ * rewrite of root window geometry, because root windows can't be
+ * redirected.
+ */
+static Bool
+WindowIsConfineToAble(WindowPtr pWin)
+{
+ if (pWin->redirectDraw == RedirectDrawNone) {
+ if (RegionNotEmpty(&pWin->borderSize))
+ return TRUE;
+ } else {
+ WindowPtr root = pWin->drawable.pScreen->root;
+ if (rgnOUT != RegionContainsRect(&pWin->borderClip,
+ RegionExtents(&root->winSize)))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static Bool
BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
{
- if (RegionNotEmpty(&pWin->borderSize))
+ if (WindowIsConfineToAble(pWin))
return TRUE;
#ifdef PANORAMIX
@@ -3627,8 +3655,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
int i;
FOR_NSCREENS_FORWARD_SKIP(i) {
- if (RegionNotEmpty
- (&pDev->spriteInfo->sprite->windows[i]->borderSize))
+ if (WindowIsConfineToAble(pDev->spriteInfo->sprite->windows[i]))
return TRUE;
}
}
--
1.9.3

25
SOURCES/0001-handle-NullCursor-to-avoid-crash.patch

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
From 54564059c2d4c841a80c65f6a730e36412ee451e Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 9 Jun 2017 13:35:47 +1000
Subject: [PATCH] handle NullCursor to avoid crash

---
hw/xfree86/drivers/modesetting/drmmode_display.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 6e755e9..431f63d 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -760,6 +760,8 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
if (!drmmode_crtc->set_cursor2_failed) {
CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen);
+ if (cursor == NullCursor)
+ return TRUE;
ret =
drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
--
2.9.4

26
SOURCES/0001-link-with-z-now.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From c24c9c3ac032c17dd63120d0adba1ef32edcf8dd Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 15 Apr 2015 12:44:49 -0400
Subject: [PATCH] link with -z now

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 27f2cc6..116eeb2 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -79,7 +79,7 @@ Xorg_LDADD = \
$(XSERVER_SYS_LIBS)
Xorg_DEPENDENCIES = $(LOCAL_LIBS)
-Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,-z,now -pie
if SUID_WRAPPER
wrapdir = $(SUID_WRAPPER_DIR)
--
2.1.0

419
SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch

@ -0,0 +1,419 @@ @@ -0,0 +1,419 @@
From 9426c5500b72e1fe004fef4c3b259023c4ec49f7 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 1 Mar 2017 16:13:57 -0500
Subject: [PATCH 1/3] miarc: Style cleanup for miWideArc

Outdent, normalize comment formatting, and use 'goto out' idiom for
error paths. No functional change.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
mi/miarc.c | 368 ++++++++++++++++++++++++++++++-------------------------------
1 file changed, 179 insertions(+), 189 deletions(-)

diff --git a/mi/miarc.c b/mi/miarc.c
index 2588ee48a..fed5c9fa3 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -894,7 +894,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
int xMin, xMax, yMin, yMax;
int pixmapWidth = 0, pixmapHeight = 0;
int xOrg = 0, yOrg = 0;
- int width;
+ int width = pGC->lineWidth;
Bool fTricky;
DrawablePtr pDrawTo;
CARD32 fg, bg;
@@ -904,210 +904,200 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
int iphase;
int halfWidth;
- width = pGC->lineWidth;
if (width == 0 && pGC->lineStyle == LineSolid) {
for (i = narcs, parc = parcs; --i >= 0; parc++)
- miArcSegment(pDraw, pGC, *parc, (miArcFacePtr) 0, (miArcFacePtr) 0);
+ miArcSegment(pDraw, pGC, *parc, NULL, NULL);
fillSpans(pDraw, pGC);
+ return;
}
- else {
- if ((pGC->lineStyle == LineSolid) && narcs) {
- while (parcs->width && parcs->height &&
- (parcs->angle2 >= FULLCIRCLE ||
- parcs->angle2 <= -FULLCIRCLE)) {
- miFillWideEllipse(pDraw, pGC, parcs);
- if (!--narcs)
- return;
- parcs++;
- }
- }
-
- /* Set up pDrawTo and pGCTo based on the rasterop */
- switch (pGC->alu) {
- case GXclear: /* 0 */
- case GXcopy: /* src */
- case GXcopyInverted: /* NOT src */
- case GXset: /* 1 */
- fTricky = FALSE;
- pDrawTo = pDraw;
- pGCTo = pGC;
- break;
- default:
- fTricky = TRUE;
-
- /* find bounding box around arcs */
- xMin = yMin = MAXSHORT;
- xMax = yMax = MINSHORT;
-
- for (i = narcs, parc = parcs; --i >= 0; parc++) {
- xMin = min(xMin, parc->x);
- yMin = min(yMin, parc->y);
- xMax = max(xMax, (parc->x + (int) parc->width));
- yMax = max(yMax, (parc->y + (int) parc->height));
- }
-
- /* expand box to deal with line widths */
- halfWidth = (width + 1) / 2;
- xMin -= halfWidth;
- yMin -= halfWidth;
- xMax += halfWidth;
- yMax += halfWidth;
-
- /* compute pixmap size; limit it to size of drawable */
- xOrg = max(xMin, 0);
- yOrg = max(yMin, 0);
- pixmapWidth = min(xMax, pDraw->width) - xOrg;
- pixmapHeight = min(yMax, pDraw->height) - yOrg;
-
- /* if nothing left, return */
- if ((pixmapWidth <= 0) || (pixmapHeight <= 0))
- return;
-
- for (i = narcs, parc = parcs; --i >= 0; parc++) {
- parc->x -= xOrg;
- parc->y -= yOrg;
- }
- if (pGC->miTranslate) {
- xOrg += pDraw->x;
- yOrg += pDraw->y;
- }
-
- /* set up scratch GC */
-
- pGCTo = GetScratchGC(1, pDraw->pScreen);
- if (!pGCTo)
- return;
- {
- ChangeGCVal gcvals[6];
-
- gcvals[0].val = GXcopy;
- gcvals[1].val = 1;
- gcvals[2].val = 0;
- gcvals[3].val = pGC->lineWidth;
- gcvals[4].val = pGC->capStyle;
- gcvals[5].val = pGC->joinStyle;
- ChangeGC(NullClient, pGCTo, GCFunction |
- GCForeground | GCBackground | GCLineWidth |
- GCCapStyle | GCJoinStyle, gcvals);
- }
- /* allocate a 1 bit deep pixmap of the appropriate size, and
- * validate it */
- pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, pixmapWidth, pixmapHeight, 1,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!pDrawTo) {
- FreeScratchGC(pGCTo);
+ if ((pGC->lineStyle == LineSolid) && narcs) {
+ while (parcs->width && parcs->height &&
+ (parcs->angle2 >= FULLCIRCLE || parcs->angle2 <= -FULLCIRCLE)) {
+ miFillWideEllipse(pDraw, pGC, parcs);
+ if (!--narcs)
return;
- }
- ValidateGC(pDrawTo, pGCTo);
- miClearDrawable(pDrawTo, pGCTo);
+ parcs++;
}
+ }
- fg = pGC->fgPixel;
- bg = pGC->bgPixel;
- if ((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillOpaqueStippled))
- bg = fg; /* the protocol sez these don't cause color changes */
+ /* Set up pDrawTo and pGCTo based on the rasterop */
+ switch (pGC->alu) {
+ case GXclear: /* 0 */
+ case GXcopy: /* src */
+ case GXcopyInverted: /* NOT src */
+ case GXset: /* 1 */
+ fTricky = FALSE;
+ pDrawTo = pDraw;
+ pGCTo = pGC;
+ break;
+ default:
+ fTricky = TRUE;
+
+ /* find bounding box around arcs */
+ xMin = yMin = MAXSHORT;
+ xMax = yMax = MINSHORT;
+
+ for (i = narcs, parc = parcs; --i >= 0; parc++) {
+ xMin = min(xMin, parc->x);
+ yMin = min(yMin, parc->y);
+ xMax = max(xMax, (parc->x + (int) parc->width));
+ yMax = max(yMax, (parc->y + (int) parc->height));
+ }
+
+ /* expand box to deal with line widths */
+ halfWidth = (width + 1) / 2;
+ xMin -= halfWidth;
+ yMin -= halfWidth;
+ xMax += halfWidth;
+ yMax += halfWidth;
+
+ /* compute pixmap size; limit it to size of drawable */
+ xOrg = max(xMin, 0);
+ yOrg = max(yMin, 0);
+ pixmapWidth = min(xMax, pDraw->width) - xOrg;
+ pixmapHeight = min(yMax, pDraw->height) - yOrg;
+
+ /* if nothing left, return */
+ if ((pixmapWidth <= 0) || (pixmapHeight <= 0))
+ return;
- polyArcs = miComputeArcs(parcs, narcs, pGC);
+ for (i = narcs, parc = parcs; --i >= 0; parc++) {
+ parc->x -= xOrg;
+ parc->y -= yOrg;
+ }
+ if (pGC->miTranslate) {
+ xOrg += pDraw->x;
+ yOrg += pDraw->y;
+ }
- if (!polyArcs) {
- if (fTricky) {
- (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo);
- FreeScratchGC(pGCTo);
- }
+ /* set up scratch GC */
+ pGCTo = GetScratchGC(1, pDraw->pScreen);
+ if (!pGCTo)
+ return;
+ {
+ ChangeGCVal gcvals[6];
+
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = 1;
+ gcvals[2].val = 0;
+ gcvals[3].val = pGC->lineWidth;
+ gcvals[4].val = pGC->capStyle;
+ gcvals[5].val = pGC->joinStyle;
+ ChangeGC(NullClient, pGCTo, GCFunction |
+ GCForeground | GCBackground | GCLineWidth |
+ GCCapStyle | GCJoinStyle, gcvals);
+ }
+
+ /* allocate a bitmap of the appropriate size, and validate it */
+ pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap)
+ (pDraw->pScreen, pixmapWidth, pixmapHeight, 1,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+ if (!pDrawTo) {
+ FreeScratchGC(pGCTo);
return;
}
-
- cap[0] = cap[1] = 0;
- join[0] = join[1] = 0;
- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
- iphase >= 0; iphase--) {
- ChangeGCVal gcval;
-
- if (iphase == 1) {
- gcval.val = bg;
- ChangeGC(NullClient, pGC, GCForeground, &gcval);
- ValidateGC(pDraw, pGC);
- }
- else if (pGC->lineStyle == LineDoubleDash) {
- gcval.val = fg;
- ChangeGC(NullClient, pGC, GCForeground, &gcval);
- ValidateGC(pDraw, pGC);
- }
- for (i = 0; i < polyArcs[iphase].narcs; i++) {
- miArcDataPtr arcData;
-
- arcData = &polyArcs[iphase].arcs[i];
- miArcSegment(pDrawTo, pGCTo, arcData->arc,
- &arcData->bounds[RIGHT_END],
- &arcData->bounds[LEFT_END]);
- if (polyArcs[iphase].arcs[i].render) {
- fillSpans(pDrawTo, pGCTo);
- /*
- * don't cap self-joining arcs
- */
- if (polyArcs[iphase].arcs[i].selfJoin &&
- cap[iphase] < polyArcs[iphase].arcs[i].cap)
- cap[iphase]++;
- while (cap[iphase] < polyArcs[iphase].arcs[i].cap) {
- int arcIndex, end;
- miArcDataPtr arcData0;
-
- arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex;
- end = polyArcs[iphase].caps[cap[iphase]].end;
- arcData0 = &polyArcs[iphase].arcs[arcIndex];
- miArcCap(pDrawTo, pGCTo,
- &arcData0->bounds[end], end,
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0);
- ++cap[iphase];
- }
- while (join[iphase] < polyArcs[iphase].arcs[i].join) {
- int arcIndex0, arcIndex1, end0, end1;
- int phase0, phase1;
- miArcDataPtr arcData0, arcData1;
- miArcJoinPtr joinp;
-
- joinp = &polyArcs[iphase].joins[join[iphase]];
- arcIndex0 = joinp->arcIndex0;
- end0 = joinp->end0;
- arcIndex1 = joinp->arcIndex1;
- end1 = joinp->end1;
- phase0 = joinp->phase0;
- phase1 = joinp->phase1;
- arcData0 = &polyArcs[phase0].arcs[arcIndex0];
- arcData1 = &polyArcs[phase1].arcs[arcIndex1];
- miArcJoin(pDrawTo, pGCTo,
- &arcData0->bounds[end0],
- &arcData1->bounds[end1],
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0,
- arcData1->arc.x, arcData1->arc.y,
- (double) arcData1->arc.width / 2.0,
- (double) arcData1->arc.height / 2.0);
- ++join[iphase];
- }
- if (fTricky) {
- if (pGC->serialNumber != pDraw->serialNumber)
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo,
- pDraw, pixmapWidth,
- pixmapHeight, xOrg, yOrg);
- miClearDrawable((DrawablePtr) pDrawTo, pGCTo);
- }
+ ValidateGC(pDrawTo, pGCTo);
+ miClearDrawable(pDrawTo, pGCTo);
+ }
+
+ fg = pGC->fgPixel;
+ bg = pGC->bgPixel;
+
+ /* the protocol sez these don't cause color changes */
+ if ((pGC->fillStyle == FillTiled) ||
+ (pGC->fillStyle == FillOpaqueStippled))
+ bg = fg;
+
+ polyArcs = miComputeArcs(parcs, narcs, pGC);
+ if (!polyArcs)
+ goto out;
+
+ cap[0] = cap[1] = 0;
+ join[0] = join[1] = 0;
+ for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) {
+ ChangeGCVal gcval;
+
+ if (iphase == 1) {
+ gcval.val = bg;
+ ChangeGC(NullClient, pGC, GCForeground, &gcval);
+ ValidateGC(pDraw, pGC);
+ }
+ else if (pGC->lineStyle == LineDoubleDash) {
+ gcval.val = fg;
+ ChangeGC(NullClient, pGC, GCForeground, &gcval);
+ ValidateGC(pDraw, pGC);
+ }
+ for (i = 0; i < polyArcs[iphase].narcs; i++) {
+ miArcDataPtr arcData;
+
+ arcData = &polyArcs[iphase].arcs[i];
+ miArcSegment(pDrawTo, pGCTo, arcData->arc,
+ &arcData->bounds[RIGHT_END],
+ &arcData->bounds[LEFT_END]);
+ if (polyArcs[iphase].arcs[i].render) {
+ fillSpans(pDrawTo, pGCTo);
+ /* don't cap self-joining arcs */
+ if (polyArcs[iphase].arcs[i].selfJoin &&
+ cap[iphase] < polyArcs[iphase].arcs[i].cap)
+ cap[iphase]++;
+ while (cap[iphase] < polyArcs[iphase].arcs[i].cap) {
+ int arcIndex, end;
+ miArcDataPtr arcData0;
+
+ arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex;
+ end = polyArcs[iphase].caps[cap[iphase]].end;
+ arcData0 = &polyArcs[iphase].arcs[arcIndex];
+ miArcCap(pDrawTo, pGCTo,
+ &arcData0->bounds[end], end,
+ arcData0->arc.x, arcData0->arc.y,
+ (double) arcData0->arc.width / 2.0,
+ (double) arcData0->arc.height / 2.0);
+ ++cap[iphase];
+ }
+ while (join[iphase] < polyArcs[iphase].arcs[i].join) {
+ int arcIndex0, arcIndex1, end0, end1;
+ int phase0, phase1;
+ miArcDataPtr arcData0, arcData1;
+ miArcJoinPtr joinp;
+
+ joinp = &polyArcs[iphase].joins[join[iphase]];
+ arcIndex0 = joinp->arcIndex0;
+ end0 = joinp->end0;
+ arcIndex1 = joinp->arcIndex1;
+ end1 = joinp->end1;
+ phase0 = joinp->phase0;
+ phase1 = joinp->phase1;
+ arcData0 = &polyArcs[phase0].arcs[arcIndex0];
+ arcData1 = &polyArcs[phase1].arcs[arcIndex1];
+ miArcJoin(pDrawTo, pGCTo,
+ &arcData0->bounds[end0],
+ &arcData1->bounds[end1],
+ arcData0->arc.x, arcData0->arc.y,
+ (double) arcData0->arc.width / 2.0,
+ (double) arcData0->arc.height / 2.0,
+ arcData1->arc.x, arcData1->arc.y,
+ (double) arcData1->arc.width / 2.0,
+ (double) arcData1->arc.height / 2.0);
+ ++join[iphase];
+ }
+ if (fTricky) {
+ if (pGC->serialNumber != pDraw->serialNumber)
+ ValidateGC(pDraw, pGC);
+ (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo,
+ pDraw, pixmapWidth,
+ pixmapHeight, xOrg, yOrg);
+ miClearDrawable((DrawablePtr) pDrawTo, pGCTo);
}
}
}
- miFreeArcs(polyArcs, pGC);
+ }
+ miFreeArcs(polyArcs, pGC);
- if (fTricky) {
- (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo);
- FreeScratchGC(pGCTo);
- }
+out:
+ if (fTricky) {
+ (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo);
+ FreeScratchGC(pGCTo);
}
}
--
2.12.0

46
SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
From bc6ccb0bdcdc27c90c95a02e821d5883ad1dc7a0 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 26 Jun 2017 12:37:56 -0400
Subject: [PATCH] modesetting: Fix PCI initialization on non-zero domains

libdrm's busid matching for the legacy three-integer bus string format
simply ignores the domain number, rather than what we were doing here of
packing the domain into the bus number. Whatever, just use the existing
code to build a busid string, since that gets the domain right.

[rhel: also remove the if !pciaccess code - ajax]

Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 791ab90..3fac07c 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -849,20 +849,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
if (pEnt->location.type == BUS_PCI) {
ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
if (ms->PciInfo) {
- BusID = XNFalloc(64);
- sprintf(BusID, "PCI:%d:%d:%d",
-#if XSERVER_LIBPCIACCESS
- ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
- ms->PciInfo->dev, ms->PciInfo->func
-#else
- ((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
- ((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
- ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
-#endif
- );
+ if ((BusID = ms_DRICreatePCIBusID(ms->PciInfo)) != NULL) {
+ ms->fd = drmOpen(NULL, BusID);
+ free(BusID);
+ }
}
- ms->fd = drmOpen(NULL, BusID);
- free(BusID);
}
else {
const char *devicename;
--
2.13.0

61
SOURCES/0001-modesetting-software-cursor-hack.patch

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
From 846596b38165e5170d1a410f37ce7c5280db649d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 9 May 2017 17:02:17 -0400
Subject: [PATCH] modesetting: software cursor hack

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/drivers/modesetting/driver.c | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 3da69a3..31a58fd 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -878,6 +878,30 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
}
static Bool
+msDefaultSoftwareCursor(modesettingPtr ms)
+{
+ Bool ret = FALSE;
+ drmVersionPtr v = drmGetVersion(ms->fd);
+
+ /*
+ * This is horrific, don't hate me. The _runtime_ fallback to software
+ * cursor doesn't seem to take on the first try; you get no cursor in
+ * gdm, but it works once you log in. However just bombing out at
+ * init time seems to work fine. So for drivers without hardware cursors
+ * (or for G200SE, where they're basically unusable) just default to sw.
+ */
+ if (!strcmp(v->name, "udl") ||
+ !strcmp(v->name, "mgag200") ||
+ !strcmp(v->name, "cirrus") ||
+ !strcmp(v->name, "ast"))
+ ret = TRUE;
+
+ drmFreeVersion(v);
+
+ return ret;
+}
+
+static Bool
PreInit(ScrnInfoPtr pScrn, int flags)
{
modesettingPtr ms;
@@ -966,9 +990,9 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86SetDefaultVisual(pScrn, -1))
return FALSE;
- if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR, FALSE)) {
- ms->drmmode.sw_cursor = TRUE;
- }
+ if (!xf86GetOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR,
+ &ms->drmmode.sw_cursor))
+ ms->drmmode.sw_cursor = msDefaultSoftwareCursor(ms);
ms->cursor_width = 64;
ms->cursor_height = 64;
--
2.12.0

185
SOURCES/0001-mustard-Don-t-probe-for-drivers-not-shipped-in-RHEL7.patch

@ -0,0 +1,185 @@ @@ -0,0 +1,185 @@
From 3fef2f0a6b01a627b77ff82e9119f9fc6c285147 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 17 Sep 2014 13:19:59 -0400
Subject: [PATCH] mustard: Don't probe for drivers not shipped in RHEL7

Mostly this is here to prevent noise for ast/cirrus/mga/other server kit
trying to probe a driver that isn't there. I'm leaving vboxvideo in out
of the goodness of my heart; if people have RHEL7 vbox guests they
probably want the native driver, but we can't ship it in good conscience
since it's too tightly bound to the hypervisor version.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/common/xf86pciBus.c | 121 +----------------------------------------
1 file changed, 1 insertion(+), 120 deletions(-)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 258988a..e4d4402 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1099,68 +1099,18 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
const char *driverList[5] = { NULL, NULL, NULL, NULL, NULL };
switch (dev->vendor_id) {
- /* AMD Geode LX */
- case 0x1022:
- if (dev->device_id == 0x2081)
- driverList[0] = "geode";
- break;
- /* older Geode products acquired by AMD still carry an NSC vendor_id */
- case 0x100b:
- if (dev->device_id == 0x0030) {
- /* NSC Geode GX2 specifically */
- driverList[0] = "geode";
- /* GX2 support started its life in the NSC tree and was later
- forked by AMD for GEODE so we keep it as a backup */
- driverList[1] = "nsc";
- }
- else
- /* other NSC variant e.g. 0x0104 (SC1400), 0x0504 (SCx200) */
- driverList[0] = "nsc";
- break;
- /* Cyrix Geode GX1 */
- case 0x1078:
- if (dev->device_id == 0x0104)
- driverList[0] = "cyrix";
- break;
- case 0x1142:
- driverList[0] = "apm";
- break;
- case 0xedd8:
- driverList[0] = "ark";
- break;
- case 0x1a03:
- driverList[0] = "ast";
- break;
case 0x1002:
driverList[0] = "ati";
break;
- case 0x102c:
- driverList[0] = "chips";
- break;
- case 0x1013:
- driverList[0] = "cirrus";
- break;
- case 0x3d3d:
- driverList[0] = "glint";
- break;
- case 0x105d:
- driverList[0] = "i128";
- break;
case 0x8086:
switch (dev->device_id)
{
/* Intel i740 */
case 0x00d1:
case 0x7800:
- driverList[0] = "i740";
- break;
/* GMA500/Poulsbo */
case 0x8108:
case 0x8109:
- /* Try psb driver on Poulsbo - if available */
- driverList[0] = "psb";
- driverList[1] = "psb_drv";
- break;
/* GMA600/Oaktrail */
case 0x4100:
case 0x4101:
@@ -1205,91 +1155,22 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
break;
}
break;
- case 0x102b:
- driverList[0] = "mga";
- break;
- case 0x10c8:
- driverList[0] = "neomagic";
- break;
case 0x10de:
case 0x12d2:
- {
- int idx = 0;
-
-#ifdef __linux__
- driverList[idx++] = "nouveau";
-#endif
- driverList[idx++] = "nv";
+ driverList[0] = "nouveau";
break;
- }
case 0x1106:
driverList[0] = "openchrome";
break;
case 0x1b36:
driverList[0] = "qxl";
break;
- case 0x1163:
- driverList[0] = "rendition";
- break;
- case 0x5333:
- switch (dev->device_id) {
- case 0x88d0:
- case 0x88d1:
- case 0x88f0:
- case 0x8811:
- case 0x8812:
- case 0x8814:
- case 0x8901:
- driverList[0] = "s3";
- break;
- case 0x5631:
- case 0x883d:
- case 0x8a01:
- case 0x8a10:
- case 0x8c01:
- case 0x8c03:
- case 0x8904:
- case 0x8a13:
- driverList[0] = "s3virge";
- break;
- default:
- driverList[0] = "savage";
- break;
- }
- break;
- case 0x1039:
- driverList[0] = "sis";
- break;
- case 0x126f:
- driverList[0] = "siliconmotion";
- break;
- case 0x121a:
- if (dev->device_id < 0x0003)
- driverList[0] = "voodoo";
- else
- driverList[0] = "tdfx";
- break;
- case 0x1011:
- driverList[0] = "tga";
- break;
- case 0x1023:
- driverList[0] = "trident";
- break;
- case 0x100c:
- driverList[0] = "tseng";
- break;
case 0x80ee:
driverList[0] = "vboxvideo";
break;
case 0x15ad:
driverList[0] = "vmware";
break;
- case 0x18ca:
- if (dev->device_id == 0x47)
- driverList[0] = "xgixp";
- else
- driverList[0] = "xgi";
- break;
default:
break;
}
--
1.9.3

26
SOURCES/0001-mustard-Enable-indirect-GLX-by-default.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From 81e6a4910daf1d2e13804553182e901c65d7a583 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 20 Feb 2017 13:46:51 -0500
Subject: [PATCH] mustard: Enable indirect GLX by default

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
os/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/utils.c b/os/utils.c
index da37588..7ab8540 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -194,7 +194,7 @@ Bool noGEExtension = FALSE;
Bool CoreDump;
-Bool enableIndirectGLX = FALSE;
+Bool enableIndirectGLX = TRUE;
#ifdef PANORAMIX
Bool PanoramiXExtensionDisabledHack = FALSE;
--
2.9.3

28
SOURCES/0001-rpath-hack.patch

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
From e562763e58cd58b0a23e5d034aafedb608e3eda3 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 12 Nov 2015 11:10:11 -0500
Subject: [PATCH] rpath hack

Normally, rpath is undesirable. But for the X server we _know_ we need
Mesa's libGL, which will always be in %{_libdir}, and not any third-party
libGL that may be configured using ld.so.conf.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 190d039..2ce40f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1352,7 +1352,7 @@ if test "x$GLX" = xyes; then
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la'
- GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
+ GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS -Wl,-rpath=\$(libdir)"
else
GLX=no
fi
--
2.9.3

35
SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
From 88c59206bffee264250142ea28713206df62d853 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 6 Apr 2017 17:22:28 -0400
Subject: [PATCH xserver] xephyr: Check for host XVideo support before trying
to use it

Otherwise xcb will treat our attempt to send xv requests as a connection
error (quite reasonably: we're asking it to emit a request for which
there is no defined major opcode), and we'll die quietly the first time
we hit KdBlockhandler.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/kdrive/ephyr/ephyrvideo.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c
index 9c9c78d..671a0dd 100644
--- a/hw/kdrive/ephyr/ephyrvideo.c
+++ b/hw/kdrive/ephyr/ephyrvideo.c
@@ -226,6 +226,11 @@ ephyrInitVideo(ScreenPtr pScreen)
return FALSE;
}
+ if (!hostx_has_extension(&xcb_xv_id)) {
+ EPHYR_LOG_ERROR("Host has no XVideo extension\n");
+ return FALSE;
+ }
+
if (!xv_priv) {
xv_priv = ephyrXVPrivNew();
}
--
2.9.3

26
SOURCES/0001-xf86AddBusDeviceToConfigure-Store-device-in-DevToCon.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From 6db849550c71b6af00c220d03816495c970a5196 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 13 Aug 2014 12:57:59 -0400
Subject: [PATCH] xf86AddBusDeviceToConfigure(): Store device in
DevToConfig[i].pVideo

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/common/xf86Configure.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 91e8df9..423b200 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -90,6 +90,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData,
switch (bus) {
#ifdef XSERVER_LIBPCIACCESS
case BUS_PCI:
+ DevToConfig[i].pVideo = busData;
ret = xf86PciConfigure(busData, DevToConfig[i].pVideo);
break;
#endif
--
1.9.3

105
SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch

@ -0,0 +1,105 @@ @@ -0,0 +1,105 @@
From a5e2c313721615d40ebf328f3619286a88dae238 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 17 May 2017 14:17:01 -0400
Subject: [PATCH xserver] xfixes: Remove the CursorCurrent array

We're not wrapping all the ways a cursor can be destroyed, so this array
ends up with stale data. Rather than try harder to wrap more code paths,
just look up the cursor when we need it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
xfixes/cursor.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index c1ab3beda..b7c47bc00 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -61,7 +61,6 @@
static RESTYPE CursorClientType;
static RESTYPE CursorHideCountType;
static RESTYPE CursorWindowType;
-static CursorPtr CursorCurrent[MAXDEVICES];
static DevPrivateKeyRec CursorScreenPrivateKeyRec;
@@ -132,10 +131,26 @@ typedef struct _CursorScreen {
Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
+static CursorPtr
+CursorForDevice(DeviceIntPtr pDev)
+{
+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+ return pDev->spriteInfo->sprite->current;
+
+ return NULL;
+}
+
+static CursorPtr
+CursorForClient(ClientPtr client)
+{
+ return CursorForDevice(PickPointer(client));
+}
+
static Bool
CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
CursorScreenPtr cs = GetCursorScreen(pScreen);
+ CursorPtr pOldCursor = CursorForDevice(pDev);
Bool ret;
DisplayCursorProcPtr backupProc;
@@ -150,11 +165,10 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
}
- if (pCursor != CursorCurrent[pDev->id]) {
+ if (pCursor != pOldCursor) {
CursorEventPtr e;
UpdateCurrentTimeIf();
- CursorCurrent[pDev->id] = pCursor;
for (e = cursorEvents; e; e = e->next) {
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
xXFixesCursorNotifyEvent ev = {
@@ -350,7 +364,7 @@ ProcXFixesGetCursorImage(ClientPtr client)
int npixels, width, height, rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -499,7 +513,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
int rc, x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq);
- pCursor = CursorCurrent[PickPointer(client)->id];
+ pCursor = CursorForClient(client);
if (!pCursor)
return BadCursor;
rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR,
@@ -873,7 +887,7 @@ ProcXFixesHideCursor(ClientPtr client)
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
CursorDisplayCursor(dev, pWin->drawable.pScreen,
- CursorCurrent[dev->id]);
+ CursorForDevice(dev));
}
}
@@ -968,7 +982,7 @@ CursorFreeHideCount(void *data, XID id)
deleteCursorHideCount(pChc, pChc->pScreen);
for (dev = inputInfo.devices; dev; dev = dev->next) {
if (IsMaster(dev) && IsPointerDevice(dev))
- CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]);
+ CursorDisplayCursor(dev, pScreen, CursorForDevice(dev));
}
return 1;
--
2.13.0

111
SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch

@ -0,0 +1,111 @@ @@ -0,0 +1,111 @@
From ca183b2a3c6e3877b93b6444acb1280356834a04 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 5 Aug 2014 12:16:31 -0400
Subject: [PATCH] xfree86: Allow mixed fbdev and pci setups

You'd like to be able to do this because (for example) that way you'd be
able to drive both intel and udlfb at once. There's no fundamental
reason why that can't work, so just delete the check in PostProbe that
forbids it. Also in the fbdev driver, we're now actually passing the PCI
device in at init time, so we can look up the device node sanely.

That almost works! Except then you break HyperV, because hyperv_fb
binds to the vmbus device, not the PCI device, because why the hell not.
So then the PCI probe path fails (because we try to find the fbdev node
under the PCI device tree, and fail), but the legacy probe path
succeeds; but then Init fails because we don't preserve that fd (or even
which /dev node we opened!), and since it _is_ a PCI device we try
fbdev_open_pci and that fails like it did during PCI probe. "I know",
you think, "I'll just record the choice made at probe time", and then
you remember you have nowhere to hang it.

So, whatever. If we make it to Init we know Probe succeeded one way or
the other, so just fall back from pci-style to handwave-style in Init
once if it seem appropriate. And in all cases, use the explicit-device
open path even for PCI devices so that Option "fbdev" actually takes
effect.

I think this is the best you can do without breaking the Probe
interface, though admittedly burning this all to the ground is a noble
goal.

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/common/xf86Bus.c | 16 ----------------
hw/xfree86/fbdevhw/fbdevhw.c | 18 +++++++++++++++---
2 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index d463e91..5adff0b 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -548,22 +548,6 @@ xf86PostProbe(void)
{
int i;
- if (fbSlotClaimed && (
-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
- sbusSlotClaimed ||
-#endif
-#ifdef XSERVER_PLATFORM_BUS
- platformSlotClaimed ||
-#endif
-#ifdef XSERVER_LIBPCIACCESS
- pciSlotClaimed
-#else
- TRUE
-#endif
- ))
- FatalError("Cannot run in framebuffer mode. Please specify busIDs "
- " for all framebuffer devices\n");
-
for (i = 0; i < xf86NumEntities; i++)
if (xf86Entities[i]->entityInit)
xf86Entities[i]->entityInit(i, xf86Entities[i]->private);
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index cbb4093..657fc49 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -347,7 +347,7 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep)
{
int fd;
- if (pPci)
+ if (pPci && !device)
fd = fbdev_open_pci(pPci, namep);
else
fd = fbdev_open(-1, device, namep);
@@ -361,16 +361,28 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep)
Bool
fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device)
{
+ static Bool been_here;
fbdevHWPtr fPtr;
fbdevHWGetRec(pScrn);
fPtr = FBDEVHWPTR(pScrn);
/* open device */
- if (pPci)
+ if (pPci && !device)
fPtr->fd = fbdev_open_pci(pPci, NULL);
else
- fPtr->fd = fbdev_open(pScrn->scrnIndex, device, NULL);
+ fPtr->fd = fbdev_open(pScrn->scrnIndex, device, NULL);
+
+ if (pPci && fPtr->fd == -1) {
+ if (been_here != serverGeneration) {
+ fPtr->fd = fbdev_open(pScrn->scrnIndex, device, NULL);
+ been_here = serverGeneration;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Please specify Option \"fbdev\" to use this device\n");
+ }
+ }
+
if (-1 == fPtr->fd) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to open framebuffer device, consult warnings"
--
2.1.0

26
SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From 5c7617de1777845d1609b301c0f470c90338d06f Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 23 Oct 2017 14:48:51 -0400
Subject: [PATCH] 0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch

---
hw/xfree86/common/xf86Config.c | 1 -
hw/xfree86/loader/loadmod.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 940f5fc..2f9d915 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -525,6 +525,8 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
if (!(stat(buf, &stat_buf) == 0 &&
S_ISREG(stat_buf.st_mode)))
continue;
+ if (strstr(dp->d_name, "vesa") || strstr(dp->d_name, "fbdev"))
+ continue;
for (p = patterns; p->pattern; p++) {
if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
match[1].rm_so != -1) {
--
2.14.2

36
SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
From e437e3cae10b730d3d8bb64e0b720064f39ca0b6 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 26 Jun 2017 17:31:14 -0400
Subject: [PATCH] xfree86: Fix off-by-one in X -configure

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index df3ca50..3994805 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -545,11 +545,11 @@ driver_sort(const void *_l, const void *_r)
return strcmp(l, r);
/* left is a fallback */
- if (left >= 0)
+ if (left >= 0 && right < 0)
return 1;
/* right is a fallback */
- if (right >= 0)
+ if (right >= 0 && left > 0)
return -1;
/* both are fallbacks, which is worse */
@@ -563,7 +563,6 @@ fixup_video_driver_list(const char **drivers)
/* walk to the end of the list */
for (end = drivers; *end && **end; end++);
- end--;
qsort(drivers, end - drivers, sizeof(const char *), driver_sort);
}
--
2.13.0

56
SOURCES/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
From f374410a00145d1703633547e90f10d43b3ded9f Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Thu, 27 Apr 2017 10:52:24 +1000
Subject: [PATCH] xfree86: use modesetting driver by default on GeForce 8 and
newer

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
hw/xfree86/common/xf86pciBus.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 682e723..2c36a3d 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -37,6 +37,7 @@
#include <unistd.h>
#include <X11/X.h>
#include <pciaccess.h>
+#include <xf86drm.h>
#include "os.h"
#include "Pci.h"
#include "xf86.h"
@@ -1146,8 +1147,29 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
break;
case 0x10de:
case 0x12d2:
+ {
+ char busid[32];
+ int fd;
+
+ snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
+ dev->domain, dev->bus, dev->dev, dev->func);
+
+ /* 'modesetting' is preferred for GeForce 8 and newer GPUs */
+ fd = drmOpenWithType("nouveau", busid, DRM_NODE_RENDER);
+ if (fd >= 0) {
+ uint64_t args[] = { 11 /* NOUVEAU_GETPARAM_CHIPSET_ID */, 0 };
+ int ret = drmCommandWriteRead(fd, 0 /* DRM_NOUVEAU_GETPARAM */,
+ &args, sizeof(args));
+ drmClose(fd);
+ if (ret == 0) {
+ if (args[1] == 0x050 || args[1] >= 0x80)
+ break;
+ }
+ }
+
driverList[0] = "nouveau";
break;
+ }
case 0x1106:
driverList[0] = "openchrome";
break;
--
1.8.3.1

73
SOURCES/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
From 7f22271ca7ace43f6fa1168a2acea9af6f2d5896 Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Thu, 13 Oct 2016 10:39:46 -0700
Subject: [PATCH xserver 01/12] xwayland: Depend on wayland-protocols to build
tablet protocol headers

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 89c841915ac4fba6d2a5ad0051c778f1a76ffbf3)
---
configure.ac | 2 +-
hw/xwayland/Makefile.am | 9 ++++++++-
hw/xwayland/xwayland-input.c | 1 +
3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e6c5b35de..d34e10538 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2503,7 +2503,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
dnl Xwayland DDX
-XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy"
+XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.5 $LIBDRM epoxy"
if test "x$XF86VIDMODE" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
fi
diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am
index a3c9fce48..e376f09dd 100644
--- a/hw/xwayland/Makefile.am
+++ b/hw/xwayland/Makefile.am
@@ -56,7 +56,9 @@ Xwayland_built_sources += \
relative-pointer-unstable-v1-client-protocol.h \
relative-pointer-unstable-v1-protocol.c \
pointer-constraints-unstable-v1-client-protocol.h \
- pointer-constraints-unstable-v1-protocol.c
+ pointer-constraints-unstable-v1-protocol.c \
+ tablet-unstable-v2-client-protocol.h \
+ tablet-unstable-v2-protocol.c
nodist_Xwayland_SOURCES = $(Xwayland_built_sources)
CLEANFILES = $(Xwayland_built_sources)
@@ -79,6 +81,11 @@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstab
pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
+tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml
+ $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
+tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml
+ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
+
%-protocol.c : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index f2564d5d3..8fdc875ea 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -34,6 +34,7 @@
#include <inpututils.h>
#include <mipointer.h>
#include <mipointrst.h>
+#include "tablet-unstable-v2-client-protocol.h"
/* Copied from mipointer.c */
#define MIPOINTER(dev) \
--
2.13.5

135
SOURCES/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch

@ -0,0 +1,135 @@ @@ -0,0 +1,135 @@
From 60f4646ae10f0b57790fce46682baa531512b53e Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 4 Dec 2017 16:55:13 +0100
Subject: [PATCH xserver] xwayland: Keep separate variables for pointer and
tablet foci

The tablet/stylus interfaces reused xwl_seat->focus_window, which
would leave a somewhat inconsistent state of that variable for
wl_pointer purposes (basically, everything) if the pointer happened
to lay on the same surface than the stylus while proximity_out
happens.

We just want the stylus xwl_window to correctly determine we have
stylus focus, and to correctly translate surface-local coordinates
to root coordinates, this can be done using a different variable.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
---
hw/xwayland/xwayland-input.c | 20 ++++++++++----------
hw/xwayland/xwayland.c | 2 ++
hw/xwayland/xwayland.h | 1 +
3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 68e365051..439903032 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1514,7 +1514,7 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool,
return;
xwl_tablet_tool->proximity_in_serial = serial;
- xwl_seat->focus_window = wl_surface_get_user_data(wl_surface);
+ xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface);
xwl_tablet_tool_set_cursor(xwl_tablet_tool);
}
@@ -1526,7 +1526,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool)
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
xwl_tablet_tool->proximity_in_serial = 0;
- xwl_seat->focus_window = NULL;
+ xwl_seat->tablet_focus_window = NULL;
xwl_tablet_tool->pressure = 0;
xwl_tablet_tool->tilt_x = 0;
@@ -1568,11 +1568,11 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool,
int sx = wl_fixed_to_int(x);
int sy = wl_fixed_to_int(y);
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
- dx = xwl_seat->focus_window->window->drawable.x;
- dy = xwl_seat->focus_window->window->drawable.y;
+ dx = xwl_seat->tablet_focus_window->window->drawable.x;
+ dy = xwl_seat->tablet_focus_window->window->drawable.y;
xwl_tablet_tool->x = dx + sx;
xwl_tablet_tool->y = dy + sy;
@@ -1585,7 +1585,7 @@ tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool,
struct xwl_tablet_tool *xwl_tablet_tool = data;
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
/* normalized to 65535 already */
@@ -1605,7 +1605,7 @@ tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool,
struct xwl_tablet_tool *xwl_tablet_tool = data;
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x);
@@ -1620,7 +1620,7 @@ tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool,
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
double rotation = wl_fixed_to_double(angle);
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
/* change origin (buttons facing right [libinput +90 degrees]) and
@@ -1639,7 +1639,7 @@ tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool,
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
float position = position_raw / 65535.0;
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f;
@@ -1652,7 +1652,7 @@ tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool,
struct xwl_tablet_tool *xwl_tablet_tool = data;
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
- if (!xwl_seat->focus_window)
+ if (!xwl_seat->tablet_focus_window)
return;
xwl_tablet_tool->wheel_clicks = clicks;
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 79deead8d..638022180 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -545,6 +545,8 @@ xwl_unrealize_window(WindowPtr window)
xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
if (xwl_seat->focus_window && xwl_seat->focus_window->window == window)
xwl_seat->focus_window = NULL;
+ if (xwl_seat->tablet_focus_window && xwl_seat->tablet_focus_window->window == window)
+ xwl_seat->tablet_focus_window = NULL;
if (xwl_seat->last_xwindow == window)
xwl_seat->last_xwindow = NullWindow;
if (xwl_seat->cursor_confinement_window &&
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 3adee82fa..e6eb37bec 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -154,6 +154,7 @@ struct xwl_seat {
struct zwp_tablet_seat_v2 *tablet_seat;
struct wl_array keys;
struct xwl_window *focus_window;
+ struct xwl_window *tablet_focus_window;
uint32_t id;
uint32_t pointer_enter_serial;
struct xorg_list link;
--
2.14.3

41
SOURCES/0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
From 74cd913b98ddeaffdccc97735c017fae660e101b Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 2 Mar 2017 11:03:15 +0100
Subject: [PATCH xserver] xwayland: add envvar XWAYLAND_NO_GLAMOR

Not all compositors allow for customizing the Xwayland command line,
gnome-shell/mutter for example have the command line and path to
Xwayland binary hardcoded, which makes it harder for users to disable
glamor acceleration in Xwayland (glamor being used by default).

Add an environment variable XWAYLAND_NO_GLAMOR to disable glamor support
in Xwayland.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit 1089d5d518a315963a8cda6c7d47a0ce09de0979)
---
hw/xwayland/xwayland-glamor.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 63f230369..00c8334c5 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -583,6 +583,13 @@ Bool
xwl_glamor_init(struct xwl_screen *xwl_screen)
{
ScreenPtr screen = xwl_screen->screen;
+ const char *no_glamor_env;
+
+ no_glamor_env = getenv("XWAYLAND_NO_GLAMOR");
+ if (no_glamor_env && *no_glamor_env != '0') {
+ ErrorF("Disabling glamor and dri3 support, XWAYLAND_NO_GLAMOR is set\n");
+ return FALSE;
+ }
if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
ErrorF("Disabling glamor and dri3, EGL setup failed\n");
--
2.13.5

70
SOURCES/0002-animcur-Use-fixed-size-screen-private.patch

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
From cb99ddee85ef8f5b98239a8625ad20ab5b10b911 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 26 Oct 2017 13:40:57 -0400
Subject: [PATCH xserver 2/6] animcur: Use fixed-size screen private

Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c)
---
render/animcur.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index 52e6b8b79..3f85f9a4f 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -77,12 +77,9 @@ static CursorBits animCursorBits = {

static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;

-#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
-
#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits))
#define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
-#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
-#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)
+#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, &AnimCurScreenPrivateKeyRec))

#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
@@ -101,9 +98,7 @@ AnimCurCloseScreen(ScreenPtr pScreen)
Unwrap(as, pScreen, RealizeCursor);
Unwrap(as, pScreen, UnrealizeCursor);
Unwrap(as, pScreen, RecolorCursor);
- SetAnimCurScreen(pScreen, 0);
ret = (*pScreen->CloseScreen) (pScreen);
- free(as);
return ret;
}

@@ -308,15 +303,13 @@ AnimCurInit(ScreenPtr pScreen)
{
AnimCurScreenPtr as;

- if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN,
+ sizeof(AnimCurScreenRec)))
return FALSE;

- as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec));
- if (!as)
- return FALSE;
+ as = GetAnimCurScreen(pScreen);
as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen);
if (!as->timer) {
- free(as);
return FALSE;
}
as->timer_set = FALSE;
@@ -329,7 +322,6 @@ AnimCurInit(ScreenPtr pScreen)
Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor);
Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor);
- SetAnimCurScreen(pScreen, as);
return TRUE;
}

--
2.14.3

167
SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch

@ -0,0 +1,167 @@ @@ -0,0 +1,167 @@
From 849c825855b82caf44d25edb8155bc9f17869256 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 1 Mar 2017 16:13:58 -0500
Subject: [PATCH 2/3] miarc: Make the caller free the arc span data

drawArc does some fairly expensive computation, but it's only sensitive
to arc width/height. Thread the span data up through the call chain so
it's at least possible for the caller to cache things.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
mi/miarc.c | 64 ++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/mi/miarc.c b/mi/miarc.c
index fed5c9fa3..d6be99000 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -215,10 +215,21 @@ typedef struct _miPolyArc {
miArcJoinPtr joins;
} miPolyArcRec, *miPolyArcPtr;
+typedef struct {
+ short lx, lw, rx, rw;
+} miArcSpan;
+
+typedef struct {
+ miArcSpan *spans;
+ int count1, count2, k;
+ char top, bot, hole;
+} miArcSpanData;
+
static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
static void newFinalSpan(int y, int xmin, int xmax);
-static void drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right,
- miArcFacePtr left);
+static miArcSpanData *drawArc(xArc * tarc, int l, int a0, int a1,
+ miArcFacePtr right, miArcFacePtr left,
+ miArcSpanData *spdata);
static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc * tarc, int lw,
miArcFacePtr left, miArcFacePtr right);
static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
@@ -244,9 +255,9 @@ static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr * ppPts);
* draw one segment of the arc using the arc spans generation routines
*/
-static void
-miArcSegment(DrawablePtr pDraw,
- GCPtr pGC, xArc tarc, miArcFacePtr right, miArcFacePtr left)
+static miArcSpanData *
+miArcSegment(DrawablePtr pDraw, GCPtr pGC, xArc tarc, miArcFacePtr right,
+ miArcFacePtr left, miArcSpanData *spdata)
{
int l = pGC->lineWidth;
int a0, a1, startAngle, endAngle;
@@ -257,7 +268,7 @@ miArcSegment(DrawablePtr pDraw,
if (tarc.width == 0 || tarc.height == 0) {
drawZeroArc(pDraw, pGC, &tarc, l, left, right);
- return;
+ return spdata;
}
if (pGC->miTranslate) {
@@ -298,7 +309,7 @@ miArcSegment(DrawablePtr pDraw,
endAngle = FULLCIRCLE;
}
- drawArc(&tarc, l, startAngle, endAngle, right, left);
+ return drawArc(&tarc, l, startAngle, endAngle, right, left, spdata);
}
/*
@@ -364,16 +375,6 @@ correspond to the inner and outer boundaries.
*/
-typedef struct {
- short lx, lw, rx, rw;
-} miArcSpan;
-
-typedef struct {
- miArcSpan *spans;
- int count1, count2, k;
- char top, bot, hole;
-} miArcSpanData;
-
static void drawQuadrant(struct arc_def *def, struct accelerators *acc,
int a0, int a1, int mask, miArcFacePtr right,
miArcFacePtr left, miArcSpanData * spdata);
@@ -905,8 +906,11 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
int halfWidth;
if (width == 0 && pGC->lineStyle == LineSolid) {
- for (i = narcs, parc = parcs; --i >= 0; parc++)
- miArcSegment(pDraw, pGC, *parc, NULL, NULL);
+ for (i = narcs, parc = parcs; --i >= 0; parc++) {
+ miArcSpanData *spdata;
+ spdata = miArcSegment(pDraw, pGC, *parc, NULL, NULL, NULL);
+ free(spdata);
+ }
fillSpans(pDraw, pGC);
return;
}
@@ -1016,6 +1020,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
cap[0] = cap[1] = 0;
join[0] = join[1] = 0;
for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) {
+ miArcSpanData *spdata = NULL;
ChangeGCVal gcval;
if (iphase == 1) {
@@ -1032,9 +1037,10 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
miArcDataPtr arcData;
arcData = &polyArcs[iphase].arcs[i];
- miArcSegment(pDrawTo, pGCTo, arcData->arc,
- &arcData->bounds[RIGHT_END],
- &arcData->bounds[LEFT_END]);
+ spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc,
+ &arcData->bounds[RIGHT_END],
+ &arcData->bounds[LEFT_END], spdata);
+ free(spdata);
if (polyArcs[iphase].arcs[i].render) {
fillSpans(pDrawTo, pGCTo);
/* don't cap self-joining arcs */
@@ -3240,9 +3246,9 @@ mirrorSppPoint(int quadrant, SppPointPtr sppPoint)
* first quadrant.
*/
-static void
-drawArc(xArc * tarc,
- int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left)
+static miArcSpanData *
+drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right,
+ miArcFacePtr left, miArcSpanData *spdata)
{ /* save end line points */
struct arc_def def;
struct accelerators acc;
@@ -3258,11 +3264,11 @@ drawArc(xArc * tarc,
int i, j;
int flipRight = 0, flipLeft = 0;
int copyEnd = 0;
- miArcSpanData *spdata;
- spdata = miComputeWideEllipse(l, tarc);
if (!spdata)
- return;
+ spdata = miComputeWideEllipse(l, tarc);
+ if (!spdata)
+ return NULL;
if (a1 < a0)
a1 += 360 * 64;
@@ -3472,7 +3478,7 @@ drawArc(xArc * tarc,
left->counterClock = temp;
}
}
- free(spdata);
+ return spdata;
}
static void
--
2.12.0

166
SOURCES/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch

@ -0,0 +1,166 @@ @@ -0,0 +1,166 @@
From 8dcc03fb4a5db18fb52377ee578a2a673d691a1e Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 15 Jan 2016 17:29:37 -0800
Subject: [PATCH xserver 02/12] xwayland: Bind to wp_tablet_manager if
available and get its seats

If we're notified about the existence of the wp_tablet_manager interface,
we bind to it so that we can make use of any tablets that are (or later
become) available. For each seat that exists or comes into existance at
a later point, obtain the associated tablet_seat.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 7d48b758a601ce0252ebd21297a7c42263adfaaf)
---
hw/xwayland/xwayland-input.c | 59 ++++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.c | 2 ++
hw/xwayland/xwayland.h | 4 +++
3 files changed, 65 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 8fdc875ea..1d2be978e 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -63,6 +63,12 @@ static void
xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat);
static void
+init_tablet_manager_seat(struct xwl_screen *xwl_screen,
+ struct xwl_seat *xwl_seat);
+static void
+release_tablet_manager_seat(struct xwl_seat *xwl_seat);
+
+static void
xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl)
{
/* Nothing to do, dix handles all settings */
@@ -1147,6 +1153,9 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version
xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
+
+ init_tablet_manager_seat(xwl_screen, xwl_seat);
+
wl_array_init(&xwl_seat->keys);
xorg_list_init(&xwl_seat->touches);
@@ -1170,6 +1179,8 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
free (p);
}
+ release_tablet_manager_seat(xwl_seat);
+
wl_seat_destroy(xwl_seat->seat);
wl_surface_destroy(xwl_seat->cursor);
if (xwl_seat->cursor_frame_cb)
@@ -1178,6 +1189,52 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
free(xwl_seat);
}
+
+static void
+init_tablet_manager_seat(struct xwl_screen *xwl_screen,
+ struct xwl_seat *xwl_seat)
+{
+ if (!xwl_screen->tablet_manager)
+ return;
+
+ xwl_seat->tablet_seat =
+ zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager,
+ xwl_seat->seat);
+}
+
+static void
+release_tablet_manager_seat(struct xwl_seat *xwl_seat)
+{
+ if (xwl_seat->tablet_seat) {
+ zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat);
+ xwl_seat->tablet_seat = NULL;
+ }
+}
+
+static void
+init_tablet_manager(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version)
+{
+ struct xwl_seat *xwl_seat;
+
+ xwl_screen->tablet_manager = wl_registry_bind(xwl_screen->registry,
+ id,
+ &zwp_tablet_manager_v2_interface,
+ min(version,1));
+
+ xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) {
+ init_tablet_manager_seat(xwl_screen, xwl_seat);
+ }
+}
+
+void
+xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen)
+{
+ if (xwl_screen->tablet_manager) {
+ zwp_tablet_manager_v2_destroy(xwl_screen->tablet_manager);
+ xwl_screen->tablet_manager = NULL;
+ }
+}
+
static void
init_relative_pointer_manager(struct xwl_screen *xwl_screen,
uint32_t id, uint32_t version)
@@ -1211,6 +1268,8 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id,
init_relative_pointer_manager(xwl_screen, id, version);
} else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) {
init_pointer_constraints(xwl_screen, id, version);
+ } else if (strcmp(interface, "zwp_tablet_manager_v2") == 0) {
+ init_tablet_manager(xwl_screen, id, version);
}
}
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 939f3392c..fa7b81c7a 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -130,6 +130,8 @@ xwl_close_screen(ScreenPtr screen)
&xwl_screen->seat_list, link)
xwl_seat_destroy(xwl_seat);
+ xwl_screen_release_tablet_manager(xwl_screen);
+
RemoveNotifyFd(xwl_screen->wayland_fd);
wl_display_disconnect(xwl_screen->display);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 5e5624be0..2752d731c 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -76,6 +76,7 @@ struct xwl_screen {
struct wl_registry *registry;
struct wl_registry *input_registry;
struct wl_compositor *compositor;
+ struct zwp_tablet_manager_v2 *tablet_manager;
struct wl_shm *shm;
struct wl_shell *shell;
struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
@@ -137,6 +138,7 @@ struct xwl_seat {
struct zwp_relative_pointer_v1 *wp_relative_pointer;
struct wl_keyboard *wl_keyboard;
struct wl_touch *wl_touch;
+ struct zwp_tablet_seat_v2 *tablet_seat;
struct wl_array keys;
struct xwl_window *focus_window;
uint32_t id;
@@ -241,6 +243,8 @@ Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen,
uint32_t id, uint32_t version);
struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap);
+void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen);
+
#ifdef XV
/* glamor Xv Adaptor */
Bool xwl_glamor_xv_init(ScreenPtr pScreen);
--
2.13.5

37
SOURCES/0003-animcur-Return-the-next-interval-directly-from-the-t.patch

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
From 8c72c85c76a003beaad9fe841ec4338dacd4b265 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 26 Oct 2017 13:53:06 -0400
Subject: [PATCH xserver 3/6] animcur: Return the next interval directly from
the timer callback

If the return value is non-zero here, DoTimer() will automatically rearm
the timer for the new (relative) delay. 'soonest' is in absolute time,
so subtract off 'now' and return that.

Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87)
---
render/animcur.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index 3f85f9a4f..26a6026ae 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -169,10 +169,9 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
}

if (activeDevice)
- TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen);
- else
- as->timer_set = FALSE;
+ return soonest - now;

+ as->timer_set = FALSE;
return 0;
}

--
2.14.3

71
SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch

@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
From 0d7f05ed99b71a4641415c9f26e245c3bb24a9a0 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 1 Mar 2017 16:13:59 -0500
Subject: [PATCH 3/3] miarc: "Cache" arc span data for dashed arcs

This avoids recomputing the span data for every dash. x11perf thinks
this is a pretty modest speedup:

832919.4 840471.1 ( 1.009) 100-pixel dashed ellipse
672353.1 680652.2 ( 1.012) 100-pixel double-dashed ellipse
13748.9 24287.9 ( 1.767) 100-pixel wide dashed ellipse
9236.3 21298.2 ( 2.306) 100-pixel wide double-dashed ellipse

But part of the reason it's so modest there is that the arcs are
relatively small (100 pixel diameter at line width 10, so ~6000 pixels)
and the dashes relatively large (30 on 20 off so ~6 dashes per
quadrant).

With larger arcs and finer dashes this is much more impressive. A fairly
trivial testcase of a single 15000x13000 arc with the default {2, 2}
dash pattern drops from ~3500 milliseconds to 10 milliseconds.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
mi/miarc.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/mi/miarc.c b/mi/miarc.c
index d6be99000..71df4ab64 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1021,6 +1021,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
join[0] = join[1] = 0;
for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) {
miArcSpanData *spdata = NULL;
+ xArc lastArc;
ChangeGCVal gcval;
if (iphase == 1) {
@@ -1037,10 +1038,17 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
miArcDataPtr arcData;
arcData = &polyArcs[iphase].arcs[i];
+ if (spdata) {
+ if (lastArc.width != arcData->arc.width ||
+ lastArc.height != arcData->arc.height) {
+ free(spdata);
+ spdata = NULL;
+ }
+ }
+ memcpy(&lastArc, &arcData->arc, sizeof(xArc));
spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc,
&arcData->bounds[RIGHT_END],
&arcData->bounds[LEFT_END], spdata);
- free(spdata);
if (polyArcs[iphase].arcs[i].render) {
fillSpans(pDrawTo, pGCTo);
/* don't cap self-joining arcs */
@@ -1097,6 +1105,8 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
}
}
}
+ free(spdata);
+ spdata = NULL;
}
miFreeArcs(polyArcs, pGC);
--
2.12.0

173
SOURCES/0003-xwayland-Listen-for-wp_tablet_seat-events.patch

@ -0,0 +1,173 @@ @@ -0,0 +1,173 @@
From 243eadc7979e35756a4f0e349ee97bbbd3a268c3 Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 14 Oct 2016 14:50:18 -0700
Subject: [PATCH xserver 03/12] xwayland: Listen for wp_tablet_seat events

The wp_tablet_seat interface provides us with notifications as tablets,
tools, and pads are connected to the system. Add listener functions and
store references to the obtained devices.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 47c4415912b5b16b115135be365beb370858df76)
---
hw/xwayland/xwayland-input.c | 94 ++++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.h | 22 +++++++++++
2 files changed, 116 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 1d2be978e..d5d12933c 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1191,6 +1191,69 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
static void
+tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
+ struct zwp_tablet_v2 *tablet)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_tablet *xwl_tablet;
+
+ xwl_tablet = calloc(sizeof *xwl_tablet, 1);
+ if (xwl_tablet == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ xwl_tablet->tablet = tablet;
+ xwl_tablet->seat = xwl_seat;
+
+ xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets);
+}
+
+static void
+tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
+ struct zwp_tablet_tool_v2 *tool)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_tablet_tool *xwl_tablet_tool;
+
+ xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1);
+ if (xwl_tablet_tool == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ xwl_tablet_tool->tool = tool;
+ xwl_tablet_tool->seat = xwl_seat;
+
+ xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools);
+}
+
+static void
+tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
+ struct zwp_tablet_pad_v2 *pad)
+{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_tablet_pad *xwl_tablet_pad;
+
+ xwl_tablet_pad = calloc(sizeof *xwl_tablet_pad, 1);
+ if (xwl_tablet_pad == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ xwl_tablet_pad->pad = pad;
+ xwl_tablet_pad->seat = xwl_seat;
+
+ xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads);
+}
+
+static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
+ tablet_seat_handle_add_tablet,
+ tablet_seat_handle_add_tool,
+ tablet_seat_handle_add_pad
+};
+
+static void
init_tablet_manager_seat(struct xwl_screen *xwl_screen,
struct xwl_seat *xwl_seat)
{
@@ -1200,11 +1263,42 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen,
xwl_seat->tablet_seat =
zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager,
xwl_seat->seat);
+
+ xorg_list_init(&xwl_seat->tablets);
+ xorg_list_init(&xwl_seat->tablet_tools);
+ xorg_list_init(&xwl_seat->tablet_pads);
+
+ zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat);
}
static void
release_tablet_manager_seat(struct xwl_seat *xwl_seat)
{
+ struct xwl_tablet *xwl_tablet, *next_xwl_tablet;
+ struct xwl_tablet_tool *xwl_tablet_tool, *next_xwl_tablet_tool;
+ struct xwl_tablet_pad *xwl_tablet_pad, *next_xwl_tablet_pad;
+
+ xorg_list_for_each_entry_safe(xwl_tablet_pad, next_xwl_tablet_pad,
+ &xwl_seat->tablet_pads, link) {
+ xorg_list_del(&xwl_tablet_pad->link);
+ zwp_tablet_pad_v2_destroy(xwl_tablet_pad->pad);
+ free(xwl_tablet_pad);
+ }
+
+ xorg_list_for_each_entry_safe(xwl_tablet_tool, next_xwl_tablet_tool,
+ &xwl_seat->tablet_tools, link) {
+ xorg_list_del(&xwl_tablet_tool->link);
+ zwp_tablet_tool_v2_destroy(xwl_tablet_tool->tool);
+ free(xwl_tablet_tool);
+ }
+
+ xorg_list_for_each_entry_safe(xwl_tablet, next_xwl_tablet,
+ &xwl_seat->tablets, link) {
+ xorg_list_del(&xwl_tablet->link);
+ zwp_tablet_v2_destroy(xwl_tablet->tablet);
+ free(xwl_tablet);
+ }
+
if (xwl_seat->tablet_seat) {
zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat);
xwl_seat->tablet_seat = NULL;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 2752d731c..a7f30b3c8 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -174,6 +174,28 @@ struct xwl_seat {
double dx_unaccel;
double dy_unaccel;
} pending_pointer_event;
+
+ struct xorg_list tablets;
+ struct xorg_list tablet_tools;
+ struct xorg_list tablet_pads;
+};
+
+struct xwl_tablet {
+ struct xorg_list link;
+ struct zwp_tablet_v2 *tablet;
+ struct xwl_seat *seat;
+};
+
+struct xwl_tablet_tool {
+ struct xorg_list link;
+ struct zwp_tablet_tool_v2 *tool;
+ struct xwl_seat *seat;
+};
+
+struct xwl_tablet_pad {
+ struct xorg_list link;
+ struct zwp_tablet_pad_v2 *pad;
+ struct xwl_seat *seat;
};
struct xwl_output {
--
2.13.5

187
SOURCES/0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch

@ -0,0 +1,187 @@ @@ -0,0 +1,187 @@
From 2a798845c62f54c921d6fad7fa7fab596dc7e11b Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Thu, 26 Oct 2017 15:24:39 -0400
Subject: [PATCH xserver 4/6] animcur: Run the timer from the device, not the
screen

This is very slightly more efficient since the callback now doesn't need
to walk every input device, instead we know exactly which device's
cursor is being updated. AnimCurTimerNotify() gets outdented nicely as a
result. A more important side effect is that we can stop using the
TimerAbsolute mode and just pass in the relative delay.

In AnimCurSetCursorPosition, we no longer need to rearm the timer with
the new screen; it is enough to update the device's state. In
AnimCurDisplayCursor we need to notice when we're switching from
animated cursor to regular and cancel the existing timer.

Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 094a63d56fbfb9e23210cc9ac538fb198af37cee)
---
render/animcur.c | 85 +++++++++++++++++++-------------------------------------
1 file changed, 28 insertions(+), 57 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index 26a6026ae..9393b4018 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -55,6 +55,7 @@ typedef struct _AnimCurElt {
typedef struct _AnimCur {
int nelt; /* number of elements in the elts array */
AnimCurElt *elts; /* actually allocated right after the structure */
+ OsTimerPtr timer;
} AnimCurRec, *AnimCurPtr;

typedef struct _AnimScrPriv {
@@ -65,8 +66,6 @@ typedef struct _AnimScrPriv {
RealizeCursorProcPtr RealizeCursor;
UnrealizeCursorProcPtr UnrealizeCursor;
RecolorCursorProcPtr RecolorCursor;
- OsTimerPtr timer;
- Bool timer_set;
} AnimCurScreenRec, *AnimCurScreenPtr;

static unsigned char empty[4];
@@ -130,49 +129,27 @@ AnimCurCursorLimits(DeviceIntPtr pDev,
static CARD32
AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
{
- ScreenPtr pScreen = arg;
+ DeviceIntPtr dev = arg;
+ ScreenPtr pScreen = dev->spriteInfo->anim.pScreen;
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- DeviceIntPtr dev;
- Bool activeDevice = FALSE;
- CARD32 soonest = ~0; /* earliest time to wakeup again */

- for (dev = inputInfo.devices; dev; dev = dev->next) {
- if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) {
- if (!activeDevice)
- activeDevice = TRUE;
+ AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
+ int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
+ DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor;

- if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) {
- AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
- int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
- DisplayCursorProcPtr DisplayCursor;
+ /*
+ * Not a simple Unwrap/Wrap as this isn't called along the DisplayCursor
+ * wrapper chain.
+ */
+ pScreen->DisplayCursor = as->DisplayCursor;
+ (void) (*pScreen->DisplayCursor) (dev, pScreen, ac->elts[elt].pCursor);
+ as->DisplayCursor = pScreen->DisplayCursor;
+ pScreen->DisplayCursor = DisplayCursor;

- /*
- * Not a simple Unwrap/Wrap as this
- * isn't called along the DisplayCursor
- * wrapper chain.
- */
- DisplayCursor = pScreen->DisplayCursor;
- pScreen->DisplayCursor = as->DisplayCursor;
- (void) (*pScreen->DisplayCursor) (dev,
- pScreen,
- ac->elts[elt].pCursor);
- as->DisplayCursor = pScreen->DisplayCursor;
- pScreen->DisplayCursor = DisplayCursor;
+ dev->spriteInfo->anim.elt = elt;
+ dev->spriteInfo->anim.time = now + ac->elts[elt].delay;

- dev->spriteInfo->anim.elt = elt;
- dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
- }
-
- if (soonest > dev->spriteInfo->anim.time)
- soonest = dev->spriteInfo->anim.time;
- }
- }
-
- if (activeDevice)
- return soonest - now;
-
- as->timer_set = FALSE;
- return 0;
+ return ac->elts[elt].delay;
}

static Bool
@@ -198,17 +175,19 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
pDev->spriteInfo->anim.pCursor = pCursor;
pDev->spriteInfo->anim.pScreen = pScreen;

- if (!as->timer_set) {
- TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time,
- AnimCurTimerNotify, pScreen);
- as->timer_set = TRUE;
- }
+ ac->timer = TimerSet(ac->timer, 0, ac->elts[0].delay,
+ AnimCurTimerNotify, pDev);
}
}
else
ret = TRUE;
}
else {
+ CursorPtr old = pDev->spriteInfo->anim.pCursor;
+
+ if (old && IsAnimCur(old))
+ TimerCancel(GetAnimCur(old)->timer);
+
pDev->spriteInfo->anim.pCursor = 0;
pDev->spriteInfo->anim.pScreen = 0;
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
@@ -227,12 +206,6 @@ AnimCurSetCursorPosition(DeviceIntPtr pDev,
Unwrap(as, pScreen, SetCursorPosition);
if (pDev->spriteInfo->anim.pCursor) {
pDev->spriteInfo->anim.pScreen = pScreen;
-
- if (!as->timer_set) {
- TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time,
- AnimCurTimerNotify, pScreen);
- as->timer_set = TRUE;
- }
}
ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
@@ -307,11 +280,6 @@ AnimCurInit(ScreenPtr pScreen)
return FALSE;

as = GetAnimCurScreen(pScreen);
- as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen);
- if (!as->timer) {
- return FALSE;
- }
- as->timer_set = FALSE;

Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);

@@ -359,10 +327,14 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,

pCursor->id = cid;

+ ac = GetAnimCur(pCursor);
+ ac->timer = TimerSet(NULL, 0, 0, AnimCurTimerNotify, NULL);
+
/* security creation/labeling check */
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
RT_NONE, NULL, DixCreateAccess);
if (rc != Success) {
+ TimerFree(ac->timer);
dixFiniPrivates(pCursor, PRIVATE_CURSOR);
free(pCursor);
return rc;
@@ -372,7 +344,6 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
* Fill in the AnimCurRec
*/
animCursorBits.refcnt++;
- ac = GetAnimCur(pCursor);
ac->nelt = ncursor;
ac->elts = (AnimCurElt *) (ac + 1);

--
2.14.3

211
SOURCES/0004-xwayland-Handle-wp_tablet-events.patch

@ -0,0 +1,211 @@ @@ -0,0 +1,211 @@
From 591b08b3311c5217969a8ceb3ed58b58fabc4891 Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 15 Jan 2016 17:01:38 -0800
Subject: [PATCH xserver 04/12] xwayland: Handle wp_tablet events

Creates and maintains the canonical trio of X devices (stylus, eraser,
and cursor) to be shared by all connected tablets. A per-tablet trio
could be created instead, but there are very few benefits to such a
configuration since all tablets still ultimately share control of a
single master pointer.

The three X devices are modeled after those created by xf86-input-wacom
but use a generic maximum X and Y that should be large enough to
accurately represent values from even the largest currently-available
tablets.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 5812d1c28f4fb7b7de8b96a81415a21425561fd4)
---
hw/xwayland/xwayland-input.c | 142 +++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.h | 3 +
2 files changed, 145 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index d5d12933c..64655de5f 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -294,6 +294,75 @@ xwl_touch_proc(DeviceIntPtr device, int what)
#undef NTOUCHPOINTS
}
+static int
+xwl_tablet_proc(DeviceIntPtr device, int what)
+{
+#define NBUTTONS 9
+#define NAXES 6
+ Atom btn_labels[NBUTTONS] = { 0 };
+ Atom axes_labels[NAXES] = { 0 };
+ BYTE map[NBUTTONS + 1] = { 0 };
+ int i;
+
+ switch (what) {
+ case DEVICE_INIT:
+ device->public.on = FALSE;
+
+ for (i = 1; i <= NBUTTONS; i++)
+ map[i] = i;
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
+ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
+ axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X);
+ axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y);
+ axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL);
+
+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels,
+ GetMotionHistorySize(), Absolute))
+ return BadValue;
+
+ /* Valuators - match the xf86-input-wacom ranges */
+ InitValuatorAxisStruct(device, 0, axes_labels[0],
+ 0, 262143, 10000, 0, 10000, Absolute);
+ InitValuatorAxisStruct(device, 1, axes_labels[1],
+ 0, 262143, 10000, 0, 10000, Absolute);
+ /* pressure */
+ InitValuatorAxisStruct(device, 2, axes_labels[2],
+ 0, 65535, 1, 0, 1, Absolute);
+ /* tilt x */
+ InitValuatorAxisStruct(device, 3, axes_labels[3],
+ -64, 63, 57, 0, 57, Absolute);
+ /* tilt y */
+ InitValuatorAxisStruct(device, 4, axes_labels[4],
+ -64, 63, 57, 0, 57, Absolute);
+ /* abs wheel (airbrush) or rotation (artpen) */
+ InitValuatorAxisStruct(device, 5, axes_labels[5],
+ -900, 899, 1, 0, 1, Absolute);
+
+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control))
+ return BadValue;
+
+ if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map))
+ return BadValue;
+
+ return Success;
+
+ case DEVICE_ON:
+ device->public.on = TRUE;
+ return Success;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ device->public.on = FALSE;
+ return Success;
+ }
+
+ return BadMatch;
+#undef NAXES
+#undef NBUTTONS
+}
+
static void
pointer_handle_enter(void *data, struct wl_pointer *pointer,
uint32_t serial, struct wl_surface *surface,
@@ -1189,6 +1258,77 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
free(xwl_seat);
}
+static void
+tablet_handle_name(void *data, struct zwp_tablet_v2 *tablet, const char *name)
+{
+}
+
+static void
+tablet_handle_id(void *data, struct zwp_tablet_v2 *tablet, uint32_t vid,
+ uint32_t pid)
+{
+}
+
+static void
+tablet_handle_path(void *data, struct zwp_tablet_v2 *tablet, const char *path)
+{
+}
+
+static void
+tablet_handle_done(void *data, struct zwp_tablet_v2 *tablet)
+{
+ struct xwl_tablet *xwl_tablet = data;
+ struct xwl_seat *xwl_seat = xwl_tablet->seat;
+
+ if (xwl_seat->stylus == NULL) {
+ xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", xwl_tablet_proc);
+ ActivateDevice(xwl_seat->stylus, TRUE);
+ }
+ EnableDevice(xwl_seat->stylus, TRUE);
+
+ if (xwl_seat->eraser == NULL) {
+ xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", xwl_tablet_proc);
+ ActivateDevice(xwl_seat->eraser, TRUE);
+ }
+ EnableDevice(xwl_seat->eraser, TRUE);
+
+ if (xwl_seat->puck == NULL) {
+ xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", xwl_tablet_proc);
+ ActivateDevice(xwl_seat->puck, TRUE);
+ }
+ EnableDevice(xwl_seat->puck, TRUE);
+}
+
+static void
+tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet)
+{
+ struct xwl_tablet *xwl_tablet = data;
+ struct xwl_seat *xwl_seat = xwl_tablet->seat;
+
+ xorg_list_del(&xwl_tablet->link);
+
+ /* The tablet is merely disabled, not removed. The next tablet
+ will re-use the same X devices */
+ if (xorg_list_is_empty(&xwl_seat->tablets)) {
+ if (xwl_seat->stylus)
+ DisableDevice(xwl_seat->stylus, TRUE);
+ if (xwl_seat->eraser)
+ DisableDevice(xwl_seat->eraser, TRUE);
+ if (xwl_seat->puck)
+ DisableDevice(xwl_seat->puck, TRUE);
+ }
+
+ zwp_tablet_v2_destroy(tablet);
+ free(xwl_tablet);
+}
+
+static const struct zwp_tablet_v2_listener tablet_listener = {
+ tablet_handle_name,
+ tablet_handle_id,
+ tablet_handle_path,
+ tablet_handle_done,
+ tablet_handle_removed
+};
static void
tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
@@ -1207,6 +1347,8 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat
xwl_tablet->seat = xwl_seat;
xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets);
+
+ zwp_tablet_v2_add_listener(tablet, &tablet_listener, xwl_tablet);
}
static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index a7f30b3c8..e7e62882b 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -132,6 +132,9 @@ struct xwl_seat {
DeviceIntPtr relative_pointer;
DeviceIntPtr keyboard;
DeviceIntPtr touch;
+ DeviceIntPtr stylus;
+ DeviceIntPtr eraser;
+ DeviceIntPtr puck;
struct xwl_screen *xwl_screen;
struct wl_seat *seat;
struct wl_pointer *wl_pointer;
--
2.13.5

77
SOURCES/0005-animcur-Fix-transitions-between-animated-cursors.patch

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
From a8f8ecdde495fb2a6ecdeca306b55c22b5fd3a6d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 9 Jan 2018 10:54:05 -0500
Subject: [PATCH xserver 5/6] animcur: Fix transitions between animated cursors

We weren't cancelling the old timer when changing cursors, making things
go all crashy. Logically we could always cancel the timer first, but
then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis
is potentially expensive.

Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit de60245e05c0d2528d4ff42557a044387e53315c)
---
render/animcur.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index 9393b4018..e585a8f23 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -152,11 +152,20 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
return ac->elts[elt].delay;
}

+static void
+AnimCurCancelTimer(DeviceIntPtr pDev)
+{
+ CursorPtr cur = pDev->spriteInfo->anim.pCursor;
+
+ if (IsAnimCur(cur))
+ TimerCancel(GetAnimCur(cur)->timer);
+}
+
static Bool
AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
- Bool ret;
+ Bool ret = TRUE;

if (IsFloating(pDev))
return FALSE;
@@ -166,8 +175,10 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
if (pCursor != pDev->spriteInfo->anim.pCursor) {
AnimCurPtr ac = GetAnimCur(pCursor);

- ret = (*pScreen->DisplayCursor)
- (pDev, pScreen, ac->elts[0].pCursor);
+ AnimCurCancelTimer(pDev);
+ ret = (*pScreen->DisplayCursor) (pDev, pScreen,
+ ac->elts[0].pCursor);
+
if (ret) {
pDev->spriteInfo->anim.elt = 0;
pDev->spriteInfo->anim.time =
@@ -179,15 +190,9 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
AnimCurTimerNotify, pDev);
}
}
- else
- ret = TRUE;
}
else {
- CursorPtr old = pDev->spriteInfo->anim.pCursor;
-
- if (old && IsAnimCur(old))
- TimerCancel(GetAnimCur(old)->timer);
-
+ AnimCurCancelTimer(pDev);
pDev->spriteInfo->anim.pCursor = 0;
pDev->spriteInfo->anim.pScreen = 0;
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
--
2.14.3

374
SOURCES/0005-xwayland-Handle-tablet_tool-events.patch

@ -0,0 +1,374 @@ @@ -0,0 +1,374 @@
From 4354336014ca0c29270a6cdf83e9f9e5fe16080e Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 14 Oct 2016 14:31:46 -0700
Subject: [PATCH xserver 05/12] xwayland: Handle tablet_tool events

Translates Wayland tablet events into corresponding X11 tablet events. As
with the prior commit, these events are modeled after those created by the
xf86-input-wacom driver to maximize compatibility with existing applications.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 8a1defcc634daddbb3570519d69ec5c9e39a8b56)
---
hw/xwayland/xwayland-input.c | 313 +++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.h | 9 ++
2 files changed, 322 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 64655de5f..142862f7e 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1331,6 +1331,317 @@ static const struct zwp_tablet_v2_listener tablet_listener = {
};
static void
+tablet_tool_receive_type(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t type)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ switch (type) {
+ case ZWP_TABLET_TOOL_V2_TYPE_ERASER:
+ xwl_tablet_tool->xdevice = xwl_seat->eraser;
+ break;
+ case ZWP_TABLET_TOOL_V2_TYPE_MOUSE:
+ case ZWP_TABLET_TOOL_V2_TYPE_LENS:
+ xwl_tablet_tool->xdevice = xwl_seat->puck;
+ break;
+ default:
+ xwl_tablet_tool->xdevice = xwl_seat->stylus;
+ break;
+ }
+}
+
+static void
+tablet_tool_receive_hardware_serial(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t hi, uint32_t low)
+{
+}
+
+static void
+tablet_tool_receive_hardware_id_wacom(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t hi, uint32_t low)
+{
+}
+
+static void
+tablet_tool_receive_capability(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t capability)
+{
+}
+
+static void
+tablet_tool_receive_done(void *data, struct zwp_tablet_tool_v2 *tool)
+{
+}
+
+static void
+tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+
+ xorg_list_del(&xwl_tablet_tool->link);
+ zwp_tablet_tool_v2_destroy(tool);
+ free(xwl_tablet_tool);
+}
+
+static void
+tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t serial, struct zwp_tablet_v2 *tablet,
+ struct wl_surface *wl_surface)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ /* There's a race here where if we create and then immediately
+ * destroy a surface, we might end up in a state where the Wayland
+ * compositor sends us an event for a surface that doesn't exist.
+ *
+ * Don't process enter events in this case.
+ *
+ * see pointer_handle_enter()
+ */
+ if (wl_surface == NULL)
+ return;
+
+ xwl_seat->focus_window = wl_surface_get_user_data(wl_surface);
+}
+
+static void
+tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ xwl_seat->focus_window = NULL;
+
+ xwl_tablet_tool->pressure = 0;
+ xwl_tablet_tool->tilt_x = 0;
+ xwl_tablet_tool->tilt_y = 0;
+ xwl_tablet_tool->rotation = 0;
+ xwl_tablet_tool->slider = 0;
+}
+
+static void
+tablet_tool_down(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ ValuatorMask mask;
+
+ xwl_seat->xwl_screen->serial = serial;
+
+ valuator_mask_zero(&mask);
+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonPress, 1, 0, &mask);
+}
+
+static void
+tablet_tool_up(void *data, struct zwp_tablet_tool_v2 *tool)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonRelease, 1, 0, &mask);
+}
+
+static void
+tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool,
+ wl_fixed_t x, wl_fixed_t y)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ int32_t dx, dy;
+ int sx = wl_fixed_to_int(x);
+ int sy = wl_fixed_to_int(y);
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ dx = xwl_seat->focus_window->window->drawable.x;
+ dy = xwl_seat->focus_window->window->drawable.y;
+
+ xwl_tablet_tool->x = dx + sx;
+ xwl_tablet_tool->y = dy + sy;
+}
+
+static void
+tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t pressure)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ /* normalized to 65535 already */
+ xwl_tablet_tool->pressure = pressure;
+}
+
+static void
+tablet_tool_distance(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t distance_raw)
+{
+}
+
+static void
+tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool,
+ wl_fixed_t tilt_x, wl_fixed_t tilt_y)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x);
+ xwl_tablet_tool->tilt_y = wl_fixed_to_double(tilt_y);
+}
+
+static void
+tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool,
+ wl_fixed_t angle)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ double rotation = wl_fixed_to_double(angle);
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ /* change origin (buttons facing right [libinput +90 degrees]) and
+ * scaling (5 points per degree) to match wacom driver behavior
+ */
+ rotation = remainderf(rotation + 90.0f, 360.0f);
+ rotation *= 5.0f;
+ xwl_tablet_tool->rotation = rotation;
+}
+
+static void
+tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool,
+ int32_t position_raw)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ float position = position_raw / 65535.0;
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f;
+}
+
+static void
+tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool,
+ wl_fixed_t degrees, int32_t clicks)
+{
+}
+
+static void
+tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
+ uint32_t serial, uint32_t button, uint32_t state)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ int xbtn = 0;
+ ValuatorMask mask;
+
+ /* BTN_0 .. BTN_9 */
+ if (button >= 0x100 && button <= 0x109) {
+ xbtn = button - 0x100 + 1;
+ }
+ /* BTN_A .. BTN_Z */
+ else if (button >= 0x130 && button <= 0x135) {
+ xbtn = button - 0x130 + 10;
+ }
+ /* BTN_BASE .. BTN_BASE6 */
+ else if (button >= 0x126 && button <= 0x12b) {
+ xbtn = button - 0x126 + 16;
+ }
+ else {
+ switch (button) {
+ case 0x110: /* BTN_LEFT */
+ case 0x14a: /* BTN_TOUCH */
+ xbtn = 1;
+ break;
+
+ case 0x112: /* BTN_MIDDLE */
+ case 0x14b: /* BTN_STYLUS */
+ xbtn = 2;
+ break;
+
+ case 0x111: /* BTN_RIGHT */
+ case 0x14c: /* BTN_STYLUS2 */
+ xbtn = 3;
+ break;
+
+ case 0x113: /* BTN_SIDE */
+ case 0x116: /* BTN_BACK */
+ xbtn = 8;
+ break;
+
+ case 0x114: /* BTN_EXTRA */
+ case 0x115: /* BTN_FORWARD */
+ xbtn = 9;
+ break;
+ }
+ }
+
+ if (!xbtn) {
+ ErrorF("unknown tablet button number %d\n", button);
+ return;
+ }
+
+ xwl_seat->xwl_screen->serial = serial;
+
+ valuator_mask_zero(&mask);
+ QueuePointerEvents(xwl_tablet_tool->xdevice,
+ state ? ButtonPress : ButtonRelease, xbtn, 0, &mask);
+}
+
+static void
+tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ valuator_mask_set(&mask, 0, xwl_tablet_tool->x);
+ valuator_mask_set(&mask, 1, xwl_tablet_tool->y);
+ valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure);
+ valuator_mask_set(&mask, 3, xwl_tablet_tool->tilt_x);
+ valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y);
+ valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider);
+
+ /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if
+ changed */
+ QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+}
+
+static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
+ tablet_tool_receive_type,
+ tablet_tool_receive_hardware_serial,
+ tablet_tool_receive_hardware_id_wacom,
+ tablet_tool_receive_capability,
+ tablet_tool_receive_done,
+ tablet_tool_receive_removed,
+ tablet_tool_proximity_in,
+ tablet_tool_proximity_out,
+ tablet_tool_down,
+ tablet_tool_up,
+ tablet_tool_motion,
+ tablet_tool_pressure,
+ tablet_tool_distance,
+ tablet_tool_tilt,
+ tablet_tool_rotation,
+ tablet_tool_slider,
+ tablet_tool_wheel,
+ tablet_tool_button_state,
+ tablet_tool_frame
+};
+
+static void
tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
struct zwp_tablet_v2 *tablet)
{
@@ -1368,6 +1679,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
xwl_tablet_tool->seat = xwl_seat;
xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools);
+
+ zwp_tablet_tool_v2_add_listener(tool, &tablet_tool_listener, xwl_tablet_tool);
}
static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index e7e62882b..fb9ac4804 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -193,6 +193,15 @@ struct xwl_tablet_tool {
struct xorg_list link;
struct zwp_tablet_tool_v2 *tool;
struct xwl_seat *seat;
+
+ DeviceIntPtr xdevice;
+ uint32_t x;
+ uint32_t y;
+ uint32_t pressure;
+ float tilt_x;
+ float tilt_y;
+ float rotation;
+ float slider;
};
struct xwl_tablet_pad {
--
2.13.5

78
SOURCES/0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
From b8e4a6a4b78946e2155e0413ce396d587ab35a66 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Fri, 9 Feb 2018 16:03:38 -0500
Subject: [PATCH xserver 6/6] animcur: Change which CursorPtr we save in
external state

Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
NULL if not animated). That value would also be available in
spriteInfo->sprite->current, so instead lets use anim.pCursor to point
to the current animation element.

(Also: having done this, look that one up from the XFixes requests)

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit e4edcaca33d3b23f612d5a91a93f52770d8fab3e)
---
render/animcur.c | 7 ++++---
xfixes/cursor.c | 5 ++++-
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index e585a8f23..50e254d01 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
ScreenPtr pScreen = dev->spriteInfo->anim.pScreen;
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);

- AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
+ AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current);
int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor;

@@ -148,6 +148,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)

dev->spriteInfo->anim.elt = elt;
dev->spriteInfo->anim.time = now + ac->elts[elt].delay;
+ dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor;

return ac->elts[elt].delay;
}
@@ -155,7 +156,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
static void
AnimCurCancelTimer(DeviceIntPtr pDev)
{
- CursorPtr cur = pDev->spriteInfo->anim.pCursor;
+ CursorPtr cur = pDev->spriteInfo->sprite->current;

if (IsAnimCur(cur))
TimerCancel(GetAnimCur(cur)->timer);
@@ -172,7 +173,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)

Unwrap(as, pScreen, DisplayCursor);
if (IsAnimCur(pCursor)) {
- if (pCursor != pDev->spriteInfo->anim.pCursor) {
+ if (pCursor != pDev->spriteInfo->sprite->current) {
AnimCurPtr ac = GetAnimCur(pCursor);

AnimCurCancelTimer(pDev);
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index a150f450b..a1fbd562e 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -134,8 +134,11 @@ Bool EnableCursor = TRUE;
static CursorPtr
CursorForDevice(DeviceIntPtr pDev)
{
- if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) {
+ if (pDev->spriteInfo->anim.pCursor)
+ return pDev->spriteInfo->anim.pCursor;
return pDev->spriteInfo->sprite->current;
+ }

return NULL;
}
--
2.14.3

121
SOURCES/0006-xwayland-handle-button-events-after-motion-events.patch

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
From 317ce1201a2ec848f9066294ea544b756f735385 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 7 Feb 2017 12:23:46 +1000
Subject: [PATCH xserver 06/12] xwayland: handle button events after motion
events

Make sure the button events are sent after the motion events into the new
position.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 773b04748d0c839bc8b12e33f74bb8d11c447f5b)
---
hw/xwayland/xwayland-input.c | 44 +++++++++++++++++++++++++++++++++++++-------
hw/xwayland/xwayland.h | 3 +++
2 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 142862f7e..50da10839 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -34,6 +34,7 @@
#include <inpututils.h>
#include <mipointer.h>
#include <mipointrst.h>
+#include <misc.h>
#include "tablet-unstable-v2-client-protocol.h"
/* Copied from mipointer.c */
@@ -1543,8 +1544,8 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
{
struct xwl_tablet_tool *xwl_tablet_tool = data;
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ uint32_t *mask = &xwl_tablet_tool->buttons_now;
int xbtn = 0;
- ValuatorMask mask;
/* BTN_0 .. BTN_9 */
if (button >= 0x100 && button <= 0x109) {
@@ -1592,11 +1593,14 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
return;
}
- xwl_seat->xwl_screen->serial = serial;
+ BUG_RETURN(xbtn >= 8 * sizeof(*mask));
- valuator_mask_zero(&mask);
- QueuePointerEvents(xwl_tablet_tool->xdevice,
- state ? ButtonPress : ButtonRelease, xbtn, 0, &mask);
+ if (state)
+ SetBit(mask, xbtn);
+ else
+ ClearBit(mask, xbtn);
+
+ xwl_seat->xwl_screen->serial = serial;
}
static void
@@ -1604,6 +1608,8 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time)
{
struct xwl_tablet_tool *xwl_tablet_tool = data;
ValuatorMask mask;
+ uint32_t released, pressed, diff;
+ int button;
valuator_mask_zero(&mask);
valuator_mask_set(&mask, 0, xwl_tablet_tool->x);
@@ -1613,10 +1619,34 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time)
valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y);
valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider);
- /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if
- changed */
QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+
+ valuator_mask_zero(&mask);
+
+ diff = xwl_tablet_tool->buttons_prev ^ xwl_tablet_tool->buttons_now;
+ released = diff & ~xwl_tablet_tool->buttons_now;
+ pressed = diff & xwl_tablet_tool->buttons_now;
+
+ button = 1;
+ while (released) {
+ if (released & 0x1)
+ QueuePointerEvents(xwl_tablet_tool->xdevice,
+ ButtonRelease, button, 0, &mask);
+ button++;
+ released >>= 1;
+ }
+
+ button = 1;
+ while (pressed) {
+ if (pressed & 0x1)
+ QueuePointerEvents(xwl_tablet_tool->xdevice,
+ ButtonPress, button, 0, &mask);
+ button++;
+ pressed >>= 1;
+ }
+
+ xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now;
}
static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index fb9ac4804..bb119dad7 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -202,6 +202,9 @@ struct xwl_tablet_tool {
float tilt_y;
float rotation;
float slider;
+
+ uint32_t buttons_now,
+ buttons_prev;
};
struct xwl_tablet_pad {
--
2.13.5

213
SOURCES/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch

@ -0,0 +1,213 @@ @@ -0,0 +1,213 @@
From 94a88b752a9373656bb0f62897513c8f5e552127 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 4 Nov 2016 19:36:10 +0100
Subject: [PATCH xserver 07/12] xwayland: Refactor cursor management into
xwl_cursor

This struct takes away the cursor info in xwl_seat, and has
an update function so we can share the frame handling code
across several xwl_cursors.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 6d1ad39fe6c18220dd39b0653fd1e4145140e2dc)
---
hw/xwayland/xwayland-cursor.c | 39 ++++++++++++++++++++-------------------
hw/xwayland/xwayland-input.c | 38 +++++++++++++++++++++++++++++++-------
hw/xwayland/xwayland.h | 11 ++++++++---
3 files changed, 59 insertions(+), 29 deletions(-)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index f334f1ca5..fdae3ce85 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -96,11 +96,11 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
}
static void
-clear_cursor_frame_callback(struct xwl_seat *xwl_seat)
+clear_cursor_frame_callback(struct xwl_cursor *xwl_cursor)
{
- if (xwl_seat->cursor_frame_cb) {
- wl_callback_destroy (xwl_seat->cursor_frame_cb);
- xwl_seat->cursor_frame_cb = NULL;
+ if (xwl_cursor->frame_cb) {
+ wl_callback_destroy (xwl_cursor->frame_cb);
+ xwl_cursor->frame_cb = NULL;
}
}
@@ -109,12 +109,12 @@ frame_callback(void *data,
struct wl_callback *callback,
uint32_t time)
{
- struct xwl_seat *xwl_seat = data;
+ struct xwl_cursor *xwl_cursor = data;
- clear_cursor_frame_callback(xwl_seat);
- if (xwl_seat->cursor_needs_update) {
- xwl_seat->cursor_needs_update = FALSE;
- xwl_seat_set_cursor(xwl_seat);
+ clear_cursor_frame_callback(xwl_cursor);
+ if (xwl_cursor->needs_update) {
+ xwl_cursor->needs_update = FALSE;
+ xwl_cursor->update_proc(xwl_cursor);
}
}
@@ -125,6 +125,7 @@ static const struct wl_callback_listener frame_listener = {
void
xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
{
+ struct xwl_cursor *xwl_cursor = &xwl_seat->cursor;
PixmapPtr pixmap;
CursorPtr cursor;
int stride;
@@ -135,13 +136,13 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
if (!xwl_seat->x_cursor) {
wl_pointer_set_cursor(xwl_seat->wl_pointer,
xwl_seat->pointer_enter_serial, NULL, 0, 0);
- clear_cursor_frame_callback(xwl_seat);
- xwl_seat->cursor_needs_update = FALSE;
+ clear_cursor_frame_callback(xwl_cursor);
+ xwl_cursor->needs_update = FALSE;
return;
}
- if (xwl_seat->cursor_frame_cb) {
- xwl_seat->cursor_needs_update = TRUE;
+ if (xwl_cursor->frame_cb) {
+ xwl_cursor->needs_update = TRUE;
return;
}
@@ -159,19 +160,19 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
wl_pointer_set_cursor(xwl_seat->wl_pointer,
xwl_seat->pointer_enter_serial,
- xwl_seat->cursor,
+ xwl_cursor->surface,
xwl_seat->x_cursor->bits->xhot,
xwl_seat->x_cursor->bits->yhot);
- wl_surface_attach(xwl_seat->cursor,
+ wl_surface_attach(xwl_cursor->surface,
xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0);
- wl_surface_damage(xwl_seat->cursor, 0, 0,
+ wl_surface_damage(xwl_cursor->surface, 0, 0,
xwl_seat->x_cursor->bits->width,
xwl_seat->x_cursor->bits->height);
- xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor);
- wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat);
+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface);
+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor);
- wl_surface_commit(xwl_seat->cursor);
+ wl_surface_commit(xwl_cursor->surface);
}
static void
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 50da10839..bb520e891 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -424,9 +424,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
* of our surfaces might not have been shown. In that case we'll
* have a cursor surface frame callback pending which we need to
* clear so that we can continue submitting new cursor frames. */
- if (xwl_seat->cursor_frame_cb) {
- wl_callback_destroy(xwl_seat->cursor_frame_cb);
- xwl_seat->cursor_frame_cb = NULL;
+ if (xwl_seat->cursor.frame_cb) {
+ wl_callback_destroy(xwl_seat->cursor.frame_cb);
+ xwl_seat->cursor.frame_cb = NULL;
xwl_seat_set_cursor(xwl_seat);
}
@@ -1203,6 +1203,31 @@ static const struct wl_seat_listener seat_listener = {
};
static void
+xwl_cursor_init(struct xwl_cursor *xwl_cursor, struct xwl_screen *xwl_screen,
+ void (* update_proc)(struct xwl_cursor *))
+{
+ xwl_cursor->surface = wl_compositor_create_surface(xwl_screen->compositor);
+ xwl_cursor->update_proc = update_proc;
+ xwl_cursor->frame_cb = NULL;
+ xwl_cursor->needs_update = FALSE;
+}
+
+static void
+xwl_cursor_release(struct xwl_cursor *xwl_cursor)
+{
+ wl_surface_destroy(xwl_cursor->surface);
+ if (xwl_cursor->frame_cb)
+ wl_callback_destroy(xwl_cursor->frame_cb);
+}
+
+static void
+xwl_seat_update_cursor(struct xwl_cursor *xwl_cursor)
+{
+ struct xwl_seat *xwl_seat = wl_container_of(xwl_cursor, xwl_seat, cursor);
+ xwl_seat_set_cursor(xwl_seat);
+}
+
+static void
create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version)
{
struct xwl_seat *xwl_seat;
@@ -1221,7 +1246,8 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version
&wl_seat_interface, min(version, 5));
xwl_seat->id = id;
- xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor);
+ xwl_cursor_init(&xwl_seat->cursor, xwl_seat->xwl_screen,
+ xwl_seat_update_cursor);
wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat);
init_tablet_manager_seat(xwl_screen, xwl_seat);
@@ -1252,9 +1278,7 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
release_tablet_manager_seat(xwl_seat);
wl_seat_destroy(xwl_seat->seat);
- wl_surface_destroy(xwl_seat->cursor);
- if (xwl_seat->cursor_frame_cb)
- wl_callback_destroy(xwl_seat->cursor_frame_cb);
+ xwl_cursor_release(&xwl_seat->cursor);
wl_array_release(&xwl_seat->keys);
free(xwl_seat);
}
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index bb119dad7..bfa5f47c7 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -127,6 +127,13 @@ struct xwl_pointer_warp_emulator {
struct zwp_locked_pointer_v1 *locked_pointer;
};
+struct xwl_cursor {
+ void (* update_proc) (struct xwl_cursor *);
+ struct wl_surface *surface;
+ struct wl_callback *frame_cb;
+ Bool needs_update;
+};
+
struct xwl_seat {
DeviceIntPtr pointer;
DeviceIntPtr relative_pointer;
@@ -148,9 +155,7 @@ struct xwl_seat {
uint32_t pointer_enter_serial;
struct xorg_list link;
CursorPtr x_cursor;
- struct wl_surface *cursor;
- struct wl_callback *cursor_frame_cb;
- Bool cursor_needs_update;
+ struct xwl_cursor cursor;
WindowPtr last_xwindow;
struct xorg_list touches;
--
2.13.5

208
SOURCES/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch

@ -0,0 +1,208 @@ @@ -0,0 +1,208 @@
From 78a4493bc8e60da7b97342660dd1ff6de844e951 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 4 Nov 2016 19:58:04 +0100
Subject: [PATCH xserver 08/12] xwayland: update cursor on tablet tools in
proximity

Each xwl_tablet_tool gets a xwl_cursor, as on wayland each of those
will get an independent cursor that can be set through
zwp_tablet_tool.set_cursor.

However, all tools (and the pointer) share conceptually the same VCP
on Xwayland, so have cursor changes trigger a xwl_cursor update on
every tool (and the pointer, again). Maybe Xwayland could keep track
of the most recent device and only update that cursor to get better
visual results, but this is simpler, and it's going to be odd
anyway...

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit f471b5b8eb451b442554517c7cb6f0aa90d218c4)
---
hw/xwayland/xwayland-cursor.c | 56 +++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland-input.c | 17 +++++++++++++
hw/xwayland/xwayland.h | 5 ++++
3 files changed, 78 insertions(+)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index fdae3ce85..c95f4e830 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -175,11 +175,62 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat)
wl_surface_commit(xwl_cursor->surface);
}
+void
+xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool)
+{
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor;
+ PixmapPtr pixmap;
+ CursorPtr cursor;
+ int stride;
+
+ if (!xwl_seat->x_cursor) {
+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool,
+ xwl_tablet_tool->proximity_in_serial,
+ NULL, 0, 0);
+ return;
+ }
+
+ if (xwl_cursor->frame_cb) {
+ xwl_cursor->needs_update = TRUE;
+ return;
+ }
+
+ cursor = xwl_seat->x_cursor;
+ pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key);
+ if (!pixmap)
+ return;
+
+ stride = cursor->bits->width * 4;
+ if (cursor->bits->argb)
+ memcpy(pixmap->devPrivate.ptr,
+ cursor->bits->argb, cursor->bits->height * stride);
+ else
+ expand_source_and_mask(cursor, pixmap->devPrivate.ptr);
+
+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool,
+ xwl_tablet_tool->proximity_in_serial,
+ xwl_cursor->surface,
+ xwl_seat->x_cursor->bits->xhot,
+ xwl_seat->x_cursor->bits->yhot);
+ wl_surface_attach(xwl_cursor->surface,
+ xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0);
+ wl_surface_damage(xwl_cursor->surface, 0, 0,
+ xwl_seat->x_cursor->bits->width,
+ xwl_seat->x_cursor->bits->height);
+
+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface);
+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor);
+
+ wl_surface_commit(xwl_cursor->surface);
+}
+
static void
xwl_set_cursor(DeviceIntPtr device,
ScreenPtr screen, CursorPtr cursor, int x, int y)
{
struct xwl_seat *xwl_seat;
+ struct xwl_tablet_tool *xwl_tablet_tool;
Bool cursor_visibility_changed;
xwl_seat = device->public.devicePrivate;
@@ -194,6 +245,11 @@ xwl_set_cursor(DeviceIntPtr device,
xwl_seat_cursor_visibility_changed(xwl_seat);
xwl_seat_set_cursor(xwl_seat);
+
+ xorg_list_for_each_entry(xwl_tablet_tool, &xwl_seat->tablet_tools, link) {
+ if (xwl_tablet_tool->proximity_in_serial != 0)
+ xwl_tablet_tool_set_cursor(xwl_tablet_tool);
+ }
}
static void
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index bb520e891..77cd42789 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1405,6 +1405,7 @@ tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool)
struct xwl_tablet_tool *xwl_tablet_tool = data;
xorg_list_del(&xwl_tablet_tool->link);
+ xwl_cursor_release(&xwl_tablet_tool->cursor);
zwp_tablet_tool_v2_destroy(tool);
free(xwl_tablet_tool);
}
@@ -1428,7 +1429,10 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool,
if (wl_surface == NULL)
return;
+ xwl_tablet_tool->proximity_in_serial = serial;
xwl_seat->focus_window = wl_surface_get_user_data(wl_surface);
+
+ xwl_tablet_tool_set_cursor(xwl_tablet_tool);
}
static void
@@ -1437,6 +1441,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool)
struct xwl_tablet_tool *xwl_tablet_tool = data;
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+ xwl_tablet_tool->proximity_in_serial = 0;
xwl_seat->focus_window = NULL;
xwl_tablet_tool->pressure = 0;
@@ -1717,10 +1722,20 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat
}
static void
+xwl_tablet_tool_update_cursor(struct xwl_cursor *xwl_cursor)
+{
+ struct xwl_tablet_tool *xwl_tablet_tool = wl_container_of(xwl_cursor,
+ xwl_tablet_tool,
+ cursor);
+ xwl_tablet_tool_set_cursor(xwl_tablet_tool);
+}
+
+static void
tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
struct zwp_tablet_tool_v2 *tool)
{
struct xwl_seat *xwl_seat = data;
+ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen;
struct xwl_tablet_tool *xwl_tablet_tool;
xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1);
@@ -1731,6 +1746,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
xwl_tablet_tool->tool = tool;
xwl_tablet_tool->seat = xwl_seat;
+ xwl_cursor_init(&xwl_tablet_tool->cursor, xwl_screen,
+ xwl_tablet_tool_update_cursor);
xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index bfa5f47c7..02a218c43 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -44,6 +44,7 @@
#include "relative-pointer-unstable-v1-client-protocol.h"
#include "pointer-constraints-unstable-v1-client-protocol.h"
+#include "tablet-unstable-v2-client-protocol.h"
struct xwl_screen {
int width;
@@ -200,6 +201,7 @@ struct xwl_tablet_tool {
struct xwl_seat *seat;
DeviceIntPtr xdevice;
+ uint32_t proximity_in_serial;
uint32_t x;
uint32_t y;
uint32_t pressure;
@@ -210,6 +212,8 @@ struct xwl_tablet_tool {
uint32_t buttons_now,
buttons_prev;
+
+ struct xwl_cursor cursor;
};
struct xwl_tablet_pad {
@@ -237,6 +241,7 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen);
struct xwl_screen *xwl_screen_get(ScreenPtr screen);
+void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
void xwl_seat_destroy(struct xwl_seat *xwl_seat);
--
2.13.5

511
SOURCES/0009-xwayland-add-tablet-pad-support.patch

@ -0,0 +1,511 @@ @@ -0,0 +1,511 @@
From 6f79f4993d351a891a715e994ab9574542e64b35 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 7 Feb 2017 15:04:46 +1000
Subject: [PATCH xserver 09/12] xwayland: add tablet pad support

Hooked up a bit differently to the other tools. Those tools can be static for
all and be re-used. The wacom driver initializes the pad with the correct
number of buttons though and we can't do this until we have the pad done event.

If the tablet is removed and we plug a different one in, we should initialize
that correctly, so unlike the other tools the pad is properly removed and
re-initialized on plug.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <ping.cheng@wacom.com>
(cherry picked from commit 8475e6360ce31551d50fd63a26f7a44d1e8928f2)
---
hw/xwayland/xwayland-input.c | 417 +++++++++++++++++++++++++++++++++++++++++++
hw/xwayland/xwayland.h | 28 +++
2 files changed, 445 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 77cd42789..8011b965c 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1341,6 +1341,7 @@ tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet)
DisableDevice(xwl_seat->eraser, TRUE);
if (xwl_seat->puck)
DisableDevice(xwl_seat->puck, TRUE);
+ /* pads are removed separately */
}
zwp_tablet_v2_destroy(tablet);
@@ -1701,6 +1702,418 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
};
static void
+tablet_pad_ring_destroy(struct xwl_tablet_pad_ring *ring)
+{
+ zwp_tablet_pad_ring_v2_destroy(ring->ring);
+ xorg_list_del(&ring->link);
+ free(ring);
+}
+
+static void
+tablet_pad_ring_source(void *data,
+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2,
+ uint32_t source)
+{
+}
+
+static void
+tablet_pad_ring_angle(void *data,
+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2,
+ wl_fixed_t degrees)
+{
+ struct xwl_tablet_pad_ring *ring = data;
+ struct xwl_tablet_pad *pad = ring->group->pad;
+ double deg = wl_fixed_to_double(degrees);
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ valuator_mask_set(&mask, 5 + ring->index, deg/360.0 * 71);
+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask);
+}
+
+static void
+tablet_pad_ring_stop(void *data,
+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2)
+{
+}
+
+static void
+tablet_pad_ring_frame(void *data,
+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2,
+ uint32_t time)
+{
+}
+
+static const struct zwp_tablet_pad_ring_v2_listener tablet_pad_ring_listener = {
+ tablet_pad_ring_source,
+ tablet_pad_ring_angle,
+ tablet_pad_ring_stop,
+ tablet_pad_ring_frame,
+};
+
+
+static void
+tablet_pad_strip_destroy(struct xwl_tablet_pad_strip *strip)
+{
+ zwp_tablet_pad_strip_v2_destroy(strip->strip);
+ xorg_list_del(&strip->link);
+ free(strip);
+}
+
+static void
+tablet_pad_strip_source(void *data,
+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2,
+ uint32_t source)
+{
+}
+
+static void
+tablet_pad_strip_position(void *data,
+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2,
+ uint32_t position)
+{
+ struct xwl_tablet_pad_strip *strip = data;
+ struct xwl_tablet_pad *pad = strip->group->pad;
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ valuator_mask_set(&mask, 3 + strip->index, position/65535.0 * 2048);
+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask);
+}
+
+static void
+tablet_pad_strip_stop(void *data,
+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2)
+{
+}
+
+static void
+tablet_pad_strip_frame(void *data,
+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2,
+ uint32_t time)
+{
+}
+
+static const struct zwp_tablet_pad_strip_v2_listener tablet_pad_strip_listener = {
+ tablet_pad_strip_source,
+ tablet_pad_strip_position,
+ tablet_pad_strip_stop,
+ tablet_pad_strip_frame,
+};
+
+static void
+tablet_pad_group_destroy(struct xwl_tablet_pad_group *group)
+{
+ struct xwl_tablet_pad_ring *r, *tr;
+ struct xwl_tablet_pad_strip *s, *ts;
+
+ xorg_list_for_each_entry_safe(r, tr,
+ &group->pad_group_ring_list,
+ link)
+ tablet_pad_ring_destroy(r);
+
+ xorg_list_for_each_entry_safe(s, ts,
+ &group->pad_group_strip_list,
+ link)
+ tablet_pad_strip_destroy(s);
+
+ zwp_tablet_pad_group_v2_destroy(group->group);
+ xorg_list_del(&group->link);
+ free(group);
+}
+
+static void
+tablet_pad_group_buttons(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2,
+ struct wl_array *buttons)
+{
+
+}
+
+static void
+tablet_pad_group_ring(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2,
+ struct zwp_tablet_pad_ring_v2 *wp_ring)
+{
+ static unsigned int ring_index = 0;
+ struct xwl_tablet_pad_group *group = data;
+ struct xwl_tablet_pad_ring *ring;
+
+ ring = calloc(1, sizeof *ring);
+ if (ring == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ ring->index = ring_index++;
+ ring->group = group;
+ ring->ring = wp_ring;
+
+ xorg_list_add(&ring->link, &group->pad_group_ring_list);
+
+ zwp_tablet_pad_ring_v2_add_listener(wp_ring, &tablet_pad_ring_listener,
+ ring);
+}
+
+static void
+tablet_pad_group_strip(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2,
+ struct zwp_tablet_pad_strip_v2 *wp_strip)
+{
+ static unsigned int strip_index = 0;
+ struct xwl_tablet_pad_group *group = data;
+ struct xwl_tablet_pad_strip *strip;
+
+ strip = calloc(1, sizeof *strip);
+ if (strip == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ strip->index = strip_index++;
+ strip->group = group;
+ strip->strip = wp_strip;
+
+ xorg_list_add(&strip->link, &group->pad_group_strip_list);
+
+ zwp_tablet_pad_strip_v2_add_listener(wp_strip, &tablet_pad_strip_listener,
+ strip);
+}
+
+static void
+tablet_pad_group_modes(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2,
+ uint32_t modes)
+{
+
+}
+
+static void
+tablet_pad_group_done(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2)
+{
+
+}
+
+static void
+tablet_pad_group_mode_switch(void *data,
+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2,
+ uint32_t time,
+ uint32_t serial,
+ uint32_t mode)
+{
+
+}
+
+static struct zwp_tablet_pad_group_v2_listener tablet_pad_group_listener = {
+ tablet_pad_group_buttons,
+ tablet_pad_group_ring,
+ tablet_pad_group_strip,
+ tablet_pad_group_modes,
+ tablet_pad_group_done,
+ tablet_pad_group_mode_switch,
+};
+
+static int
+xwl_tablet_pad_proc(DeviceIntPtr device, int what)
+{
+ struct xwl_tablet_pad *pad = device->public.devicePrivate;
+ /* Axis layout mirrors that of xf86-input-wacom to have better
+ compatibility with existing clients */
+#define NAXES 7
+ Atom axes_labels[NAXES] = { 0 };
+ BYTE map[MAX_BUTTONS + 1];
+ int i = 0;
+ Atom btn_labels[MAX_BUTTONS] = { 0 }; /* btn labels are meaningless */
+ int nbuttons;
+
+ switch (what) {
+ case DEVICE_INIT:
+ device->public.on = FALSE;
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
+ /* The others have no good mapping */
+
+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels,
+ GetMotionHistorySize(), Absolute))
+ return BadValue;
+
+ for (i = 1; i <= MAX_BUTTONS; i++)
+ map[i] = i;
+
+ /* We need at least 7 buttons to allow scrolling */
+ nbuttons = min(max(pad->nbuttons + 4, 7), MAX_BUTTONS);
+
+ if (!InitButtonClassDeviceStruct(device, nbuttons,
+ btn_labels, map))
+ return BadValue;
+
+ /* Valuators */
+ InitValuatorAxisStruct(device, 0, axes_labels[0],
+ 0, 100, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(device, 1, axes_labels[1],
+ 0, 100, 1, 0, 1, Absolute);
+ /* Pressure - unused, for backwards compat only */
+ InitValuatorAxisStruct(device, 2, axes_labels[2],
+ 0, 2048, 1, 0, 1, Absolute);
+ /* strip x */
+ InitValuatorAxisStruct(device, 3, axes_labels[3],
+ 0, 2048, 1, 0, 1, Absolute);
+ /* strip y */
+ InitValuatorAxisStruct(device, 4, axes_labels[4],
+ 0, 2048, 1, 0, 1, Absolute);
+ /* ring */
+ InitValuatorAxisStruct(device, 5, axes_labels[5],
+ 0, 71, 1, 0, 1, Absolute);
+ /* ring2 */
+ InitValuatorAxisStruct(device, 6, axes_labels[6],
+ 0, 71, 1, 0, 1, Absolute);
+
+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control))
+ return BadValue;
+
+ return Success;
+
+ case DEVICE_ON:
+ device->public.on = TRUE;
+ return Success;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ device->public.on = FALSE;
+ return Success;
+ }
+
+ return BadMatch;
+#undef NAXES
+}
+
+static void
+tablet_pad_group(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ struct zwp_tablet_pad_group_v2 *pad_group)
+{
+ struct xwl_tablet_pad *pad = data;
+ struct xwl_tablet_pad_group *group;
+
+ group = calloc(1, sizeof *group);
+ if (pad == NULL) {
+ ErrorF("%s ENOMEM\n", __func__);
+ return;
+ }
+
+ group->pad = pad;
+ group->group = pad_group;
+ xorg_list_init(&group->pad_group_ring_list);
+ xorg_list_init(&group->pad_group_strip_list);
+
+ xorg_list_add(&group->link, &pad->pad_group_list);
+
+ zwp_tablet_pad_group_v2_add_listener(pad_group,
+ &tablet_pad_group_listener,
+ group);
+}
+
+static void
+tablet_pad_path(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ const char *path)
+{
+
+}
+
+static void
+tablet_pad_buttons(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ uint32_t buttons)
+{
+ struct xwl_tablet_pad *pad = data;
+
+ pad->nbuttons = buttons;
+}
+
+static void
+tablet_pad_done(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2)
+{
+ struct xwl_tablet_pad *pad = data;
+
+ pad->xdevice = add_device(pad->seat, "xwayland-pad",
+ xwl_tablet_pad_proc);
+ pad->xdevice->public.devicePrivate = pad;
+ ActivateDevice(pad->xdevice, TRUE);
+ EnableDevice(pad->xdevice, TRUE);
+}
+
+static void
+tablet_pad_button(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ uint32_t time,
+ uint32_t button,
+ uint32_t state)
+{
+ struct xwl_tablet_pad *pad = data;
+ ValuatorMask mask;
+
+ button++; /* wayland index vs X's 1-offset */
+ /* skip scroll wheel buttons 4-7 */
+ button = button > 3 ? button + 4 : button;
+
+ valuator_mask_zero(&mask);
+ QueuePointerEvents(pad->xdevice,
+ state ? ButtonPress : ButtonRelease, button, 0, &mask);
+}
+
+static void
+tablet_pad_enter(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ uint32_t serial,
+ struct zwp_tablet_v2 *tablet,
+ struct wl_surface *surface)
+{
+ /* pairs the pad with the tablet but also to set the focus. We
+ * don't care about the pairing and always use X's focus */
+}
+
+static void
+tablet_pad_leave(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2,
+ uint32_t serial,
+ struct wl_surface *surface)
+{
+ /* pairs the pad with the tablet but also to set the focus. We
+ * don't care about the pairing and always use X's focus */
+}
+
+static void
+tablet_pad_removed(void *data,
+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2)
+{
+ struct xwl_tablet_pad *pad = data;
+ struct xwl_tablet_pad_group *g, *tg;
+
+ xorg_list_for_each_entry_safe(g, tg, &pad->pad_group_list, link)
+ tablet_pad_group_destroy(g);
+
+ RemoveDevice(pad->xdevice, TRUE);
+ xorg_list_del(&pad->link);
+ zwp_tablet_pad_v2_destroy(pad->pad);
+ free(pad);
+}
+
+static const struct zwp_tablet_pad_v2_listener tablet_pad_listener = {
+ tablet_pad_group,
+ tablet_pad_path,
+ tablet_pad_buttons,
+ tablet_pad_done,
+ tablet_pad_button,
+ tablet_pad_enter,
+ tablet_pad_leave,
+ tablet_pad_removed,
+};
+
+static void
tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
struct zwp_tablet_v2 *tablet)
{
@@ -1769,8 +2182,12 @@ tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat,
xwl_tablet_pad->pad = pad;
xwl_tablet_pad->seat = xwl_seat;
+ xorg_list_init(&xwl_tablet_pad->pad_group_list);
xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads);
+
+ zwp_tablet_pad_v2_add_listener(pad, &tablet_pad_listener,
+ xwl_tablet_pad);
}
static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 02a218c43..250564f73 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -216,10 +216,38 @@ struct xwl_tablet_tool {
struct xwl_cursor cursor;
};
+struct xwl_tablet_pad_ring {
+ unsigned int index;
+ struct xorg_list link;
+ struct xwl_tablet_pad_group *group;
+ struct zwp_tablet_pad_ring_v2 *ring;
+};
+
+struct xwl_tablet_pad_strip {
+ unsigned int index;
+ struct xorg_list link;
+ struct xwl_tablet_pad_group *group;
+ struct zwp_tablet_pad_strip_v2 *strip;
+};
+
+struct xwl_tablet_pad_group {
+ struct xorg_list link;
+ struct xwl_tablet_pad *pad;
+ struct zwp_tablet_pad_group_v2 *group;
+
+ struct xorg_list pad_group_ring_list;
+ struct xorg_list pad_group_strip_list;
+};
+
struct xwl_tablet_pad {
struct xorg_list link;
struct zwp_tablet_pad_v2 *pad;
struct xwl_seat *seat;
+
+ DeviceIntPtr xdevice;
+
+ unsigned int nbuttons;
+ struct xorg_list pad_group_list;
};
struct xwl_output {
--
2.13.5

74
SOURCES/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
From 81d85fb95d71c0d781328506f1417e7b92c68b97 Mon Sep 17 00:00:00 2001
From: Lyude <lyude@redhat.com>
Date: Thu, 4 May 2017 18:04:31 -0400
Subject: [PATCH xserver 10/12] xwayland: Unconditionally initialize lists in
init_tablet_manager_seat()

In the event that xwayland gets launched on a wayland compositor that
doesn't yet have support for wp_tablet_manager, we end up skipping the
initialization of the lists. This is wrong, because regardless of
whether or not a tablet is present we still attempt to traverse these
lists later in xwl_set_cursor(), expecting that if the lists are empty
from no tablet manager that we simply won't execute any loop iterations.

(EE)
(EE) Backtrace:
(EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9]
(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7f73722545bf]
(EE) 2: Xwayland (xwl_set_cursor+0x9f) [0x429974]
(EE) 3: Xwayland (miPointerUpdateSprite+0x261) [0x4fe1ca]
(EE) 4: Xwayland (mieqProcessInputEvents+0x239) [0x4f8d33]
(EE) 5: Xwayland (ProcessInputEvents+0x9) [0x4282f0]
(EE) 6: Xwayland (Dispatch+0x42) [0x43e2d4]
(EE) 7: Xwayland (dix_main+0x5c9) [0x44c6dc]
(EE) 8: Xwayland (main+0x28) [0x61c523]
(EE) 9: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f7371e9d401]
(EE) 10: Xwayland (_start+0x2a) [0x4208fa]
(EE) 11: ? (?+0x2a) [0x2a]
(EE)
(EE) Segmentation fault at address 0x28
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)

Reproduced when trying to run upstream xwayland under fedora 25's weston
package.

Signed-off-by: Lyude <lyude@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a06bb73053d9df56d9070ce325a43af3a3c7a6a2)
---
hw/xwayland/xwayland-input.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 8011b965c..ee932be60 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -2200,6 +2200,10 @@ static void
init_tablet_manager_seat(struct xwl_screen *xwl_screen,
struct xwl_seat *xwl_seat)
{
+ xorg_list_init(&xwl_seat->tablets);
+ xorg_list_init(&xwl_seat->tablet_tools);
+ xorg_list_init(&xwl_seat->tablet_pads);
+
if (!xwl_screen->tablet_manager)
return;
@@ -2207,10 +2211,6 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen,
zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager,
xwl_seat->seat);
- xorg_list_init(&xwl_seat->tablets);
- xorg_list_init(&xwl_seat->tablet_tools);
- xorg_list_init(&xwl_seat->tablet_pads);
-
zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat);
}
--
2.13.5

39
SOURCES/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
From edcc95e914079485b7d693cecbfc436d084ad47d Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 9 Jun 2017 16:02:06 -0700
Subject: [PATCH xserver 11/12] xwayland: Correct off-by-one error in tablet
button numbering

The 'tablet_tool_frame' function treats the button masks as though they
are zero-indexed, but 'tablet_tool_button_state' treats them as one-
indexed. The result is that an e.g. middle click event recieved from
Wayland will be sent from the X server as a right-click instead.

Fixes: 773b04748d0 ("xwayland: handle button events after motion events")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fbc9814975fe82be25becf1a55d4f8d34298a956)
---
hw/xwayland/xwayland-input.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index ee932be60..a6d7d9356 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1626,9 +1626,9 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool,
BUG_RETURN(xbtn >= 8 * sizeof(*mask));
if (state)
- SetBit(mask, xbtn);
+ SetBit(mask, xbtn - 1);
else
- ClearBit(mask, xbtn);
+ ClearBit(mask, xbtn - 1);
xwl_seat->xwl_screen->serial = serial;
}
--
2.13.5

78
SOURCES/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
From d03bf0d1759d7d113216a0311e794b5adb0845de Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 9 Jun 2017 16:02:07 -0700
Subject: [PATCH xserver 12/12] xwayland: Implement tablet_tool_wheel for
scrolling

The 'tablet_tool_wheel' function for tablet scrolling was added back in
8a1defcc634 but left unimplemented. This commit fills in the necessary
details, using the "clicks" count as the number of discrete scroll up/down
events to send.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 7c7a540f1e1d6b5466e1c9aa28476a2d7273d5ed)
---
hw/xwayland/xwayland-input.c | 24 ++++++++++++++++++++++++
hw/xwayland/xwayland.h | 2 ++
2 files changed, 26 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index a6d7d9356..0cf318623 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1566,6 +1566,13 @@ static void
tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool,
wl_fixed_t degrees, int32_t clicks)
{
+ struct xwl_tablet_tool *xwl_tablet_tool = data;
+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
+
+ if (!xwl_seat->focus_window)
+ return;
+
+ xwl_tablet_tool->wheel_clicks = clicks;
}
static void
@@ -1677,6 +1684,23 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time)
}
xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now;
+
+ while (xwl_tablet_tool->wheel_clicks) {
+ if (xwl_tablet_tool->wheel_clicks < 0) {
+ button = 4;
+ xwl_tablet_tool->wheel_clicks++;
+ }
+ else {
+ button = 5;
+ xwl_tablet_tool->wheel_clicks--;
+ }
+
+ QueuePointerEvents(xwl_tablet_tool->xdevice,
+ ButtonPress, button, 0, &mask);
+ QueuePointerEvents(xwl_tablet_tool->xdevice,
+ ButtonRelease, button, 0, &mask);
+
+ }
}
static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 250564f73..135aa8761 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -213,6 +213,8 @@ struct xwl_tablet_tool {
uint32_t buttons_now,
buttons_prev;
+ int32_t wheel_clicks;
+
struct xwl_cursor cursor;
};
--
2.13.5

30
SOURCES/06_use-intel-only-on-pre-gen4.diff

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
Description: Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
Author: Timo Aaltonen <tjaalton@debian.org>

--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1173,7 +1173,23 @@ xf86VideoPtrToDriverList(struct pci_devi
case 0x0bef:
/* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
break;
- default:
+ /* Default to intel only on pre-gen4 chips */
+ case 0x3577:
+ case 0x2562:
+ case 0x3582:
+ case 0x358e:
+ case 0x2572:
+ case 0x2582:
+ case 0x258a:
+ case 0x2592:
+ case 0x2772:
+ case 0x27a2:
+ case 0x27ae:
+ case 0x29b2:
+ case 0x29c2:
+ case 0x29d2:
+ case 0xa001:
+ case 0xa011:
driverList[0] = "intel";
break;
}

54
SOURCES/10-quirks.conf

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
# Collection of quirks and blacklist/whitelists for specific devices.


# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
Section "InputClass"
Identifier "ThinkPad HDAPS accelerometer blacklist"
MatchProduct "ThinkPad HDAPS accelerometer data"
Option "Ignore" "on"
EndSection

# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
Identifier "Xen Virtual Pointer axis blacklist"
MatchProduct "Xen Virtual Pointer"
Option "IgnoreAbsoluteAxes" "off"
Option "IgnoreRelativeAxes" "off"
EndSection

# https://bugzilla.redhat.com/show_bug.cgi?id=612140
# please make Evoluent VerticalMouse 3 work out of the box
# Button mapping on this mouse is quirky
Section "InputClass"
Identifier "Evoluent VerticalMouse 3"
MatchProduct "Evoluent VerticalMouse 3"
# Sets following configuration:
# top button: left
# middle button: middle
# bottom button: right
# wheel click: middle
# thumb button: 8 (back)
Option "ButtonMapping" "1 2 2 4 5 6 7 3 8"
EndSection


# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
Identifier "Tag trackballs as XI_TRACKBALL"
MatchProduct "trackball"
MatchDriver "evdev"
Option "TypeName" "TRACKBALL"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
MatchProduct "La-VIEW Technology Naos 5000 Mouse"
MatchDriver "evdev"
Option "TypeName" "MOUSE"
EndSection

46
SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
From patchwork Thu Apr 16 12:04:21 2015
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [RFC] mi: reduce missing segments on large ellipse
From: Olivier Fourdan <ofourdan@redhat.com>
X-Patchwork-Id: 47327
Message-Id: <1429185861-4411-2-git-send-email-ofourdan@redhat.com>
To: xorg-devel@lists.x.org
Cc: Olivier Fourdan <ofourdan@redhat.com>
Date: Thu, 16 Apr 2015 14:04:21 +0200

With larger ellipses, rounding will cause some spans close to vertical
tangent to be of zero length, leading to sometimes rather large missing
portion of the arc.

Try to detect this case and work around it.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1166989
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91858
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
mi/miarc.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/mi/miarc.c b/mi/miarc.c
index e8bc87e..be9c94c 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -563,6 +563,16 @@ miComputeEllipseSpans(int lw, xArc * parc, miArcSpanData * spdata)
outx = x + t;
}
}
+ if (ICEIL(xorg + outx) - ICEIL(xorg + inx) < lw ) {
+ if (inx <= 0.0) {
+ outx = outx + ICEIL(-r);
+ inx = inx + ICEIL(r);
+ }
+ else {
+ outx = outx + ICEIL(r);
+ inx = inx + ICEIL(-r);
+ }
+ }
span->lx = ICEIL(xorg - outx);
if (inx <= 0.0) {
spdata->count1++;

58
SOURCES/driver-abi-rebuild.sh

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
#!/bin/sh
#
# Trivial script to rebuild drivers for ABI changes in the server
# Run me after a new xserver has hit the buildroot

builddir="abi-rebuild"

#if [ -e "$builddir" ]; then
# echo "Path '$builddir' exists. Move out of the way first"
# exit 1
#fi

mkdir -p $builddir
pushd $builddir

if git config --get remote.origin.url | grep -q redhat.com ; then
pkg=rhpkg
else
pkg=fedpkg
fi

# figure out the branch we're on
branch=$(git branch | awk '/^\*/ { print $2 }' | grep -v '^master$')
if [ $branch ]; then
branch="-b $branch"
fi

$pkg co $branch xorg-x11-drivers
pushd xorg-x11-drivers
driverlist=$(grep ^Requires *.spec | awk '{ print $2 }')
popd

# Things not in -drivers for whatever reason...
extradrivers="xorg-x11-glamor xorg-x11-drv-ivtv"

rm -rf xorg-x11-drivers
echo $driverlist $extradrivers | xargs -n1 $pkg co $branch

for i in xorg-x11-drv-*/ ; do
[ -e $i/dead.package ] && continue
pushd $i
rpmdev-bumpspec -c "- 1.15 ABI rebuild" *.spec
$pkg commit -c -p && $pkg build --nowait
#$pkg mockbuild
#$pkg srpm
#mockchain -r fedora-20-x86_64 -l $OLDPWD
#mockchain -r rhel-7.0-candidate-x86_64 -l $OLDPWD

if [ $i = "xorg-x11-glamor" ]; then
koji wait-repo f21-build --build $($pkg verrel)
fi

popd
done

popd


306
SOURCES/gitignore

@ -0,0 +1,306 @@ @@ -0,0 +1,306 @@
Makefile
Makefile.in
.deps
.libs
.msg
*.lo
*.la
*.a
*.o
*~
.*sw?
*.pbxuser
*.mode1v3
obj*
build*
local
aclocal.m4
autom4te.cache
compile
config.guess
config.log
config.status
config.sub
configure
configure.lineno
depcomp
install-sh
libtool
ltmain.sh
missing
TAGS
tags
ylwrap
xorg-server.pc
stamp-h?
do-not-use-config.h
do-not-use-config.h.in
afb/afbbltC.c
afb/afbbltCI.c
afb/afbbltG.c
afb/afbbltO.c
afb/afbbltX.c
afb/afbseg.c
afb/afbtileC.c
afb/afbtileG.c
cfb/cfb8lineCO.c
cfb/cfb8lineCP.c
cfb/cfb8lineG.c
cfb/cfb8lineX.c
cfb/cfb8segC.c
cfb/cfb8segCS.c
cfb/cfb8segX.c
cfb/cfb8setG.c
cfb/cfbbltC.c
cfb/cfbbltG.c
cfb/cfbbltO.c
cfb/cfbbltX.c
cfb/cfbfillarcC.c
cfb/cfbfillarcG.c
cfb/cfbglrop8.c
cfb/cfbply1rctC.c
cfb/cfbply1rctG.c
cfb/cfbseg.c
cfb/cfbsolidC.c
cfb/cfbsolidG.c
cfb/cfbsolidX.c
cfb/cfbtile32C.c
cfb/cfbtile32G.c
cfb/cfbtileoddC.c
cfb/cfbtileoddG.c
cfb/cfbzerarcC.c
cfb/cfbzerarcG.c
cfb/cfbzerarcX.c
cfb32/cfb8lineCO.c
cfb32/cfb8lineCP.c
cfb32/cfb8lineG.c
cfb32/cfb8lineX.c
cfb32/cfb8segC.c
cfb32/cfb8segCS.c
cfb32/cfb8segX.c
cfb32/cfb8setG.c
cfb32/cfbbltC.c
cfb32/cfbbltG.c
cfb32/cfbbltO.c
cfb32/cfbbltX.c
cfb32/cfbfillarcC.c
cfb32/cfbfillarcG.c
cfb32/cfbply1rctC.c
cfb32/cfbply1rctG.c
cfb32/cfbseg.c
cfb32/cfbsolidC.c
cfb32/cfbsolidG.c
cfb32/cfbsolidX.c
cfb32/cfbtile32C.c
cfb32/cfbtile32G.c
cfb32/cfbtileoddC.c
cfb32/cfbtileoddG.c
cfb32/cfbzerarcC.c
cfb32/cfbzerarcG.c
cfb32/cfbzerarcX.c
doc/Xserver.1x
doc/Xserver.man
hw/dmx/Xdmx
hw/dmx/Xdmx.1x
hw/dmx/config/dmxtodmx
hw/dmx/config/dmxtodmx.1x
hw/dmx/config/parser.c
hw/dmx/config/parser.h
hw/dmx/config/scanner.c
hw/dmx/config/vdltodmx
hw/dmx/config/vdltodmx.1x
hw/dmx/config/xdmxconfig
hw/dmx/config/xdmxconfig.1x
hw/dmx/examples/dmxaddinput
hw/dmx/examples/dmxaddscreen
hw/dmx/examples/dmxreconfig
hw/dmx/examples/dmxresize
hw/dmx/examples/dmxrminput
hw/dmx/examples/dmxrmscreen
hw/dmx/examples/dmxwininfo
hw/dmx/examples/ev
hw/dmx/examples/evi
hw/dmx/examples/res
hw/dmx/examples/xbell
hw/dmx/examples/xdmx
hw/dmx/examples/xinput
hw/dmx/examples/xled
hw/dmx/examples/xtest
hw/kdrive/ati/Xati
hw/kdrive/chips/Xchips
hw/kdrive/ephyr/Xephyr
hw/kdrive/epson/Xepson
hw/kdrive/fake/Xfake
hw/kdrive/fbdev/Xfbdev
hw/kdrive/i810/Xi810
hw/kdrive/mach64/Xmach64
hw/kdrive/mga/Xmga
hw/kdrive/neomagic/Xneomagic
hw/kdrive/nvidia/Xnvidia
hw/kdrive/pm2/Xpm2
hw/kdrive/r128/Xr128
hw/kdrive/sdl/Xsdl
hw/kdrive/sis300/Xsis
hw/kdrive/smi/Xsmi
hw/kdrive/vesa/Xvesa
hw/kdrive/via/Xvia
hw/vfb/Xvfb
hw/vfb/Xvfb.1x
hw/vfb/Xvfb.man
hw/xfree86/Xorg
hw/xfree86/common/xf86Build.h
hw/xfree86/common/xf86DefModeSet.c
hw/xfree86/doc/man/Xorg.1x
hw/xfree86/doc/man/Xorg.man
hw/xfree86/doc/man/xorg.conf.5x
hw/xfree86/doc/man/xorg.conf.man
hw/xfree86/exa/exa.4
hw/xfree86/exa/exa.4x
hw/xfree86/exa/exa.man
hw/xfree86/fbdevhw/fbdevhw.4x
hw/xfree86/fbdevhw/fbdevhw.man
hw/xfree86/getconfig/cfg.man
hw/xfree86/getconfig/getconfig.1x
hw/xfree86/getconfig/getconfig.5x
hw/xfree86/getconfig/getconfig.man
hw/xfree86/os-support/xorgos.c
hw/xfree86/osandcommon.c
hw/xfree86/ramdac/xf86BitOrder.c
hw/xfree86/scanpci/xf86PciData.c
hw/xfree86/scanpci/xf86PciIds.h
hw/xfree86/utils/cvt/cvt
hw/xfree86/utils/cvt/cvt.man
hw/xfree86/utils/gtf/gtf
hw/xfree86/utils/gtf/gtf.1x
hw/xfree86/utils/gtf/gtf.man
hw/xfree86/utils/ioport/inb
hw/xfree86/utils/ioport/inl
hw/xfree86/utils/ioport/inw
hw/xfree86/utils/ioport/ioport
hw/xfree86/utils/ioport/outb
hw/xfree86/utils/ioport/outl
hw/xfree86/utils/ioport/outw
hw/xfree86/utils/pcitweak/pcitweak
hw/xfree86/utils/pcitweak/pcitweak.1x
hw/xfree86/utils/pcitweak/pcitweak.man
hw/xfree86/utils/scanpci/scanpci
hw/xfree86/utils/scanpci/scanpci.1x
hw/xfree86/utils/scanpci/scanpci.man
hw/xfree86/utils/xorgcfg/XOrgCfg
hw/xfree86/utils/xorgcfg/xorgcfg
hw/xfree86/utils/xorgcfg/xorgcfg.1x
hw/xfree86/utils/xorgcfg/xorgcfg.man
hw/xfree86/utils/xorgconfig/xorgconfig
hw/xfree86/utils/xorgconfig/xorgconfig.1x
hw/xfree86/utils/xorgconfig/xorgconfig.man
hw/xfree86/xaa/l-xaaBitmap.c
hw/xfree86/xaa/l-xaaStipple.c
hw/xfree86/xaa/l-xaaTEGlyph.c
hw/xfree86/xaa/l3-xaaBitmap.c
hw/xfree86/xaa/l3-xaaStipple.c
hw/xfree86/xaa/lf-xaaBitmap.c
hw/xfree86/xaa/lf-xaaStipple.c
hw/xfree86/xaa/lf-xaaTEGlyph.c
hw/xfree86/xaa/lf3-xaaBitmap.c
hw/xfree86/xaa/lf3-xaaStipple.c
hw/xfree86/xaa/m-xaaBitmap.c
hw/xfree86/xaa/m-xaaStipple.c
hw/xfree86/xaa/m-xaaTEGlyph.c
hw/xfree86/xaa/m3-xaaBitmap.c
hw/xfree86/xaa/m3-xaaStipple.c
hw/xfree86/xaa/mf-xaaBitmap.c
hw/xfree86/xaa/mf-xaaStipple.c
hw/xfree86/xaa/mf-xaaTEGlyph.c
hw/xfree86/xaa/mf3-xaaBitmap.c
hw/xfree86/xaa/mf3-xaaStipple.c
hw/xfree86/xaa/s-xaaDashLine.c
hw/xfree86/xaa/s-xaaLine.c
hw/xfree86/xf1bpp/maskbits.c
hw/xfree86/xf1bpp/mfbbitblt.c
hw/xfree86/xf1bpp/mfbbltC.c
hw/xfree86/xf1bpp/mfbbltCI.c
hw/xfree86/xf1bpp/mfbbltG.c
hw/xfree86/xf1bpp/mfbbltO.c
hw/xfree86/xf1bpp/mfbbltX.c
hw/xfree86/xf1bpp/mfbbres.c
hw/xfree86/xf1bpp/mfbbresd.c
hw/xfree86/xf1bpp/mfbclip.c
hw/xfree86/xf1bpp/mfbcmap.c
hw/xfree86/xf1bpp/mfbfillarc.c
hw/xfree86/xf1bpp/mfbfillrct.c
hw/xfree86/xf1bpp/mfbfillsp.c
hw/xfree86/xf1bpp/mfbfont.c
hw/xfree86/xf1bpp/mfbgc.c
hw/xfree86/xf1bpp/mfbgetsp.c
hw/xfree86/xf1bpp/mfbigbblak.c
hw/xfree86/xf1bpp/mfbigbwht.c
hw/xfree86/xf1bpp/mfbhrzvert.c
hw/xfree86/xf1bpp/mfbimage.c
hw/xfree86/xf1bpp/mfbline.c
hw/xfree86/xf1bpp/mfbmisc.c
hw/xfree86/xf1bpp/mfbpablack.c
hw/xfree86/xf1bpp/mfbpainv.c
hw/xfree86/xf1bpp/mfbpawhite.c
hw/xfree86/xf1bpp/mfbpgbblak.c
hw/xfree86/xf1bpp/mfbpgbinv.c
hw/xfree86/xf1bpp/mfbpgbwht.c
hw/xfree86/xf1bpp/mfbpixmap.c
hw/xfree86/xf1bpp/mfbplyblack.c
hw/xfree86/xf1bpp/mfbplyinv.c
hw/xfree86/xf1bpp/mfbplywhite.c
hw/xfree86/xf1bpp/mfbpntwin.c
hw/xfree86/xf1bpp/mfbpolypnt.c
hw/xfree86/xf1bpp/mfbpushpxl.c
hw/xfree86/xf1bpp/mfbscrclse.c
hw/xfree86/xf1bpp/mfbscrinit.c
hw/xfree86/xf1bpp/mfbseg.c
hw/xfree86/xf1bpp/mfbsetsp.c
hw/xfree86/xf1bpp/mfbteblack.c
hw/xfree86/xf1bpp/mfbtewhite.c
hw/xfree86/xf1bpp/mfbtileC.c
hw/xfree86/xf1bpp/mfbtileG.c
hw/xfree86/xf1bpp/mfbwindow.c
hw/xfree86/xf1bpp/mfbzerarc.c
hw/xfree86/xf4bpp/mfbseg.c
hw/xfree86/xf8_32bpp/cfbgc32.c
hw/xfree86/xf8_32bpp/cfbgc8.c
hw/xfree86/xorg.c
hw/xfree86/xorg.conf.example
hw/xfree86/xorg.conf.example.pre
hw/xnest/Xnest
hw/xnest/Xnest.1x
hw/xnest/Xnest.man
hw/xprint/Xprt
hw/xprint/config/C/print/Xprinters.ghostscript
hw/xprint/doc/Xprt.1x
hw/xprint/doc/Xprt.man
hw/xprint/dpmsstubs-wrapper.c
hw/xprint/miinitext-wrapper.c
include/dix-config.h
include/kdrive-config.h
include/xgl-config.h
include/xkb-config.h
include/xorg-config.h
include/xorg-server.h
include/xwin-config.h
mfb/mfbbltC.c
mfb/mfbbltCI.c
mfb/mfbbltG.c
mfb/mfbbltO.c
mfb/mfbbltX.c
mfb/mfbigbblak.c
mfb/mfbigbwht.c
mfb/mfbpablack.c
mfb/mfbpainv.c
mfb/mfbpawhite.c
mfb/mfbpgbblak.c
mfb/mfbpgbinv.c
mfb/mfbpgbwht.c
mfb/mfbplyblack.c
mfb/mfbplyinv.c
mfb/mfbplywhite.c
mfb/mfbseg.c
mfb/mfbteblack.c
mfb/mfbtewhite.c
mfb/mfbtileC.c
mfb/mfbtileG.c

48
SOURCES/xserver-1.4.99-ssh-isnt-local.patch

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
From 66a3b14e118e90db80f96fcab52af4df35bc2377 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 10 Dec 2007 11:26:57 -0500
Subject: [PATCH] Hack for proper MIT-SHM rejection for ssh-forwarded clients.

---
Xext/shm.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/Xext/shm.c b/Xext/shm.c
index de48020..c011210 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -321,8 +321,21 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
mode_t mask;
int uidset = 0, gidset = 0;
LocalClientCredRec *lcc;
+ Bool is_ssh = FALSE;
if (GetLocalClientCreds(client, &lcc) != -1) {
+#ifdef linux
+ if (lcc->fieldsSet & LCC_PID_SET) {
+ /* ssh isn't actually a local client */
+ char exe[64], buf[64];
+
+ memset(buf, 0, 64);
+ snprintf(exe, 64, "/proc/%d/exe", lcc->pid);
+ readlink(exe, buf, 63);
+ if (strstr(buf, "/ssh"))
+ is_ssh = TRUE;
+ }
+#endif
if (lcc->fieldsSet & LCC_UID_SET) {
uid = lcc->euid;
@@ -342,6 +355,9 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
#endif
FreeLocalClientCreds(lcc);
+ if (is_ssh)
+ return -1;
+
if (uidset) {
/* User id 0 always gets access */
if (uid == 0) {
--
1.7.10.1

302
SOURCES/xserver-autobind-hotplug.patch

@ -0,0 +1,302 @@ @@ -0,0 +1,302 @@
From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 17 Aug 2012 09:49:24 +1000
Subject: [PATCH xserver v3] autobind GPUs to the screen

This is a modified version of a patch we've been carry-ing in Fedora and
RHEL for years now. This patch automatically adds secondary GPUs to the
master as output sink / offload source making e.g. the use of
slave-outputs just work, with requiring the user to manually run
"xrandr --setprovideroutputsource" before he can hookup an external
monitor to his hybrid graphics laptop.

There is one problem with this patch, which is why it was not upstreamed
before. What to do when a secondary GPU gets detected really is a policy
decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
as such should be under control of the Desktop Environment.

Unconditionally adding autobinding support to the xserver will result
in races between the DE dealing with the hotplug of a secondary GPU
and the server itself dealing with it.

However we've waited for years for any Desktop Environments to actually
start doing some sort of autoconfiguration of secondary GPUs and there
is still not a single DE dealing with this, so I believe that it is
time to upstream this now.

To avoid potential future problems if any DEs get support for doing
secondary GPU configuration themselves, the new autobind functionality
is made optional. Since no DEs currently support doing this themselves it
is enabled by default. When DEs grow support for doing this themselves
they can disable the servers autobinding through the servers cmdline or a
xorg.conf snippet.

Signed-off-by: Dave Airlie <airlied@gmail.com>
[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Make the default enabled instead of installing a xorg.conf
snippet which enables it unconditionally
Changes in v3:
-Handle GPUScreen autoconfig in randr/rrprovider.c, looking at
rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c
looking at xf86CrtcConfig->provider. This fixes the autoconfig not
working with the nvidia binary driver
---
hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++
hw/xfree86/common/xf86Globals.c | 2 ++
hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++
hw/xfree86/common/xf86Priv.h | 1 +
hw/xfree86/common/xf86Privstr.h | 1 +
hw/xfree86/common/xf86platformBus.c | 4 ++++
hw/xfree86/man/Xorg.man | 7 +++++++
hw/xfree86/man/xorg.conf.man | 6 ++++++
randr/randrstr.h | 3 +++
randr/rrprovider.c | 22 ++++++++++++++++++++++
10 files changed, 85 insertions(+)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 21daf1a..df3ca50 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -719,6 +719,7 @@ typedef enum {
FLAG_DRI2,
FLAG_USE_SIGIO,
FLAG_AUTO_ADD_GPU,
+ FLAG_AUTO_BIND_GPU,
FLAG_MAX_CLIENTS,
FLAG_IGLX,
} FlagValues;
@@ -778,6 +779,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
{0}, FALSE},
+ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN,
+ {0}, FALSE},
{FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER,
{0}, FALSE },
{FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN,
@@ -857,6 +860,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
}
xf86Msg(from, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
+
+ if (xf86AutoBindGPUDisabled) {
+ xf86Info.autoBindGPU = FALSE;
+ from = X_CMDLINE;
+ }
+ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) {
+ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU,
+ &xf86Info.autoBindGPU);
+ from = X_CONFIG;
+ }
+ else {
+ from = X_DEFAULT;
+ }
+ xf86Msg(from, "%sutomatically binding GPU devices\n",
+ xf86Info.autoBindGPU ? "A" : "Not a");
+
/*
* Set things up based on the config file information. Some of these
* settings may be overridden later when the command line options are
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index e962b75..0d1e31b 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -136,6 +136,7 @@ xf86InfoRec xf86Info = {
#else
.autoAddGPU = FALSE,
#endif
+ .autoBindGPU = TRUE,
};
const char *xf86ConfigFile = NULL;
@@ -197,6 +198,7 @@ Bool xf86FlipPixels = FALSE;
Gamma xf86Gamma = { 0.0, 0.0, 0.0 };
Bool xf86AllowMouseOpenFail = FALSE;
+Bool xf86AutoBindGPUDisabled = FALSE;
#ifdef XF86VIDMODE
Bool xf86VidModeDisabled = FALSE;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index a544b65..b0cba3d 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -76,6 +76,7 @@
#include "xf86DDC.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
+#include "xf86Crtc.h"
#include "picturestr.h"
#include "xf86Bus.h"
@@ -298,6 +299,19 @@ xf86PrivsElevated(void)
}
static void
+xf86AutoConfigOutputDevices(void)
+{
+ int i;
+
+ if (!xf86Info.autoBindGPU)
+ return;
+
+ for (i = 0; i < xf86NumGPUScreens; i++)
+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
+ xf86ScrnToScreen(xf86Screens[0]));
+}
+
+static void
InstallSignalHandlers(void)
{
/*
@@ -871,6 +885,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevices();
+
xf86VGAarbiterWrapFunctions();
if (sigio_blocked)
input_unlock();
@@ -1389,6 +1405,10 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86Info.iglxFrom = X_CMDLINE;
return 0;
}
+ if (!strcmp(argv[i], "-noautoBindGPU")) {
+ xf86AutoBindGPUDisabled = TRUE;
+ return 1;
+ }
/* OS-specific processing */
return xf86ProcessArgument(argc, argv, i);
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index c1f8a18..9a3d0df 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -46,6 +46,7 @@
extern _X_EXPORT const char *xf86ConfigFile;
extern _X_EXPORT const char *xf86ConfigDir;
extern _X_EXPORT Bool xf86AllowMouseOpenFail;
+extern _X_EXPORT Bool xf86AutoBindGPUDisabled;
#ifdef XF86VIDMODE
extern _X_EXPORT Bool xf86VidModeDisabled;
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index c29b3cc..4c5f54b 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -102,6 +102,7 @@ typedef struct {
MessageType dri2From;
Bool autoAddGPU;
+ Bool autoBindGPU;
} xf86InfoRec, *xf86InfoPtr;
#ifdef DPMSExtension
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 063e81c..42789ca 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -48,6 +48,7 @@
#include "Pci.h"
#include "xf86platformBus.h"
#include "xf86Config.h"
+#include "xf86Crtc.h"
#include "randrstr.h"
int platformSlotClaimed;
@@ -579,6 +580,9 @@ xf86platformAddDevice(int index)
}
/* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ if (xf86Info.autoBindGPU)
+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
+ xf86ScrnToScreen(xf86Screens[0]));
RRResourcesChanged(xf86Screens[0]->pScreen);
RRTellChanged(xf86Screens[0]->pScreen);
diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
index def9bfc..8df6b7d 100644
--- a/hw/xfree86/man/Xorg.man
+++ b/hw/xfree86/man/Xorg.man
@@ -283,6 +283,13 @@ is a comma separated list of directories to search for
server modules. This option is only available when the server is run
as root (i.e, with real-uid 0).
.TP 8
+.B \-noautoBindGPU
+Disable automatically setting secondary GPUs up as output sinks and offload
+sources. This is equivalent to setting the
+.B AutoBindGPU
+xorg.conf(__filemansuffix__) file option. To
+.B false.
+.TP 8
.B \-nosilk
Disable Silken Mouse support.
.TP 8
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 7d0c524..3e596e4 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -673,6 +673,12 @@ Enabled by default.
If this option is disabled, then no GPU devices will be added from the udev
backend. Enabled by default. (May need to be disabled to setup Xinerama).
.TP 7
+.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q
+If enabled then secondary GPUs will be automatically set up as output-sinks and
+offload-sources. Making e.g. laptop outputs connected only to the secondary
+GPU directly available for use without needing to run
+"xrandr --setprovideroutputsource". Enabled by default.
+.TP 7
.BI "Option \*qLog\*q \*q" string \*q
This option controls whether the log is flushed and/or synced to disk after
each message.
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 706e9a7..66999d5 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -976,6 +976,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p);
extern _X_EXPORT void
RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider);
+extern _X_EXPORT void
+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen);
+
/* rrproviderproperty.c */
extern _X_EXPORT void
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index f9df67e..abc5685 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -482,3 +482,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider)
WriteEventsToClient(client, 1, (xEvent *) &pe);
}
+
+void
+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen);
+ RRProviderPtr provider = pScrPriv->provider;
+ RRProviderPtr master_provider = masterPriv->provider;
+
+ if (!provider || !master_provider)
+ return;
+
+ if ((provider->capabilities & RR_Capability_SinkOutput) &&
+ (master_provider->capabilities & RR_Capability_SourceOutput)) {
+ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider);
+ RRInitPrimeSyncProps(pScreen);
+ }
+
+ if ((provider->capabilities & RR_Capability_SourceOffload) &&
+ (master_provider->capabilities & RR_Capability_SinkOffload))
+ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider);
+}
--
2.9.3

14
SOURCES/xserver-sdk-abi-requires.git

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#!/bin/sh
#
# The X server provides capabilities of the form:
#
# Provides: xserver-abi(ansic-0) = 4
#
# for an ABI version of 0.4. The major number is encoded into the name so
# that major number changes force upgrades. If we didn't, then
#
# Requires: xserver-abi(ansic) >= 0.4
#
# would also match 1.0, which is wrong since major numbers mean an ABI break.

echo "xserver-abi($1-@MAJOR@) >= @MINOR@"

19
SOURCES/xserver-sdk-abi-requires.release

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
#!/bin/sh
#
# The X server provides capabilities of the form:
#
# Provides: xserver-abi(ansic-0) = 4
#
# for an ABI version of 0.4. The major number is encoded into the name so
# that major number changes force upgrades. If we didn't, then
#
# Requires: xserver-abi(ansic) >= 0.4
#
# would also match 1.0, which is wrong since major numbers mean an ABI break.

ver=$(pkg-config --variable abi_$1 xorg-server)

major=$(echo $ver | cut -f 1 -d .)
minor=$(echo $ver | cut -f 2 -d .)

echo "xserver-abi($1-$major) >= $minor"

5
SOURCES/xserver.pamd

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
#%PAM-1.0
auth sufficient pam_rootok.so
auth required pam_console.so
account required pam_permit.so
session optional pam_keyinit.so force revoke

200
SOURCES/xvfb-run.sh

@ -0,0 +1,200 @@ @@ -0,0 +1,200 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../xorg-server/xvfb-run.sh
# Copyright (C) 2005 The T2 SDE Project
# Copyright (C) XXXX - 2005 Debian
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---

# $Id$
# from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run

# This script starts an instance of Xvfb, the "fake" X server, runs a command
# with that server available, and kills the X server when done. The return
# value of the command becomes the return value of this script.
#
# If anyone is using this to build a Debian package, make sure the package
# Build-Depends on xvfb, xbase-clients, and xfonts-base.

set -e

PROGNAME=xvfb-run
SERVERNUM=99
AUTHFILE=
ERRORFILE=/dev/null
STARTWAIT=3
XVFBARGS="-screen 0 640x480x8"
LISTENTCP="-nolisten tcp"
XAUTHPROTO=.

# Query the terminal to establish a default number of columns to use for
# displaying messages to the user. This is used only as a fallback in the event
# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the
# script is running, and this cannot, only being calculated once.)
DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
DEFCOLUMNS=80
fi

# Display a message, wrapping lines at the terminal width.
message () {
echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
}

# Display an error message.
error () {
message "error: $*" >&2
}

# Display a usage message.
usage () {
if [ -n "$*" ]; then
message "usage error: $*"
fi
cat <<EOF
Usage: $PROGNAME [OPTION ...] COMMAND
Run COMMAND (usually an X client) in a virtual X server environment.
Options:
-a --auto-servernum try to get a free server number, starting at
--server-num (deprecated, use --auto-display
instead)
-d --auto-display use the X server to find a display number
automatically
-e FILE --error-file=FILE file used to store xauth errors and Xvfb
output (default: $ERRORFILE)
-f FILE --auth-file=FILE file used to store auth cookie
(default: ./.Xauthority)
-h --help display this usage message and exit
-n NUM --server-num=NUM server number to use (default: $SERVERNUM)
-l --listen-tcp enable TCP port listening in the X server
-p PROTO --xauth-protocol=PROTO X authority protocol name to use
(default: xauth command's default)
-s ARGS --server-args=ARGS arguments (other than server number and
"-nolisten tcp") to pass to the Xvfb server
(default: "$XVFBARGS")
-w DELAY --wait=DELAY delay in seconds to wait for Xvfb to start
before running COMMAND (default: $STARTWAIT)
EOF
}

# Find a free server number by looking at .X*-lock files in /tmp.
find_free_servernum() {
# Sadly, the "local" keyword is not POSIX. Leave the next line commented in
# the hope Debian Policy eventually changes to allow it in /bin/sh scripts
# anyway.
#local i

i=$SERVERNUM
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}

# Parse the command line.
ARGS=$(getopt --options +ade:f:hn:lp:s:w: \
--long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
--name "$PROGNAME" -- "$@")
GETOPT_STATUS=$?

if [ $GETOPT_STATUS -ne 0 ]; then
error "internal error; getopt exited with status $GETOPT_STATUS"
exit 6
fi

eval set -- "$ARGS"

while :; do
case "$1" in
-a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;;
-d|--auto-display) AUTO_DISPLAY=1 ;;
-e|--error-file) ERRORFILE="$2"; shift ;;
-f|--auth-file) AUTHFILE="$2"; shift ;;
-h|--help) SHOWHELP="yes" ;;
-n|--server-num) SERVERNUM="$2"; shift ;;
-l|--listen-tcp) LISTENTCP="" ;;
-p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-s|--server-args) XVFBARGS="$2"; shift ;;
-w|--wait) STARTWAIT="$2"; shift ;;
--) shift; break ;;
*) error "internal error; getopt permitted \"$1\" unexpectedly"
exit 6
;;
esac
shift
done

if [ "$SHOWHELP" ]; then
usage
exit 0
fi

if [ -z "$*" ]; then
usage "need a command to run" >&2
exit 2
fi

if ! which xauth >/dev/null; then
error "xauth command not found"
exit 3
fi

# Set up the temp dir for the pid and X authorization file
XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)"
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX)
fi

# Start Xvfb.
MCOOKIE=$(mcookie)

if [ -z "$AUTO_DISPLAY" ]; then
# Old style using a pre-computed SERVERNUM
XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \
2>&1 &
XVFBPID=$!
else
# New style using Xvfb to provide a free display
PIDFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" pid.XXXXXX)
SERVERNUM=$(XAUTHORITY=$AUTHFILE Xvfb -displayfd 1 $XVFBARGS $LISTENTCP \
2>"$ERRORFILE" & echo $! > $PIDFILE)
XVFBPID=$(cat $PIDFILE)
fi
sleep "$STARTWAIT"

XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
add :$SERVERNUM $XAUTHPROTO $MCOOKIE
EOF

# Start the command and save its exit status.
set +e
DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
RETVAL=$?
set -e

# Kill Xvfb now that the command has exited.
kill $XVFBPID

# Clean up.
XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1
if [ -n "$XVFB_RUN_TMPDIR" ]; then
if ! rm -r "$XVFB_RUN_TMPDIR"; then
error "problem while cleaning up temporary directory"
exit 5
fi
fi

# Return the executed command's exit status.
exit $RETVAL

# vim:set ai et sts=4 sw=4 tw=80:

87
SPECS/xorg-x11-server.spec

@ -41,8 +41,8 @@ @@ -41,8 +41,8 @@

Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.19.3
Release: 12%{?gitdate:.%{gitdate}}%{?dist}
Version: 1.19.5
Release: 5%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X
@ -52,11 +52,11 @@ Group: User Interface/X @@ -52,11 +52,11 @@ Group: User Interface/X
# git snapshot. to recreate, run:
# ./make-git-snapshot.sh `cat commitid`
#Source0: xorg-server-%{gitdate}.tar.xz
Source0: http://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2
Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2
Source1: make-git-snapshot.sh
Source2: commitid
%else
Source0: http://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2
Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2
Source1: gitignore
%endif

@ -86,6 +86,7 @@ Patch101: 0001-Always-install-vbe-and-int10-sdk-headers.patch @@ -86,6 +86,7 @@ Patch101: 0001-Always-install-vbe-and-int10-sdk-headers.patch
Patch102: 0001-mustard-Enable-indirect-GLX-by-default.patch
Patch103: 06_use-intel-only-on-pre-gen4.diff
Patch104: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch
Patch105: 0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch

# Trivial things to never merge upstream ever:
# This really could be done prettier.
@ -93,9 +94,6 @@ Patch5002: xserver-1.4.99-ssh-isnt-local.patch @@ -93,9 +94,6 @@ Patch5002: xserver-1.4.99-ssh-isnt-local.patch
Patch5004: xserver-autobind-hotplug.patch
Patch5005: 0001-link-with-z-now.patch

# Bug 798994 - Exposure event not generated in Xinerama mode
Patch9231: 0001-xinerama-Implement-graphics-exposures-for-window-pix.patch

# Bug 1166989 - Tcl/tk Canvas draw error
Patch9423: RFC-mi-reduce-missing-segments-on-large-ellipse.patch

@ -111,11 +109,24 @@ Patch9703: 0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch @@ -111,11 +109,24 @@ Patch9703: 0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch
Patch9710: 0001-modesetting-software-cursor-hack.patch
Patch9711: 0001-handle-NullCursor-to-avoid-crash.patch
Patch9712: 0001-xfixes-Remove-the-CursorCurrent-array.patch
Patch9713: 0001-modesetting-Validate-the-atom-for-enum-properties.patch
Patch9714: 0001-dix-Remove-clients-from-input-and-output-ready-queue.patch
Patch9715: 0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch
Patch9716: 0001-xfree86-Fix-off-by-one-in-X-configure.patch
Patch9717: 0001-xfree86-modes-Make-colormap-gamma-glue-code-work-wit.patch

# Backport tablet support for Xwayland - *NOT* in server-1.19-branch
Patch9901: 0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch
Patch9902: 0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch
Patch9903: 0003-xwayland-Listen-for-wp_tablet_seat-events.patch
Patch9904: 0004-xwayland-Handle-wp_tablet-events.patch
Patch9905: 0005-xwayland-Handle-tablet_tool-events.patch
Patch9906: 0006-xwayland-handle-button-events-after-motion-events.patch
Patch9907: 0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch
Patch9908: 0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch
Patch9909: 0009-xwayland-add-tablet-pad-support.patch
Patch9910: 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch
Patch9911: 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch
Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch
# Bug 1544442
Patch9913: 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch

Patch9922: 0002-animcur-Use-fixed-size-screen-private.patch
Patch9923: 0003-animcur-Return-the-next-interval-directly-from-the-t.patch
@ -123,6 +134,10 @@ Patch9924: 0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch @@ -123,6 +134,10 @@ Patch9924: 0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch
Patch9925: 0005-animcur-Fix-transitions-between-animated-cursors.patch
Patch9926: 0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch

# Additional debug feature, allow to disable glamor in Xwayland using
# an envvar, could be useful in el7 - *NOT* in server-1.19-branch
Patch9951: 0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch

%global moduledir %{_libdir}/xorg/modules
%global drimoduledir %{_libdir}/dri
%global sdkdir %{_includedir}/xorg
@ -145,6 +160,7 @@ Patch9926: 0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch @@ -145,6 +160,7 @@ Patch9926: 0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch

%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev
%global xservers --enable-xvfb --enable-xnest --enable-dmx %{kdrive} %{enable_xorg}
%global wayland --enable-xwayland

BuildRequires: pam-devel
BuildRequires: systemtap-sdt-devel
@ -165,6 +181,10 @@ BuildRequires: libXinerama-devel libXi-devel @@ -165,6 +181,10 @@ BuildRequires: libXinerama-devel libXi-devel
BuildRequires: libXt-devel libdmx-devel libXmu-devel libXrender-devel
BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel

BuildRequires: wayland-devel
BuildRequires: wayland-protocols-devel >= 1.5
BuildRequires: pkgconfig(wayland-client) >= 1.3.0
BuildRequires: pkgconfig(epoxy)
BuildRequires: libXv-devel
BuildRequires: pixman-devel >= 0.30.0
BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel byacc flex
@ -303,6 +323,15 @@ X protocol, and therefore supports the newer X extensions like @@ -303,6 +323,15 @@ X protocol, and therefore supports the newer X extensions like
Render and Composite.


%package Xwayland
Summary: Wayland X Server
Group: User Interface/X
Requires: xorg-x11-server-common >= %{version}-%{release}

%description Xwayland
Xwayland is an X server for running X clients under Wayland.


%if %{with_hw_servers}
%package devel
Summary: SDK for X server driver module development
@ -369,21 +398,18 @@ sed -i 's/MAXCLIENTS\t2048/MAXCLIENTS\t4096/g' include/misc.h @@ -369,21 +398,18 @@ sed -i 's/MAXCLIENTS\t2048/MAXCLIENTS\t4096/g' include/misc.h
sed -i 's/LIMITCLIENTS\t256/LIMITCLIENTS\t1024/g' include/misc.h
###


%build

%global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins"

%if %{with_hw_servers}
%global dri_flags --with-dri-driver-path=%{drimoduledir} --enable-dri2 --enable-dri3 --enable-glamor --enable-xshmfence
%global dri_flags --with-dri-driver-path=%{drimoduledir} --enable-dri --enable-dri2 --enable-dri3 --enable-glamor --enable-xshmfence
%else
%global dri_flags --disable-dri
%endif

# ick
%if 0%{?rhel}
sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac
%endif

# --with-pie ?
autoreconf -f -v --install || exit 1
@ -404,8 +430,10 @@ autoreconf -f -v --install || exit 1 @@ -404,8 +430,10 @@ autoreconf -f -v --install || exit 1
--without-dtrace \
--disable-linux-acpi --disable-linux-apm \
--enable-xselinux --enable-record --enable-present \
--enable-xcsecurity \
--enable-config-udev \
--disable-unit-tests \
%{?wayland} \
%{dri_flags} %{?bodhi_flags} \
${CONFIGURE}
@ -513,9 +541,6 @@ rm -rf $RPM_BUILD_ROOT @@ -513,9 +541,6 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/xorg/modules/drivers/modesetting_drv.so
%dir %{_libdir}/xorg/modules/extensions
%{_libdir}/xorg/modules/extensions/libglx.so
%if !0%{?rhel}
%{_libdir}/xorg/modules/extensions/libxwayland.so
%endif
%dir %{_libdir}/xorg/modules/input
%{_libdir}/xorg/modules/libfbdevhw.so
%{_libdir}/xorg/modules/libexa.so
@ -577,6 +602,10 @@ rm -rf $RPM_BUILD_ROOT @@ -577,6 +602,10 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/Xephyr
%{_mandir}/man1/Xephyr.1*

%files Xwayland
%defattr(-,root,root,-)
%{_bindir}/Xwayland

%if %{with_hw_servers}
%files devel
%doc COPYING
@ -594,11 +623,29 @@ rm -rf $RPM_BUILD_ROOT @@ -594,11 +623,29 @@ rm -rf $RPM_BUILD_ROOT
%{xserver_source_dir}

%changelog
* Wed Feb 21 2018 Adam Jackson <ajax@redhat.com> - 1.19.3-11.2
* Tue Feb 13 2018 Adam Jackson <ajax@redhat.com> - 1.19.5-5
- Fix fetching animated cursor images with the XFIXES extension

* Mon Dec 11 2017 Adam Jackson <ajax@redhat.com> - 1.19.3-11.1
- Fix a crash in RANDR gamma/colormap setup
* Mon Feb 12 2018 Olivier Fourdan <ofourdan@redhat.com> - 1.19.5-4
- Fix cursor issue with Xwayland and tablet.

* Wed Feb 7 2018 Olivier Fourdan <ofourdan@redhat.com> - 1.19.5-3
- Fix "xvfb-run --auto-display" not working with xserver-1.19

* Mon Oct 23 2017 Adam Jackson <ajax@redhat.com> - 1.19.5-2
- Don't attempt to probe vesa or fbdev in X -configure

* Thu Oct 12 2017 Adam Jackson <ajax@redhat.com> - 1.19.5-1
- xserver 1.19.5

* Thu Oct 05 2017 Adam Jackson <ajax@redhat.com> - 1.19.4-1
- xserver 1.19.4

* Thu Sep 28 2017 Olivier Fourdan <ofourdan@redhat.com> - 1.19.3-13
- Enable dri3 and Xwayland, backport Xwayland and glamor fixes

* Fri Aug 25 2017 Adam Jackson <ajax@redhat.com> - 1.19.3-12
- Enable XC-SECURITY

* Mon Jun 26 2017 Adam Jackson <ajax@redhat.com> - 1.19.3-11
- Fix off-by-one in X -configure

Loading…
Cancel
Save