From a3e08ec95f29751b23f2a1475f491a18d8bc49b3 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 02:51:17 +0000 Subject: import xorg-x11-server-1.19.3-11.el7 --- diff --git a/.gitignore b/.gitignore index dff77f2..8a83cf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xorg-server-1.17.2.tar.bz2 +SOURCES/xorg-server-1.19.3.tar.bz2 diff --git a/.xorg-x11-server.metadata b/.xorg-x11-server.metadata index 929b5d7..72833ff 100644 --- a/.xorg-x11-server.metadata +++ b/.xorg-x11-server.metadata @@ -1 +1 @@ -56ac29a82b99bcf4c7ba2fca41a44cfa18748262 SOURCES/xorg-server-1.17.2.tar.bz2 +77f580ffa22a8bbcc3536e74e19114e446417a9c SOURCES/xorg-server-1.19.3.tar.bz2 diff --git a/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch b/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch deleted file mode 100644 index 78a28a3..0000000 --- a/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 42351690f5a4999bfe7370eb3c496f74f635c709 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 8 Aug 2016 14:38:54 +0200 -Subject: [PATCH xserver] Fix Xorg -configure not working anymore - -Xorg -configure relies on the bus implementation, e.g. -xf86pciBus.c to call xf86AddBusDeviceToConfigure(). The new -xf86platformBus code does not have support for this. - -Almost all drivers support both the xf86platformBus and xf86pciBus -nowadays, and the generic xf86Bus xf86CallDriverProbe() function -prefers the new xf86platformBus probe method when available. - -Since the platformBus paths do not call xf86AddBusDeviceToConfigure() -this results in Xorg -configure failing with the following error: -"No devices to configure. Configuration failed.". - -Adding support for the xf86Configure code to xf86platformBus.c -is non trivial and since we advise users to normally run without -any Xorg.conf at all not worth the trouble. - -However some users still want to use Xorg -configure to generate a -template config file, this commit implements a minimal fix to make -things work again for PCI devices by skipping the platform -probe method when xf86DoConfigure is set. - -This has been tested on a system with integrated intel graphics, -with both the intel and modesetting drivers and restores Xorg -configure -functionality on both cases. - -Cc: Adam Jackson -Signed-off-by: Hans de Goede ---- - hw/xfree86/common/xf86Bus.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index bd36fc5..5b93940 100644 ---- a/hw/xfree86/common/xf86Bus.c -+++ b/hw/xfree86/common/xf86Bus.c -@@ -78,7 +78,8 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) - Bool foundScreen = FALSE; - - #ifdef XSERVER_PLATFORM_BUS -- if (drv->platformProbe != NULL) { -+ /* xf86platformBus.c does not support Xorg -configure */ -+ if (!xf86DoConfigure && drv->platformProbe != NULL) { - foundScreen = xf86platformProbeDev(drv); - } - if (ServerIsNotSeat0() && foundScreen) --- -2.7.4 - diff --git a/SOURCES/0001-configurable-maximum-number-of-clients.patch b/SOURCES/0001-configurable-maximum-number-of-clients.patch deleted file mode 100644 index 4303944..0000000 --- a/SOURCES/0001-configurable-maximum-number-of-clients.patch +++ /dev/null @@ -1,492 +0,0 @@ -From 3f48fe3c668a0fc420db97b3d116b5b007909876 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 7 Jul 2015 18:19:50 +0200 -Subject: [PATCH] configurable maximum number of clients - -Make the maximum number of clients user configurable, either from the command -line or from xorg.conf - -This patch works by using the MAXCLIENTS (raised to 512) as the maximum -allowed number of clients, but allowing the actual limit to be set by the -user to a lower value (keeping the default of 256). - -There is a limit size of 29 bits to be used to store both the client ID and -the X resources ID, so by reducing the number of clients allowed to connect to -the X server, the user can increase the number of X resources per client or -vice-versa. - -Parts of this patch are based on a similar patch from Adam Jackson - - -This now requires at least xproto 7.0.28 - -Signed-off-by: Adam Jackson -Signed-off-by: Olivier Fourdan -Reviewed-by: Adam Jackson -Signed-off-by: Keith Packard ---- - dix/colormap.c | 28 ++++++++++++++-------------- - dix/dispatch.c | 4 ++-- - dix/main.c | 2 +- - dix/resource.c | 33 ++++++++++++++++++++++++++++----- - hw/dmx/glxProxy/glxext.c | 2 +- - hw/xfree86/common/xf86Config.c | 16 ++++++++++++++++ - hw/xfree86/man/xorg.conf.man | 4 ++++ - include/misc.h | 3 ++- - include/opaque.h | 1 + - include/resource.h | 15 ++------------- - man/Xserver.man | 5 +++++ - os/connection.c | 6 +++--- - os/osdep.h | 8 ++++---- - os/osinit.c | 3 +++ - os/utils.c | 14 ++++++++++++++ - 15 files changed, 100 insertions(+), 44 deletions(-) - -diff --git a/dix/colormap.c b/dix/colormap.c -index 4d408d5..ac1a615 100644 ---- a/dix/colormap.c -+++ b/dix/colormap.c -@@ -249,7 +249,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, - - size = pVisual->ColormapEntries; - sizebytes = (size * sizeof(Entry)) + -- (MAXCLIENTS * sizeof(Pixel *)) + (MAXCLIENTS * sizeof(int)); -+ (LimitClients * sizeof(Pixel *)) + (LimitClients * sizeof(int)); - if ((class | DynamicClass) == DirectColor) - sizebytes *= 3; - sizebytes += sizeof(ColormapRec); -@@ -274,7 +274,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, - sizebytes = size * sizeof(Entry); - pmap->clientPixelsRed = (Pixel **) ((char *) pmap->red + sizebytes); - pmap->numPixelsRed = (int *) ((char *) pmap->clientPixelsRed + -- (MAXCLIENTS * sizeof(Pixel *))); -+ (LimitClients * sizeof(Pixel *))); - pmap->mid = mid; - pmap->flags = 0; /* start out with all flags clear */ - if (mid == pScreen->defColormap) -@@ -286,8 +286,8 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, - size = NUMRED(pVisual); - pmap->freeRed = size; - memset((char *) pmap->red, 0, (int) sizebytes); -- memset((char *) pmap->numPixelsRed, 0, MAXCLIENTS * sizeof(int)); -- for (pptr = &pmap->clientPixelsRed[MAXCLIENTS]; -+ memset((char *) pmap->numPixelsRed, 0, LimitClients * sizeof(int)); -+ for (pptr = &pmap->clientPixelsRed[LimitClients]; - --pptr >= pmap->clientPixelsRed;) - *pptr = (Pixel *) NULL; - if (alloc == AllocAll) { -@@ -310,26 +310,26 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, - if ((class | DynamicClass) == DirectColor) { - pmap->freeGreen = NUMGREEN(pVisual); - pmap->green = (EntryPtr) ((char *) pmap->numPixelsRed + -- (MAXCLIENTS * sizeof(int))); -+ (LimitClients * sizeof(int))); - pmap->clientPixelsGreen = (Pixel **) ((char *) pmap->green + sizebytes); - pmap->numPixelsGreen = (int *) ((char *) pmap->clientPixelsGreen + -- (MAXCLIENTS * sizeof(Pixel *))); -+ (LimitClients * sizeof(Pixel *))); - pmap->freeBlue = NUMBLUE(pVisual); - pmap->blue = (EntryPtr) ((char *) pmap->numPixelsGreen + -- (MAXCLIENTS * sizeof(int))); -+ (LimitClients * sizeof(int))); - pmap->clientPixelsBlue = (Pixel **) ((char *) pmap->blue + sizebytes); - pmap->numPixelsBlue = (int *) ((char *) pmap->clientPixelsBlue + -- (MAXCLIENTS * sizeof(Pixel *))); -+ (LimitClients * sizeof(Pixel *))); - - memset((char *) pmap->green, 0, (int) sizebytes); - memset((char *) pmap->blue, 0, (int) sizebytes); - - memmove((char *) pmap->clientPixelsGreen, -- (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *)); -+ (char *) pmap->clientPixelsRed, LimitClients * sizeof(Pixel *)); - memmove((char *) pmap->clientPixelsBlue, -- (char *) pmap->clientPixelsRed, MAXCLIENTS * sizeof(Pixel *)); -- memset((char *) pmap->numPixelsGreen, 0, MAXCLIENTS * sizeof(int)); -- memset((char *) pmap->numPixelsBlue, 0, MAXCLIENTS * sizeof(int)); -+ (char *) pmap->clientPixelsRed, LimitClients * sizeof(Pixel *)); -+ memset((char *) pmap->numPixelsGreen, 0, LimitClients * sizeof(int)); -+ memset((char *) pmap->numPixelsBlue, 0, LimitClients * sizeof(int)); - - /* If every cell is allocated, mark its refcnt */ - if (alloc == AllocAll) { -@@ -413,7 +413,7 @@ FreeColormap(void *value, XID mid) - (*pmap->pScreen->DestroyColormap) (pmap); - - if (pmap->clientPixelsRed) { -- for (i = 0; i < MAXCLIENTS; i++) -+ for (i = 0; i < LimitClients; i++) - free(pmap->clientPixelsRed[i]); - } - -@@ -431,7 +431,7 @@ FreeColormap(void *value, XID mid) - } - } - if ((pmap->class | DynamicClass) == DirectColor) { -- for (i = 0; i < MAXCLIENTS; i++) { -+ for (i = 0; i < LimitClients; i++) { - free(pmap->clientPixelsGreen[i]); - free(pmap->clientPixelsBlue[i]); - } -diff --git a/dix/dispatch.c b/dix/dispatch.c -index 17fa75e..bb4a110 100644 ---- a/dix/dispatch.c -+++ b/dix/dispatch.c -@@ -3483,7 +3483,7 @@ NextAvailableClient(void *ospriv) - xReq data; - - i = nextFreeClientID; -- if (i == MAXCLIENTS) -+ if (i == LimitClients) - return (ClientPtr) NULL; - clients[i] = client = - dixAllocateObjectWithPrivates(ClientRec, PRIVATE_CLIENT); -@@ -3503,7 +3503,7 @@ NextAvailableClient(void *ospriv) - } - if (i == currentMaxClients) - currentMaxClients++; -- while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) -+ while ((nextFreeClientID < LimitClients) && clients[nextFreeClientID]) - nextFreeClientID++; - - /* Enable client ID tracking. This must be done before -diff --git a/dix/main.c b/dix/main.c -index 7c6ac94..287a335 100644 ---- a/dix/main.c -+++ b/dix/main.c -@@ -163,7 +163,7 @@ dix_main(int argc, char *argv[], char *envp[]) - OsInit(); - if (serverGeneration == 1) { - CreateWellKnownSockets(); -- for (i = 1; i < MAXCLIENTS; i++) -+ for (i = 1; i < LimitClients; i++) - clients[i] = NullClient; - serverClient = calloc(sizeof(ClientRec), 1); - if (!serverClient) -diff --git a/dix/resource.c b/dix/resource.c -index 964f0b3..b33d959 100644 ---- a/dix/resource.c -+++ b/dix/resource.c -@@ -600,6 +600,29 @@ CreateNewResourceClass(void) - - static ClientResourceRec clientTable[MAXCLIENTS]; - -+static unsigned int -+ilog2(int val) -+{ -+ int bits; -+ -+ if (val <= 0) -+ return 0; -+ for (bits = 0; val != 0; bits++) -+ val >>= 1; -+ return bits - 1; -+} -+ -+/***************** -+ * ResourceClientBits -+ * Returns the client bit offset in the client + resources ID field -+ *****************/ -+ -+unsigned int -+ResourceClientBits(void) -+{ -+ return (ilog2(LimitClients)); -+} -+ - /***************** - * InitClientResources - * When a new client is created, call this to allocate space -@@ -883,7 +906,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) - int *eltptr; - int elements; - -- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { -+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) { - head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; - eltptr = &clientTable[cid].elements; - -@@ -917,7 +940,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) - ResourcePtr res; - ResourcePtr *prev, *head; - -- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { -+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) { - head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; - - prev = head; -@@ -952,7 +975,7 @@ ChangeResourceValue(XID id, RESTYPE rtype, void *value) - int cid; - ResourcePtr res; - -- if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { -+ if (((cid = CLIENT_ID(id)) < LimitClients) && clientTable[cid].buckets) { - res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; - - for (; res; res = res->next) -@@ -1190,7 +1213,7 @@ dixLookupResourceByType(void **result, XID id, RESTYPE rtype, - if ((rtype & TypeMask) > lastResourceType) - return BadImplementation; - -- if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { -+ if ((cid < LimitClients) && clientTable[cid].buckets) { - res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; - - for (; res; res = res->next) -@@ -1223,7 +1246,7 @@ dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, - - *result = NULL; - -- if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { -+ if ((cid < LimitClients) && clientTable[cid].buckets) { - res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; - - for (; res; res = res->next) -diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c -index 3c5a14b..c858272 100644 ---- a/hw/dmx/glxProxy/glxext.c -+++ b/hw/dmx/glxProxy/glxext.c -@@ -347,7 +347,7 @@ GlxExtensionInit(void) - /* - ** Initialize table of client state. There is never a client 0. - */ -- for (i = 1; i <= MAXCLIENTS; i++) { -+ for (i = 1; i <= LimitClients; i++) { - __glXClients[i] = 0; - } - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index d42572f..5f7d13b 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -697,6 +697,7 @@ typedef enum { - FLAG_DRI2, - FLAG_USE_SIGIO, - FLAG_AUTO_ADD_GPU, -+ FLAG_MAX_CLIENTS, - } FlagValues; - - /** -@@ -756,6 +757,8 @@ static OptionInfoRec FlagOptions[] = { - {0}, FALSE}, - {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, - {0}, FALSE}, -+ {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, -+ {0}, FALSE }, - {-1, NULL, OPTV_NONE, - {0}, FALSE}, - }; -@@ -1046,6 +1049,19 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) - xf86Info.dri2From = X_CONFIG; - } - #endif -+ -+ from = X_DEFAULT; -+ if (LimitClients != LIMITCLIENTS) -+ from = X_CMDLINE; -+ i = -1; -+ if (xf86GetOptValInteger(FlagOptions, FLAG_MAX_CLIENTS, &i)) { -+ if (i != 64 && i != 128 && i != 256 && i != 512) -+ ErrorF("MaxClients must be one of 64, 128, 256 or 512\n"); -+ from = X_CONFIG; -+ LimitClients = i; -+ } -+ xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n", -+ LimitClients, RESOURCE_ID_MASK); - } - - Bool -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index d26c3cc..9157fc9 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -621,6 +621,10 @@ It is only enabled for screens that have the - .B \*qDPMS\*q - option set (see the MONITOR section below). - .TP 7 -+.BI "Option \*qMaxClients\*q \*q" integer \*q -+Set the maximum number of clients allowed to connect to the X server. -+Acceptable values are 64, 128, 256 or 512. -+.TP 7 - .BI "Option \*qPixmap\*q \*q" bpp \*q - This sets the pixmap format to use for depth 24. - Allowed values for -diff --git a/include/misc.h b/include/misc.h -index 9b1c03a..56e138c 100644 ---- a/include/misc.h -+++ b/include/misc.h -@@ -86,7 +86,8 @@ OF THIS SOFTWARE. - #ifndef MAXGPUSCREENS - #define MAXGPUSCREENS 16 - #endif --#define MAXCLIENTS 256 -+#define MAXCLIENTS 512 -+#define LIMITCLIENTS 256 /* Must be a power of 2 and <= MAXCLIENTS */ - #define MAXEXTENSIONS 128 - #define MAXFORMATS 8 - #define MAXDEVICES 40 /* input devices */ -diff --git a/include/opaque.h b/include/opaque.h -index a2c54aa..0ba0d64 100644 ---- a/include/opaque.h -+++ b/include/opaque.h -@@ -36,6 +36,7 @@ from The Open Group. - extern _X_EXPORT const char *defaultTextFont; - extern _X_EXPORT const char *defaultCursorFont; - extern _X_EXPORT int MaxClients; -+extern _X_EXPORT int LimitClients; - extern _X_EXPORT volatile char isItTimeToYield; - extern _X_EXPORT volatile char dispatchException; - -diff --git a/include/resource.h b/include/resource.h -index 772f363..597f7b6 100644 ---- a/include/resource.h -+++ b/include/resource.h -@@ -85,21 +85,10 @@ typedef uint32_t RESTYPE; - #define RT_LASTPREDEF ((RESTYPE)9) - #define RT_NONE ((RESTYPE)0) - -+extern unsigned int ResourceClientBits(void); - /* bits and fields within a resource id */ - #define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */ --#if MAXCLIENTS == 64 --#define RESOURCE_CLIENT_BITS 6 --#endif --#if MAXCLIENTS == 128 --#define RESOURCE_CLIENT_BITS 7 --#endif --#if MAXCLIENTS == 256 --#define RESOURCE_CLIENT_BITS 8 --#endif --#if MAXCLIENTS == 512 --#define RESOURCE_CLIENT_BITS 9 --#endif --/* client field offset */ -+#define RESOURCE_CLIENT_BITS ResourceClientBits() /* client field offset */ - #define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS) - /* resource field */ - #define RESOURCE_ID_MASK ((1 << CLIENTOFFSET) - 1) -diff --git a/man/Xserver.man b/man/Xserver.man -index bc4c7fc..d927913 100644 ---- a/man/Xserver.man -+++ b/man/Xserver.man -@@ -320,6 +320,11 @@ sets the stack space limit of the server to the specified number of kilobytes. - A value of zero makes the stack size as large as possible. The default value - of \-1 leaves the stack space limit unchanged. - .TP 8 -+.B \-maxclients -+.BR 64 | 128 | 256 | 512 -+Set the maximum number of clients allowed to connect to the X server. -+Acceptable values are 64, 128, 256 or 512. -+.TP 8 - .B \-render - .BR default | mono | gray | color - sets the color allocation policy that will be used by the render extension. -diff --git a/os/connection.c b/os/connection.c -index 7ff44e1..d198e1f 100644 ---- a/os/connection.c -+++ b/os/connection.c -@@ -161,9 +161,9 @@ int *ConnectionTranslation = NULL; - */ - - #undef MAXSOCKS --#define MAXSOCKS 500 -+#define MAXSOCKS 512 - #undef MAXSELECT --#define MAXSELECT 500 -+#define MAXSELECT 512 - - struct _ct_node { - struct _ct_node *next; -@@ -299,7 +299,7 @@ InitConnectionLimits(void) - if (lastfdesc > MAXCLIENTS) { - lastfdesc = MAXCLIENTS; - if (debug_conns) -- ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS); -+ ErrorF("REACHED MAXIMUM CLIENTS LIMIT %d\n", LimitClients); - } - MaxClients = lastfdesc; - -diff --git a/os/osdep.h b/os/osdep.h -index 77a5b53..86263a5 100644 ---- a/os/osdep.h -+++ b/os/osdep.h -@@ -65,7 +65,7 @@ SOFTWARE. - - #ifndef OPEN_MAX - #ifdef SVR4 --#define OPEN_MAX 256 -+#define OPEN_MAX 512 - #else - #include - #ifndef OPEN_MAX -@@ -75,7 +75,7 @@ SOFTWARE. - #if !defined(WIN32) - #define OPEN_MAX NOFILES_MAX - #else --#define OPEN_MAX 256 -+#define OPEN_MAX 512 - #endif - #endif - #endif -@@ -89,10 +89,10 @@ SOFTWARE. - * like sysconf(_SC_OPEN_MAX) is not supported. - */ - --#if OPEN_MAX <= 256 -+#if OPEN_MAX <= 512 - #define MAXSOCKS (OPEN_MAX - 1) - #else --#define MAXSOCKS 256 -+#define MAXSOCKS 512 - #endif - - /* MAXSELECT is the number of fds that select() can handle */ -diff --git a/os/osinit.c b/os/osinit.c -index 91e3e06..ddd3fce 100644 ---- a/os/osinit.c -+++ b/os/osinit.c -@@ -86,6 +86,9 @@ int limitStackSpace = -1; - int limitNoFile = -1; - #endif - -+/* The actual user defined max number of clients */ -+int LimitClients = LIMITCLIENTS; -+ - static OsSigWrapperPtr OsSigWrapper = NULL; - - OsSigWrapperPtr -diff --git a/os/utils.c b/os/utils.c -index 03721fd..b518add 100644 ---- a/os/utils.c -+++ b/os/utils.c -@@ -556,6 +556,7 @@ UseMsg(void) - #ifdef LOCK_SERVER - ErrorF("-nolock disable the locking mechanism\n"); - #endif -+ ErrorF("-maxclients n set maximum number of clients (power of two)\n"); - ErrorF("-nolisten string don't listen on protocol\n"); - ErrorF("-listen string listen on protocol\n"); - ErrorF("-noreset don't reset after last client exists\n"); -@@ -860,6 +861,19 @@ ProcessCommandLine(int argc, char *argv[]) - nolock = TRUE; - } - #endif -+ else if ( strcmp( argv[i], "-maxclients") == 0) -+ { -+ if (++i < argc) { -+ LimitClients = atoi(argv[i]); -+ if (LimitClients != 64 && -+ LimitClients != 128 && -+ LimitClients != 256 && -+ LimitClients != 512) { -+ FatalError("maxclients must be one of 64, 128, 256 or 512\n"); -+ } -+ } else -+ UseMsg(); -+ } - else if (strcmp(argv[i], "-nolisten") == 0) { - if (++i < argc) { - if (_XSERVTransNoListen(argv[i])) --- -1.7.1 - diff --git a/SOURCES/0001-dix-Enable-indirect-GLX-by-default-add-xorg.conf-opt.patch b/SOURCES/0001-dix-Enable-indirect-GLX-by-default-add-xorg.conf-opt.patch deleted file mode 100644 index c5fcd0b..0000000 --- a/SOURCES/0001-dix-Enable-indirect-GLX-by-default-add-xorg.conf-opt.patch +++ /dev/null @@ -1,106 +0,0 @@ -From d69bf823d4f7acefe7b0fac592525c07b7c68521 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 23 May 2016 14:09:58 -0400 -Subject: [PATCH] dix: Enable indirect GLX by default, add xorg.conf option - -Signed-off-by: Adam Jackson ---- - hw/xfree86/common/xf86Config.c | 9 +++++++++ - hw/xfree86/common/xf86Init.c | 4 ++++ - hw/xfree86/common/xf86Privstr.h | 1 + - hw/xfree86/man/xorg.conf.man | 4 ++++ - os/utils.c | 2 +- - 5 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 5f7d13b..2f829e3 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -698,6 +698,7 @@ typedef enum { - FLAG_USE_SIGIO, - FLAG_AUTO_ADD_GPU, - FLAG_MAX_CLIENTS, -+ FLAG_IGLX, - } FlagValues; - - /** -@@ -759,6 +760,8 @@ static OptionInfoRec FlagOptions[] = { - {0}, FALSE}, - {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, - {0}, FALSE }, -+ {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, -+ {0}, FALSE}, - {-1, NULL, OPTV_NONE, - {0}, FALSE}, - }; -@@ -941,6 +944,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) - xf86Info.aiglx = value; - xf86Info.aiglxFrom = X_CONFIG; - } -+ if (xf86Info.iglxFrom != X_CMDLINE) { -+ if (xf86GetOptValBool(FlagOptions, FLAG_IGLX, &value)) { -+ enableIndirectGLX = value; -+ xf86Info.iglxFrom = X_CONFIG; -+ } -+ } - #endif - - /* if we're not hotplugging, force some input devices to exist */ -diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c -index 70048c5..f53660d 100644 ---- a/hw/xfree86/common/xf86Init.c -+++ b/hw/xfree86/common/xf86Init.c -@@ -1468,6 +1468,10 @@ ddxProcessArgument(int argc, char **argv, int i) - xf86Info.ShareVTs = TRUE; - return 1; - } -+ if (!strcmp(argv[i], "-iglx") || !strcmp(argv[i], "+iglx")) { -+ xf86Info.iglxFrom = X_CMDLINE; -+ return 0; -+ } - - /* OS-specific processing */ - return xf86ProcessArgument(argc, argv, i); -diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h -index cffa14d..75d86e6 100644 ---- a/hw/xfree86/common/xf86Privstr.h -+++ b/hw/xfree86/common/xf86Privstr.h -@@ -89,6 +89,7 @@ typedef struct { - MessageType randRFrom; - Bool aiglx; - MessageType aiglxFrom; -+ MessageType iglxFrom; - XF86_GlxVisuals glxVisuals; - MessageType glxVisualsFrom; - -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 9157fc9..d788d90 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -644,6 +644,10 @@ Default is disabled. - .BI "Option \*qAIGLX\*q \*q" boolean \*q - enable or disable AIGLX. AIGLX is enabled by default. - .TP 7 -+.BI "Option \*qIndirectGLX\*q \*q" boolean \*q -+enable or disable indirect GLX contexts. Indirect GLX contexts are enabled by -+default. -+.TP 7 - .BI "Option \*qDRI2\*q \*q" boolean \*q - enable or disable DRI2. DRI2 is disabled by default. - .TP 7 -diff --git a/os/utils.c b/os/utils.c -index b518add..5c1f1e4 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.7.0 - diff --git a/SOURCES/0001-dix-Remove-clients-from-input-and-output-ready-queue.patch b/SOURCES/0001-dix-Remove-clients-from-input-and-output-ready-queue.patch new file mode 100644 index 0000000..c4a4ef2 --- /dev/null +++ b/SOURCES/0001-dix-Remove-clients-from-input-and-output-ready-queue.patch @@ -0,0 +1,47 @@ +From d9e23ea4228575344e3b4c0443cecc5eb75356e4 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Wed, 10 May 2017 21:50:45 -0700 +Subject: [PATCH xserver] dix: Remove clients from input and output ready + queues after closing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Delay removing the client from these two queues until all potential +I/O has completed in case we mark the client as ready for reading or +with pending output during the close operation. + +Bugzilla: https://bugs.freedesktop.org/100957 +Signed-off-by: Keith Packard +Tested-by: Nick Sarnie +Reviewed-by: Michel Dänzer +--- + dix/dispatch.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dix/dispatch.c b/dix/dispatch.c +index a2df1e0e6..8b371b678 100644 +--- a/dix/dispatch.c ++++ b/dix/dispatch.c +@@ -3414,7 +3414,6 @@ CloseDownClient(ClientPtr client) + if (grabState != GrabNone && grabClient == client) { + UngrabServer(client); + } +- mark_client_not_ready(client); + BITCLEAR(grabWaiters, client->index); + DeleteClientFromAnySelections(client); + ReleaseActiveGrabs(client); +@@ -3443,8 +3442,9 @@ CloseDownClient(ClientPtr client) + if (ClientIsAsleep(client)) + ClientSignal(client); + ProcessWorkQueueZombies(); +- output_pending_clear(client); + CloseDownConnection(client); ++ output_pending_clear(client); ++ mark_client_not_ready(client); + + /* If the client made it to the Running stage, nClients has + * been incremented on its behalf, so we need to decrement it +-- +2.13.0 + diff --git a/SOURCES/0001-dix-export-ResourceClientBits.patch b/SOURCES/0001-dix-export-ResourceClientBits.patch deleted file mode 100644 index a50f23c..0000000 --- a/SOURCES/0001-dix-export-ResourceClientBits.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c74c074d8e4981eb4509e120e14d15387bdc94ef Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 31 Aug 2015 08:18:59 +0200 -Subject: [PATCH xserver] dix: export ResourceClientBits() - -ResourceClientBits() might be used by the modules as well, need to -mark the symbol as visible to that the linker can resolve it at -run time. - -/usr/bin/X: symbol lookup error: -/usr/lib64/xorg/modules/extensions/libglx.so: undefined symbol: -ResourceClientBits - -bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91763 -Signed-off-by: Olivier Fourdan -Reviewed-by: Keith Packard -Signed-off-by: Keith Packard ---- - include/resource.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/resource.h b/include/resource.h -index 597f7b6..5871a4c 100644 ---- a/include/resource.h -+++ b/include/resource.h -@@ -85,7 +85,7 @@ typedef uint32_t RESTYPE; - #define RT_LASTPREDEF ((RESTYPE)9) - #define RT_NONE ((RESTYPE)0) - --extern unsigned int ResourceClientBits(void); -+extern _X_EXPORT unsigned int ResourceClientBits(void); - /* bits and fields within a resource id */ - #define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */ - #define RESOURCE_CLIENT_BITS ResourceClientBits() /* client field offset */ --- -2.7.3 - diff --git a/SOURCES/0001-glamor-add-support-for-allocating-linear-buffers-v2.patch b/SOURCES/0001-glamor-add-support-for-allocating-linear-buffers-v2.patch deleted file mode 100644 index ff526c6..0000000 --- a/SOURCES/0001-glamor-add-support-for-allocating-linear-buffers-v2.patch +++ /dev/null @@ -1,209 +0,0 @@ -From 3a9d066fd64f01b3276d22a199474826f79fe371 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Wed, 10 Jun 2015 14:46:22 +1000 -Subject: [PATCH xserver 1/8] glamor: add support for allocating linear buffers - (v2) - -We need this for doing USB offload scenarios using glamor -and modesetting driver. - -unfortunately only gbm in mesa 10.6 has support for the -linear API. - -v1.1: fix bad define -v2: update the configure.ac test as per amdgpu. (Michel) -set linear bos to external to avoid cache. (Eric) - -Reviewed-by: Eric Anholt -Signed-off-by: Dave Airlie -(cherry picked from commit ea0e4d752b778c1f2132f8d29542f7dabc296415) -[hdegoede@redhat.com: Rename new glamor_egl_create_argb8888_based_texture -variant with 4 function args to glamor_egl_create_argb8888_based_texture_linear, -make glamor_egl_create_argb8888_based_texture a wrapper, to avoid breaking -glamor ABI] ---- - configure.ac | 4 ++++ - glamor/glamor.h | 5 +++++ - glamor/glamor_egl.c | 11 ++++++++++- - glamor/glamor_egl_stubs.c | 6 ++++++ - glamor/glamor_fbo.c | 15 +++++++++------ - hw/xwayland/xwayland-glamor.c | 6 ++++++ - include/dix-config.h.in | 3 +++ - 7 files changed, 43 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 7ce87cd..db74298 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2126,6 +2126,10 @@ if test "x$GLAMOR" = xyes; then - if test "x$GBM" = xyes; then - AC_DEFINE(GLAMOR_HAS_GBM, 1, - [Build glamor with GBM-based EGL support]) -+ AC_CHECK_DECL(GBM_BO_USE_LINEAR, -+ [AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [], -+ [#include -+ #include ]) - fi - - fi -diff --git a/glamor/glamor.h b/glamor/glamor.h -index 206158c..e9d21bf 100644 ---- a/glamor/glamor.h -+++ b/glamor/glamor.h -@@ -166,6 +166,11 @@ extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr - screen, - int w, - int h); -+extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture_linear(ScreenPtr -+ screen, -+ int w, -+ int h, -+ Bool linear); - extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr, - unsigned int, Bool, - CARD16 *, CARD32 *); -diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c -index 6160032..6a57584 100644 ---- a/glamor/glamor_egl.c -+++ b/glamor/glamor_egl.c -@@ -187,7 +187,7 @@ glamor_egl_get_gbm_device(ScreenPtr screen) - } - - unsigned int --glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) -+glamor_egl_create_argb8888_based_texture_linear(ScreenPtr screen, int w, int h, Bool linear) - { - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl; -@@ -200,6 +200,9 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) - - glamor_egl = glamor_egl_get_screen_private(scrn); - bo = gbm_bo_create(glamor_egl->gbm, w, h, GBM_FORMAT_ARGB8888, -+#ifdef GLAMOR_HAS_GBM_LINEAR -+ (linear ? GBM_BO_USE_LINEAR : 0) | -+#endif - GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT); - if (!bo) - return 0; -@@ -226,6 +229,12 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) - #endif - } - -+unsigned int -+glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) -+{ -+ return glamor_egl_create_argb8888_based_texture_linear(screen, w, h, FALSE); -+} -+ - Bool - glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) - { -diff --git a/glamor/glamor_egl_stubs.c b/glamor/glamor_egl_stubs.c -index a93f62d..12ec2b5 100644 ---- a/glamor/glamor_egl_stubs.c -+++ b/glamor/glamor_egl_stubs.c -@@ -54,3 +54,9 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) - { - return 0; - } -+ -+unsigned int -+glamor_egl_create_argb8888_based_texture_linear(ScreenPtr screen, int w, int h, Bool linear) -+{ -+ return 0; -+} -diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c -index ad4dfe6..9d4b7d5 100644 ---- a/glamor/glamor_fbo.c -+++ b/glamor/glamor_fbo.c -@@ -247,6 +247,9 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - goto done; - } - -+ if (flag == CREATE_PIXMAP_USAGE_SHARED) -+ fbo->external = TRUE; -+ - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { - if (glamor_pixmap_ensure_fb(fbo) != 0) { - glamor_purge_fbo(fbo); -@@ -332,7 +335,7 @@ glamor_destroy_fbo(glamor_pixmap_fbo *fbo) - - static int - _glamor_create_tex(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format) -+ int w, int h, GLenum format, Bool linear) - { - unsigned int tex = 0; - -@@ -341,8 +344,8 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, - * give us ARGB8888. We ask glamor_egl to use get - * an ARGB8888 based texture for us. */ - if (glamor_priv->dri3_enabled && format == GL_RGBA) { -- tex = glamor_egl_create_argb8888_based_texture(glamor_priv->screen, -- w, h); -+ tex = glamor_egl_create_argb8888_based_texture_linear( -+ glamor_priv->screen, w, h, linear); - } - if (!tex) { - glamor_make_current(glamor_priv); -@@ -364,7 +367,7 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, - GLint tex = 0; - int cache_flag; - -- if (flag == GLAMOR_CREATE_FBO_NO_FBO) -+ if (flag == GLAMOR_CREATE_FBO_NO_FBO || flag == CREATE_PIXMAP_USAGE_SHARED) - goto new_fbo; - - if (flag == GLAMOR_CREATE_PIXMAP_MAP) -@@ -380,7 +383,7 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, - if (fbo) - return fbo; - new_fbo: -- tex = _glamor_create_tex(glamor_priv, w, h, format); -+ tex = _glamor_create_tex(glamor_priv, w, h, format, flag == CREATE_PIXMAP_USAGE_SHARED); - no_tex: - fbo = glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); - -@@ -564,7 +567,7 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) - if (!pixmap_priv->base.fbo->tex) - pixmap_priv->base.fbo->tex = - _glamor_create_tex(glamor_priv, pixmap->drawable.width, -- pixmap->drawable.height, format); -+ pixmap->drawable.height, format, FALSE); - - if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0) - if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0) -diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c -index d574d94..b82149c 100644 ---- a/hw/xwayland/xwayland-glamor.c -+++ b/hw/xwayland/xwayland-glamor.c -@@ -420,6 +420,12 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) - return 0; - } - -+unsigned int -+glamor_egl_create_argb8888_based_texture_linear(ScreenPtr screen, int w, int h, Bool linear) -+{ -+ return 0; -+} -+ - struct xwl_auth_state { - int fd; - ClientPtr client; -diff --git a/include/dix-config.h.in b/include/dix-config.h.in -index b0eb696..a7b152f 100644 ---- a/include/dix-config.h.in -+++ b/include/dix-config.h.in -@@ -503,6 +503,9 @@ - /* Build glamor's GBM-based EGL support */ - #undef GLAMOR_HAS_GBM - -+/* Build glamor/gbm has linear support */ -+#undef GLAMOR_HAS_GBM_LINEAR -+ - /* byte order */ - #undef X_BYTE_ORDER - --- -2.7.4 - diff --git a/SOURCES/0001-glamor-make-current-in-prepare-paths.patch b/SOURCES/0001-glamor-make-current-in-prepare-paths.patch deleted file mode 100644 index 376a3f4..0000000 --- a/SOURCES/0001-glamor-make-current-in-prepare-paths.patch +++ /dev/null @@ -1,40 +0,0 @@ -From db5337afb248edf81087cf8d74006fc496d70589 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Wed, 15 Jul 2015 17:56:11 +1000 -Subject: [PATCH] glamor: make current in prepare paths -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Lots of the accel paths only make current once they start -doing someting, so a lot of them call the bail paths without -make current, which means on PRIME systems for example -we end up in the wrong context. - -Add a prepare pixmap in the prepare fallback path. - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90667 -Signed-off-by: Dave Airlie -Signed-off-by: Eric Anholt -Reviewed-and-Tested-by: Michel Dänzer -Reviewed-by: Eric Anholt ---- - glamor/glamor_prepare.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c -index 833291c..5a73e6c 100644 ---- a/glamor/glamor_prepare.c -+++ b/glamor/glamor_prepare.c -@@ -45,6 +45,8 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) - return TRUE; - -+ glamor_make_current(glamor_priv); -+ - RegionInit(®ion, box, 1); - - /* See if it's already mapped */ --- -2.4.3 - diff --git a/SOURCES/0001-glx-swrast-Do-more-GLX-extension-setup.patch b/SOURCES/0001-glx-swrast-Do-more-GLX-extension-setup.patch deleted file mode 100644 index ee10db5..0000000 --- a/SOURCES/0001-glx-swrast-Do-more-GLX-extension-setup.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 2d7194334a9f84e417ec90e220b2fe476f704612 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 15 May 2015 11:27:31 -0400 -Subject: [PATCH] glx/swrast: Do more GLX extension setup - -This gets you nice things like core contexts when using Xvfb. - -Also, no, MESA_copy_sub_buffer is not enabled automatically. - -Reviewed-by: James Jones -Reviewed-by: Jon Turney -Signed-off-by: Adam Jackson ---- - glx/glxdriswrast.c | 37 ++++++++++++++++++++++++++++++++++--- - 1 file changed, 34 insertions(+), 3 deletions(-) - -diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c -index 5d9aa04..e25ca47 100644 ---- a/glx/glxdriswrast.c -+++ b/glx/glxdriswrast.c -@@ -71,6 +71,8 @@ struct __GLXDRIscreen { - const __DRIcopySubBufferExtension *copySubBuffer; - const __DRItexBufferExtension *texBuffer; - const __DRIconfig **driConfigs; -+ -+ unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - }; - - struct __GLXDRIcontext { -@@ -394,21 +396,36 @@ initializeExtensions(__GLXDRIscreen * screen) - const __DRIextension **extensions; - int i; - -+ if (screen->swrast->base.version >= 3) { -+ __glXEnableExtension(screen->glx_enable_bits, -+ "GLX_ARB_create_context"); -+ __glXEnableExtension(screen->glx_enable_bits, -+ "GLX_ARB_create_context_profile"); -+ __glXEnableExtension(screen->glx_enable_bits, -+ "GLX_EXT_create_context_es2_profile"); -+ } -+ -+ /* these are harmless to enable unconditionally */ -+ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); -+ __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); -+ __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); -+ __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); -+ - extensions = screen->core->getExtensions(screen->driScreen); - - for (i = 0; extensions[i]; i++) { - if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { - screen->copySubBuffer = - (const __DRIcopySubBufferExtension *) extensions[i]; - /* GLX_MESA_copy_sub_buffer is always enabled. */ - } - - if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { - screen->texBuffer = (const __DRItexBufferExtension *) extensions[i]; - /* GLX_EXT_texture_from_pixmap is always enabled. */ - } - - /* Ignore unknown extensions */ - } - } - -@@ -420,6 +435,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - { - const char *driverName = "swrast"; - __GLXDRIscreen *screen; -+ size_t buffer_size; - - screen = calloc(1, sizeof *screen); - if (screen == NULL) -@@ -431,6 +447,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - screen->base.swapInterval = NULL; - screen->base.pScreen = pScreen; - -+ __glXInitExtensionEnableBits(screen->glx_enable_bits); -+ - screen->driver = glxProbeDriver(driverName, - (void **) &screen->core, - __DRI_CORE, 1, -@@ -459,6 +477,19 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - - __glXScreenInit(&screen->base, pScreen); - -+ /* The first call simply determines the length of the extension string. -+ * This allows us to allocate some memory to hold the extension string, -+ * but it requires that we call __glXGetExtensionString a second time. -+ */ -+ buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); -+ if (buffer_size > 0) { -+ free(screen->base.GLXextensions); -+ -+ screen->base.GLXextensions = xnfalloc(buffer_size); -+ (void) __glXGetExtensionString(screen->glx_enable_bits, -+ screen->base.GLXextensions); -+ } -+ - screen->base.GLXmajor = 1; - screen->base.GLXminor = 4; - --- -2.4.3 - diff --git a/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch b/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch new file mode 100644 index 0000000..64f343e --- /dev/null +++ b/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch @@ -0,0 +1,25 @@ +From 54564059c2d4c841a80c65f6a730e36412ee451e Mon Sep 17 00:00:00 2001 +From: 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 + diff --git a/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch b/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch deleted file mode 100644 index 8d67f40..0000000 --- a/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch +++ /dev/null @@ -1,245 +0,0 @@ -From ce813f9c98d9074fe089ce9f74494abfe4dddce8 Mon Sep 17 00:00:00 2001 -From: Fedora X Ninjas -Date: Wed, 19 Aug 2015 13:45:43 -0400 -Subject: [PATCH] kms: implement a double-buffered shadow mode - -v2: Free the rect list. - -Signed-off-by: Fedora X Ninjas ---- - hw/xfree86/drivers/modesetting/driver.c | 128 ++++++++++++++++++++++- - hw/xfree86/drivers/modesetting/drmmode_display.c | 7 ++ - hw/xfree86/drivers/modesetting/drmmode_display.h | 2 + - 3 files changed, 132 insertions(+), 5 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 1215cb3..1189df7 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -124,6 +124,7 @@ typedef enum { - OPTION_DEVICE_PATH, - OPTION_SHADOW_FB, - OPTION_ACCEL_METHOD, -+ OPTION_DOUBLE_SHADOW, - } modesettingOpts; - - static const OptionInfoRec Options[] = { -@@ -131,6 +132,7 @@ static const OptionInfoRec Options[] = { - {OPTION_DEVICE_PATH, "kmsdev", OPTV_STRING, {0}, FALSE}, - {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE}, -+ {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, - {-1, NULL, OPTV_NONE, {0}, FALSE} - }; - -@@ -615,6 +617,32 @@ try_enable_glamor(ScrnInfoPtr pScrn) - #endif - } - -+static Bool -+msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms) -+{ -+ Bool ret = FALSE, asked; -+ int from; -+ drmVersionPtr v = drmGetVersion(ms->fd); -+ -+ if (!strcmp(v->name, "mgag200") || -+ !strcmp(v->name, "ast")) /* XXX || rn50 */ -+ ret = TRUE; -+ -+ drmFreeVersion(v); -+ -+ asked = xf86GetOptValBool(ms->Options, OPTION_DOUBLE_SHADOW, &ret); -+ -+ if (asked) -+ from = X_CONFIG; -+ else -+ from = X_INFO; -+ -+ xf86DrvMsg(pScrn->scrnIndex, from, -+ "Double-buffered shadow updates: %s", ret ? "on" : "off"); -+ -+ return ret; -+} -+ - #ifndef DRM_CAP_CURSOR_WIDTH - #define DRM_CAP_CURSOR_WIDTH 0x8 - #endif -@@ -814,6 +842,8 @@ PreInit(ScrnInfoPtr pScrn, int flags) - prefer_shadow ? "YES" : "NO", - ms->drmmode.force_24_32 ? "FORCE" : - ms->drmmode.shadow_enable ? "YES" : "NO"); -+ -+ ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); - } - - if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { -@@ -872,10 +902,92 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, - return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); - } - -+/* somewhat arbitrary tile size, in pixels */ -+#define TILE 16 -+ -+static int -+msUpdateIntersect(modesettingPtr ms, shadowBufPtr pBuf, BoxPtr box, -+ xRectangle *prect) -+{ -+ int i, dirty = 0, stride = pBuf->pPixmap->devKind, cpp = ms->drmmode.cpp; -+ int width = (box->x2 - box->x1) * cpp; -+ unsigned char *old, *new; -+ -+ old = ms->drmmode.shadow_fb2; -+ old += (box->y1 * stride) + (box->x1 * cpp); -+ new = ms->drmmode.shadow_fb; -+ new += (box->y1 * stride) + (box->x1 * cpp); -+ -+ for (i = box->y2 - box->y1 - 1; i >= 0; i--) { -+ unsigned char *o = old + i * stride, -+ *n = new + i * stride; -+ if (memcmp(o, n, width) != 0) { -+ dirty = 1; -+ memcpy(o, n, width); -+ } -+ } -+ -+ if (dirty) { -+ prect->x = box->x1; -+ prect->y = box->y1; -+ prect->width = box->x2 - box->x1; -+ prect->height = box->y2 - box->y1; -+ } -+ -+ return dirty; -+} -+ - static void - msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) - { -- shadowUpdatePacked(pScreen, pBuf); -+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); -+ modesettingPtr ms = modesettingPTR(pScrn); -+ Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; -+ -+ if (ms->drmmode.shadow_enable2 && ms->drmmode.shadow_fb2) do { -+ RegionPtr damage = DamageRegion(pBuf->pDamage), tiles; -+ BoxPtr extents = RegionExtents(damage); -+ xRectangle *prect; -+ int nrects; -+ int i, j, tx1, tx2, ty1, ty2; -+ -+ tx1 = extents->x1 / TILE; -+ tx2 = (extents->x2 + TILE - 1) / TILE; -+ ty1 = extents->y1 / TILE; -+ ty2 = (extents->y2 + TILE - 1) / TILE; -+ -+ nrects = (tx2 - tx1) * (ty2 - ty1); -+ if (!(prect = calloc(nrects, sizeof(xRectangle)))) -+ break; -+ -+ nrects = 0; -+ for (j = ty2 - 1; j >= ty1; j--) { -+ for (i = tx2 - 1; i >= tx1; i--) { -+ BoxRec box; -+ -+ box.x1 = max(i * TILE, extents->x1); -+ box.y1 = max(j * TILE, extents->y1); -+ box.x2 = min((i+1) * TILE, extents->x2); -+ box.y2 = min((j+1) * TILE, extents->y2); -+ -+ if (RegionContainsRect(damage, &box) != rgnOUT) { -+ if (msUpdateIntersect(ms, pBuf, &box, prect + nrects)) { -+ nrects++; -+ } -+ } -+ } -+ } -+ -+ tiles = RegionFromRects(nrects, prect, CT_NONE); -+ RegionIntersect(damage, damage, tiles); -+ RegionDestroy(tiles); -+ free(prect); -+ } while (0); -+ -+ if (use_ms_shadow) -+ ms_shadowUpdate32to24(pScreen, pBuf); -+ else -+ shadowUpdatePacked(pScreen, pBuf); - } - - static Bool -@@ -887,7 +999,6 @@ CreateScreenResources(ScreenPtr pScreen) - Bool ret; - void *pixels = NULL; - int err; -- Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; - - pScreen->CreateScreenResources = ms->createScreenResources; - ret = pScreen->CreateScreenResources(pScreen); -@@ -915,13 +1026,18 @@ CreateScreenResources(ScreenPtr pScreen) - if (ms->drmmode.shadow_enable) - pixels = ms->drmmode.shadow_fb; - -+ if (ms->drmmode.shadow_enable2) { -+ ms->drmmode.shadow_fb2 = calloc(1, pScrn->displayWidth * pScrn->virtualY * ((pScrn->bitsPerPixel + 7) >> 3)); -+ if (!ms->drmmode.shadow_fb2) -+ ms->drmmode.shadow_enable2 = FALSE; -+ } -+ - if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels)) - FatalError("Couldn't adjust screen pixmap\n"); - - if (ms->drmmode.shadow_enable) { -- if (!shadowAdd(pScreen, rootPixmap, -- use_ms_shadow ? ms_shadowUpdate32to24 : msUpdatePacked, -- msShadowWindow, 0, 0)) -+ if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow, -+ 0, 0)) - return FALSE; - } - -@@ -1238,6 +1354,8 @@ CloseScreen(ScreenPtr pScreen) - shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); - free(ms->drmmode.shadow_fb); - ms->drmmode.shadow_fb = NULL; -+ free(ms->drmmode.shadow_fb2); -+ ms->drmmode.shadow_fb2 = NULL; - } - drmmode_uevent_fini(pScrn, &ms->drmmode); - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 349bddb..7dd85c8 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -1393,6 +1393,13 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - drmmode->shadow_fb = new_pixels; - } - -+ if (drmmode->shadow_enable2) { -+ uint32_t size = scrn->displayWidth * scrn->virtualY * cpp; -+ void *fb2 = calloc(1, size); -+ free(drmmode->shadow_fb2); -+ drmmode->shadow_fb2 = fb2; -+ } -+ - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - scrn->displayWidth * cpp, new_pixels); - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h -index 927efec..3a7d222 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.h -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h -@@ -65,8 +65,10 @@ typedef struct { - - Bool glamor; - Bool shadow_enable; -+ Bool shadow_enable2; - Bool force_24_32; - void *shadow_fb; -+ void *shadow_fb2; - - /** - * A screen-sized pixmap when we're doing triple-buffered DRI2 --- -2.7.0 - diff --git a/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch b/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch new file mode 100644 index 0000000..4e97a78 --- /dev/null +++ b/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch @@ -0,0 +1,419 @@ +From 9426c5500b72e1fe004fef4c3b259023c4ec49f7 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 +Signed-off-by: Adam Jackson +--- + 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 + diff --git a/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch b/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch new file mode 100644 index 0000000..3e3bc60 --- /dev/null +++ b/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch @@ -0,0 +1,46 @@ +From bc6ccb0bdcdc27c90c95a02e821d5883ad1dc7a0 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 + +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 + diff --git a/SOURCES/0001-modesetting-Fix-the-error-check-from-DRM_IOCTL_MODE_.patch b/SOURCES/0001-modesetting-Fix-the-error-check-from-DRM_IOCTL_MODE_.patch deleted file mode 100644 index bb6d474..0000000 --- a/SOURCES/0001-modesetting-Fix-the-error-check-from-DRM_IOCTL_MODE_.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6fed3ac4419f88220894143d65854cf41d459b53 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 16 Feb 2015 17:00:53 +0100 -Subject: [PATCH 1/5] modesetting: Fix the error check from - DRM_IOCTL_MODE_CURSOR2 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The error value isn't always -EINVAL, e.g. the kernel drm core returns --ENXIO when the corresponding ops doesn't exist. Without this fix, -DRM_IOCTL_MODE_CURSOR2 would be dealt as success even if it -shouldn't. - -Signed-off-by: Takashi Iwai -Reviewed-by: Michel Dänzer ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 6a13660..04cb17a 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -472,8 +472,8 @@ drmmode_set_cursor(xf86CrtcPtr crtc) - cursor->bits->xhot, cursor->bits->yhot); - if (!ret) - return; -- if (ret == -EINVAL) -- use_set_cursor2 = FALSE; -+ -+ use_set_cursor2 = FALSE; - } - - ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, --- -2.4.3 - diff --git a/SOURCES/0001-modesetting-Implement-32-24-bpp-conversion-in-shadow.patch b/SOURCES/0001-modesetting-Implement-32-24-bpp-conversion-in-shadow.patch deleted file mode 100644 index cd53fc4..0000000 --- a/SOURCES/0001-modesetting-Implement-32-24-bpp-conversion-in-shadow.patch +++ /dev/null @@ -1,518 +0,0 @@ -From 71b321fbb79998d92766ca94ab3f8220d07d4616 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Wed, 29 Jul 2015 11:52:20 -0400 -Subject: [PATCH] modesetting: Implement 32->24 bpp conversion in shadow update - -24bpp front buffers tend to be the least well tested path for client -rendering. On the qemu cirrus emulation, and on some Matrox G200 server -chips, the hardware can't do 32bpp at all. It's better to just allocate -a 32bpp shadow and downconvert in the upload hook than expose a funky -pixmap format to clients. - -[ajax: Ported from RHEL and separate modesetting driver, lifted kbpp -into the drmmode struct, cleaned up commit message, fixed 16bpp] - -[ajax: Backported from upstream submission to 1.17 branch] - -Reviewed-by: Adam Jackson -Signed-off-by: Dave Airlied ---- - hw/xfree86/drivers/modesetting/Makefile.am | 3 + - hw/xfree86/drivers/modesetting/driver.c | 51 ++++++--- - hw/xfree86/drivers/modesetting/drmmode_display.c | 59 +++++----- - hw/xfree86/drivers/modesetting/drmmode_display.h | 7 +- - hw/xfree86/drivers/modesetting/sh3224.c | 140 +++++++++++++++++++++++ - hw/xfree86/drivers/modesetting/sh3224.h | 7 ++ - 6 files changed, 217 insertions(+), 50 deletions(-) - create mode 100644 hw/xfree86/drivers/modesetting/sh3224.c - create mode 100644 hw/xfree86/drivers/modesetting/sh3224.h - -diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am -index 82c4f2f..206418e 100644 ---- a/hw/xfree86/drivers/modesetting/Makefile.am -+++ b/hw/xfree86/drivers/modesetting/Makefile.am -@@ -35,6 +35,7 @@ AM_CPPFLAGS = \ - -I$(srcdir)/../../modes \ - -I$(srcdir)/../../parser \ - -I$(srcdir)/../../ramdac \ -+ -I$(srcdir) \ - $(NULL) - - modesetting_drv_la_LTLIBRARIES = modesetting_drv.la -@@ -51,6 +52,8 @@ modesetting_drv_la_SOURCES = \ - dumb_bo.c \ - dumb_bo.h \ - present.c \ -+ sh3224.c \ -+ sh3224.h \ - vblank.c \ - $(NULL) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index d52517d..1215cb3 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -60,6 +60,7 @@ - #endif - - #include "driver.h" -+#include "sh3224.h" - - static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); - static Bool CloseScreen(ScreenPtr pScreen); -@@ -634,7 +635,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) - uint64_t value = 0; - int ret; - int bppflags; -- int defaultdepth, defaultbpp; - - if (pScrn->numEntities != 1) - return FALSE; -@@ -729,16 +729,23 @@ PreInit(ScrnInfoPtr pScrn, int flags) - pScrn->capabilities |= RR_Capability_SinkOutput; - } - #endif -- drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); -- if (defaultdepth == 24 && defaultbpp == 24) -- bppflags = SupportConvert32to24 | Support24bppFb; -- else -- bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; -+ bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; - -- if (!xf86SetDepthBpp -- (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) -+ if (!xf86SetDepthBpp(pScrn, -+ drmmode_check_default_depth(pScrn, &ms->drmmode), -+ 0, 0, bppflags)) - return FALSE; - -+ ms->drmmode.kbpp = pScrn->bitsPerPixel; -+ if (pScrn->depth >= 24) { -+ if (!drmmode_check_32bpp(pScrn, &ms->drmmode)) { -+ ms->drmmode.force_24_32 = TRUE; -+ ms->drmmode.kbpp = 24; -+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, -+ "Using 24bpp hw front buffer with 32bpp shadow\n"); -+ } -+ } -+ - switch (pScrn->depth) { - case 15: - case 16: -@@ -750,6 +757,8 @@ PreInit(ScrnInfoPtr pScrn, int flags) - pScrn->depth); - return FALSE; - } -+ if (ms->drmmode.kbpp == 0) -+ ms->drmmode.kbpp = pScrn->bitsPerPixel; - xf86PrintDepthBpp(pScrn); - - /* Process the options */ -@@ -786,18 +795,24 @@ PreInit(ScrnInfoPtr pScrn, int flags) - } else { - Bool prefer_shadow = TRUE; - -- ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); -- if (!ret) { -- prefer_shadow = !!value; -- } -+ if (ms->drmmode.force_24_32) { -+ prefer_shadow = TRUE; -+ ms->drmmode.shadow_enable = TRUE; -+ } else { -+ ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); -+ if (!ret) { -+ prefer_shadow = !!value; -+ } - -- ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, -- OPTION_SHADOW_FB, -- prefer_shadow); -+ ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, -+ OPTION_SHADOW_FB, -+ prefer_shadow); -+ } - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "ShadowFB: preferred %s, enabled %s\n", - prefer_shadow ? "YES" : "NO", -+ ms->drmmode.force_24_32 ? "FORCE" : - ms->drmmode.shadow_enable ? "YES" : "NO"); - } - -@@ -851,7 +866,7 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, - modesettingPtr ms = modesettingPTR(pScrn); - int stride; - -- stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; -+ stride = (pScrn->displayWidth * ms->drmmode.kbpp) / 8; - *size = stride; - - return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); -@@ -872,6 +887,7 @@ CreateScreenResources(ScreenPtr pScreen) - Bool ret; - void *pixels = NULL; - int err; -+ Bool use_ms_shadow = ms->drmmode.force_24_32 && pScrn->bitsPerPixel == 32; - - pScreen->CreateScreenResources = ms->createScreenResources; - ret = pScreen->CreateScreenResources(pScreen); -@@ -903,7 +919,8 @@ CreateScreenResources(ScreenPtr pScreen) - FatalError("Couldn't adjust screen pixmap\n"); - - if (ms->drmmode.shadow_enable) { -- if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, -+ if (!shadowAdd(pScreen, rootPixmap, -+ use_ms_shadow ? ms_shadowUpdate32to24 : msUpdatePacked, - msShadowWindow, 0, 0)) - return FALSE; - } -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index b803314..349bddb 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -288,7 +288,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - if (drmmode->fb_id == 0) { - ret = drmModeAddFB(drmmode->fd, - pScrn->virtualX, height, -- pScrn->depth, pScrn->bitsPerPixel, -+ pScrn->depth, drmmode->kbpp, - drmmode_bo_get_pitch(&drmmode->front_bo), - drmmode_bo_get_handle(&drmmode->front_bo), - &drmmode->fb_id); -@@ -1340,6 +1340,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - uint32_t old_fb_id; - int i, pitch, old_width, old_height, old_pitch; - int cpp = (scrn->bitsPerPixel + 7) / 8; -+ int kcpp = (drmmode->kbpp + 7) / 8; - PixmapPtr ppix = screen->GetScreenPixmap(screen); - void *new_pixels = NULL; - -@@ -1361,17 +1362,17 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - old_front = drmmode->front_bo; - - if (!drmmode_create_bo(drmmode, &drmmode->front_bo, -- width, height, scrn->bitsPerPixel)) -+ width, height, drmmode->kbpp)) - goto fail; - - pitch = drmmode_bo_get_pitch(&drmmode->front_bo); - - scrn->virtualX = width; - scrn->virtualY = height; -- scrn->displayWidth = pitch / cpp; -+ scrn->displayWidth = pitch / kcpp; - - ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth, -- scrn->bitsPerPixel, pitch, -+ drmmode->kbpp, pitch, - drmmode_bo_get_handle(&drmmode->front_bo), - &drmmode->fb_id); - if (ret) -@@ -1384,8 +1385,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - } - - if (drmmode->shadow_enable) { -- uint32_t size = scrn->displayWidth * scrn->virtualY * -- ((scrn->bitsPerPixel + 7) >> 3); -+ uint32_t size = scrn->displayWidth * scrn->virtualY * cpp; - new_pixels = calloc(1, size); - if (new_pixels == NULL) - goto fail; -@@ -1393,7 +1393,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - drmmode->shadow_fb = new_pixels; - } - -- screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels); -+ screen->ModifyPixmapHeader(ppix, width, height, -1, -1, -+ scrn->displayWidth * cpp, new_pixels); - - if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) - goto fail; -@@ -1420,7 +1421,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) - drmmode->front_bo = old_front; - scrn->virtualX = old_width; - scrn->virtualY = old_height; -- scrn->displayWidth = old_pitch / cpp; -+ scrn->displayWidth = old_pitch / kcpp; - drmmode->fb_id = old_fb_id; - - return FALSE; -@@ -1695,7 +1696,7 @@ drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int width; - int height; -- int bpp = pScrn->bitsPerPixel; -+ int bpp = ms->drmmode.kbpp; - int i; - int cpp = (bpp + 7) / 8; - -@@ -1778,29 +1779,30 @@ drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) - } - } - -+/* returns 0 if no preference or check failed */ -+int -+drmmode_check_default_depth(ScrnInfoPtr pScrn, drmmode_ptr drmmode) -+{ -+ uint64_t value = 0; -+ -+ drmGetCap(drmmode->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &value); -+ -+ return value; -+} -+ - /* ugly workaround to see if we can create 32bpp */ --void --drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth, -- int *bpp) -+Bool -+drmmode_check_32bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode) - { - drmModeResPtr mode_res; -- uint64_t value; - struct dumb_bo *bo; - uint32_t fb_id; - int ret; -+ int can = FALSE; - -- /* 16 is fine */ -- ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &value); -- if (!ret && (value == 16 || value == 8)) { -- *depth = value; -- *bpp = value; -- return; -- } -- -- *depth = 24; - mode_res = drmModeGetResources(drmmode->fd); - if (!mode_res) -- return; -+ goto out; - - if (mode_res->min_width == 0) - mode_res->min_width = 1; -@@ -1809,25 +1811,22 @@ drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth, - /*create a bo */ - bo = dumb_bo_create(drmmode->fd, mode_res->min_width, mode_res->min_height, - 32); -- if (!bo) { -- *bpp = 24; -- goto out; -- } -+ if (!bo) -+ goto out; - - ret = drmModeAddFB(drmmode->fd, mode_res->min_width, mode_res->min_height, - 24, 32, bo->pitch, bo->handle, &fb_id); - - if (ret) { -- *bpp = 24; - dumb_bo_destroy(drmmode->fd, bo); - goto out; - } - - drmModeRmFB(drmmode->fd, fb_id); -- *bpp = 32; -+ can = TRUE; - - dumb_bo_destroy(drmmode->fd, bo); - out: - drmModeFreeResources(mode_res); -- return; -+ return can; - } -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h -index 3a8959a..927efec 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.h -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h -@@ -50,6 +50,7 @@ typedef struct { - drmModeResPtr mode_res; - drmModeFBPtr mode_fb; - int cpp; -+ int kbpp; - ScrnInfoPtr scrn; - - struct gbm_device *gbm; -@@ -64,6 +65,7 @@ typedef struct { - - Bool glamor; - Bool shadow_enable; -+ Bool force_24_32; - void *shadow_fb; - - /** -@@ -158,9 +160,8 @@ Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); - void *drmmode_map_front_bo(drmmode_ptr drmmode); - Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); - void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode); --void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode, -- int *depth, int *bpp); -- -+Bool drmmode_check_32bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode); -+int drmmode_check_default_depth(ScrnInfoPtr pScrn, drmmode_ptr drmmode); - - #ifndef DRM_CAP_DUMB_PREFERRED_DEPTH - #define DRM_CAP_DUMB_PREFERRED_DEPTH 3 -diff --git a/hw/xfree86/drivers/modesetting/sh3224.c b/hw/xfree86/drivers/modesetting/sh3224.c -new file mode 100644 -index 0000000..a64a103 ---- /dev/null -+++ b/hw/xfree86/drivers/modesetting/sh3224.c -@@ -0,0 +1,140 @@ -+/* -+ * -+ * Copyright © 2000 Keith Packard -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Keith Packard not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Keith Packard makes no -+ * representations about the suitability of this software for any purpose. It -+ * is provided "as is" without express or implied warranty. -+ * -+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#ifdef HAVE_DIX_CONFIG_H -+#include "dix-config.h" -+#endif -+ -+#include "shadow.h" -+#include "fb.h" -+ -+#include "sh3224.h" -+#define Get8(a) ((CARD32) READ(a)) -+ -+#if BITMAP_BIT_ORDER == MSBFirst -+#define Get24(a) ((Get8(a) << 16) | (Get8((a)+1) << 8) | Get8((a)+2)) -+#define Put24(a,p) ((WRITE((a+0), (CARD8) ((p) >> 16))), \ -+ (WRITE((a+1), (CARD8) ((p) >> 8))), \ -+ (WRITE((a+2), (CARD8) (p)))) -+#else -+#define Get24(a) (Get8(a) | (Get8((a)+1) << 8) | (Get8((a)+2)<<16)) -+#define Put24(a,p) ((WRITE((a+0), (CARD8) (p))), \ -+ (WRITE((a+1), (CARD8) ((p) >> 8))), \ -+ (WRITE((a+2), (CARD8) ((p) >> 16)))) -+#endif -+ -+static void -+sh24_32BltLine(CARD8 *srcLine, -+ CARD8 *dstLine, -+ int width) -+{ -+ CARD32 *src; -+ CARD8 *dst; -+ int w; -+ CARD32 pixel; -+ -+ src = (CARD32 *) srcLine; -+ dst = dstLine; -+ w = width; -+ -+ while (((long)dst & 3) && w) { -+ w--; -+ pixel = READ(src++); -+ Put24(dst, pixel); -+ dst += 3; -+ } -+ /* Do four aligned pixels at a time */ -+ while (w >= 4) { -+ CARD32 s0, s1; -+ -+ s0 = READ(src++); -+ s1 = READ(src++); -+#if BITMAP_BIT_ORDER == LSBFirst -+ WRITE((CARD32 *) dst, (s0 & 0xffffff) | (s1 << 24)); -+#else -+ WRITE((CARD32 *) dst, (s0 << 8) | ((s1 & 0xffffff) >> 16)); -+#endif -+ s0 = READ(src++); -+#if BITMAP_BIT_ORDER == LSBFirst -+ WRITE((CARD32 *) (dst + 4), -+ ((s1 & 0xffffff) >> 8) | (s0 << 16)); -+#else -+ WRITE((CARD32 *) (dst + 4), -+ (s1 << 16) | ((s0 & 0xffffff) >> 8)); -+#endif -+ s1 = READ(src++); -+#if BITMAP_BIT_ORDER == LSBFirst -+ WRITE((CARD32 *) (dst + 8), -+ ((s0 & 0xffffff) >> 16) | (s1 << 8)); -+#else -+ WRITE((CARD32 *) (dst + 8), (s0 << 24) | (s1 & 0xffffff)); -+#endif -+ dst += 12; -+ w -= 4; -+ } -+ while (w--) { -+ pixel = READ(src++); -+ Put24(dst, pixel); -+ dst += 3; -+ } -+} -+ -+void -+ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf) -+{ -+ RegionPtr damage = shadowDamage(pBuf); -+ PixmapPtr pShadow = pBuf->pPixmap; -+ int nbox = RegionNumRects(damage); -+ BoxPtr pbox = RegionRects(damage); -+ FbStride shaStride; -+ int shaBpp; -+ _X_UNUSED int shaXoff, shaYoff; -+ int x, y, w, h; -+ CARD32 winSize; -+ FbBits *shaBase, *shaLine; -+ CARD8 *winBase = NULL, *winLine; -+ -+ fbGetDrawable(&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, -+ shaYoff); -+ -+ /* just get the initial window base + stride */ -+ winBase = (*pBuf->window)(pScreen, 0, 0, SHADOW_WINDOW_WRITE, -+ &winSize, pBuf->closure); -+ -+ while (nbox--) { -+ x = pbox->x1; -+ y = pbox->y1; -+ w = pbox->x2 - pbox->x1; -+ h = pbox->y2 - pbox->y1; -+ -+ winLine = winBase + y * winSize + (x * 3); -+ shaLine = shaBase + y * shaStride + ((x * shaBpp) >> FB_SHIFT); -+ -+ while (h--) { -+ sh24_32BltLine((CARD8 *)shaLine, (CARD8 *)winLine, w); -+ winLine += winSize; -+ shaLine += shaStride; -+ } -+ pbox++; -+ } -+} -diff --git a/hw/xfree86/drivers/modesetting/sh3224.h b/hw/xfree86/drivers/modesetting/sh3224.h -new file mode 100644 -index 0000000..fc301f9 ---- /dev/null -+++ b/hw/xfree86/drivers/modesetting/sh3224.h -@@ -0,0 +1,7 @@ -+#ifndef SH3224_H -+#define SH3224_H -+ -+void -+ms_shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf); -+ -+#endif --- -1.8.3.1 - diff --git a/SOURCES/0001-modesetting-Validate-the-atom-for-enum-properties.patch b/SOURCES/0001-modesetting-Validate-the-atom-for-enum-properties.patch new file mode 100644 index 0000000..ea7bacd --- /dev/null +++ b/SOURCES/0001-modesetting-Validate-the-atom-for-enum-properties.patch @@ -0,0 +1,33 @@ +From d4995a3936ae283b9080fdaa0905daa669ebacfc Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 12 Jun 2017 14:43:23 -0400 +Subject: [PATCH xserver] modesetting: Validate the atom for enum properties + +The client could have said anything here, and if what they said doesn't +actually name an atom NameForAtom() will return NULL, and strcmp() will +be unhappy about that. + +Signed-off-by: Adam Jackson +Reviewed-by: Peter Hutterer +Signed-off-by: Peter Hutterer +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index aa6baae09..961b56127 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -1557,7 +1557,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property, + value->size != 1) + return FALSE; + memcpy(&atom, value->data, 4); +- name = NameForAtom(atom); ++ if (!(name = NameForAtom(atom))) ++ return FALSE; + + /* search for matching name string, then set its value down */ + for (j = 0; j < p->mode_prop->count_enums; j++) { +-- +2.13.0 + diff --git a/SOURCES/0001-modesetting-software-cursor-hack.patch b/SOURCES/0001-modesetting-software-cursor-hack.patch new file mode 100644 index 0000000..8b54c0f --- /dev/null +++ b/SOURCES/0001-modesetting-software-cursor-hack.patch @@ -0,0 +1,61 @@ +From 846596b38165e5170d1a410f37ce7c5280db649d Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 9 May 2017 17:02:17 -0400 +Subject: [PATCH] modesetting: software cursor hack + +Signed-off-by: Adam Jackson +--- + 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 + diff --git a/SOURCES/0001-mustard-Enable-indirect-GLX-by-default.patch b/SOURCES/0001-mustard-Enable-indirect-GLX-by-default.patch new file mode 100644 index 0000000..2ace225 --- /dev/null +++ b/SOURCES/0001-mustard-Enable-indirect-GLX-by-default.patch @@ -0,0 +1,26 @@ +From 81e6a4910daf1d2e13804553182e901c65d7a583 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 20 Feb 2017 13:46:51 -0500 +Subject: [PATCH] mustard: Enable indirect GLX by default + +Signed-off-by: Adam Jackson +--- + 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 + diff --git a/SOURCES/0001-os-make-sure-the-clientsWritable-fd_set-is-initializ.patch b/SOURCES/0001-os-make-sure-the-clientsWritable-fd_set-is-initializ.patch deleted file mode 100644 index fdc15c1..0000000 --- a/SOURCES/0001-os-make-sure-the-clientsWritable-fd_set-is-initializ.patch +++ /dev/null @@ -1,65 +0,0 @@ -From bbf1893cc039155432a960b61d55978f1b706295 Mon Sep 17 00:00:00 2001 -From: Martin Peres -Date: Mon, 20 Jul 2015 10:37:30 +0300 -Subject: [PATCH xserver] os: make sure the clientsWritable fd_set is - initialized before use - -In WaitForSomething(), the fd_set clientsWritable may be used -unitialized when the boolean AnyClientsWriteBlocked is set in the -WakeupHandler(). This leads to a crash in FlushAllOutput() after -x11proto's commit 2c94cdb453bc641246cc8b9a876da9799bee1ce7. - -The problem did not manifest before because both the XFD_SIZE and the -maximum number of clients were set to 256. As the connectionTranslation -table was initalized for the 256 clients to 0, the test on the index not -being 0 was aborting before dereferencing the client #0. - -As of commit 2c94cdb453bc641246cc8b9a876da9799bee1ce7 in x11proto, the -XFD_SIZE got bumped to 512. This lead the OutputPending fd_set to have -any fd above 256 to be uninitialized which in turns lead to reading an -index after the end of the ConnectionTranslation table. This index would -then be used to find the client corresponding to the fd marked as -pending writes and would also result to an out-of-bound access which -would usually be the fatal one. - -Fix this by zeroing the clientsWritable fd_set at the beginning of -WaitForSomething(). In this case, the bottom part of the loop, which -would indirectly call FlushAllOutput, will not do any work but the next -call to select will result in the execution of the right codepath. This -is exactly what we want because we need to know the writable clients -before handling them. In the end, it also makes sure that the fds above -MaxClient are initialized, preventing the crash in FlushAllOutput(). - -Thanks to everyone involved in tracking this one down! - -Reported-by: Karol Herbst -Reported-by: Tobias Klausmann -Signed-off-by: Martin Peres -Tested-by: Tobias Klausmann -Tested-by: Martin Peres -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91316 -Cc: Ilia Mirkin -Cc: Olivier Fourdan -Cc: Alan Coopersmith -Reviewed-by: Alan Coopersmith ---- - os/WaitFor.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/os/WaitFor.c b/os/WaitFor.c -index 431f1a6..993c14e 100644 ---- a/os/WaitFor.c -+++ b/os/WaitFor.c -@@ -158,6 +158,7 @@ WaitForSomething(int *pClientsReady) - Bool someReady = FALSE; - - FD_ZERO(&clientsReadable); -+ FD_ZERO(&clientsWritable); - - if (nready) - SmartScheduleStopTimer(); --- -2.5.5 - diff --git a/SOURCES/0001-right-of.patch b/SOURCES/0001-right-of.patch deleted file mode 100644 index a847a48..0000000 --- a/SOURCES/0001-right-of.patch +++ /dev/null @@ -1,157 +0,0 @@ -From f96860984536dc3b6763286195b69f73759d2dad Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 15 Apr 2015 12:43:03 -0400 -Subject: [PATCH] right-of - -Signed-off-by: Adam Jackson - -diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h -index 643a65d..b5f1fa8 100644 ---- a/hw/xfree86/common/xf86str.h -+++ b/hw/xfree86/common/xf86str.h -@@ -508,10 +508,13 @@ typedef struct _confdrirec { - } confDRIRec, *confDRIPtr; - - /* These values should be adjusted when new fields are added to ScrnInfoRec */ --#define NUM_RESERVED_INTS 16 -+#define NUM_RESERVED_INTS 15 - #define NUM_RESERVED_POINTERS 14 - #define NUM_RESERVED_FUNCS 10 - -+/* let clients know they can use this */ -+#define XF86_SCRN_HAS_PREFER_CLONE 1 -+ - typedef void *(*funcPointer) (void); - - /* flags for depth 24 pixmap options */ -@@ -768,6 +771,9 @@ typedef struct _ScrnInfoRec { - ClockRangePtr clockRanges; - int adjustFlags; - -+ /* initial rightof support disable */ -+ int preferClone; -+ - /* - * These can be used when the minor ABI version is incremented. - * The NUM_* parameters must be reduced appropriately to keep the -diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index 9d592a7..1e32a90 100644 ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -1123,6 +1123,15 @@ xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes) - int o; - int min_x, min_y; - -+ /* check for initial right-of heuristic */ -+ for (o = 0; o < config->num_output; o++) -+ { -+ xf86OutputPtr output = config->output[o]; -+ -+ if (output->initial_x || output->initial_y) -+ return TRUE; -+ } -+ - for (o = 0; o < config->num_output; o++) { - xf86OutputPtr output = config->output[o]; - -@@ -2102,6 +2111,57 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) - return match; - } - -+static int -+numEnabledOutputs(xf86CrtcConfigPtr config, Bool *enabled) -+{ -+ int i = 0, p; -+ -+ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; -+ -+ return i; -+} -+ -+static Bool -+xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, -+ DisplayModePtr *modes, Bool *enabled, -+ int width, int height) -+{ -+ int o; -+ int w = 0; -+ -+ if (scrn->preferClone) -+ return FALSE; -+ -+ if (numEnabledOutputs(config, enabled) < 2) -+ return FALSE; -+ -+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) { -+ DisplayModePtr mode = -+ xf86OutputHasPreferredMode(config->output[o], width, height); -+ -+ if (!mode) -+ return FALSE; -+ -+ w += mode->HDisplay; -+ } -+ -+ if (w > width) -+ return FALSE; -+ -+ w = 0; -+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) { -+ DisplayModePtr mode = -+ xf86OutputHasPreferredMode(config->output[o], width, height); -+ -+ config->output[o]->initial_x = w; -+ w += mode->HDisplay; -+ -+ modes[o] = mode; -+ } -+ -+ return TRUE; -+} -+ - static Bool - xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr * modes, Bool *enabled, -@@ -2178,14 +2238,10 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - */ - if (!ret) - do { -- int i = 0; - float aspect = 0.0; - DisplayModePtr a = NULL, b = NULL; - -- /* count the number of enabled outputs */ -- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++); -- -- if (i != 1) -+ if (numEnabledOutputs(config, enabled) != 1) - break; - - p = -1; -@@ -2491,6 +2547,8 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) - else { - if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); -+ else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height)) -+ xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n"); - else if (xf86TargetPreferred - (scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); -@@ -2510,9 +2568,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) - "Output %s enabled but has no modes\n", - config->output[o]->name); - else -- xf86DrvMsg(scrn->scrnIndex, X_INFO, -- "Output %s using initial mode %s\n", -- config->output[o]->name, modes[o]->name); -+ xf86DrvMsg (scrn->scrnIndex, X_INFO, -+ "Output %s using initial mode %s +%d+%d\n", -+ config->output[o]->name, modes[o]->name, -+ config->output[o]->initial_x, -+ config->output[o]->initial_y); - } - - /* --- -2.1.0 - diff --git a/SOURCES/0001-rpath-hack.patch b/SOURCES/0001-rpath-hack.patch index a0c3c10..8aba68d 100644 --- a/SOURCES/0001-rpath-hack.patch +++ b/SOURCES/0001-rpath-hack.patch @@ -1,4 +1,4 @@ -From 2489f2f38eb32d9dd03718a36cbdbdf13d2f8b9b Mon Sep 17 00:00:00 2001 +From e562763e58cd58b0a23e5d034aafedb608e3eda3 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 12 Nov 2015 11:10:11 -0500 Subject: [PATCH] rpath hack @@ -6,23 +6,23 @@ 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 | 1 + - 1 files changed, 1 insertions(+), 0 deletion(-) + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index fa15a2d..a5af1e0 100644 +index 190d039..2ce40f4 100644 --- a/configure.ac +++ b/configure.ac -@@ -1330,6 +1330,7 @@ if test "x$GLX_USE_TLS" = xyes ; then - GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" - GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" +@@ -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 -+GLX_SYS_LIBS="$GLX_SYS_LIBS -Wl,-rpath=\$(libdir)" - AC_SUBST([GLX_DEFINES]) - AC_SUBST([GLX_SYS_LIBS]) - -- -2.5.0 +2.9.3 diff --git a/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch b/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch new file mode 100644 index 0000000..382cfce --- /dev/null +++ b/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch @@ -0,0 +1,35 @@ +From 88c59206bffee264250142ea28713206df62d853 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 +--- + 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 + diff --git a/SOURCES/0001-xephyr-Don-t-crash-if-the-server-advertises-zero-xv-.patch b/SOURCES/0001-xephyr-Don-t-crash-if-the-server-advertises-zero-xv-.patch deleted file mode 100644 index 6d4873e..0000000 --- a/SOURCES/0001-xephyr-Don-t-crash-if-the-server-advertises-zero-xv-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b006591136695fcf2ed055e0545d58e8b38c99f3 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Tue, 5 Jul 2016 13:00:42 -0400 -Subject: [PATCH xserver] xephyr: Don't crash if the server advertises zero xv - adaptors - -Useless as an XVideo implementation with zero adaptors might be, it's -apparently a thing in the wild. Catch this case and bail out of xv init -if it happens. - -[ajax: This probably isn't the exact commit that's going upstream, as the -bug is really "no XVideo at all" not "no adaptors", but that's just about -the commit message not the code.] - -Signed-off-by: Adam Jackson ---- - hw/kdrive/ephyr/ephyrvideo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c -index 56a5ff1..31b1eee 100644 ---- a/hw/kdrive/ephyr/ephyrvideo.c -+++ b/hw/kdrive/ephyr/ephyrvideo.c -@@ -462,7 +462,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this) - - if (a_this->host_adaptors) - a_this->num_adaptors = a_this->host_adaptors->num_adaptors; -- if (a_this->num_adaptors < 0) { -+ if (a_this->num_adaptors <= 0) { - EPHYR_LOG_ERROR("failed to get number of host adaptors\n"); - goto out; - } --- -2.7.4 - diff --git a/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch b/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch new file mode 100644 index 0000000..6f27ada --- /dev/null +++ b/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch @@ -0,0 +1,105 @@ +From a5e2c313721615d40ebf328f3619286a88dae238 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 +--- + 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 + diff --git a/SOURCES/0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch b/SOURCES/0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch deleted file mode 100644 index 4bcf274..0000000 --- a/SOURCES/0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch +++ /dev/null @@ -1,104 +0,0 @@ -From fc35e97cde284a56d8e7bfa8e7087268fda66af9 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Tue, 12 Jul 2016 10:04:18 -0400 -Subject: [PATCH xserver] xfree86: Fix fallback driver sort order for Xorg - -configure (v2) - -The intent here was that fallback drivers would be at the end of the -list in order, but if a fallback driver happened to be at the end of the -list already that's not what would happen. Rather than open-code -something smarter, just use qsort. - -Note that qsort puts things in ascending order, so somewhat backwardsly -fallbacks are greater than native drivers, and vesa is greater than -modesetting. - -v2: Use strcmp to compare non-fallback drivers so we get a predictable -result if your libc's qsort isn't stable (Keith Packard) - -Signed-off-by: Adam Jackson ---- - hw/xfree86/common/xf86Config.c | 59 ++++++++++++++++++++++++++++-------------- - 1 file changed, 40 insertions(+), 19 deletions(-) - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 2dbefba..560e2ea 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -518,33 +518,54 @@ xf86InputDriverlistFromConfig(void) - return modulearray; - } - -+static int -+is_fallback(const char *s) -+{ -+ /* later entries are less preferred */ -+ const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; -+ int i; -+ -+ for (i = 0; fallback[i]; i++) -+ if (strstr(s, fallback[i])) -+ return i; -+ -+ return -1; -+} -+ -+static int -+driver_sort(const void *_l, const void *_r) -+{ -+ const char *l = *(const char **)_l; -+ const char *r = *(const char **)_r; -+ int left = is_fallback(l); -+ int right = is_fallback(r); -+ -+ /* neither is a fallback, asciibetize */ -+ if (left == -1 && right == -1) -+ return strcmp(l, r); -+ -+ /* left is a fallback */ -+ if (left >= 0) -+ return 1; -+ -+ /* right is a fallback */ -+ if (right >= 0) -+ return -1; -+ -+ /* both are fallbacks, which is worse */ -+ return left - right; -+} -+ - static void - fixup_video_driver_list(const char **drivers) - { -- static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; -- const char **end, **drv; -- const char *x; -- int i; -+ const char **end; - - /* walk to the end of the list */ - for (end = drivers; *end && **end; end++); - end--; - -- /* -- * for each of the fallback drivers, if we find it in the list, -- * swap it with the last available non-fallback driver. -- */ -- for (i = 0; fallback[i]; i++) { -- for (drv = drivers; drv != end; drv++) { -- if (strstr(*drv, fallback[i])) { -- x = *drv; -- *drv = *end; -- *end = x; -- end--; -- break; -- } -- } -- } -+ qsort(drivers, end - drivers, sizeof(const char *), driver_sort); - } - - static const char ** --- -2.7.4 - diff --git a/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch b/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch new file mode 100644 index 0000000..fc22e7f --- /dev/null +++ b/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch @@ -0,0 +1,36 @@ +From e437e3cae10b730d3d8bb64e0b720064f39ca0b6 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 26 Jun 2017 17:31:14 -0400 +Subject: [PATCH] xfree86: Fix off-by-one in X -configure + +Signed-off-by: Adam Jackson +--- +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 + diff --git a/SOURCES/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch b/SOURCES/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch new file mode 100644 index 0000000..5ed3a37 --- /dev/null +++ b/SOURCES/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch @@ -0,0 +1,56 @@ +From f374410a00145d1703633547e90f10d43b3ded9f Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +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 +--- + 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 + #include + #include ++#include + #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 + diff --git a/SOURCES/0001-xinerama-Implement-graphics-exposures-for-window-pix.patch b/SOURCES/0001-xinerama-Implement-graphics-exposures-for-window-pix.patch index 54f0b1d..e7b15af 100644 --- a/SOURCES/0001-xinerama-Implement-graphics-exposures-for-window-pix.patch +++ b/SOURCES/0001-xinerama-Implement-graphics-exposures-for-window-pix.patch @@ -1,8 +1,8 @@ -From a92dd0013ae184c921f3415e651ff53da2ca9397 Mon Sep 17 00:00:00 2001 +From ea529874fd1f7a4a9207f7e3308fd9818e325c7a Mon Sep 17 00:00:00 2001 From: Adam Jackson -Date: Wed, 24 Sep 2014 11:31:51 -0400 -Subject: [PATCH] xinerama: Implement graphics exposures for window->pixmap - copies (v2) +Date: Thu, 30 Jun 2016 11:40:49 -0400 +Subject: [PATCH xserver] xinerama: Implement graphics exposures for + window->pixmap copies (v4) This code is using GetImage to accumulate a logical view of the window image (since the windows will be clipped to their containing screen), @@ -10,16 +10,10 @@ and then PutImage to load that back into the pixmap. What it wasn't doing was constructing a region for the obscured areas of the window and emitting graphics exposures for same. -This special case for window->pixmap copies (and corresponding lack of -graphics exposures) appears to date back to cvs revision 3.15 of this -file in xfree86, which makes it almost exactly fifteen years old. It's -possible that we could do better now, since Composite would mean that -for redirected windows we would in fact have consistent window contents -on every screen. Would be slightly ugly to have Xinerama know about -Composite at the dispatch level, but then this is Xinerama we're talking -about, nothing's pretty here. - v2: Fix coordinate translation when the source is the root window +v3: Create sourceBox with the right coordinates initially instead of +translating (Keith Packard) +v4: Clamp the region to 15 bits to avoid overflow (Keith Packard) Signed-off-by: Adam Jackson --- @@ -27,7 +21,7 @@ Signed-off-by: Adam Jackson 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c -index 83a2e08..8e3120d 100644 +index 18f3ac7..f31b1e0 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -1050,7 +1050,7 @@ PanoramiXClearToBackground(ClientPtr client) @@ -53,9 +47,9 @@ index 83a2e08..8e3120d 100644 } - pitch = PixmapBytePad(stuff->width, drawables[0]->depth); -- if (!(data = calloc(1, stuff->height * pitch))) +- if (!(data = calloc(stuff->height, pitch))) + pitch = PixmapBytePad(width, drawables[0]->depth); -+ if (!(data = calloc(1, height * pitch))) ++ if (!(data = calloc(height, pitch))) return BadAlloc; - XineramaGetImageData(drawables, srcx, srcy, @@ -66,7 +60,7 @@ index 83a2e08..8e3120d 100644 FOR_NSCREENS_BACKWARD(j) { stuff->gc = gc->info[j].id; -@@ -1123,14 +1124,62 @@ PanoramiXCopyArea(ClientPtr client) +@@ -1123,14 +1124,63 @@ PanoramiXCopyArea(ClientPtr client) } (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty, @@ -83,10 +77,7 @@ index 83a2e08..8e3120d 100644 + if (pGC->graphicsExposures) { + RegionRec rgn; + int dx, dy; -+ -+ /* create region for source box */ -+ BoxRec sourceBox = { srcx, srcy, srcx + width, srcy + height }; -+ RegionInit(&rgn, &sourceBox, 1); ++ BoxRec sourceBox; + + dx = drawables[0]->x; + dy = drawables[0]->y; @@ -95,8 +86,12 @@ index 83a2e08..8e3120d 100644 + dy += screenInfo.screens[0]->y; + } + -+ /* translate from source-relative to screen */ -+ RegionTranslate(&rgn, dx, dy); ++ sourceBox.x1 = min(srcx + dx, 0); ++ sourceBox.y1 = min(srcy + dy, 0); ++ sourceBox.x2 = max(sourceBox.x1 + width, 32767); ++ sourceBox.y2 = max(sourceBox.y1 + height, 32767); ++ ++ RegionInit(&rgn, &sourceBox, 1); + + /* subtract the (screen-space) clips of the source drawables */ + FOR_NSCREENS(j) { @@ -134,5 +129,5 @@ index 83a2e08..8e3120d 100644 else { DrawablePtr pDst = NULL, pSrc = NULL; -- -1.9.3 +2.9.3 diff --git a/SOURCES/0001-xkb-add-a-cause-to-the-xkb-indicator-update-after-a-.patch b/SOURCES/0001-xkb-add-a-cause-to-the-xkb-indicator-update-after-a-.patch deleted file mode 100644 index 388af66..0000000 --- a/SOURCES/0001-xkb-add-a-cause-to-the-xkb-indicator-update-after-a-.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ed4f5ebde487bda2b8bda4cb4a1455f41a7c2933 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 28 Jun 2016 11:42:41 +1000 -Subject: [PATCH xserver] xkb: add a cause to the xkb indicator update after a - keymap change - -Regression introduce by ac164e58870d which calls -XkbUpdateAllDeviceIndicators() with two NULL arguments. A few layers down into -the stack and we triggered a NULL-pointer dereference. In theory a NULL cause -is acceptable since we don't actually change modifier state here. Instead of -updating all places to check for NULL just set the cause to the client -request and go to the pub. - -https://bugs.freedesktop.org/show_bug.cgi?id=96384 - -Signed-off-by: Peter Hutterer ---- - xkb/xkb.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 3a6ad65..678f823 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5706,6 +5706,7 @@ ProcXkbGetKbdByName(ClientPtr client) - xkbGetGeometryReply grep = { 0 }; - XkbComponentNamesRec names = { 0 }; - XkbDescPtr xkb, new; -+ XkbEventCauseRec cause; - unsigned char *str; - char mapFile[PATH_MAX]; - unsigned len; -@@ -6016,7 +6017,8 @@ ProcXkbGetKbdByName(ClientPtr client) - new = NULL; - } - XkbFreeComponentNames(&names, FALSE); -- XkbUpdateAllDeviceIndicators(NULL, NULL); -+ XkbSetCauseXkbReq(&cause, X_kbGetKbdByName, client); -+ XkbUpdateAllDeviceIndicators(NULL, &cause); - - return Success; - } --- -2.7.4 - diff --git a/SOURCES/0001-xkb-after-changing-the-keymap-force-an-indicator-upd.patch b/SOURCES/0001-xkb-after-changing-the-keymap-force-an-indicator-upd.patch deleted file mode 100644 index a6d85ca..0000000 --- a/SOURCES/0001-xkb-after-changing-the-keymap-force-an-indicator-upd.patch +++ /dev/null @@ -1,92 +0,0 @@ -From ac164e58870d70640381e68b776eb95578c7fbd3 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 4 May 2016 20:36:18 +1000 -Subject: [PATCH xserver] xkb: after changing the keymap, force an indicator - update - -When NumLock is on and a new keymap is applied, the next modifier state -change will turn off that LED (but leave the state enabled). The cause -for this is a bit convoluted: - -* the SLI explicitState is copied from the current state in - ProcXkbGetKbdByName. Thus, if NumLock is on, that state is 0x2. -* on the next modifier key press (e.g. Shift), XkbApplyState() calls into - XkbUpdateIndicators() -> XkbUpdateLedAutoState() to update SLIs (if any) - for the currently changed modifier. But it does so with a mask only for - the changed modifier (i.e. for Shift). -* XkbUpdateLedAutoState() calculates the state based on this mask and - ends up with 0 because we don't have a Shift LED and we masked out the - others. -* XkbUpdateLedAutoState() compares that state with the previous state - (which is still 0x2) and then proceeds to turn the LED off - -This doesn't happen in the normal case because either the mask -encompasses all modifiers or the state matches of the masked-out -modifiers matches the old state. - -Avoid this issue by forcing an SLI update after changing the keymap. -This updates the sli->effectiveState and thus restores everything to -happy working order. - -https://bugzilla.redhat.com/show_bug.cgi?id=1047151 - -Signed-off-by: Peter Hutterer -Reviewed-by: Daniel Stone ---- - include/xkbsrv.h | 4 ++++ - xkb/xkb.c | 3 ++- - xkb/xkbLEDs.c | 2 +- - 3 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/include/xkbsrv.h b/include/xkbsrv.h -index cc6307a..7e71089 100644 ---- a/include/xkbsrv.h -+++ b/include/xkbsrv.h -@@ -496,6 +496,10 @@ extern _X_EXPORT void XkbUpdateIndicators(DeviceIntPtr /* keybd */ , - XkbEventCausePtr /* cause */ - ); - -+extern _X_EXPORT void XkbUpdateAllDeviceIndicators(XkbChangesPtr /* changes */, -+ XkbEventCausePtr /* cause */ -+ ); -+ - extern _X_EXPORT XkbSrvLedInfoPtr XkbAllocSrvLedInfo(DeviceIntPtr /* dev */ , - KbdFeedbackPtr /* kf */ , - LedFeedbackPtr /* lf */ , -diff --git a/xkb/xkb.c b/xkb/xkb.c -index 294cdf8..3a6ad65 100644 ---- a/xkb/xkb.c -+++ b/xkb/xkb.c -@@ -5692,7 +5692,6 @@ ProcXkbListComponents(ClientPtr client) - } - - /***====================================================================***/ -- - int - ProcXkbGetKbdByName(ClientPtr client) - { -@@ -6017,6 +6016,8 @@ ProcXkbGetKbdByName(ClientPtr client) - new = NULL; - } - XkbFreeComponentNames(&names, FALSE); -+ XkbUpdateAllDeviceIndicators(NULL, NULL); -+ - return Success; - } - -diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c -index 4e16002..5792d9f 100644 ---- a/xkb/xkbLEDs.c -+++ b/xkb/xkbLEDs.c -@@ -304,7 +304,7 @@ XkbUpdateLedAutoState(DeviceIntPtr dev, - return; - } - --static void -+void - XkbUpdateAllDeviceIndicators(XkbChangesPtr changes, XkbEventCausePtr cause) - { - DeviceIntPtr edev; --- -2.7.4 - diff --git a/SOURCES/0001-xkb-fix-SlowKeys-release-reject-beeps.patch b/SOURCES/0001-xkb-fix-SlowKeys-release-reject-beeps.patch deleted file mode 100644 index e58c72d..0000000 --- a/SOURCES/0001-xkb-fix-SlowKeys-release-reject-beeps.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f9b5bbaa3a7fce1a4efb2084b8d9d82b98d4ee83 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 8 Mar 2016 15:42:42 +1000 -Subject: [PATCH xserver] xkb: fix SlowKeys release/reject beeps - -Wrong use of the mask here caused a beep whenever a key was rejected but -also when it was released after being accepted. Fix the mask to check -for the correct enabled controls. - -Signed-off-by: Peter Hutterer -Reviewed-by: Daniel Stone ---- - xkb/xkbAccessX.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c -index 02e820b..892cb30 100644 ---- a/xkb/xkbAccessX.c -+++ b/xkb/xkbAccessX.c -@@ -618,6 +618,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) - if (ctrls->enabled_ctrls & XkbSlowKeysMask) { - xkbAccessXNotify ev; - unsigned beep_type; -+ unsigned mask; - - ev.keycode = key; - ev.slowKeysDelay = ctrls->slow_keys_delay; -@@ -625,14 +626,16 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) - if (BitIsOn(keybd->key->down, key) || (xkbi->mouseKey == key)) { - ev.detail = XkbAXN_SKRelease; - beep_type = _BEEP_SLOW_RELEASE; -+ mask = XkbAX_SKReleaseFBMask; - } - else { - ev.detail = XkbAXN_SKReject; - beep_type = _BEEP_SLOW_REJECT; -+ mask = XkbAX_SKRejectFBMask; - ignoreKeyEvent = TRUE; - } - XkbSendAccessXNotify(keybd, &ev); -- if (XkbAX_NeedFeedback(ctrls, XkbAX_SKRejectFBMask)) { -+ if (XkbAX_NeedFeedback(ctrls, mask)) { - XkbDDXAccessXBeep(keybd, beep_type, XkbSlowKeysMask); - } - if (xkbi->slowKey == key) --- -2.7.4 - diff --git a/SOURCES/0002-glamor-egl-add-function-to-back-a-pixmap-with-a-dma-.patch b/SOURCES/0002-glamor-egl-add-function-to-back-a-pixmap-with-a-dma-.patch deleted file mode 100644 index 016ae20..0000000 --- a/SOURCES/0002-glamor-egl-add-function-to-back-a-pixmap-with-a-dma-.patch +++ /dev/null @@ -1,154 +0,0 @@ -From e8e0e58df335371fb5e14cadda5f9f9b2b440b0e Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Wed, 10 Jun 2015 13:38:39 +1000 -Subject: [PATCH xserver 2/8] glamor: egl: add function to back a pixmap with a - dma-buf. (v1.1) - -Rather than create the pixmap, this uses the file descriptor -to change an existing pixmaps backing store. - -This is required for reverse prime slaves, where we create -the slave pixmap, then set the backing store. - -v1.1: use local pScreen (Eric) - -Reviewed-by: Eric Anholt -Signed-off-by: Dave Airlie -(cherry picked from commit 1f10ee221edb87561900f5d2b1336db1c4a9f05c) ---- - glamor/glamor.h | 19 +++++++++++++++++++ - glamor/glamor_egl.c | 49 ++++++++++++++++++++++++++++++++++--------------- - 2 files changed, 53 insertions(+), 15 deletions(-) - -diff --git a/glamor/glamor.h b/glamor/glamor.h -index e9d21bf..7adf23c 100644 ---- a/glamor/glamor.h -+++ b/glamor/glamor.h -@@ -245,6 +245,25 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen, - CARD8 depth, - CARD8 bpp); - -+/* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd. -+ * -+ * @pixmap: Pixmap to change backing for -+ * @fd: The dma-buf fd to import. -+ * @width: The width of the buffer. -+ * @height: The height of the buffer. -+ * @stride: The stride of the buffer. -+ * @depth: The depth of the buffer. -+ * @bpp: The number of bpp of the buffer. -+ * -+ * Returns TRUE if successful, FALSE on failure. -+ * */ -+extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap, -+ int fd, -+ CARD16 width, -+ CARD16 height, -+ CARD16 stride, -+ CARD8 depth, -+ CARD8 bpp); - #ifdef GLAMOR_FOR_XORG - - #define GLAMOR_EGL_MODULE_NAME "glamoregl" -diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c -index 6a57584..7c406cc 100644 ---- a/glamor/glamor_egl.c -+++ b/glamor/glamor_egl.c -@@ -468,19 +468,19 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, - #endif - } - --_X_EXPORT PixmapPtr --glamor_pixmap_from_fd(ScreenPtr screen, -- int fd, -- CARD16 width, -- CARD16 height, -- CARD16 stride, CARD8 depth, CARD8 bpp) -+_X_EXPORT Bool -+glamor_back_pixmap_from_fd(PixmapPtr pixmap, -+ int fd, -+ CARD16 width, -+ CARD16 height, -+ CARD16 stride, CARD8 depth, CARD8 bpp) - { - #ifdef GLAMOR_HAS_GBM -+ ScreenPtr screen = pixmap->drawable.pScreen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl; - struct gbm_bo *bo; - EGLImageKHR image; -- PixmapPtr pixmap; - Bool ret = FALSE; - - EGLint attribs[] = { -@@ -496,10 +496,10 @@ glamor_pixmap_from_fd(ScreenPtr screen, - glamor_egl = glamor_egl_get_screen_private(scrn); - - if (!glamor_egl->dri3_capable) -- return NULL; -+ return FALSE; - - if (bpp != 32 || !(depth == 24 || depth == 32) || width == 0 || height == 0) -- return NULL; -+ return FALSE; - - attribs[1] = width; - attribs[3] = height; -@@ -511,29 +511,48 @@ glamor_pixmap_from_fd(ScreenPtr screen, - NULL, attribs); - - if (image == EGL_NO_IMAGE_KHR) -- return NULL; -+ return FALSE; - - /* EGL_EXT_image_dma_buf_import can impose restrictions on the - * usage of the image. Use gbm_bo to bypass the limitations. */ -- - bo = gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE, image, 0); - eglDestroyImageKHR(glamor_egl->display, image); - - if (!bo) -- return NULL; -+ return FALSE; - -- pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); - screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL); - - ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo); - gbm_bo_destroy(bo); - - if (ret) -- return pixmap; -- else { -+ return TRUE; -+ return FALSE; -+#else -+ return FALSE; -+#endif -+} -+ -+_X_EXPORT PixmapPtr -+glamor_pixmap_from_fd(ScreenPtr screen, -+ int fd, -+ CARD16 width, -+ CARD16 height, -+ CARD16 stride, CARD8 depth, CARD8 bpp) -+{ -+#ifdef GLAMOR_HAS_GBM -+ PixmapPtr pixmap; -+ Bool ret; -+ -+ pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0); -+ ret = glamor_back_pixmap_from_fd(pixmap, fd, width, height, -+ stride, depth, bpp); -+ if (ret == FALSE) { - screen->DestroyPixmap(pixmap); - return NULL; - } -+ return pixmap; - #else - return NULL; - #endif --- -2.7.4 - diff --git a/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch b/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch new file mode 100644 index 0000000..31055ae --- /dev/null +++ b/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch @@ -0,0 +1,167 @@ +From 849c825855b82caf44d25edb8155bc9f17869256 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 +Signed-off-by: Adam Jackson +--- + 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 + diff --git a/SOURCES/0002-modesetting-Use-load_cursor_argb_check-for-sw-cursor.patch b/SOURCES/0002-modesetting-Use-load_cursor_argb_check-for-sw-cursor.patch deleted file mode 100644 index 0f87f11..0000000 --- a/SOURCES/0002-modesetting-Use-load_cursor_argb_check-for-sw-cursor.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 69e95d106533be1bea74e3874cf6eb0fdb0f3f12 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 16 Feb 2015 17:00:54 +0100 -Subject: [PATCH 2/5] modesetting: Use load_cursor_argb_check for sw cursor - fallback - -The modesetting driver still has an everlasting bug of invisible -cursor on cirrus and other KMS drivers where no hardware cursor is -supported. This patch is a part of an attempt to address it. - -This patch particularly converts the current load_cursor_argb callback -of modesetting driver to load_cursor_argb_check so that it can return -whether the driver handles the hw cursor or falls back to the sw -cursor. - -Signed-off-by: Takashi Iwai -Reviewed-by: Kenneth Graunke ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 04cb17a..baeef46 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -452,7 +452,7 @@ drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y) - drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); - } - --static void -+static Bool - drmmode_set_cursor(xf86CrtcPtr crtc) - { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -@@ -471,7 +471,7 @@ drmmode_set_cursor(xf86CrtcPtr crtc) - handle, ms->cursor_width, ms->cursor_height, - cursor->bits->xhot, cursor->bits->yhot); - if (!ret) -- return; -+ return TRUE; - - use_set_cursor2 = FALSE; - } -@@ -486,11 +486,15 @@ drmmode_set_cursor(xf86CrtcPtr crtc) - cursor_info->MaxWidth = cursor_info->MaxHeight = 0; - drmmode_crtc->drmmode->sw_cursor = TRUE; - /* fallback to swcursor */ -+ return FALSE; - } -+ return TRUE; - } - --static void --drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) -+static void drmmode_hide_cursor(xf86CrtcPtr crtc); -+ -+static Bool -+drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) - { - modesettingPtr ms = modesettingPTR(crtc->scrn); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -@@ -504,7 +508,8 @@ drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) - ptr[i] = image[i]; // cpu_to_le32(image[i]); - - if (drmmode_crtc->cursor_up) -- drmmode_set_cursor(crtc); -+ return drmmode_set_cursor(crtc); -+ return TRUE; - } - - static void -@@ -767,7 +772,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { - .set_cursor_position = drmmode_set_cursor_position, - .show_cursor = drmmode_show_cursor, - .hide_cursor = drmmode_hide_cursor, -- .load_cursor_argb = drmmode_load_cursor_argb, -+ .load_cursor_argb_check = drmmode_load_cursor_argb_check, - - .gamma_set = drmmode_crtc_gamma_set, - .destroy = NULL, /* XXX */ --- -2.4.3 - diff --git a/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch b/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch new file mode 100644 index 0000000..75ea549 --- /dev/null +++ b/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch @@ -0,0 +1,71 @@ +From 0d7f05ed99b71a4641415c9f26e245c3bb24a9a0 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +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 +Signed-off-by: Adam Jackson +--- + 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 + diff --git a/SOURCES/0003-modesetting-Fix-hw-cursor-check-at-the-first-call.patch b/SOURCES/0003-modesetting-Fix-hw-cursor-check-at-the-first-call.patch deleted file mode 100644 index d18d394..0000000 --- a/SOURCES/0003-modesetting-Fix-hw-cursor-check-at-the-first-call.patch +++ /dev/null @@ -1,71 +0,0 @@ -From b0bfd0cf08c29bf07e22f88b437ca6dfcd8d1af5 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 16 Feb 2015 17:00:55 +0100 -Subject: [PATCH 3/5] modesetting: Fix hw cursor check at the first call - -With the previous patch, the modesetting driver can now return whether -the driver supports hw cursor. However, it alone doesn't suffice, -unfortunately. drmmode_load_cursor_argb_check() is called in the -following chain: - - xf86CursorSetCursor() - -> xf86SetCursor() - -> xf86DriverLoadCursorARGB() - -> xf86_load_cursor_argb() - -> xf86_crtc_load_cursor_argb() - -> drmmode_load_cursor_argb_check() - -*but* at first with drmmode_crtc->cursor_up = FALSE. Then the -function doesn't actually set the cursor but returns TRUE -unconditionally. The actual call of drmmode_set_cursor() is done at -first via the show_cursor callback, and there is no check of sw cursor -fallback any longer at this place. Since it's called only once per -cursor setup, so the xserver still thinks as if the hw cursor is -supported. - -This patch is an ad hoc fix to correct the behavior somehow: it does -call drmmode_set_cursor() at the very first time even if cursor_up is -FALSE, then quickly hides again. In that way, whether the hw cursor -is supported is evaluated in the right place at the right time. - -Of course, it might be more elegant if we have a more proper mechanism -to fall back to sw cursor at any call path. But it'd need more -rework, so I leave this workaround as is for now. - -Reviewed-by: Adam Jackson -Signed-off-by: Takashi Iwai ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index baeef46..022b9e6 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -500,6 +500,7 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - int i; - uint32_t *ptr; -+ static Bool first_time = TRUE; - - /* cursor should be mapped already */ - ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr); -@@ -507,8 +508,13 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image) - for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) - ptr[i] = image[i]; // cpu_to_le32(image[i]); - -- if (drmmode_crtc->cursor_up) -- return drmmode_set_cursor(crtc); -+ if (drmmode_crtc->cursor_up || first_time) { -+ Bool ret = drmmode_set_cursor(crtc); -+ if (!drmmode_crtc->cursor_up) -+ drmmode_hide_cursor(crtc); -+ first_time = FALSE; -+ return ret; -+ } - return TRUE; - } - --- -2.4.3 - diff --git a/SOURCES/0003-modesetting-add-output-master-support.patch b/SOURCES/0003-modesetting-add-output-master-support.patch deleted file mode 100644 index 21e5bb5..0000000 --- a/SOURCES/0003-modesetting-add-output-master-support.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 0431d88161fe27d3c9846b7c4e0539c1437b0b60 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Tue, 9 Jun 2015 17:15:44 +1000 -Subject: [PATCH xserver 3/8] modesetting: add output master support - -This allows a glamor enabled master device to have -slave USB devices attached. - -Tested with modesetting on SNB + USB. - -It relies on the previous patch to export linear -buffers from glamor. - -Acked-by: Eric Anholt -Signed-off-by: Dave Airlie -(cherry picked from commit a79fbfd707e1d745b670def08287241c87e11c28) ---- - hw/xfree86/drivers/modesetting/driver.c | 58 +++++++++++++++++++++++++++++++++ - 1 file changed, 58 insertions(+) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index dd06ee2..71a4209 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -540,6 +540,38 @@ dispatch_slave_dirty(ScreenPtr pScreen) - } - - static void -+redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) -+{ -+ -+ RegionRec pixregion; -+ -+ PixmapRegionInit(&pixregion, dirty->slave_dst); -+ DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); -+ PixmapSyncDirtyHelper(dirty, &pixregion); -+ -+ DamageRegionProcessPending(&dirty->slave_dst->drawable); -+ RegionUninit(&pixregion); -+} -+ -+static void -+ms_dirty_update(ScreenPtr screen) -+{ -+ RegionPtr region; -+ PixmapDirtyUpdatePtr ent; -+ -+ if (xorg_list_is_empty(&screen->pixmap_dirty_list)) -+ return; -+ -+ xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { -+ region = DamageRegion(ent->damage); -+ if (RegionNotEmpty(region)) { -+ redisplay_dirty(screen, ent); -+ DamageEmpty(ent->damage); -+ } -+ } -+} -+ -+static void - msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) - { - modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); -@@ -552,6 +584,8 @@ msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) - dispatch_slave_dirty(pScreen); - else if (ms->dirty_enabled) - dispatch_dirty(pScreen); -+ -+ ms_dirty_update(pScreen); - } - - static void -@@ -760,6 +794,10 @@ PreInit(ScrnInfoPtr pScrn, int flags) - if (ret == 0) { - if (value & DRM_PRIME_CAP_IMPORT) - pScrn->capabilities |= RR_Capability_SinkOutput; -+#if GLAMOR_HAS_GBM_LINEAR -+ if (value & DRM_PRIME_CAP_EXPORT) -+ pScrn->capabilities |= RR_Capability_SourceOutput; -+#endif - } - #endif - bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; -@@ -1076,6 +1114,23 @@ msShadowInit(ScreenPtr pScreen) - } - - static Bool -+msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle) -+{ -+#ifdef GLAMOR_HAS_GBM -+ int ret; -+ CARD16 stride; -+ CARD32 size; -+ ret = glamor_fd_from_pixmap(ppix->drawable.pScreen, ppix, &stride, &size); -+ if (ret == -1) -+ return FALSE; -+ -+ *handle = (void *)(long)(ret); -+ return TRUE; -+#endif -+ return FALSE; -+} -+ -+static Bool - msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) - { - ScreenPtr screen = ppix->drawable.pScreen; -@@ -1230,7 +1285,10 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) - ms->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = msBlockHandler; - -+ pScreen->SharePixmapBacking = msSharePixmapBacking; - pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; -+ pScreen->StartPixmapTracking = PixmapStartDirtyTracking; -+ pScreen->StopPixmapTracking = PixmapStopDirtyTracking; - - if (!xf86CrtcScreenInit(pScreen)) - return FALSE; --- -2.7.4 - diff --git a/SOURCES/0004-modesetting-reverse-prime-support-v1.1.patch b/SOURCES/0004-modesetting-reverse-prime-support-v1.1.patch deleted file mode 100644 index b820536..0000000 --- a/SOURCES/0004-modesetting-reverse-prime-support-v1.1.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 83b6c5e1e463f86169384a50c56fdbde1114bed5 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Wed, 10 Jun 2015 13:41:02 +1000 -Subject: [PATCH xserver 4/8] modesetting: reverse prime support (v1.1) - -This adds support for reverse prime to the modesetting driver. - -Reverse prime is where we have two GPUs in the display chain, -but the second GPU can't scanout from the shared pixmap, so needs -an extra copy to the on screen pixmap. - -This allows modesetting to support this scenario while still -supporting the USB offload one. - -v1.1: -fix comment + ret = bits (Eric) - -Reviewed-by: Eric Anholt -Signed-off-by: Dave Airlie -(cherry picked from commit 7328fb3f2b468048faf4ed4c29db720b5bf00b05) ---- - hw/xfree86/drivers/modesetting/driver.c | 17 +++++- - hw/xfree86/drivers/modesetting/drmmode_display.c | 74 ++++++++++++++++++++++-- - hw/xfree86/drivers/modesetting/drmmode_display.h | 4 +- - 3 files changed, 86 insertions(+), 9 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 71a4209..088a4bc 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -580,7 +580,7 @@ msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) - pScreen->BlockHandler(pScreen, pTimeout, pReadmask); - ms->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = msBlockHandler; -- if (pScreen->isGPU) -+ if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode) - dispatch_slave_dirty(pScreen); - else if (ms->dirty_enabled) - dispatch_dirty(pScreen); -@@ -1137,10 +1137,18 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - modesettingPtr ms = modesettingPTR(scrn); - Bool ret; -- int size = ppix->devKind * ppix->drawable.height; - int ihandle = (int) (long) fd_handle; - -- ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size); -+ if (ms->drmmode.reverse_prime_offload_mode) { -+ ret = glamor_back_pixmap_from_fd(ppix, ihandle, -+ ppix->drawable.width, -+ ppix->drawable.height, -+ ppix->devKind, ppix->drawable.depth, -+ ppix->drawable.bitsPerPixel); -+ } else { -+ int size = ppix->devKind * ppix->drawable.height; -+ ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size); -+ } - if (ret == FALSE) - return ret; - -@@ -1331,6 +1339,9 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to initialize the Present extension.\n"); - } -+ /* enable reverse prime if we are a GPU screen, and accelerated */ -+ if (pScreen->isGPU) -+ ms->drmmode.reverse_prime_offload_mode = TRUE; - } - #endif - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 7dd85c8..d824e8b 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -50,6 +50,7 @@ - - #include "driver.h" - -+static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height); - static int - drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo) - { -@@ -341,10 +342,14 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - - fb_id = drmmode->fb_id; - if (crtc->randr_crtc->scanout_pixmap) { -- msPixmapPrivPtr ppriv = -- msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); -- fb_id = ppriv->fb_id; -- x = y = 0; -+ if (!drmmode->reverse_prime_offload_mode) { -+ msPixmapPrivPtr ppriv = -+ msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap); -+ fb_id = ppriv->fb_id; -+ x = 0; -+ } else -+ x = drmmode_crtc->prime_pixmap_x; -+ y = 0; - } - else if (drmmode_crtc->rotate_fb_id) { - fb_id = drmmode_crtc->rotate_fb_id; -@@ -507,7 +512,54 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green, - } - - static Bool --drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) -+drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) -+{ -+ ScreenPtr screen = xf86ScrnToScreen(crtc->scrn); -+ PixmapPtr screenpix = screen->GetScreenPixmap(screen); -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); -+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -+ int c, total_width = 0, max_height = 0, this_x = 0; -+ -+ if (!ppix) { -+ if (crtc->randr_crtc->scanout_pixmap) -+ PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix); -+ drmmode_crtc->prime_pixmap_x = 0; -+ return TRUE; -+ } -+ /* iterate over all the attached crtcs to work out the bounding box */ -+ for (c = 0; c < xf86_config->num_crtc; c++) { -+ xf86CrtcPtr iter = xf86_config->crtc[c]; -+ if (!iter->enabled && iter != crtc) -+ continue; -+ if (iter == crtc) { -+ this_x = total_width; -+ total_width += ppix->drawable.width; -+ if (max_height < ppix->drawable.height) -+ max_height = ppix->drawable.height; -+ } else { -+ total_width += iter->mode.HDisplay; -+ if (max_height < iter->mode.VDisplay) -+ max_height = iter->mode.VDisplay; -+ } -+ } -+ -+ if (total_width != screenpix->drawable.width || -+ max_height != screenpix->drawable.height) { -+ -+ if (!drmmode_xf86crtc_resize(crtc->scrn, total_width, max_height)) -+ return FALSE; -+ -+ screenpix = screen->GetScreenPixmap(screen); -+ screen->width = screenpix->drawable.width = total_width; -+ screen->height = screenpix->drawable.height = max_height; -+ } -+ drmmode_crtc->prime_pixmap_x = this_x; -+ PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0); -+ return TRUE; -+} -+ -+static Bool -+drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix) - { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - drmmode_ptr drmmode = drmmode_crtc->drmmode; -@@ -548,6 +600,18 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) - return TRUE; - } - -+static Bool -+drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) -+{ -+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -+ drmmode_ptr drmmode = drmmode_crtc->drmmode; -+ -+ if (drmmode->reverse_prime_offload_mode) -+ return drmmode_set_scanout_pixmap_gpu(crtc, ppix); -+ else -+ return drmmode_set_scanout_pixmap_cpu(crtc, ppix); -+} -+ - static void * - drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) - { -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h -index 3a7d222..aa54bcc 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.h -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h -@@ -84,6 +84,8 @@ typedef struct { - uint32_t triple_buffer_name; - - DevPrivateKeyRec pixmapPrivateKeyRec; -+ -+ Bool reverse_prime_offload_mode; - } drmmode_rec, *drmmode_ptr; - - typedef struct { -@@ -98,7 +100,7 @@ typedef struct { - - drmmode_bo rotate_bo; - unsigned rotate_fb_id; -- -+ unsigned prime_pixmap_x; - /** - * @{ MSC (vblank count) handling for the PRESENT extension. - * --- -2.7.4 - diff --git a/SOURCES/0005-modesetting-set-capabilities-up-after-glamor-and-ena.patch b/SOURCES/0005-modesetting-set-capabilities-up-after-glamor-and-ena.patch deleted file mode 100644 index 2576051..0000000 --- a/SOURCES/0005-modesetting-set-capabilities-up-after-glamor-and-ena.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b9e7f0e36c2cba342583f2f6e7acd6f77812070c Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Fri, 29 Apr 2016 14:01:33 +1000 -Subject: [PATCH xserver 5/8] modesetting: set capabilities up after glamor and - enable offload caps. - -This moves the capabilites setting to after glamor is initialised, and -enables the offload caps in cases where they work. This enables DRI2 -PRIME support with modesetting. - -Reviewed-by: Alex Deucher -Signed-off-by: Dave Airlie -(cherry picked from commit 2378adde6770385c06f7efcd32f270d00d49ce3f) ---- - hw/xfree86/drivers/modesetting/driver.c | 28 ++++++++++++++++------------ - 1 file changed, 16 insertions(+), 12 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 088a4bc..35d3fd5 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -788,18 +788,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) - - ms->drmmode.fd = ms->fd; - -- pScrn->capabilities = 0; --#ifdef DRM_CAP_PRIME -- ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); -- if (ret == 0) { -- if (value & DRM_PRIME_CAP_IMPORT) -- pScrn->capabilities |= RR_Capability_SinkOutput; --#if GLAMOR_HAS_GBM_LINEAR -- if (value & DRM_PRIME_CAP_EXPORT) -- pScrn->capabilities |= RR_Capability_SourceOutput; --#endif -- } --#endif - bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; - - if (!xf86SetDepthBpp(pScrn, -@@ -889,6 +877,22 @@ PreInit(ScrnInfoPtr pScrn, int flags) - ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); - } - -+ pScrn->capabilities = 0; -+#ifdef DRM_CAP_PRIME -+ ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); -+ if (ret == 0) { -+ if (value & DRM_PRIME_CAP_IMPORT) { -+ pScrn->capabilities |= RR_Capability_SinkOutput; -+ if (ms->drmmode.glamor) -+ pScrn->capabilities |= RR_Capability_SourceOffload; -+ } -+#if GLAMOR_HAS_GBM_LINEAR -+ if (value & DRM_PRIME_CAP_EXPORT && ms->drmmode.glamor) -+ pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload; -+#endif -+ } -+#endif -+ - if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n"); - goto fail; --- -2.7.4 - diff --git a/SOURCES/0006-modesetting-Properly-cleanup-fb-for-reverse-prime-of.patch b/SOURCES/0006-modesetting-Properly-cleanup-fb-for-reverse-prime-of.patch deleted file mode 100644 index da571a9..0000000 --- a/SOURCES/0006-modesetting-Properly-cleanup-fb-for-reverse-prime-of.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 1e234ae444fa4170582bdb2ada3cf46973adcd22 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 1 Jun 2016 14:59:38 +0200 -Subject: [PATCH xserver 6/8] modesetting: Properly cleanup fb for - reverse-prime-offload - -drmmode_set_scanout_pixmap_gpu(pix) adds drmmod->fb_id through a call -to drmmode_xf86crtc_resize(), but on a subsequent -drmmode_set_scanout_pixmap_gpu(NULL) it would not remove the fb. - -This keeps the crtc marked as busy, which causes the dgpu to not -being able to runtime suspend, after an output attached to the dgpu -has been used once. Which causes burning through an additional 10W -of power and the laptop to run quite hot. - -This commit adds the missing remove fb call, allowing the dgpu to runtime -suspend after an external monitor has been plugged into the laptop. - -Note this also makes drmmode_set_scanout_pixmap_gpu(NULL) match the -behavior of drmmode_set_scanout_pixmap_cpu(NULL) which was already -removing the fb. - -Signed-off-by: Hans de Goede -Reviewed-by: Dave Airlie -(cherry picked from commit b8ef71fb07a8ba9587aeaca942b4de20b59266ca) ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index d824e8b..10efd8f 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -518,11 +518,17 @@ drmmode_set_scanout_pixmap_gpu(xf86CrtcPtr crtc, PixmapPtr ppix) - PixmapPtr screenpix = screen->GetScreenPixmap(screen); - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -+ drmmode_ptr drmmode = drmmode_crtc->drmmode; - int c, total_width = 0, max_height = 0, this_x = 0; - - if (!ppix) { -- if (crtc->randr_crtc->scanout_pixmap) -+ if (crtc->randr_crtc->scanout_pixmap) { - PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix); -+ if (drmmode->fb_id) { -+ drmModeRmFB(drmmode->fd, drmmode->fb_id); -+ drmmode->fb_id = 0; -+ } -+ } - drmmode_crtc->prime_pixmap_x = 0; - return TRUE; - } --- -2.7.4 - diff --git a/SOURCES/0007-modesetting-Fix-swapping-of-provider-sink-source-cap.patch b/SOURCES/0007-modesetting-Fix-swapping-of-provider-sink-source-cap.patch deleted file mode 100644 index 85dca41..0000000 --- a/SOURCES/0007-modesetting-Fix-swapping-of-provider-sink-source-cap.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8ca090a954e26f5c24479951e22c8638346a4fd8 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 16 Jun 2016 15:21:03 +0200 -Subject: [PATCH xserver 7/8] modesetting: Fix swapping of provider sink / - source capabilities - -When a card has import capability it can be an offload _sink_, not -a source and vice versa for export capability. - -This commit fixes the modesetting driver to properly set these -capabilities, this went unnoticed sofar because most gpus have both -import and export capability. - -Signed-off-by: Hans de Goede -Reviewed-by: Eric Engestrom ---- - hw/xfree86/drivers/modesetting/driver.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 35d3fd5..50cb880 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -884,11 +884,11 @@ PreInit(ScrnInfoPtr pScrn, int flags) - if (value & DRM_PRIME_CAP_IMPORT) { - pScrn->capabilities |= RR_Capability_SinkOutput; - if (ms->drmmode.glamor) -- pScrn->capabilities |= RR_Capability_SourceOffload; -+ pScrn->capabilities |= RR_Capability_SinkOffload; - } - #if GLAMOR_HAS_GBM_LINEAR - if (value & DRM_PRIME_CAP_EXPORT && ms->drmmode.glamor) -- pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload; -+ pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload; - #endif - } - #endif --- -2.7.4 - diff --git a/SOURCES/06_use-intel-only-on-pre-gen4.diff b/SOURCES/06_use-intel-only-on-pre-gen4.diff new file mode 100644 index 0000000..4994492 --- /dev/null +++ b/SOURCES/06_use-intel-only-on-pre-gen4.diff @@ -0,0 +1,30 @@ +Description: Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting +Author: Timo Aaltonen + +--- 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; + } diff --git a/SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch b/SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch new file mode 100644 index 0000000..8c4c469 --- /dev/null +++ b/SOURCES/RFC-mi-reduce-missing-segments-on-large-ellipse.patch @@ -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 +X-Patchwork-Id: 47327 +Message-Id: <1429185861-4411-2-git-send-email-ofourdan@redhat.com> +To: xorg-devel@lists.x.org +Cc: Olivier Fourdan +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 +--- + 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++; diff --git a/SOURCES/exa-only-draw-valid-trapezoids.patch b/SOURCES/exa-only-draw-valid-trapezoids.patch deleted file mode 100644 index 59cc5d6..0000000 --- a/SOURCES/exa-only-draw-valid-trapezoids.patch +++ /dev/null @@ -1,48 +0,0 @@ -From patchwork Wed Oct 2 13:47:54 2013 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: exa: only draw valid trapezoids -From: Maarten Lankhorst -X-Patchwork-Id: 14769 -Message-Id: <524C240A.9010607@canonical.com> -To: "X.Org Devel List" -Date: Wed, 02 Oct 2013 15:47:54 +0200 - -Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484 - -If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly. -A similar fix should also be applied to pixman. - -Signed-off-by: Maarten Lankhorst - ---- - - -diff --git a/exa/exa_render.c b/exa/exa_render.c -index 172e2b5..807eeba 100644 ---- a/exa/exa_render.c -+++ b/exa/exa_render.c -@@ -1141,7 +1141,8 @@ exaTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - - exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); - for (; ntrap; ntrap--, traps++) -- (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1); -+ if (xTrapezoidValid(traps)) -+ (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1); - exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); - - xRel = bounds.x1 + xSrc - xDst; -diff --git a/render/picture.h b/render/picture.h -index c85353a..fcd6401 100644 ---- a/render/picture.h -+++ b/render/picture.h -@@ -211,7 +211,7 @@ typedef pixman_fixed_t xFixed; - /* whether 't' is a well defined not obviously empty trapezoid */ - #define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \ - (t)->right.p1.y != (t)->right.p2.y && \ -- (int) ((t)->bottom - (t)->top) > 0) -+ ((t)->bottom > (t)->top)) - - /* - * Standard NTSC luminance conversions: diff --git a/SOURCES/xserver-autobind-hotplug.patch b/SOURCES/xserver-autobind-hotplug.patch index 07395b0..8025cbd 100644 --- a/SOURCES/xserver-autobind-hotplug.patch +++ b/SOURCES/xserver-autobind-hotplug.patch @@ -1,44 +1,158 @@ -From cd6f931fb06f825f246222a4362fbf728f8dce73 Mon Sep 17 00:00:00 2001 +From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 17 Aug 2012 09:49:24 +1000 -Subject: [PATCH] autobind GPUs to the screen, (v3) +Subject: [PATCH xserver v3] autobind GPUs to the screen -this is racy and really not what we want for hotplug going forward, -but until DE support is in GNOME its probably for the best. +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. -v2: fix if config or slave config is NULL -v3: fix multi useful slaves -DO NOT UPSTREAM. +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 +[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] +Signed-off-by: Hans de Goede --- - hw/xfree86/common/xf86Init.c | 12 ++++++++++++ - hw/xfree86/common/xf86platformBus.c | 3 +++ - hw/xfree86/modes/xf86Crtc.c | 32 ++++++++++++++++++++++++++++++++ - 3 files changed, 47 insertions(+) +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 6282252..dc33ad1 100644 +index a544b65..b0cba3d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c -@@ -361,6 +361,16 @@ xf86CreateRootWindow(WindowPtr pWin) - return ret; +@@ -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) } -+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); -+static void + static void +xf86AutoConfigOutputDevices(void) +{ + int i; + ++ if (!xf86Info.autoBindGPU) ++ return; ++ + for (i = 0; i < xf86NumGPUScreens; i++) -+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]); ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); +} + - static void ++static void InstallSignalHandlers(void) { -@@ -949,6 +959,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) + /* +@@ -871,6 +885,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumGPUScreens; i++) AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); @@ -46,68 +160,143 @@ index 6282252..dc33ad1 100644 + xf86VGAarbiterWrapFunctions(); if (sigio_blocked) - OsReleaseSIGIO(); + 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 33b2b7d..be3bdd9 100644 +index 063e81c..42789ca 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c -@@ -393,6 +393,8 @@ xf86platformProbeDev(DriverPtr drvp) - return foundScreen; - } +@@ -48,6 +48,7 @@ + #include "Pci.h" + #include "xf86platformBus.h" + #include "xf86Config.h" ++#include "xf86Crtc.h" -+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); -+ - int - xf86platformAddDevice(int index) - { -@@ -465,6 +467,7 @@ xf86platformAddDevice(int index) + #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); -+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]); ++ if (xf86Info.autoBindGPU) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); RRResourcesChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->pScreen); -diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index 4726f2a..e83ea13 100644 ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -3440,3 +3440,35 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn) - crtc->x = crtc->y = 0; - } - } +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 xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master) ++void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) +{ -+ RRProviderPtr master_provider; -+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master); -+ xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn); -+ Bool unbound = FALSE; ++ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); ++ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); ++ RRProviderPtr provider = pScrPriv->provider; ++ RRProviderPtr master_provider = masterPriv->provider; + -+ if (!config || !slave_config) ++ if (!provider || !master_provider) + return; + -+ master_provider = config->randr_provider; -+ -+ if ((master->capabilities & RR_Capability_SinkOffload) && -+ pScrn->capabilities & RR_Capability_SourceOffload) { -+ /* source offload */ -+ -+ DetachUnboundGPU(pScrn->pScreen); -+ unbound = TRUE; -+ AttachOffloadGPU(master->pScreen, pScrn->pScreen); -+ slave_config->randr_provider->offload_sink = master_provider; -+ } -+ if ((master->capabilities & RR_Capability_SourceOutput) && -+ pScrn->capabilities & RR_Capability_SinkOutput) { -+ /* sink offload */ -+ if (!unbound) -+ DetachUnboundGPU(pScrn->pScreen); -+ AttachOutputGPU(master->pScreen, pScrn->pScreen); -+ slave_config->randr_provider->output_source = master_provider; ++ 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); +} -- -1.8.3.1 +2.9.3 diff --git a/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index dea6f2f..bb8e88e 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -16,11 +16,11 @@ # source because rpm is a terrible language. %global ansic_major 0 %global ansic_minor 4 -%global videodrv_major 19 +%global videodrv_major 23 %global videodrv_minor 0 -%global xinput_major 21 -%global xinput_minor 0 -%global extension_major 9 +%global xinput_major 24 +%global xinput_minor 1 +%global extension_major 10 %global extension_minor 0 %endif @@ -41,8 +41,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.17.2 -Release: 22%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.19.3 +Release: 11%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -83,61 +83,38 @@ Patch09: 0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch # RHEL-specific mustard Patch100: 0001-mustard-Don-t-probe-for-drivers-not-shipped-in-RHEL7.patch Patch101: 0001-Always-install-vbe-and-int10-sdk-headers.patch - -# Backports from post-1.17 -Patch200: 0001-glx-swrast-Do-more-GLX-extension-setup.patch -Patch201: 0001-glamor-make-current-in-prepare-paths.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 # Trivial things to never merge upstream ever: # This really could be done prettier. Patch5002: xserver-1.4.99-ssh-isnt-local.patch -Patch5003: 0001-right-of.patch Patch5004: xserver-autobind-hotplug.patch Patch5005: 0001-link-with-z-now.patch -# submitted: http://lists.x.org/archives/xorg-devel/2013-October/037996.html -Patch9100: exa-only-draw-valid-trapezoids.patch - # Bug 798994 - Exposure event not generated in Xinerama mode Patch9231: 0001-xinerama-Implement-graphics-exposures-for-window-pix.patch -Patch9300: 0001-modesetting-Fix-the-error-check-from-DRM_IOCTL_MODE_.patch -Patch9301: 0002-modesetting-Use-load_cursor_argb_check-for-sw-cursor.patch -Patch9302: 0003-modesetting-Fix-hw-cursor-check-at-the-first-call.patch -Patch9303: 0001-modesetting-Implement-32-24-bpp-conversion-in-shadow.patch -Patch9304: 0001-kms-implement-a-double-buffered-shadow-mode.patch - -# Bug 1263989 - "Xorg -configure" command doesn't make xorg.conf.new file. -# Submitted upstream Aug 8th 2016 -Patch9305: 0001-Fix-Xorg-configure-not-working-anymore.patch +# Bug 1166989 - Tcl/tk Canvas draw error +Patch9423: RFC-mi-reduce-missing-segments-on-large-ellipse.patch -# Bug 1300957 - [RFE] Enable "maxclients" option in x server -Patch9400: 0001-configurable-maximum-number-of-clients.patch -# The following is required for maxclient and included in xserver 1.17.4, -# but not in 1.17.2 -Patch9401: 0001-os-make-sure-the-clientsWritable-fd_set-is-initializ.patch -Patch9402: 0001-dix-export-ResourceClientBits.patch +# Bug 1374198 - Xephyr crashes when launched over ssh X forwarding from Windows +Patch9430: 0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch -# Bug 1271089 - Slow keys - "Beep when a key is rejected" does something else -Patch9500: 0001-xkb-fix-SlowKeys-release-reject-beeps.patch +Patch9504: 0001-rpath-hack.patch -# Bug 1083642 - Numlock keyboard led turns off when I press some keyboard keys -Patch9501: 0001-xkb-after-changing-the-keymap-force-an-indicator-upd.patch -Patch9502: 0001-xkb-add-a-cause-to-the-xkb-indicator-update-after-a-.patch +Patch9701: 0001-miarc-Style-cleanup-for-miWideArc.patch +Patch9702: 0002-miarc-Make-the-caller-free-the-arc-span-data.patch +Patch9703: 0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch -Patch9503: 0001-dix-Enable-indirect-GLX-by-default-add-xorg.conf-opt.patch -Patch9504: 0001-rpath-hack.patch -Patch9505: 0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch -Patch9506: 0001-xephyr-Don-t-crash-if-the-server-advertises-zero-xv-.patch - -# Bug 1353505 - Add Prime and Reverse Prime support to the modesetting driver -Patch9601: 0001-glamor-add-support-for-allocating-linear-buffers-v2.patch -Patch9602: 0002-glamor-egl-add-function-to-back-a-pixmap-with-a-dma-.patch -Patch9603: 0003-modesetting-add-output-master-support.patch -Patch9604: 0004-modesetting-reverse-prime-support-v1.1.patch -Patch9605: 0005-modesetting-set-capabilities-up-after-glamor-and-ena.patch -Patch9606: 0006-modesetting-Properly-cleanup-fb-for-reverse-prime-of.patch -Patch9607: 0007-modesetting-Fix-swapping-of-provider-sink-source-cap.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 %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri @@ -172,7 +149,7 @@ BuildRequires: xorg-x11-proto-devel >= 7.7-13 BuildRequires: xorg-x11-font-utils >= 7.2-11 BuildRequires: libepoxy-devel libxshmfence-devel BuildRequires: xorg-x11-xtrans-devel >= 1.3.5 -BuildRequires: libXfont-devel libXau-devel libxkbfile-devel libXres-devel +BuildRequires: libXfont2-devel libXau-devel libxkbfile-devel libXres-devel BuildRequires: libfontenc-devel libXtst-devel libXdmcp-devel BuildRequires: libX11-devel libXext-devel BuildRequires: libXinerama-devel libXi-devel @@ -239,19 +216,14 @@ Provides: xorg-x11-glamor = %{version}-%{release} Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} Provides: xorg-x11-drv-modesetting = %{version}-%{release} -%if 0%{?fedora} > 17 -# Dropped from F18, use a video card instead -# in F17 updates-testing: 0.7.4-1.fc17 -Obsoletes: xorg-x11-drv-ark <= 0.7.3-15.fc17 -Obsoletes: xorg-x11-drv-chips <= 1.2.4-8.fc18 -Obsoletes: xorg-x11-drv-s3 <= 0.6.3-14.fc17 -Obsoletes: xorg-x11-drv-tseng <= 1.2.4-12.fc17 -%endif - - Requires: xorg-x11-server-common >= %{version}-%{release} Requires: system-setup-keyboard +%if 0%{?rhel} >= 7 +# 10-evdev.conf moved here in 7.4 +Conflicts: xorg-x11-drv-evdev < 2.10.5-1 +%endif + %description Xorg X.org X11 is an open source implementation of the X Window System. It provides the basic low level functionality which full fledged @@ -352,30 +324,13 @@ BuildArch: noarch Xserver source code needed to build VNC server (Xvnc) %prep -#setup -q -n %{pkgname}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} -%setup -q -n %{pkgname}-%{version} - -#if 0%{?gitdate} -%if 0 -git checkout -b fedora -sed -i 's/git/&+ssh/' .git/config -if [ -z "$GIT_COMMITTER_NAME" ]; then - git config user.email "x@fedoraproject.org" - git config user.name "Fedora X Ninjas" -fi -%else -git init -if [ -z "$GIT_COMMITTER_NAME" ]; then - git config user.email "x@fedoraproject.org" - git config user.name "Fedora X Ninjas" -fi +%autosetup -N -n %{pkgname}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} +rm -rf .git cp %{SOURCE1} .gitignore -git add . -git commit -a -q -m "%{version} baseline." -%endif - -# Apply all the patches. -git am -p1 %{patches} < /dev/null +# ick +%global __scm git +%{expand:%__scm_setup_git -q} +%autopatch %if %{with_hw_servers} && 0%{?stable_abi} # check the ABI in the source against what we expect. @@ -405,15 +360,11 @@ test `getminor extension` == %{extension_minor} %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 %{?!rhel:--enable-dri3} --enable-glamor --enable-xshmfence +%global dri_flags --with-dri-driver-path=%{drimoduledir} --enable-dri2 --enable-dri3 --enable-glamor --enable-xshmfence %else %global dri_flags --disable-dri %endif -%if 0%{?fedora} -%global bodhi_flags --with-vendor-name="Fedora Project" -%endif - # ick %if 0%{?rhel} sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac @@ -434,6 +385,7 @@ autoreconf -f -v --install || exit 1 --with-builderstring="Build ID: %{name} %{version}-%{release}" \ --with-os-name="$(hostname -s) $(uname -r)" \ --with-xkb-output=%{_localstatedir}/lib/xkb \ + --with-fallback-input-driver=evdev \ --without-dtrace \ --disable-linux-acpi --disable-linux-apm \ --enable-xselinux --enable-record --enable-present \ @@ -572,11 +524,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man5/xorg.conf.d.5* %dir %{_sysconfdir}/X11/xorg.conf.d %dir %{_datadir}/X11/xorg.conf.d -%{_datadir}/X11/xorg.conf.d/10-evdev.conf %{_datadir}/X11/xorg.conf.d/10-quirks.conf %endif - %files Xnest %defattr(-,root,root,-) %{_bindir}/Xnest @@ -607,13 +557,11 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/xvfb-run %{_mandir}/man1/Xvfb.1* - %files Xephyr %defattr(-,root,root,-) %{_bindir}/Xephyr %{_mandir}/man1/Xephyr.1* - %if %{with_hw_servers} %files devel %doc COPYING @@ -626,12 +574,61 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/aclocal/xorg-server.m4 %endif - %files source %defattr(-, root, root, -) %{xserver_source_dir} %changelog +* Mon Jun 26 2017 Adam Jackson - 1.19.3-11 +- Fix off-by-one in X -configure + +* Mon Jun 26 2017 Adam Jackson - 1.19.3-10 +- Fix modesetting initialization on non-zero PCI domains + +* Mon Jun 19 2017 Adam Jackson - 1.19.3-9 +- Remove clients from input and output ready queues after closing + +* Mon Jun 19 2017 Adam Jackson - 1.19.3-8 +- Validate RANDR output property atoms + +* Mon Jun 12 2017 Adam Jackson - 1.19.3-7 +- Fix a crash in FixesGetCursor* + +* Fri Jun 09 2017 Dave Airlie - 1.19.3-6 +- Don't crash on NULL cursor in modesetting driver (#1458361) + +* Tue May 09 2017 Adam Jackson - 1.19.3-5 +- Fix software cursor fallback for the modesetting driver on server GPUs + +* Tue May 09 2017 Adam Jackson - 1.19.3-4 +- Fix performance problem in dashed arc drawing + +* Thu Apr 27 2017 Ben Skeggs - 1.19.3-3 +- Default to modesetting driver on NVIDIA GeForce 8 and newer + +* Fri Apr 07 2017 Adam Jackson - 1.19.3-2 +- Fix Xephyr on servers with no XVideo extension + +* Wed Mar 15 2017 Adam Jackson - 1.19.3-1 +- xserver 1.19.3 + +* Wed Mar 01 2017 Adam Jackson - 1.19.1-0.6 +- Default to modesetting driver on Intel gen4 and up + +* Mon Feb 20 2017 Adam Jackson - 1.19.1-0.5 +- Enable DRI3 +- Restore indirect GLX by default + +* Wed Feb 08 2017 Olivier Fourdan - 1.19.1-0.3 +- Reduce rounding errors in miComputeEllipseSpans() with large radius + Resolves: rhbz#1166989 + +* Tue Feb 07 2017 Adam Jackson - 1.19.1-0.2 +- Set default input driver to evdev + +* Wed Feb 01 2017 Adam Jackson - 1.19.1-0.1 +- xserver 1.19.1 + * Mon Aug 8 2016 Hans de Goede - 1.17.2-22 - Replace modesetting-Claim-PCI-devices-as-PCI-not-platform with a new patch for the same issue, which also works properly with prime setups