import xorg-x11-server-1.20.6-3.el8

This commit is contained in:
CentOS Sources 2020-04-28 04:57:56 -04:00 committed by Andrew Lukoshko
parent 567ce9e969
commit cb0bc223b9
15 changed files with 214 additions and 874 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/xorg-server-1.20.3.tar.bz2
SOURCES/xorg-server-1.20.6.tar.bz2

View File

@ -1 +1 @@
a522cd543606b4d0509d821b8061904951171c50 SOURCES/xorg-server-1.20.3.tar.bz2
59473e72136113f3a35b1ab5a5cfcbcad955b660 SOURCES/xorg-server-1.20.6.tar.bz2

View File

@ -1,222 +0,0 @@
From 14e029d1e0d3b1b9e1981bcca84ecf765e4ed738 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 16 Nov 2018 14:36:55 -0500
Subject: [PATCH xserver] dix: ensure work queues are cleared on reset
If the server resets, most client workqueues are cleaned up as the
clients are killed.
The one exception is the server's client, which is exempt from
the killing spree.
If that client has a queued work procedure active, it won't get
cleared on reset.
This commit ensures it gets cleared too.
---
dix/dixutils.c | 13 +++++++++++++
dix/main.c | 2 ++
include/dix.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 540023cbd..a4e27fe27 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -480,60 +480,73 @@ RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
if (inHandler) {
handlerDeleted = TRUE;
handlers[i].deleted = TRUE;
}
else {
for (; i < numHandlers - 1; i++)
handlers[i] = handlers[i + 1];
numHandlers--;
}
break;
}
}
void
InitBlockAndWakeupHandlers(void)
{
free(handlers);
handlers = (BlockHandlerPtr) 0;
numHandlers = 0;
sizeHandlers = 0;
}
/*
* A general work queue. Perform some task before the server
* sleeps for input.
*/
WorkQueuePtr workQueue;
static WorkQueuePtr *workQueueLast = &workQueue;
+void
+ClearWorkQueue(void)
+{
+ WorkQueuePtr q, *p;
+
+ p = &workQueue;
+ while ((q = *p)) {
+ *p = q->next;
+ free(q);
+ }
+ workQueueLast = p;
+}
+
void
ProcessWorkQueue(void)
{
WorkQueuePtr q, *p;
p = &workQueue;
/*
* Scan the work queue once, calling each function. Those
* which return TRUE are removed from the queue, otherwise
* they will be called again. This must be reentrant with
* QueueWorkProc.
*/
while ((q = *p)) {
if ((*q->function) (q->client, q->closure)) {
/* remove q from the list */
*p = q->next; /* don't fetch until after func called */
free(q);
}
else {
p = &q->next; /* don't fetch until after func called */
}
}
workQueueLast = p;
}
void
ProcessWorkQueueZombies(void)
{
WorkQueuePtr q, *p;
diff --git a/dix/main.c b/dix/main.c
index f98643aa5..b228d9c28 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -315,46 +315,48 @@ dix_main(int argc, char *argv[], char *envp[])
dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
free(pScreen);
screenInfo.numGPUScreens = i;
}
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
FreeScratchPixmapsForScreen(screenInfo.screens[i]);
FreeGCperDepth(i);
FreeDefaultStipple(i);
dixFreeScreenSpecificPrivates(screenInfo.screens[i]);
(*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN);
free(screenInfo.screens[i]);
screenInfo.numScreens = i;
}
ReleaseClientIds(serverClient);
dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
serverClient->devPrivates = NULL;
dixFreeRegistry();
FreeFonts();
FreeAllAtoms();
FreeAuditTimer();
DeleteCallbackManager();
+ ClearWorkQueue();
+
if (dispatchException & DE_TERMINATE) {
CloseWellKnownConnections();
}
OsCleanup((dispatchException & DE_TERMINATE) != 0);
if (dispatchException & DE_TERMINATE) {
ddxGiveUp(EXIT_NO_ERROR);
break;
}
free(ConnectionInfo);
ConnectionInfo = NULL;
}
return 0;
}
diff --git a/include/dix.h b/include/dix.h
index 476559842..b6e2bcfde 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -213,60 +213,62 @@ extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ ,
Bool /*map */ );
extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ );
extern _X_EXPORT void BlockHandler(void *timeout);
extern _X_EXPORT void WakeupHandler(int result);
void
EnableLimitedSchedulingLatency(void);
void
DisableLimitedSchedulingLatency(void);
typedef void (*ServerBlockHandlerProcPtr) (void *blockData,
void *timeout);
typedef void (*ServerWakeupHandlerProcPtr) (void *blockData,
int result);
extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData);
extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData);
extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
+extern _X_EXPORT void ClearWorkQueue(void);
+
extern _X_EXPORT void ProcessWorkQueue(void);
extern _X_EXPORT void ProcessWorkQueueZombies(void);
extern _X_EXPORT Bool QueueWorkProc(Bool (*function)(ClientPtr clientUnused,
void *closure),
ClientPtr client,
void *closure);
typedef Bool (*ClientSleepProcPtr) (ClientPtr client,
void *closure);
extern _X_EXPORT Bool ClientSleep(ClientPtr client,
ClientSleepProcPtr function,
void *closure);
#ifndef ___CLIENTSIGNAL_DEFINED___
#define ___CLIENTSIGNAL_DEFINED___
extern _X_EXPORT Bool ClientSignal(ClientPtr /*client */ );
#endif /* ___CLIENTSIGNAL_DEFINED___ */
#ifndef ___CLIENTSIGNALALL_DEFINED___
#define ___CLIENTSIGNALALL_DEFINED___
#define CLIENT_SIGNAL_ANY ((void *)-1)
extern _X_EXPORT int ClientSignalAll(ClientPtr /*client*/,
ClientSleepProcPtr /*function*/,
void * /*closure*/);
#endif /* ___CLIENTSIGNALALL_DEFINED___ */
extern _X_EXPORT void ClientWakeup(ClientPtr /*client */ );
--
2.17.1

