xserver 1.19.1
This commit is contained in:
parent
ee515e44b0
commit
62cd573e50
@ -1,87 +0,0 @@
|
|||||||
From c5bd98b820d7bd2c486daaaa919a4eda710fde6c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Fedora X Ninjas <x@fedoraproject.org>
|
|
||||||
Date: Fri, 28 Oct 2016 13:46:17 -0400
|
|
||||||
Subject: [PATCH] Fix segfault if xorg.conf.d is absent
|
|
||||||
|
|
||||||
---
|
|
||||||
hw/xfree86/common/xf86AutoConfig.c | 9 +++++++++
|
|
||||||
hw/xfree86/parser/read.c | 16 +++++++++++++++-
|
|
||||||
hw/xfree86/parser/xf86Parser.h | 1 +
|
|
||||||
3 files changed, 25 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
|
|
||||||
index 9402651..c3e17be 100644
|
|
||||||
--- a/hw/xfree86/common/xf86AutoConfig.c
|
|
||||||
+++ b/hw/xfree86/common/xf86AutoConfig.c
|
|
||||||
@@ -149,6 +149,15 @@ xf86AutoConfig(void)
|
|
||||||
char buf[1024];
|
|
||||||
ConfigStatus ret;
|
|
||||||
|
|
||||||
+ /* Make sure config rec is there */
|
|
||||||
+ if (xf86allocateConfig() != NULL) {
|
|
||||||
+ ret = CONFIG_OK; /* OK so far */
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ xf86Msg(X_ERROR, "Couldn't allocate Config record.\n");
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
listPossibleVideoDrivers(deviceList, 20);
|
|
||||||
|
|
||||||
for (p = deviceList; *p; p++) {
|
|
||||||
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
|
|
||||||
index ec038ae..d7e7312 100644
|
|
||||||
--- a/hw/xfree86/parser/read.c
|
|
||||||
+++ b/hw/xfree86/parser/read.c
|
|
||||||
@@ -56,6 +56,7 @@
|
|
||||||
#include <xorg-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#include "xf86Config.h"
|
|
||||||
#include "xf86Parser.h"
|
|
||||||
#include "xf86tokens.h"
|
|
||||||
#include "Configint.h"
|
|
||||||
@@ -91,7 +92,7 @@ xf86readConfigFile(void)
|
|
||||||
int token;
|
|
||||||
XF86ConfigPtr ptr = NULL;
|
|
||||||
|
|
||||||
- if ((ptr = calloc(1, sizeof(XF86ConfigRec))) == NULL) {
|
|
||||||
+ if ((ptr = xf86allocateConfig()) == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -270,6 +271,19 @@ xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2)
|
|
||||||
return (!(last_1 == last_2));
|
|
||||||
}
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * Conditionally allocate config struct, but only allocate it
|
|
||||||
+ * if it's not already there. In either event, return the pointer
|
|
||||||
+ * to the global config struct.
|
|
||||||
+ */
|
|
||||||
+XF86ConfigPtr xf86allocateConfig(void)
|
|
||||||
+{
|
|
||||||
+ if (!xf86configptr) {
|
|
||||||
+ xf86configptr = calloc(1, sizeof(XF86ConfigRec));
|
|
||||||
+ }
|
|
||||||
+ return xf86configptr;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void
|
|
||||||
xf86freeConfig(XF86ConfigPtr p)
|
|
||||||
{
|
|
||||||
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
|
|
||||||
index ff35846..9c4b403 100644
|
|
||||||
--- a/hw/xfree86/parser/xf86Parser.h
|
|
||||||
+++ b/hw/xfree86/parser/xf86Parser.h
|
|
||||||
@@ -449,6 +449,7 @@ extern char *xf86openConfigDirFiles(const char *path, const char *cmdline,
|
|
||||||
extern void xf86setBuiltinConfig(const char *config[]);
|
|
||||||
extern XF86ConfigPtr xf86readConfigFile(void);
|
|
||||||
extern void xf86closeConfigFile(void);
|
|
||||||
+extern XF86ConfigPtr xf86allocateConfig(void);
|
|
||||||
extern void xf86freeConfig(XF86ConfigPtr p);
|
|
||||||
extern int xf86writeConfigFile(const char *, XF86ConfigPtr);
|
|
||||||
extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident,
|
|
||||||
--
|
|
||||||
2.7.4
|
|
||||||
|
|
@ -1,517 +0,0 @@
|
|||||||
From 32e632e85894eddc3ace83f16f1e973b1be478fe Mon Sep 17 00:00:00 2001
|
|
||||||
From: Adam Jackson <ajax@redhat.com>
|
|
||||||
Date: Mon, 12 Dec 2016 13:08:17 -0500
|
|
||||||
Subject: [PATCH xserver] Revert "damage: Make damageRegionProcessPending take
|
|
||||||
a damage not a drawable"
|
|
||||||
|
|
||||||
The commit message makes the assertion that the code below damage is not
|
|
||||||
allowed to change whether there's a damage monitor for the drawable.
|
|
||||||
That turns out not to be the case! exa's mixed code, at least, will
|
|
||||||
create and destroy a damage in PrepareAccess. The destroy path can then
|
|
||||||
be catastrophic, as damageRegionProcessPending will attempt to
|
|
||||||
RegionEmpty memory from the middle of a freed block.
|
|
||||||
|
|
||||||
I'd wanted that invariant for performance, but faster isn't worth
|
|
||||||
broken, so revert it. I think what exa's doing is reasonable, so the
|
|
||||||
better way to improve performance for the unmonitored case is to either
|
|
||||||
revisit dynamically wrapping into the GC, or inline damage into dix.
|
|
||||||
|
|
||||||
This reverts commit 4e124203f2260daaf54155f4a05fe469733e0b97.
|
|
||||||
|
|
||||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1389886
|
|
||||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
||||||
---
|
|
||||||
miext/damage/damage.c | 121 +++++++++++++++++++++++++-------------------------
|
|
||||||
1 file changed, 60 insertions(+), 61 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
|
|
||||||
index 17c2abf..d6a3614 100644
|
|
||||||
--- a/miext/damage/damage.c
|
|
||||||
+++ b/miext/damage/damage.c
|
|
||||||
@@ -282,8 +282,10 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-damageRegionProcessPending(DamagePtr pDamage)
|
|
||||||
+damageRegionProcessPending(DrawablePtr pDrawable)
|
|
||||||
{
|
|
||||||
+ drawableDamage(pDrawable);
|
|
||||||
+
|
|
||||||
for (; pDamage != NULL; pDamage = pDamage->pNext) {
|
|
||||||
if (pDamage->reportAfter) {
|
|
||||||
/* It's possible that there is only interest in postRendering reporting. */
|
|
||||||
@@ -358,7 +360,6 @@ damageCreateGC(GCPtr pGC)
|
|
||||||
|
|
||||||
#define DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable) \
|
|
||||||
damageGCPriv(pGC); \
|
|
||||||
- drawableDamage(pDrawable); \
|
|
||||||
const GCFuncs *oldFuncs = pGC->funcs; \
|
|
||||||
unwrap(pGCPriv, pGC, funcs); \
|
|
||||||
unwrap(pGCPriv, pGC, ops); \
|
|
||||||
@@ -456,7 +457,7 @@ damageDestroyClip(GCPtr pGC)
|
|
||||||
#define BOX_NOT_EMPTY(box) \
|
|
||||||
(((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
|
|
||||||
|
|
||||||
-#define checkGCDamage(d,g) (d && \
|
|
||||||
+#define checkGCDamage(d,g) (getDrawableDamage(d) && \
|
|
||||||
(!g->pCompositeClip ||\
|
|
||||||
RegionNotEmpty(g->pCompositeClip)))
|
|
||||||
|
|
||||||
@@ -468,7 +469,8 @@ damageDestroyClip(GCPtr pGC)
|
|
||||||
if(box.y2 > extents->y2) box.y2 = extents->y2; \
|
|
||||||
}
|
|
||||||
|
|
||||||
-#define checkPictureDamage(d, p) (d && RegionNotEmpty(p->pCompositeClip))
|
|
||||||
+#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \
|
|
||||||
+ RegionNotEmpty(p->pCompositeClip))
|
|
||||||
|
|
||||||
static void
|
|
||||||
damageComposite(CARD8 op,
|
|
||||||
@@ -485,9 +487,8 @@ damageComposite(CARD8 op,
|
|
||||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
||||||
|
|
||||||
damageScrPriv(pScreen);
|
|
||||||
- drawableDamage(pDst->pDrawable);
|
|
||||||
|
|
||||||
- if (checkPictureDamage(pDamage, pDst)) {
|
|
||||||
+ if (checkPictureDamage(pDst)) {
|
|
||||||
BoxRec box;
|
|
||||||
|
|
||||||
box.x1 = xDst + pDst->pDrawable->x;
|
|
||||||
@@ -504,7 +505,7 @@ damageComposite(CARD8 op,
|
|
||||||
pMask,
|
|
||||||
pDst,
|
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDst->pDrawable);
|
|
||||||
wrap(pScrPriv, ps, Composite, damageComposite);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -520,9 +521,8 @@ damageGlyphs(CARD8 op,
|
|
||||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
||||||
|
|
||||||
damageScrPriv(pScreen);
|
|
||||||
- drawableDamage(pDst->pDrawable);
|
|
||||||
|
|
||||||
- if (checkPictureDamage(pDamage, pDst)) {
|
|
||||||
+ if (checkPictureDamage(pDst)) {
|
|
||||||
int nlistTmp = nlist;
|
|
||||||
GlyphListPtr listTmp = list;
|
|
||||||
GlyphPtr *glyphsTmp = glyphs;
|
|
||||||
@@ -567,7 +567,7 @@ damageGlyphs(CARD8 op,
|
|
||||||
}
|
|
||||||
unwrap(pScrPriv, ps, Glyphs);
|
|
||||||
(*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDst->pDrawable);
|
|
||||||
wrap(pScrPriv, ps, Glyphs, damageGlyphs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -579,9 +579,8 @@ damageAddTraps(PicturePtr pPicture,
|
|
||||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
||||||
|
|
||||||
damageScrPriv(pScreen);
|
|
||||||
- drawableDamage(pPicture->pDrawable);
|
|
||||||
|
|
||||||
- if (checkPictureDamage(pDamage, pPicture)) {
|
|
||||||
+ if (checkPictureDamage(pPicture)) {
|
|
||||||
BoxRec box;
|
|
||||||
int i;
|
|
||||||
int x, y;
|
|
||||||
@@ -616,7 +615,7 @@ damageAddTraps(PicturePtr pPicture,
|
|
||||||
}
|
|
||||||
unwrap(pScrPriv, ps, AddTraps);
|
|
||||||
(*ps->AddTraps) (pPicture, x_off, y_off, ntrap, traps);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pPicture->pDrawable);
|
|
||||||
wrap(pScrPriv, ps, AddTraps, damageAddTraps);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -628,7 +627,7 @@ damageFillSpans(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (npt && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (npt && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
int nptTmp = npt;
|
|
||||||
DDXPointPtr pptTmp = ppt;
|
|
||||||
int *pwidthTmp = pwidth;
|
|
||||||
@@ -664,7 +663,7 @@ damageFillSpans(DrawablePtr pDrawable,
|
|
||||||
|
|
||||||
(*pGC->ops->FillSpans) (pDrawable, pGC, npt, ppt, pwidth, fSorted);
|
|
||||||
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -676,7 +675,7 @@ damageSetSpans(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (npt && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (npt && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
DDXPointPtr pptTmp = ppt;
|
|
||||||
int *pwidthTmp = pwidth;
|
|
||||||
int nptTmp = npt;
|
|
||||||
@@ -710,7 +709,7 @@ damageSetSpans(DrawablePtr pDrawable,
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->SetSpans) (pDrawable, pGC, pcharsrc, ppt, pwidth, npt, fSorted);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -722,7 +721,7 @@ damagePutImage(DrawablePtr pDrawable,
|
|
||||||
int y, int w, int h, int leftPad, int format, char *pImage)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
- if (checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
|
|
||||||
box.x1 = x + pDrawable->x;
|
|
||||||
@@ -736,7 +735,7 @@ damagePutImage(DrawablePtr pDrawable,
|
|
||||||
}
|
|
||||||
(*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h,
|
|
||||||
leftPad, format, pImage);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -750,7 +749,7 @@ damageCopyArea(DrawablePtr pSrc,
|
|
||||||
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDst);
|
|
||||||
|
|
||||||
- if (checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (checkGCDamage(pDst, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
|
|
||||||
box.x1 = dstx + pDst->x;
|
|
||||||
@@ -765,7 +764,7 @@ damageCopyArea(DrawablePtr pSrc,
|
|
||||||
|
|
||||||
ret = (*pGC->ops->CopyArea) (pSrc, pDst,
|
|
||||||
pGC, srcx, srcy, width, height, dstx, dsty);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDst);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDst);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@@ -783,7 +782,7 @@ damageCopyPlane(DrawablePtr pSrc,
|
|
||||||
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDst);
|
|
||||||
|
|
||||||
- if (checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (checkGCDamage(pDst, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
|
|
||||||
box.x1 = dstx + pDst->x;
|
|
||||||
@@ -799,7 +798,7 @@ damageCopyPlane(DrawablePtr pSrc,
|
|
||||||
ret = (*pGC->ops->CopyPlane) (pSrc, pDst,
|
|
||||||
pGC, srcx, srcy, width, height, dstx, dsty,
|
|
||||||
bitPlane);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDst);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDst);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@@ -810,7 +809,7 @@ damagePolyPoint(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (npt && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (npt && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
int nptTmp = npt;
|
|
||||||
xPoint *pptTmp = ppt;
|
|
||||||
@@ -840,7 +839,7 @@ damagePolyPoint(DrawablePtr pDrawable,
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, ppt);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -850,7 +849,7 @@ damagePolylines(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (npt && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (npt && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
int nptTmp = npt;
|
|
||||||
DDXPointPtr pptTmp = ppt;
|
|
||||||
BoxRec box;
|
|
||||||
@@ -913,7 +912,7 @@ damagePolylines(DrawablePtr pDrawable,
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppt);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -922,7 +921,7 @@ damagePolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSeg, xSegment * pSeg)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (nSeg && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (nSeg && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
int extra = pGC->lineWidth;
|
|
||||||
int nsegTmp = nSeg;
|
|
||||||
@@ -992,7 +991,7 @@ damagePolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSeg, xSegment * pSeg)
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolySegment) (pDrawable, pGC, nSeg, pSeg);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1002,7 +1001,7 @@ damagePolyRectangle(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (nRects && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (nRects && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
int offset1, offset2, offset3;
|
|
||||||
int nRectsTmp = nRects;
|
|
||||||
@@ -1051,7 +1050,7 @@ damagePolyRectangle(DrawablePtr pDrawable,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolyRectangle) (pDrawable, pGC, nRects, pRects);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1060,7 +1059,7 @@ damagePolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (nArcs && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (nArcs && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
int extra = pGC->lineWidth >> 1;
|
|
||||||
BoxRec box;
|
|
||||||
int nArcsTmp = nArcs;
|
|
||||||
@@ -1098,7 +1097,7 @@ damagePolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolyArc) (pDrawable, pGC, nArcs, pArcs);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1108,7 +1107,7 @@ damageFillPolygon(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (npt > 2 && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (npt > 2 && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
DDXPointPtr pptTmp = ppt;
|
|
||||||
int nptTmp = npt;
|
|
||||||
BoxRec box;
|
|
||||||
@@ -1157,7 +1156,7 @@ damageFillPolygon(DrawablePtr pDrawable,
|
|
||||||
}
|
|
||||||
|
|
||||||
(*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, npt, ppt);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1166,7 +1165,7 @@ damagePolyFillRect(DrawablePtr pDrawable,
|
|
||||||
GCPtr pGC, int nRects, xRectangle *pRects)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
- if (nRects && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (nRects && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
xRectangle *pRectsTmp = pRects;
|
|
||||||
int nRectsTmp = nRects;
|
|
||||||
@@ -1193,7 +1192,7 @@ damagePolyFillRect(DrawablePtr pDrawable,
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolyFillRect) (pDrawable, pGC, nRects, pRects);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1202,7 +1201,7 @@ damagePolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
|
|
||||||
- if (nArcs && checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (nArcs && checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
int nArcsTmp = nArcs;
|
|
||||||
xArc *pArcsTmp = pArcs;
|
|
||||||
@@ -1229,7 +1228,7 @@ damagePolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PolyFillArc) (pDrawable, pGC, nArcs, pArcs);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1278,9 +1277,12 @@ damageDamageChars(DrawablePtr pDrawable,
|
|
||||||
#define TT_IMAGE16 3
|
|
||||||
|
|
||||||
static void
|
|
||||||
-damageText(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned long count,
|
|
||||||
- char *chars, FontEncoding fontEncoding, DamagePtr pDamage,
|
|
||||||
- Bool textType)
|
|
||||||
+damageText(DrawablePtr pDrawable,
|
|
||||||
+ GCPtr pGC,
|
|
||||||
+ int x,
|
|
||||||
+ int y,
|
|
||||||
+ unsigned long count,
|
|
||||||
+ char *chars, FontEncoding fontEncoding, Bool textType)
|
|
||||||
{
|
|
||||||
CharInfoPtr *charinfo;
|
|
||||||
unsigned long i;
|
|
||||||
@@ -1289,7 +1291,7 @@ damageText(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned long count,
|
|
||||||
|
|
||||||
imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
|
|
||||||
|
|
||||||
- if (!pDamage)
|
|
||||||
+ if (!checkGCDamage(pDrawable, pGC))
|
|
||||||
return;
|
|
||||||
|
|
||||||
charinfo = xallocarray(count, sizeof(CharInfoPtr));
|
|
||||||
@@ -1314,9 +1316,9 @@ damagePolyText8(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
|
|
||||||
- pDamage, TT_POLY8);
|
|
||||||
+ TT_POLY8);
|
|
||||||
x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
@@ -1328,9 +1330,9 @@ damagePolyText16(DrawablePtr pDrawable,
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
|
|
||||||
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
|
|
||||||
- pDamage, TT_POLY16);
|
|
||||||
+ TT_POLY16);
|
|
||||||
x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
@@ -1341,9 +1343,9 @@ damageImageText8(DrawablePtr pDrawable,
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
|
|
||||||
- pDamage, TT_IMAGE8);
|
|
||||||
+ TT_IMAGE8);
|
|
||||||
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1354,9 +1356,9 @@ damageImageText16(DrawablePtr pDrawable,
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
|
|
||||||
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
|
|
||||||
- pDamage, TT_IMAGE16);
|
|
||||||
+ TT_IMAGE16);
|
|
||||||
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1371,7 +1373,7 @@ damageImageGlyphBlt(DrawablePtr pDrawable,
|
|
||||||
damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y,
|
|
||||||
nglyph, ppci, TRUE, pGC->subWindowMode);
|
|
||||||
(*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1386,7 +1388,7 @@ damagePolyGlyphBlt(DrawablePtr pDrawable,
|
|
||||||
damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y,
|
|
||||||
nglyph, ppci, FALSE, pGC->subWindowMode);
|
|
||||||
(*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1396,7 +1398,7 @@ damagePushPixels(GCPtr pGC,
|
|
||||||
DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg)
|
|
||||||
{
|
|
||||||
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
|
|
||||||
- if (checkGCDamage(pDamage, pGC)) {
|
|
||||||
+ if (checkGCDamage(pDrawable, pGC)) {
|
|
||||||
BoxRec box;
|
|
||||||
|
|
||||||
box.x1 = xOrg;
|
|
||||||
@@ -1415,7 +1417,7 @@ damagePushPixels(GCPtr pGC,
|
|
||||||
damageDamageBox(pDrawable, &box, pGC->subWindowMode);
|
|
||||||
}
|
|
||||||
(*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1480,7 +1482,6 @@ damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|
||||||
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
|
||||||
|
|
||||||
damageScrPriv(pScreen);
|
|
||||||
- drawableDamage(&pWindow->drawable);
|
|
||||||
|
|
||||||
if (getWindowDamage(pWindow)) {
|
|
||||||
int dx = pWindow->drawable.x - ptOldOrg.x;
|
|
||||||
@@ -1496,7 +1497,7 @@ damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|
||||||
}
|
|
||||||
unwrap(pScrPriv, pScreen, CopyWindow);
|
|
||||||
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(&pWindow->drawable);
|
|
||||||
wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1870,22 +1871,20 @@ DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion)
|
|
||||||
void
|
|
||||||
DamageRegionProcessPending(DrawablePtr pDrawable)
|
|
||||||
{
|
|
||||||
- drawableDamage(pDrawable);
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
|
|
||||||
void
|
|
||||||
DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion)
|
|
||||||
{
|
|
||||||
- drawableDamage(pDrawable);
|
|
||||||
damageRegionAppend(pDrawable, pRegion, FALSE, -1);
|
|
||||||
|
|
||||||
/* Go back and report this damage for DamagePtrs with reportAfter set, since
|
|
||||||
* this call isn't part of an in-progress drawing op in the call chain and
|
|
||||||
* the DDX probably just wants to know about it right away.
|
|
||||||
*/
|
|
||||||
- damageRegionProcessPending(pDamage);
|
|
||||||
+ damageRegionProcessPending(pDrawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
From 578d032c3646f2c3ee4be8b8ebdfe89418ef71ce Mon Sep 17 00:00:00 2001
|
|
||||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
||||||
Date: Fri, 11 Nov 2016 15:28:50 +1000
|
|
||||||
Subject: [PATCH xserver] Xi: when creating a new master device, update barries
|
|
||||||
for all clients
|
|
||||||
|
|
||||||
The previous code only worked when the barrier was created by the same client
|
|
||||||
as the one calling XIChangeDeviceHierarchy.
|
|
||||||
|
|
||||||
http://bugzilla.redhat.com/show_bug.cgi?id=1384432
|
|
||||||
|
|
||||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
||||||
---
|
|
||||||
Xi/xichangehierarchy.c | 6 ++++--
|
|
||||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
|
|
||||||
index 8d5b577..f2b7785 100644
|
|
||||||
--- a/Xi/xichangehierarchy.c
|
|
||||||
+++ b/Xi/xichangehierarchy.c
|
|
||||||
@@ -194,7 +194,8 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
|
|
||||||
flags[XTestptr->id] |= XISlaveAttached;
|
|
||||||
flags[XTestkeybd->id] |= XISlaveAttached;
|
|
||||||
|
|
||||||
- XIBarrierNewMasterDevice(client, ptr->id);
|
|
||||||
+ for (int i = 0; i < currentMaxClients; i++)
|
|
||||||
+ XIBarrierNewMasterDevice(clients[i], ptr->id);
|
|
||||||
|
|
||||||
unwind:
|
|
||||||
free(name);
|
|
||||||
@@ -300,7 +301,8 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- XIBarrierRemoveMasterDevice(client, ptr->id);
|
|
||||||
+ for (int i = 0; i < currentMaxClients; i++)
|
|
||||||
+ XIBarrierRemoveMasterDevice(clients[i], ptr->id);
|
|
||||||
|
|
||||||
/* disable the remove the devices, XTest devices must be done first
|
|
||||||
else the sprites they rely on will be destroyed */
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
From 12c471a80334127984f0bd251ecea6a7eb3f1414 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
Date: Mon, 19 Dec 2016 20:50:48 +0100
|
|
||||||
Subject: [PATCH xserver] glamor: glamor_egl_get_display: Return NULL if
|
|
||||||
eglGetPlatformDisplayEXT returns NULL
|
|
||||||
|
|
||||||
If the libEGL we are using has eglGetPlatformDisplayEXT, yet it still
|
|
||||||
returns NULL, then this very likely means that it does not support
|
|
||||||
the type (e.g. EGL_PLATFORM_GBM_MESA) passed in, and then returning NULL
|
|
||||||
is the right thing to do.
|
|
||||||
|
|
||||||
This avoids falling back to an eglGetDisplay() implementation which does
|
|
||||||
not understands the passed in gbm handle, treats it as a pointer to
|
|
||||||
something else completely, followed by a crash sooner or later.
|
|
||||||
|
|
||||||
Specifically this fixes using the nvidia binary driver, with nvidia's
|
|
||||||
libEGL + the modesetting driver on a secondary GPU crashing inside
|
|
||||||
glamor_egl_init() sometimes.
|
|
||||||
|
|
||||||
Cc: Adam Jackson <ajax@redhat.com>
|
|
||||||
Cc: Eric Anholt <eric@anholt.net>
|
|
||||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
---
|
|
||||||
glamor/glamor_egl.c | 4 ++++
|
|
||||||
glamor/glamor_egl.h | 4 +---
|
|
||||||
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
|
|
||||||
index 9cc0f8d..4bde637 100644
|
|
||||||
--- a/glamor/glamor_egl.c
|
|
||||||
+++ b/glamor/glamor_egl.c
|
|
||||||
@@ -769,6 +769,10 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|
||||||
|
|
||||||
glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA,
|
|
||||||
glamor_egl->gbm);
|
|
||||||
+ if (!glamor_egl->display) {
|
|
||||||
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n");
|
|
||||||
+ goto error;
|
|
||||||
+ }
|
|
||||||
#else
|
|
||||||
glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd);
|
|
||||||
#endif
|
|
||||||
diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h
|
|
||||||
index 6b05f57..2c6d307 100644
|
|
||||||
--- a/glamor/glamor_egl.h
|
|
||||||
+++ b/glamor/glamor_egl.h
|
|
||||||
@@ -67,9 +67,7 @@ glamor_egl_get_display(EGLint type, void *native)
|
|
||||||
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT =
|
|
||||||
(void *) eglGetProcAddress("eglGetPlatformDisplayEXT");
|
|
||||||
if (getPlatformDisplayEXT)
|
|
||||||
- dpy = getPlatformDisplayEXT(type, native, NULL);
|
|
||||||
- if (dpy)
|
|
||||||
- return dpy;
|
|
||||||
+ return getPlatformDisplayEXT(type, native, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Welp, everything is awful. */
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
|||||||
From 10f3c8d6eab0af074d0371152ada543e4dfe7369 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hans De Goede <hdegoede@redhat.com>
|
|
||||||
Date: Tue, 22 Nov 2016 15:28:51 +0100
|
|
||||||
Subject: [PATCH xserver 1/2] randr: rrCheckPixmapBounding: Do not substract
|
|
||||||
crtc non 0 x, y from screen size
|
|
||||||
|
|
||||||
The purpose of rrCheckPixmapBounding is to make sure that the
|
|
||||||
screen_pixmap is large enough for the slave-output which crtc is
|
|
||||||
being configured.
|
|
||||||
|
|
||||||
This should include crtc->x and crtc->y, otherwise the crtc might
|
|
||||||
still end up scanning out an area outside of the screen-pixmap.
|
|
||||||
|
|
||||||
For example: Take a laptop with an external monitor on a slave-output at
|
|
||||||
1920x1080+0+0 and its internal-screen at 3840x2160+1920+0 and in
|
|
||||||
gnome-settings-daemon move the external monitor to be on the ri ght of
|
|
||||||
the internal screen rather then on the left. First g-s-d will do a
|
|
||||||
RRSetScreenSize to 5760*2160 (which is a nop), then it calls RRSetCrtc
|
|
||||||
to move the slave output to 1920x1080+3840+0, since this is a slave
|
|
||||||
output, rrCheckPixmapBounding gets called, since the 2 crtcs now overlap
|
|
||||||
the code before this commit would shrinks the screen_pixmap to 3180*2160.
|
|
||||||
Then g-s-d calls RRSetCrtc to move the internal screen to 3180*2160+0+0.
|
|
||||||
|
|
||||||
And we end up with the slave-output configured to scan-out an area
|
|
||||||
which completely falls outside of the screen-pixmap (and end up with
|
|
||||||
a black display on the external monitor).
|
|
||||||
|
|
||||||
This commit fixes this by not substracting the x1 and y1 coordinates
|
|
||||||
of the union-ed region when determining the new screen_pixmap size.
|
|
||||||
|
|
||||||
Cc: Nikhil Mahale <nmahale@nvidia.com>
|
|
||||||
Cc: Dave Airlie <airlied@redhat.com>
|
|
||||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
||||||
---
|
|
||||||
randr/rrcrtc.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
|
|
||||||
index 5d404e8..ac853ea 100644
|
|
||||||
--- a/randr/rrcrtc.c
|
|
||||||
+++ b/randr/rrcrtc.c
|
|
||||||
@@ -686,8 +686,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
|
|
||||||
}
|
|
||||||
|
|
||||||
newsize = RegionExtents(&total_region);
|
|
||||||
- new_width = newsize->x2 - newsize->x1;
|
|
||||||
- new_height = newsize->y2 - newsize->y1;
|
|
||||||
+ new_width = newsize->x2;
|
|
||||||
+ new_height = newsize->y2;
|
|
||||||
|
|
||||||
if (new_width == screen_pixmap->drawable.width &&
|
|
||||||
new_height == screen_pixmap->drawable.height) {
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
|||||||
From 5fd444d8e92dd6ae9a2bb0b5235e2375a17f09ac Mon Sep 17 00:00:00 2001
|
|
||||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
Date: Tue, 22 Nov 2016 09:48:03 +0100
|
|
||||||
Subject: [PATCH xserver] xwayland: Fix use after free of cursors
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Sometimes, Xwayland will try to use a cursor that has just been freed,
|
|
||||||
leading to a crash when trying to access that cursor data either in
|
|
||||||
miPointerUpdateSprite() or AnimCurTimerNotify().
|
|
||||||
|
|
||||||
CheckMotion() updates the pointer's cursor based on which xwindow
|
|
||||||
XYToWindow() returns, and Xwayland implements its own xwl_xy_to_window()
|
|
||||||
to fake a crossing to the root window when the pointer has left the
|
|
||||||
Wayland surface but is still within the xwindow.
|
|
||||||
|
|
||||||
But after an xwindow is unrealized, the last xwindow used to match the
|
|
||||||
xwindows is cleared so two consecutive calls to xwl_xy_to_window() may
|
|
||||||
not return the same xwindow.
|
|
||||||
|
|
||||||
To avoid this issue, update the last_xwindow based on enter and leave
|
|
||||||
notifications instead of xwl_xy_to_window(), and check if the xwindow
|
|
||||||
found by the regular miXYToWindow() is a child of the known last
|
|
||||||
xwindow, so that multiple consecutive calls to xwl_xy_to_window()
|
|
||||||
return the same xwindow, being either the one found by miXYToWindow()
|
|
||||||
or the root window.
|
|
||||||
|
|
||||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1385258
|
|
||||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
Tested-by: Vít Ondruch <vondruch@redhat.com>
|
|
||||||
Tested-by: Satish Balay <balay@fastmail.fm>
|
|
||||||
---
|
|
||||||
hw/xwayland/xwayland-input.c | 17 +++++++++++++----
|
|
||||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
|
|
||||||
index 0526122..681bc9d 100644
|
|
||||||
--- a/hw/xwayland/xwayland-input.c
|
|
||||||
+++ b/hw/xwayland/xwayland-input.c
|
|
||||||
@@ -312,6 +312,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
|
|
||||||
dx = xwl_seat->focus_window->window->drawable.x;
|
|
||||||
dy = xwl_seat->focus_window->window->drawable.y;
|
|
||||||
|
|
||||||
+ /* We just entered a new xwindow, forget about the old last xwindow */
|
|
||||||
+ xwl_seat->last_xwindow = NullWindow;
|
|
||||||
+
|
|
||||||
master = GetMaster(dev, POINTER_OR_FLOAT);
|
|
||||||
(*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE);
|
|
||||||
|
|
||||||
@@ -360,8 +363,14 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
|
|
||||||
|
|
||||||
xwl_seat->xwl_screen->serial = serial;
|
|
||||||
|
|
||||||
- xwl_seat->focus_window = NULL;
|
|
||||||
- CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
|
|
||||||
+ /* The pointer has left a known xwindow, save it for a possible match
|
|
||||||
+ * in sprite_check_lost_focus()
|
|
||||||
+ */
|
|
||||||
+ if (xwl_seat->focus_window) {
|
|
||||||
+ xwl_seat->last_xwindow = xwl_seat->focus_window->window;
|
|
||||||
+ xwl_seat->focus_window = NULL;
|
|
||||||
+ CheckMotion(NULL, GetMaster(dev, POINTER_OR_FLOAT));
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
@@ -1256,10 +1265,10 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
|
|
||||||
*/
|
|
||||||
if (master->lastSlave == xwl_seat->pointer &&
|
|
||||||
xwl_seat->focus_window == NULL &&
|
|
||||||
- xwl_seat->last_xwindow == window)
|
|
||||||
+ xwl_seat->last_xwindow != NullWindow &&
|
|
||||||
+ IsParent (xwl_seat->last_xwindow, window))
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
- xwl_seat->last_xwindow = window;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
|||||||
From a17f2aee7e46b4f0e4214fbbac5e1b1d12057dbe Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hans De Goede <hdegoede@redhat.com>
|
|
||||||
Date: Tue, 22 Nov 2016 15:28:52 +0100
|
|
||||||
Subject: [PATCH xserver 2/2] randr: rrCheckPixmapBounding: do not shrink the
|
|
||||||
screen_pixmap
|
|
||||||
|
|
||||||
The purpose of rrCheckPixmapBounding is to make sure that the
|
|
||||||
screen_pixmap is *large* enough for the slave-output which crtc is
|
|
||||||
being configured.
|
|
||||||
|
|
||||||
However until now rrCheckPixmapBounding would also shrink the
|
|
||||||
screen_pixmap in certain scenarios leading to various problems.
|
|
||||||
|
|
||||||
For example: Take a laptop with its internalscreen on a slave-output and
|
|
||||||
currently disabled and an external monitor at 1920x1080+0+0.
|
|
||||||
Now lets say that we want to drive the external monitor at its native
|
|
||||||
resolution of 2560x1440 and have the internal screen mirror the top left
|
|
||||||
part of the external monitor, so we run:
|
|
||||||
|
|
||||||
$ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \
|
|
||||||
--mode 2560x1440 --pos 0x0
|
|
||||||
|
|
||||||
Here xrandr utility first calls RRSetScreenSize to 2560x1440, then it
|
|
||||||
calls RRSetCrtc 1920x1080+0+0 on the eDP, since this is a slave output,
|
|
||||||
rrCheckPixmapBounding gets called and resizes the screen_pixmap to
|
|
||||||
1920x1080, undoing the RRSetScreenSize. Then RRSetCrtc 2560x1440+0+0
|
|
||||||
gets called on the HDMI, depending on crtc->transforms this will
|
|
||||||
either result in a BadValue error from ProcRRSetCrtcConfig; or
|
|
||||||
it will succeed, but the monitor ends up running at 2560x1440
|
|
||||||
while showing a 1920x1080 screen_pixmap + black borders on the right
|
|
||||||
and bottom. Neither of which is what we want.
|
|
||||||
|
|
||||||
This commit removes the troublesome shrinking behavior, fixing this.
|
|
||||||
|
|
||||||
Note:
|
|
||||||
|
|
||||||
1) One could argue that this will leave us with a too large screen_pixmap
|
|
||||||
in some cases, but rrCheckPixmapBounding only gets called for slave
|
|
||||||
outputs, so xrandr clients already must manually shrink the screen_pixmap
|
|
||||||
after disabling crtcs in normal setups.
|
|
||||||
|
|
||||||
2) An alternative approach would be to also call rrCheckPixmapBounding
|
|
||||||
on RRSetCrtc on normal (non-slave) outputs, but that would result in
|
|
||||||
2 unnecessary resizes of the screen_pixmap in the above example, which
|
|
||||||
seems undesirable.
|
|
||||||
|
|
||||||
Cc: Nikhil Mahale <nmahale@nvidia.com>
|
|
||||||
Cc: Dave Airlie <airlied@redhat.com>
|
|
||||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
---
|
|
||||||
randr/rrcrtc.c | 6 ++++++
|
|
||||||
1 file changed, 6 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
|
|
||||||
index ac853ea..d1a51f0 100644
|
|
||||||
--- a/randr/rrcrtc.c
|
|
||||||
+++ b/randr/rrcrtc.c
|
|
||||||
@@ -689,6 +689,12 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
|
|
||||||
new_width = newsize->x2;
|
|
||||||
new_height = newsize->y2;
|
|
||||||
|
|
||||||
+ if (new_width < screen_pixmap->drawable.width)
|
|
||||||
+ new_width = screen_pixmap->drawable.width;
|
|
||||||
+
|
|
||||||
+ if (new_height < screen_pixmap->drawable.height)
|
|
||||||
+ new_height = screen_pixmap->drawable.height;
|
|
||||||
+
|
|
||||||
if (new_width == screen_pixmap->drawable.width &&
|
|
||||||
new_height == screen_pixmap->drawable.height) {
|
|
||||||
} else {
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
|||||||
From 57e7f3bbba2d6a38d31ed0c32b9cf47affc12ddd Mon Sep 17 00:00:00 2001
|
|
||||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
Date: Thu, 3 Nov 2016 09:59:30 +0100
|
|
||||||
Subject: [PATCH xserver v2 4/7] glamor: restore vfunc handlers on init failure
|
|
||||||
|
|
||||||
In glamor_init(), if the minimum requirements are not met, glamor may
|
|
||||||
fail after setting up its own CloseScreen() and DestroyPixmap()
|
|
||||||
routines, leading to a crash when either of the two routines is called
|
|
||||||
if glamor failed to complete its initialization, e.g:
|
|
||||||
|
|
||||||
(EE) Backtrace:
|
|
||||||
(EE) 0: Xwayland (OsSigHandler+0x29)
|
|
||||||
(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0)
|
|
||||||
(EE) 2: Xwayland (glamor_sync_close+0x2a)
|
|
||||||
(EE) 3: Xwayland (glamor_close_screen+0x52)
|
|
||||||
(EE) 4: Xwayland (CursorCloseScreen+0x88)
|
|
||||||
(EE) 5: Xwayland (AnimCurCloseScreen+0xa4)
|
|
||||||
(EE) 6: Xwayland (present_close_screen+0x42)
|
|
||||||
(EE) 7: Xwayland (dix_main+0x4f9)
|
|
||||||
(EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf1)
|
|
||||||
(EE) 9: Xwayland (_start+0x2a)
|
|
||||||
|
|
||||||
Restore the previous CloseScreen() and DestroyPixmap() vfunc handlers in
|
|
||||||
case of failure when checking for the minimum requirements, so that if
|
|
||||||
any of the requirement is not met we don't leave the CloseScreen() and
|
|
||||||
DestroyPixmap() from glamor handlers in place.
|
|
||||||
|
|
||||||
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1390018
|
|
||||||
|
|
||||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
|
||||||
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
||||||
---
|
|
||||||
glamor/glamor.c | 11 ++++++++---
|
|
||||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/glamor/glamor.c b/glamor/glamor.c
|
|
||||||
index b771832..c54cf3b 100644
|
|
||||||
--- a/glamor/glamor.c
|
|
||||||
+++ b/glamor/glamor.c
|
|
||||||
@@ -470,7 +470,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|
||||||
LogMessage(X_WARNING,
|
|
||||||
"glamor%d: Failed to allocate screen private\n",
|
|
||||||
screen->myNum);
|
|
||||||
- goto fail;
|
|
||||||
+ goto free_glamor_private;
|
|
||||||
}
|
|
||||||
|
|
||||||
glamor_set_screen_private(screen, glamor_priv);
|
|
||||||
@@ -480,7 +480,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|
||||||
LogMessage(X_WARNING,
|
|
||||||
"glamor%d: Failed to allocate pixmap private\n",
|
|
||||||
screen->myNum);
|
|
||||||
- goto fail;
|
|
||||||
+ goto free_glamor_private;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&glamor_gc_private_key, PRIVATE_GC,
|
|
||||||
@@ -488,7 +488,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|
||||||
LogMessage(X_WARNING,
|
|
||||||
"glamor%d: Failed to allocate gc private\n",
|
|
||||||
screen->myNum);
|
|
||||||
- goto fail;
|
|
||||||
+ goto free_glamor_private;
|
|
||||||
}
|
|
||||||
|
|
||||||
glamor_priv->saved_procs.close_screen = screen->CloseScreen;
|
|
||||||
@@ -731,6 +731,11 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
fail:
|
|
||||||
+ /* Restore default CloseScreen and DestroyPixmap handlers */
|
|
||||||
+ screen->CloseScreen = glamor_priv->saved_procs.close_screen;
|
|
||||||
+ screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
|
|
||||||
+
|
|
||||||
+ free_glamor_private:
|
|
||||||
free(glamor_priv);
|
|
||||||
glamor_set_screen_private(screen, NULL);
|
|
||||||
return FALSE;
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
6a4d01e4e5047ab8f556960424ba1fa9 xorg-server-1.19.0.tar.bz2
|
SHA512 (xorg-server-1.19.1.tar.bz2) = 37d413fdd96ce6b15ae20ca5028331498586044cfc7a6ab0acb99201b04063c69bcd06867f2dc33237b244ce2870a1c5a4be3cbe4560f2461894f46f8d5dbdd7
|
||||||
|
@ -44,8 +44,8 @@
|
|||||||
|
|
||||||
Summary: X.Org X11 X server
|
Summary: X.Org X11 X server
|
||||||
Name: xorg-x11-server
|
Name: xorg-x11-server
|
||||||
Version: 1.19.0
|
Version: 1.19.1
|
||||||
Release: 4%{?gitdate:.%{gitdate}}%{dist}
|
Release: 1%{?gitdate:.%{gitdate}}%{dist}
|
||||||
URL: http://www.x.org
|
URL: http://www.x.org
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: User Interface/X
|
Group: User Interface/X
|
||||||
@ -78,14 +78,9 @@ Source31: xserver-sdk-abi-requires.git
|
|||||||
Source40: driver-abi-rebuild.sh
|
Source40: driver-abi-rebuild.sh
|
||||||
|
|
||||||
# Various fixes pending upstream
|
# Various fixes pending upstream
|
||||||
Patch1: 0004-glamor-restore-vfunc-handlers-on-init-failure.patch
|
|
||||||
Patch2: 0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch
|
Patch2: 0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch
|
||||||
Patch3: 0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch
|
Patch3: 0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch
|
||||||
Patch4: 0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch
|
Patch4: 0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch
|
||||||
Patch5: 0001-Fix-segfault-if-xorg.conf.d-is-absent.patch
|
|
||||||
Patch6: 0001-xwayland-Fix-use-after-free-of-cursors.patch
|
|
||||||
Patch7: 0001-randr-rrCheckPixmapBounding-Do-not-substract-crtc-no.patch
|
|
||||||
Patch8: 0002-randr-rrCheckPixmapBounding-do-not-shrink-the-screen.patch
|
|
||||||
|
|
||||||
# Patches for better integration with the nvidia driver, pending upstream
|
# Patches for better integration with the nvidia driver, pending upstream
|
||||||
Patch11: 0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch
|
Patch11: 0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch
|
||||||
@ -94,14 +89,10 @@ Patch13: 0003-xfree86-Add-options-support-for-OutputClass-Options.patch
|
|||||||
Patch14: 0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch
|
Patch14: 0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch
|
||||||
Patch15: 0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch
|
Patch15: 0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch
|
||||||
Patch16: 0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch
|
Patch16: 0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch
|
||||||
Patch17: 0001-glamor-glamor_egl_get_display-Return-NULL-if-eglGetP.patch
|
|
||||||
|
|
||||||
# From Debian use intel ddx driver only for gen4 and older chipsets
|
# From Debian use intel ddx driver only for gen4 and older chipsets
|
||||||
Patch20: 06_use-intel-only-on-pre-gen4.diff
|
Patch20: 06_use-intel-only-on-pre-gen4.diff
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1389886
|
|
||||||
Patch21: 0001-Revert-damage-Make-damageRegionProcessPending-take-a.patch
|
|
||||||
|
|
||||||
#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch
|
#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch
|
||||||
|
|
||||||
Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
|
Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
|
||||||
@ -109,9 +100,6 @@ Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
|
|||||||
# Submitted upstream, but not going anywhere
|
# Submitted upstream, but not going anywhere
|
||||||
Patch7027: xserver-autobind-hotplug.patch
|
Patch7027: xserver-autobind-hotplug.patch
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1384432
|
|
||||||
Patch7028: 0001-Xi-when-creating-a-new-master-device-update-barries-.patch
|
|
||||||
|
|
||||||
# because the display-managers are not ready yet, do not upstream
|
# because the display-managers are not ready yet, do not upstream
|
||||||
Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
||||||
|
|
||||||
@ -608,6 +596,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 11 2017 Adam Jackson <ajax@redhat.com> - 1.19.1-1
|
||||||
|
- xserver 1.19.1
|
||||||
|
|
||||||
* Tue Jan 10 2017 Hans de Goede <hdegoede@redhat.com> - 1.19.0-4
|
* Tue Jan 10 2017 Hans de Goede <hdegoede@redhat.com> - 1.19.0-4
|
||||||
- Follow Debian and only default to the intel ddx on gen4 or older intel GPUs
|
- Follow Debian and only default to the intel ddx on gen4 or older intel GPUs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user