diff --git a/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch b/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch new file mode 100644 index 0000000..78a28a3 --- /dev/null +++ b/SOURCES/0001-Fix-Xorg-configure-not-working-anymore.patch @@ -0,0 +1,53 @@ +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-Run-vesa-probe-last.patch b/SOURCES/0001-Run-vesa-probe-last.patch deleted file mode 100644 index 6afaad4..0000000 --- a/SOURCES/0001-Run-vesa-probe-last.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7a1980ce6eaacacb1d8124f3022217fa14c48a69 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 15 Apr 2015 12:41:20 -0400 -Subject: [PATCH] Run vesa probe last - -Signed-off-by: Adam Jackson ---- - hw/xfree86/common/xf86Config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index d42572f..4f57149 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -519,7 +519,7 @@ xf86InputDriverlistFromConfig(void) - static void - fixup_video_driver_list(const char **drivers) - { -- static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; -+ static const char *fallback[5] = { "wsfb", "vesa", "fbdev", "modesetting", NULL }; - const char **end, **drv; - const char *x; - int i; --- -2.1.0 - diff --git a/SOURCES/0001-configurable-maximum-number-of-clients.patch b/SOURCES/0001-configurable-maximum-number-of-clients.patch new file mode 100644 index 0000000..4303944 --- /dev/null +++ b/SOURCES/0001-configurable-maximum-number-of-clients.patch @@ -0,0 +1,492 @@ +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 new file mode 100644 index 0000000..c5fcd0b --- /dev/null +++ b/SOURCES/0001-dix-Enable-indirect-GLX-by-default-add-xorg.conf-opt.patch @@ -0,0 +1,106 @@ +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-export-ResourceClientBits.patch b/SOURCES/0001-dix-export-ResourceClientBits.patch new file mode 100644 index 0000000..a50f23c --- /dev/null +++ b/SOURCES/0001-dix-export-ResourceClientBits.patch @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..ff526c6 --- /dev/null +++ b/SOURCES/0001-glamor-add-support-for-allocating-linear-buffers-v2.patch @@ -0,0 +1,209 @@ +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-kms-implement-a-double-buffered-shadow-mode.patch b/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch index ebce42b..8d67f40 100644 --- a/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch +++ b/SOURCES/0001-kms-implement-a-double-buffered-shadow-mode.patch @@ -1,17 +1,19 @@ -From 46ac5c2c39a476c44fae207ca9745a8a60c7ea72 Mon Sep 17 00:00:00 2001 +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 | 127 ++++++++++++++++++++++- + 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, 131 insertions(+), 5 deletions(-) + 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..b0c2f17 100644 +index 1215cb3..1189df7 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -124,6 +124,7 @@ typedef enum { @@ -72,7 +74,7 @@ index 1215cb3..b0c2f17 100644 } if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { -@@ -872,10 +902,91 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, +@@ -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); } @@ -156,6 +158,7 @@ index 1215cb3..b0c2f17 100644 + tiles = RegionFromRects(nrects, prect, CT_NONE); + RegionIntersect(damage, damage, tiles); + RegionDestroy(tiles); ++ free(prect); + } while (0); + + if (use_ms_shadow) @@ -165,7 +168,7 @@ index 1215cb3..b0c2f17 100644 } static Bool -@@ -887,7 +998,6 @@ CreateScreenResources(ScreenPtr pScreen) +@@ -887,7 +999,6 @@ CreateScreenResources(ScreenPtr pScreen) Bool ret; void *pixels = NULL; int err; @@ -173,7 +176,7 @@ index 1215cb3..b0c2f17 100644 pScreen->CreateScreenResources = ms->createScreenResources; ret = pScreen->CreateScreenResources(pScreen); -@@ -915,13 +1025,18 @@ CreateScreenResources(ScreenPtr pScreen) +@@ -915,13 +1026,18 @@ CreateScreenResources(ScreenPtr pScreen) if (ms->drmmode.shadow_enable) pixels = ms->drmmode.shadow_fb; @@ -195,7 +198,7 @@ index 1215cb3..b0c2f17 100644 return FALSE; } -@@ -1238,6 +1353,8 @@ CloseScreen(ScreenPtr pScreen) +@@ -1238,6 +1354,8 @@ CloseScreen(ScreenPtr pScreen) shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen)); free(ms->drmmode.shadow_fb); ms->drmmode.shadow_fb = NULL; @@ -205,10 +208,10 @@ index 1215cb3..b0c2f17 100644 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 079fceb..66f0bbe 100644 +index 349bddb..7dd85c8 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -1382,6 +1382,13 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) +@@ -1393,6 +1393,13 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) drmmode->shadow_fb = new_pixels; } @@ -238,5 +241,5 @@ index 927efec..3a7d222 100644 /** * A screen-sized pixmap when we're doing triple-buffered DRI2 -- -2.5.0 +2.7.0 diff --git a/SOURCES/0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch b/SOURCES/0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch deleted file mode 100644 index f66dc36..0000000 --- a/SOURCES/0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ffce7eb36404a96b860586d79f50dac820700e51 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Tue, 29 Sep 2015 13:24:31 -0400 -Subject: [PATCH] modesetting: Claim PCI devices as PCI not platform - -The X -configure code is hideously bad, and the platform bus path in it -doesn't claim devices the same way the PCI path does, nDevToConfig is never -incremented so nothing looks configurable. For most devices we can work -around this by claiming the device as PCI not as platform, since both will -be scanned. - -This probably doesn't fix X -configure on non-PCI devices with this driver, -but those are pretty rare in comparison. A proper fix would involve -rewriting the autoconfig code to be comprehensible, which is too invasive -to consider doing downstream. - ---- - hw/xfree86/drivers/modesetting/driver.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index b0c2f17..4989069 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -370,6 +370,11 @@ ms_platform_probe(DriverPtr driver, - const char *path = xf86_platform_device_odev_attributes(dev)->path; - int scr_flags = 0; - -+ if (dev->pdev) { -+ /* claim pci devices later, not here */ -+ return FALSE; -+ } -+ - if (flags & PLATFORM_PROBE_GPU_SCREEN) - scr_flags = XF86_ALLOCATE_GPU_SCREEN; - --- -2.4.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 new file mode 100644 index 0000000..fdc15c1 --- /dev/null +++ b/SOURCES/0001-os-make-sure-the-clientsWritable-fd_set-is-initializ.patch @@ -0,0 +1,65 @@ +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-rpath-hack.patch b/SOURCES/0001-rpath-hack.patch new file mode 100644 index 0000000..a0c3c10 --- /dev/null +++ b/SOURCES/0001-rpath-hack.patch @@ -0,0 +1,28 @@ +From 2489f2f38eb32d9dd03718a36cbdbdf13d2f8b9b Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 12 Nov 2015 11:10:11 -0500 +Subject: [PATCH] rpath hack + +Normally, rpath is undesirable. But for the X server we _know_ we need +Mesa's libGL, which will always be in %{_libdir}, and not any third-party +libGL that may be configured using ld.so.conf. + +--- + configure.ac | 1 + + 1 files changed, 1 insertions(+), 0 deletion(-) + +diff --git a/configure.ac b/configure.ac +index fa15a2d..a5af1e0 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" + fi ++GLX_SYS_LIBS="$GLX_SYS_LIBS -Wl,-rpath=\$(libdir)" + AC_SUBST([GLX_DEFINES]) + AC_SUBST([GLX_SYS_LIBS]) + +-- +2.5.0 + 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 new file mode 100644 index 0000000..6d4873e --- /dev/null +++ b/SOURCES/0001-xephyr-Don-t-crash-if-the-server-advertises-zero-xv-.patch @@ -0,0 +1,35 @@ +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-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch b/SOURCES/0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch new file mode 100644 index 0000000..4bcf274 --- /dev/null +++ b/SOURCES/0001-xfree86-Fix-fallback-driver-sort-order-for-Xorg-conf.patch @@ -0,0 +1,104 @@ +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-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 new file mode 100644 index 0000000..388af66 --- /dev/null +++ b/SOURCES/0001-xkb-add-a-cause-to-the-xkb-indicator-update-after-a-.patch @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000..a6d85ca --- /dev/null +++ b/SOURCES/0001-xkb-after-changing-the-keymap-force-an-indicator-upd.patch @@ -0,0 +1,92 @@ +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 new file mode 100644 index 0000000..e58c72d --- /dev/null +++ b/SOURCES/0001-xkb-fix-SlowKeys-release-reject-beeps.patch @@ -0,0 +1,48 @@ +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 new file mode 100644 index 0000000..016ae20 --- /dev/null +++ b/SOURCES/0002-glamor-egl-add-function-to-back-a-pixmap-with-a-dma-.patch @@ -0,0 +1,154 @@ +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/0003-modesetting-add-output-master-support.patch b/SOURCES/0003-modesetting-add-output-master-support.patch new file mode 100644 index 0000000..21e5bb5 --- /dev/null +++ b/SOURCES/0003-modesetting-add-output-master-support.patch @@ -0,0 +1,121 @@ +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 new file mode 100644 index 0000000..b820536 --- /dev/null +++ b/SOURCES/0004-modesetting-reverse-prime-support-v1.1.patch @@ -0,0 +1,201 @@ +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 new file mode 100644 index 0000000..2576051 --- /dev/null +++ b/SOURCES/0005-modesetting-set-capabilities-up-after-glamor-and-ena.patch @@ -0,0 +1,66 @@ +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 new file mode 100644 index 0000000..da571a9 --- /dev/null +++ b/SOURCES/0006-modesetting-Properly-cleanup-fb-for-reverse-prime-of.patch @@ -0,0 +1,55 @@ +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 new file mode 100644 index 0000000..85dca41 --- /dev/null +++ b/SOURCES/0007-modesetting-Fix-swapping-of-provider-sink-source-cap.patch @@ -0,0 +1,40 @@ +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/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index dd1fa64..dea6f2f 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -42,7 +42,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.17.2 -Release: 10%{?gitdate:.%{gitdate}}%{?dist} +Release: 22%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -78,7 +78,6 @@ Source40: driver-abi-rebuild.sh Patch01: 0001-dix-Fix-GrabPointer-to-not-wrongly-succeed-on-redire.patch Patch02: 0001-Enable-PAM-support.patch Patch07: 0001-xf86AddBusDeviceToConfigure-Store-device-in-DevToCon.patch -Patch08: 0001-Run-vesa-probe-last.patch Patch09: 0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch # RHEL-specific mustard @@ -109,7 +108,36 @@ 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. -Patch9305: 0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch +# Submitted upstream Aug 8th 2016 +Patch9305: 0001-Fix-Xorg-configure-not-working-anymore.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 1271089 - Slow keys - "Beep when a key is rejected" does something else +Patch9500: 0001-xkb-fix-SlowKeys-release-reject-beeps.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 + +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 %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri @@ -140,7 +168,7 @@ BuildRequires: git-core BuildRequires: automake autoconf libtool pkgconfig BuildRequires: xorg-x11-util-macros >= 1.17 -BuildRequires: xorg-x11-proto-devel >= 7.7-12 +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 @@ -604,6 +632,48 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* 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 +- Resolves: rhbz#1353505 + +* Thu Aug 4 2016 Hans de Goede - 1.17.2-21 +- Add missing modesetting-Claim-PCI-devices-as-PCI-not-platform changes to + really allow prime and slave output support with the modesetting driver +- Resolves: rhbz#1353505 + +* Thu Aug 4 2016 Hans de Goede - 1.17.2-20 +- Add Prime and Reverse Prime support to the modesetting driver +- Resolves: rhbz#1353505 + +* Thu Jul 21 2016 Adam Jackson - 1.17.2-19 +- Fix Xephyr initialization against servers without XVideo extension + +* Thu Jul 14 2016 Adam Jackson - 1.17.2-18 +- Link GLX against Mesa's libGL explicitly +- Fix fallback driver sort order in X -configure + +* Tue Jun 28 2016 Peter Hutterer 1.17.2-17 +- Fix segfault after indicator update (#1083642) + +* Wed Jun 01 2016 Adam Jackson - 1.17.2-16 +- Enable IGLX by default and add xorg.conf option + +* Thu May 05 2016 Peter Hutterer 1.17.2-15 +- Force indicator update after layout change (#1083642) + +* Fri Apr 29 2016 Peter Hutterer 1.17.2-14 +- Fix SlowKeys beep behavior (#1271089) + +* Wed Apr 27 2016 Adam Jackson - 1.17.2-13 +- Fix memory leak in modesetting double-shadowfb code + +* Thu Apr 21 2016 Adam Jackson 1.17.2-12 +- Fix missing symbol export + +* Tue Mar 22 2016 Olivier Fourdan 1.17.2-11 +- Configurable number of clients (#1300957) + * Thu Oct 08 2015 Adam Jackson 1.17.2-10 - Make -devel Prov/Obs xorg-x11-glamor-devel