View File

@ -1,37 +0,0 @@
From 2c3ca9250852cb4624da81cb61e05ecd3e6e377a Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 19 Aug 2019 14:27:54 -0400
Subject: [PATCH xserver] miext/sync: Fix ABI for 1.20
The initialized field was added in:
commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a
Author: Alex Goins <agoins@nvidia.com>
Date: Wed Apr 10 13:48:02 2019 -0500
xsync: Add resource inside of SyncCreate, export SyncCreate
But it added this field not at the end of SyncObject. It may not have
been _usefully_ possible to create those from another extension prior to
that commit, but that's still an ABI-incompatible change.
---
miext/sync/misyncstr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h
index 2a6e84a964..ea48a45197 100644
--- a/miext/sync/misyncstr.h
+++ b/miext/sync/misyncstr.h
@@ -43,8 +43,8 @@ struct _SyncObject {
struct _SyncTriggerList *pTriglist; /* list of triggers */
XID id; /* resource ID */
unsigned char type; /* SYNC_* */
- Bool initialized; /* FALSE if created but not initialized */
Bool beingDestroyed; /* in process of going away */
+ Bool initialized; /* FALSE if created but not initialized */
};
typedef struct _SyncCounter {
--
2.21.0

View File

@ -0,0 +1,59 @@
From 58d357db299116657b468db9565c0e431bb7ea29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Tue, 26 Nov 2019 17:14:46 +0100
Subject: [PATCH xserver 1/3] modesetting: Call glamor_finish from
drmmode_crtc_set_mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This makes sure any pending drawing to a new scanout buffer will be
visible from the start.
This makes the finish call in drmmode_copy_fb superfluous, so remove it.
Reviewed-by: Adam Jackson <ajax@redhat.com>
(Cherry picked from commit c66c548eabf06835cb0cb906598fb87c7bb30cf4)
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 336f7686e..8786d13a3 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -754,6 +754,7 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ ScreenPtr screen = crtc->scrn->pScreen;
drmModeModeInfo kmode;
int output_count = 0;
uint32_t *output_ids = NULL;
@@ -764,6 +765,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y))
return 1;
+#ifdef GLAMOR_HAS_GBM
+ /* Make sure any pending drawing will be visible in a new scanout buffer */
+ if (drmmode->glamor)
+ glamor_finish(screen);
+#endif
+
if (ms->atomic_modeset) {
drmModeAtomicReq *req = drmModeAtomicAlloc();
Bool active;
@@ -1452,8 +1459,6 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
FreeScratchGC(gc);
- glamor_finish(pScreen);
-
pScreen->canDoBGNoneRoot = TRUE;
if (drmmode->fbcon_pixmap)
--
2.24.0

View File

@ -0,0 +1,40 @@
From 6a5e47c57d16de8b6a6a2636f3cbad1aebec32e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Mon, 27 Jan 2020 17:47:10 +0100
Subject: [PATCH xserver] xfree86/modes: Bail from xf86RotateRedisplay if
pScreen->root is NULL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoids a crash in xf86RotatePrepare -> DamageRegister during
CreateScreenResources if rotation or another transform is configured for
any connected RandR output in xorg.conf. The generic rotation/transform
code generally can't work without the root window currently.
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/969
Fixes: 094f42cdfe5d "xfree86/modes: Call xf86RotateRedisplay from
xf86CrtcRotate"
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
hw/xfree86/modes/xf86Rotate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 05944cfcb..5415ed97c 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -176,7 +176,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
DamagePtr damage = xf86_config->rotation_damage;
RegionPtr region;
- if (!damage)
+ if (!damage || !pScreen->root)
return FALSE;
xf86RotatePrepare(pScreen);
region = DamageRegion(damage);
--
2.24.1

View File

@ -24,7 +24,7 @@ index 8158c2b62..78d1c947d 100644
@@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
int idx = 0;
#ifdef __linux__
#if defined(__linux__) || defined(__NetBSD__)
+ char busid[32];
+ int fd;
+

View File

@ -1,245 +0,0 @@
From 82f01ad7869e3f2be51e41a8246dab5982bbc36a Mon Sep 17 00:00:00 2001
From: Alex Goins <agoins@nvidia.com>
Date: Wed, 10 Apr 2019 13:48:02 -0500
Subject: [PATCH xserver 1/5] xsync: Add resource inside of SyncCreate, export
SyncCreate
As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may
want to create a fence, then initialize it in their own way. This currently
can't be done without adding a function directly to Xext/sync.c due to the fact
that the RTFence resource type is private and there is no external interface to
add to it.
To facilitate other X extensions creating fences and initializing them, this
change exports SyncCreate() and adds the resource directly within it. Callers no
longer need to call AddResource() after SyncCreate(), they only need to
initialize the SyncObject.
To prevent FreeFence() and FreeCounter() from segfaulting if the call to
AddResource() fails before the sync object is initialized, this adds a new
'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and
FreeCounter() to skip de-initialization and simply free the object.
Initialization after adding the resource shouldn't otherwise be a problem due to
the single-threaded nature of X.
Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 7f962c70b6d9c346477f23f6c15211e749110078)
---
Xext/sync.c | 50 +++++++++++++++++++++++-------------------
Xext/syncsdk.h | 3 +++
miext/sync/misync.c | 27 +++++++++++++----------
miext/sync/misync.h | 1 +
miext/sync/misyncstr.h | 5 +++--
5 files changed, 51 insertions(+), 35 deletions(-)
diff --git a/Xext/sync.c b/Xext/sync.c
index 8f22a865bb..fd2ceb0423 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -881,18 +881,21 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
return Success;
}
-static SyncObject *
+SyncObject *
SyncCreate(ClientPtr client, XID id, unsigned char type)
{
SyncObject *pSync;
+ RESTYPE resType;
switch (type) {
case SYNC_COUNTER:
pSync = malloc(sizeof(SyncCounter));
+ resType = RTCounter;
break;
case SYNC_FENCE:
pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence,
PRIVATE_SYNC_FENCE);
+ resType = RTFence;
break;
default:
return NULL;
@@ -901,6 +904,11 @@ SyncCreate(ClientPtr client, XID id, unsigned char type)
if (!pSync)
return NULL;
+ pSync->initialized = FALSE;
+
+ if (!AddResource(id, resType, (void *) pSync))
+ return NULL;
+
pSync->client = client;
pSync->id = id;
pSync->pTriglist = NULL;
@@ -923,13 +931,10 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
if (status != Success) {
- dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
+ FreeResource(pFence->sync.id, RT_NONE);
return status;
}
- if (!AddResource(id, RTFence, (void *) pFence))
- return BadAlloc;
-
return Success;
#else
return BadImplementation;
@@ -957,8 +962,7 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue)
pCounter->value = initialvalue;
pCounter->pSysCounterInfo = NULL;
- if (!AddResource(id, RTCounter, (void *) pCounter))
- return NULL;
+ pCounter->sync.initialized = TRUE;
return pCounter;
}
@@ -1137,21 +1141,26 @@ static int
FreeCounter(void *env, XID id)
{
SyncCounter *pCounter = (SyncCounter *) env;
- SyncTriggerList *ptl, *pnext;
pCounter->sync.beingDestroyed = TRUE;
- /* tell all the counter's triggers that the counter has been destroyed */
- for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
- pnext = ptl->next;
- free(ptl); /* destroy the trigger list as we go */
- }
- if (IsSystemCounter(pCounter)) {
- xorg_list_del(&pCounter->pSysCounterInfo->entry);
- free(pCounter->pSysCounterInfo->name);
- free(pCounter->pSysCounterInfo->private);
- free(pCounter->pSysCounterInfo);
+
+ if (pCounter->sync.initialized) {
+ SyncTriggerList *ptl, *pnext;
+
+ /* tell all the counter's triggers that counter has been destroyed */
+ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
+ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
+ pnext = ptl->next;
+ free(ptl); /* destroy the trigger list as we go */
+ }
+ if (IsSystemCounter(pCounter)) {
+ xorg_list_del(&pCounter->pSysCounterInfo->entry);
+ free(pCounter->pSysCounterInfo->name);
+ free(pCounter->pSysCounterInfo->private);
+ free(pCounter->pSysCounterInfo);
+ }
}
+
free(pCounter);
return Success;
}
@@ -1889,9 +1898,6 @@ ProcSyncCreateFence(ClientPtr client)
miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
- if (!AddResource(stuff->fid, RTFence, (void *) pFence))
- return BadAlloc;
-
return Success;
}
diff --git a/Xext/syncsdk.h b/Xext/syncsdk.h
index f1b99d010b..c88285cb13 100644
--- a/Xext/syncsdk.h
+++ b/Xext/syncsdk.h
@@ -29,6 +29,9 @@
extern _X_EXPORT int
SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode);
+extern _X_EXPORT SyncObject*
+ SyncCreate(ClientPtr client, XID id, unsigned char type);
+
#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
do { \
int rc; \
diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index 490fa0b172..0931803f6c 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -101,25 +101,30 @@ miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered)
pFence->funcs = miSyncFenceFuncs;
pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered);
+
+ pFence->sync.initialized = TRUE;
}
void
miSyncDestroyFence(SyncFence * pFence)
{
- ScreenPtr pScreen = pFence->pScreen;
- SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
- SyncTriggerList *ptl, *pNext;
-
pFence->sync.beingDestroyed = TRUE;
- /* tell all the fence's triggers that the counter has been destroyed */
- for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
- (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
- pNext = ptl->next;
- free(ptl); /* destroy the trigger list as we go */
+
+ if (pFence->sync.initialized) {
+ ScreenPtr pScreen = pFence->pScreen;
+ SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
+ SyncTriggerList *ptl, *pNext;
+
+ /* tell all the fence's triggers that the counter has been destroyed */
+ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
+ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
+ pNext = ptl->next;
+ free(ptl); /* destroy the trigger list as we go */
+ }
+
+ pScreenPriv->funcs.DestroyFence(pScreen, pFence);
}
- pScreenPriv->funcs.DestroyFence(pScreen, pFence);
-
dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
}
diff --git a/miext/sync/misync.h b/miext/sync/misync.h
index dc78c5fdb3..f7082d5ea4 100644
--- a/miext/sync/misync.h
+++ b/miext/sync/misync.h
@@ -28,6 +28,7 @@
#ifndef _MISYNC_H_
#define _MISYNC_H_
+typedef struct _SyncObject SyncObject;
typedef struct _SyncFence SyncFence;
typedef struct _SyncTrigger SyncTrigger;
diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h
index 2eab2aa576..2a6e84a964 100644
--- a/miext/sync/misyncstr.h
+++ b/miext/sync/misyncstr.h
@@ -38,13 +38,14 @@
#define SYNC_COUNTER 0
#define SYNC_FENCE 1
-typedef struct _SyncObject {
+struct _SyncObject {
ClientPtr client; /* Owning client. 0 for system counters */
struct _SyncTriggerList *pTriglist; /* list of triggers */
XID id; /* resource ID */
unsigned char type; /* SYNC_* */
+ Bool initialized; /* FALSE if created but not initialized */
Bool beingDestroyed; /* in process of going away */
-} SyncObject;
+};
typedef struct _SyncCounter {
SyncObject sync; /* Common sync object data */
--
2.21.0

View File

@ -1,92 +0,0 @@
From 1fdb7cbce538f0b37304a3cfc9fae4ff2fe9ece9 Mon Sep 17 00:00:00 2001
From: Kyle Brenneman <kbrenneman@nvidia.com>
Date: Thu, 19 Oct 2017 15:14:51 -0600
Subject: [PATCH xserver 2/5] GLX: Add a per-client vendor mapping.
Each client now has its own (screen, vendor) mapping.
Currently, it's just a copy of the global mapping, but later changes will allow
it to change.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5)
---
glx/vndext.c | 11 ++++++++++-
glx/vndserver.h | 5 +++++
glx/vndservermapping.c | 19 +++++++++++++++----
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/glx/vndext.c b/glx/vndext.c
index d7936467be..20c0648ccf 100644
--- a/glx/vndext.c
+++ b/glx/vndext.c
@@ -139,8 +139,17 @@ GlxGetClientData(ClientPtr client)
{
GlxClientPriv *cl = xglvGetClientPrivate(client);
if (cl == NULL) {
- cl = calloc(1, sizeof(GlxClientPriv));
+ cl = calloc(1, sizeof(GlxClientPriv)
+ + screenInfo.numScreens * sizeof(GlxServerVendor *));
if (cl != NULL) {
+ int i;
+
+ cl->vendors = (GlxServerVendor **) (cl + 1);
+ for (i=0; i<screenInfo.numScreens; i++)
+ {
+ cl->vendors[i] = GlxGetVendorForScreen(NULL, screenInfo.screens[i]);
+ }
+
xglvSetClientPrivate(client, cl);
}
}
diff --git a/glx/vndserver.h b/glx/vndserver.h
index a175656ae7..78246d212c 100644
--- a/glx/vndserver.h
+++ b/glx/vndserver.h
@@ -57,6 +57,11 @@ typedef struct GlxContextTagInfoRec {
typedef struct GlxClientPrivRec {
GlxContextTagInfo *contextTags;
unsigned int contextTagCount;
+
+ /**
+ * The vendor handles for each screen.
+ */
+ GlxServerVendor **vendors;
} GlxClientPriv;
extern int GlxErrorBase;
diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c
index fd3be92d95..778656bb6e 100644
--- a/glx/vndservermapping.c
+++ b/glx/vndservermapping.c
@@ -187,10 +187,21 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor)
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen)
{
- GlxScreenPriv *priv = GlxGetScreen(screen);
- if (priv != NULL) {
- return priv->vendor;
+ // Note that the client won't be sending GPU screen numbers, so we don't
+ // need per-client mappings for them.
+ if (client != NULL && !screen->isGPU) {
+ GlxClientPriv *cl = GlxGetClientData(client);
+ if (cl != NULL) {
+ return cl->vendors[screen->myNum];
+ } else {
+ return NULL;
+ }
} else {
- return NULL;
+ GlxScreenPriv *priv = GlxGetScreen(screen);
+ if (priv != NULL) {
+ return priv->vendor;
+ } else {
+ return NULL;
+ }
}
}
--
2.21.0

View File

@ -0,0 +1,37 @@
From 532f1618a0600e8601fd42f40eb628e4794300b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Tue, 26 Nov 2019 17:16:37 +0100
Subject: [PATCH xserver 2/3] xfree86/modes: Call xf86RotateRedisplay from
xf86CrtcRotate
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If a new rotate buffer was allocated. This makes sure the new buffer
has valid transformed contents when it starts being displayed.
Reviewed-by: Adam Jackson <ajax@redhat.com>
(Cherry picked from commit 327df450ffcf5bda5b4254db0208d355860d1010)
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
hw/xfree86/modes/xf86Rotate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index a8f1e615c..05944cfcb 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -485,6 +485,9 @@ xf86CrtcRotate(xf86CrtcPtr crtc)
if (damage)
xf86CrtcDamageShadow(crtc);
+ else if (crtc->rotatedData && !crtc->rotatedPixmap)
+ /* Make sure the new rotate buffer has valid transformed contents */
+ xf86RotateRedisplay(pScreen);
/* All done */
return TRUE;
--
2.24.0

View File

@ -1,113 +0,0 @@
From abeae4a6d356653d50026707ecc2afceac83631e Mon Sep 17 00:00:00 2001
From: Kyle Brenneman <kbrenneman@nvidia.com>
Date: Wed, 8 May 2019 08:44:54 -0600
Subject: [PATCH xserver 3/5] GLX: Use the sending client for looking up XID's
When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based
on the screen number for the XID and the client that sent the current request.
In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the
(XID -> vendor) mapping, so we have to look up a vendor by screen number.
With this change, GlxGetXIDMap will use the (screen -> vendor) map for
whichever client sent the current request, instead of using the global
(screen -> vendor) map.
Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will
store the client for the current request in a global variable. That way, the
ABI for GLXVND doesn't need to change.
v2: Fix an error check in GlxDispatchRequest.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c)
---
glx/vndcmds.c | 13 +++++++++++--
glx/vndserver.h | 7 +++++++
glx/vndservermapping.c | 12 ++++++++----
3 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/glx/vndcmds.c b/glx/vndcmds.c
index f0779d14a2..21c6fef9ea 100644
--- a/glx/vndcmds.c
+++ b/glx/vndcmds.c
@@ -468,15 +468,24 @@ void GlxDispatchReset(void)
int GlxDispatchRequest(ClientPtr client)
{
REQUEST(xReq);
+ int result;
+
if (GlxExtensionEntry->base == 0)
return BadRequest;
+
+ GlxSetRequestClient(client);
+
if (stuff->data < OPCODE_ARRAY_LEN) {
if (dispatchFuncs[stuff->data] == NULL) {
// Try to find a dispatch stub.
dispatchFuncs[stuff->data] = GetVendorDispatchFunc(stuff->data, 0);
}
- return dispatchFuncs[stuff->data](client);
+ result = dispatchFuncs[stuff->data](client);
} else {
- return dispatch_GLXSingle(client);
+ result = dispatch_GLXSingle(client);
}
+
+ GlxSetRequestClient(NULL);
+
+ return result;
}
diff --git a/glx/vndserver.h b/glx/vndserver.h
index 78246d212c..613fef0fe2 100644
--- a/glx/vndserver.h
+++ b/glx/vndserver.h
@@ -95,6 +95,13 @@ Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor);
GlxServerVendor * GlxGetXIDMap(XID id);
void GlxRemoveXIDMap(XID id);
+/**
+ * Records the client that sent the current request. This is needed in
+ * GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a
+ * regular X window.
+ */
+void GlxSetRequestClient(ClientPtr client);
+
GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor);
GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag);
void GlxFreeContextTag(GlxContextTagInfo *tagInfo);
diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c
index 778656bb6e..4efab8b81d 100644
--- a/glx/vndservermapping.c
+++ b/glx/vndservermapping.c
@@ -33,6 +33,13 @@
#include "vndservervendor.h"
+static ClientPtr requestClient = NULL;
+
+void GlxSetRequestClient(ClientPtr client)
+{
+ requestClient = client;
+}
+
static GlxServerVendor *LookupXIDMapResource(XID id)
{
void *ptr = NULL;
@@ -59,10 +66,7 @@ GlxServerVendor *GlxGetXIDMap(XID id)
DixGetAttrAccess);
if (rv == Success && ptr != NULL) {
DrawablePtr draw = (DrawablePtr) ptr;
- GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen);
- if (screenPriv != NULL) {
- vendor = screenPriv->vendor;
- }
+ vendor = GlxGetVendorForScreen(requestClient, draw->pScreen);
}
}
return vendor;
--
2.21.0

View File

@ -0,0 +1,55 @@
From 5489029ff6508b37d71d47d905d744c436a49563 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
Date: Tue, 26 Nov 2019 17:17:12 +0100
Subject: [PATCH xserver 3/3] modesetting: Clear new screen pixmap storage on
RandR resize
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes random garbage being visible intermittently.
Reviewed-by: Adam Jackson <ajax@redhat.com>
(Cherry picked from commit 9ba13bac9dd076f166ff0d063fc144b904a40d12)
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 8786d13a3..eca058258 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1795,6 +1795,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
&drmmode_crtc->prime_pixmap);
}
+static void
+drmmode_clear_pixmap(PixmapPtr pixmap)
+{
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ GCPtr gc;
+
+ gc = GetScratchGC(pixmap->drawable.depth, screen);
+ if (gc) {
+ miClearDrawable(&pixmap->drawable, gc);
+ FreeScratchGC(gc);
+ }
+}
+
static void *
drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
{
@@ -3179,6 +3192,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
if (!drmmode_glamor_handle_new_screen_pixmap(drmmode))
goto fail;
+ drmmode_clear_pixmap(ppix);
+
for (i = 0; i < xf86_config->num_crtc; i++) {
xf86CrtcPtr crtc = xf86_config->crtc[i];
--
2.24.0

View File

@ -1,114 +0,0 @@
From d3034ef2f5121d85ae766a73fda4e523399043a9 Mon Sep 17 00:00:00 2001
From: Kyle Brenneman <kbrenneman@nvidia.com>
Date: Thu, 2 May 2019 07:17:21 -0600
Subject: [PATCH xserver 4/5] GLX: Add a function to change a clients vendor
list.
Add a new function, GlxServerExports::setClientScreenVendor, which will change
the vendor that handles GLX requests for a screen, but only for requests from
a specific client.
v2: Increment the GLXVND minor version number.
v3: Note the GLXVND version requirement for setClientScreenVendor.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93)
---
glx/vndext.c | 1 +
glx/vndserver.h | 1 +
glx/vndservermapping.c | 21 +++++++++++++++++++++
include/glxvndabi.h | 13 ++++++++++++-
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/glx/vndext.c b/glx/vndext.c
index 20c0648ccf..582e60b6e7 100644
--- a/glx/vndext.c
+++ b/glx/vndext.c
@@ -324,6 +324,7 @@ _X_EXPORT const GlxServerExports glxServer = {
.getContextTagPrivate = GlxGetContextTagPrivate,
.getVendorForScreen = GlxGetVendorForScreen,
.forwardRequest = GlxForwardRequest,
+ .setClientScreenVendor = GlxSetClientScreenVendor,
};
const GlxServerExports *
diff --git a/glx/vndserver.h b/glx/vndserver.h
index 613fef0fe2..772b458a1c 100644
--- a/glx/vndserver.h
+++ b/glx/vndserver.h
@@ -107,6 +107,7 @@ GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag);
void GlxFreeContextTag(GlxContextTagInfo *tagInfo);
Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor);
+Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen);
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen);
diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c
index 4efab8b81d..04788ffbdd 100644
--- a/glx/vndservermapping.c
+++ b/glx/vndservermapping.c
@@ -189,6 +189,27 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor)
return TRUE;
}
+Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor)
+{
+ GlxClientPriv *cl;
+
+ if (screen == NULL || screen->isGPU) {
+ return FALSE;
+ }
+
+ cl = GlxGetClientData(client);
+ if (cl == NULL) {
+ return FALSE;
+ }
+
+ if (vendor != NULL) {
+ cl->vendors[screen->myNum] = vendor;
+ } else {
+ cl->vendors[screen->myNum] = GlxGetVendorForScreen(NULL, screen);
+ }
+ return TRUE;
+}
+
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen)
{
// Note that the client won't be sending GPU screen numbers, so we don't
diff --git a/include/glxvndabi.h b/include/glxvndabi.h
index b78306d235..71f36e7222 100644
--- a/include/glxvndabi.h
+++ b/include/glxvndabi.h
@@ -75,7 +75,7 @@
* will still work.
*/
#define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0
-#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 0
+#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1
#if defined(__cplusplus)
extern "C" {
@@ -236,6 +236,17 @@ typedef struct GlxServerExportsRec {
* \param client The client.
*/
int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client);
+
+ /**
+ * Sets the vendor library to use for a screen for a specific client.
+ *
+ * This function changes which vendor should handle GLX requests for a
+ * screen. Unlike \c setScreenVendor, this function can be called at any
+ * time, and only applies to requests from a single client.
+ *
+ * This function is available in GLXVND version 0.1 or later.
+ */
+ Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
} GlxServerExports;
extern _X_EXPORT const GlxServerExports glxServer;
--
2.21.0

View File

@ -1,35 +0,0 @@
From 39b3005c329bc63676df72c43529d641bf305bcd Mon Sep 17 00:00:00 2001
From: Aaron Plattner <aplattner@nvidia.com>
Date: Tue, 21 May 2019 10:50:42 -0700
Subject: [PATCH xserver 5/5] GLX: Set GlxServerExports::{major,minor}Version
Commit 56c0a71fdd94a008e5d746261f70a713c4767f93 incremented the
GLXSERVER_VENDOR_ABI_MINOR_VERSION define, but this define was not actually
being used to set glxServer.minorVersion.
Update the initializer for glxServer to use the correct version numbers.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit b4231d69028adc8123801a7552b40a15ea928d1b)
---
glx/vndext.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/glx/vndext.c b/glx/vndext.c
index 582e60b6e7..0513733b65 100644
--- a/glx/vndext.c
+++ b/glx/vndext.c
@@ -304,8 +304,8 @@ GlxFreeServerImports(GlxServerImports *imports)
}
_X_EXPORT const GlxServerExports glxServer = {
- .majorVersion = 0,
- .minorVersion = 0,
+ .majorVersion = GLXSERVER_VENDOR_ABI_MAJOR_VERSION,
+ .minorVersion = GLXSERVER_VENDOR_ABI_MINOR_VERSION,
.extensionInitCallback = &vndInitCallbackListPtr,
--
2.21.0

View File

@ -45,8 +45,8 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.20.3
Release: 11%{?gitdate:.%{gitdate}}%{?dist}
Version: 1.20.6
Release: 3%{?gitdate:.%{gitdate}}%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X
@ -102,8 +102,6 @@ Patch17: 0001-xwayland-Disable-Present-support.patch
Patch18: 0001-mustard-Work-around-broken-fbdev-headers.patch
# fix to be upstreamed
Patch20: 0001-dix-ensure-work-queues-are-cleared-on-reset.patch
Patch100: 0001-linux-Make-platform-device-probe-less-fragile.patch
Patch102: 0001-xfree86-ensure-the-readlink-buffer-is-null-terminate.patch
@ -111,15 +109,13 @@ Patch102: 0001-xfree86-ensure-the-readlink-buffer-is-null-terminate.patch
Patch200: 0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch
Patch201: 0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch
# 1739249 - X server backports for PRIME render offloading
Patch301: 0001-xsync-Add-resource-inside-of-SyncCreate-export-SyncC.patch
Patch302: 0002-GLX-Add-a-per-client-vendor-mapping.patch
Patch303: 0003-GLX-Use-the-sending-client-for-looking-up-XID-s.patch
Patch304: 0004-GLX-Add-a-function-to-change-a-clients-vendor-list.patch
Patch305: 0005-GLX-Set-GlxServerExports-major-minor-Version.patch
# ... plus an ABI fix, see:
# https://gitlab.freedesktop.org/xorg/xserver/merge_requests/265
Patch306: 0001-miext-sync-Fix-ABI-for-1.20.patch
# 1738670 - Graphical artifacts when modesetting
Patch300: 0001-modesetting-Call-glamor_finish-from-drmmode_crtc_set.patch
Patch301: 0002-xfree86-modes-Call-xf86RotateRedisplay-from-xf86Crtc.patch
Patch302: 0003-modesetting-Clear-new-screen-pixmap-storage-on-RandR.patch
# 1795328 - Crash in xf86CrtcRotate with Option "Rotate" in xorg.conf
Patch400: 0001-xfree86-modes-Bail-from-xf86RotateRedisplay-if-pScre.patch
BuildRequires: systemtap-sdt-devel
BuildRequires: git
@ -563,6 +559,17 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Tue Feb 11 2020 Michel Dänzer <mdaenzer@redhat.com> - 1.20.6-3
- Add fix for crash with Option "Rotate" in xorg.conf
Resolves: #1795328
* Wed Dec 11 2019 Michel Dänzer <mdaenzer@redhat.com> - 1.20.6-2
- Add fixes for intermittent modesetting artifacts
Resolves: #1738670
* Mon Dec 9 2019 Olivier Fourdan <ofourdan@redhat.com> - 1.20.6-1
- xserver 1.20.6
* Tue Sep 03 2019 Adam Jackson <ajax@redhat.com> - 1.20.3-11
- Add DRI2 fallback driver mappings for i965 and radeonsi