diff options
| author | Olivier Fourdan <ofourdan@redhat.com> | 2015-07-07 18:19:50 +0200 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2015-08-24 00:00:18 -0700 |
| commit | d206c240c0b85c4da44f073d6e9a692afb6b96d2 (patch) | |
| tree | 31eebed4e7b51c3e83c243046f707982f9c88ae5 /hw | |
| parent | 7ecdfbf0af3547295b245efa754123db65cabb43 (diff) | |
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
<ajax@redhat.com>
This now requires at least xproto 7.0.28
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/dmx/glxProxy/glxext.c | 2 | ||||
| -rw-r--r-- | hw/xfree86/common/xf86Config.c | 16 | ||||
| -rw-r--r-- | hw/xfree86/man/xorg.conf.man | 4 |
3 files changed, 21 insertions, 1 deletions
diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index 3c5a14bc7..c85827284 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 2b4df0cf7..d2c32258e 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -703,6 +703,7 @@ typedef enum { FLAG_DRI2, FLAG_USE_SIGIO, FLAG_AUTO_ADD_GPU, + FLAG_MAX_CLIENTS, } FlagValues; /** @@ -762,6 +763,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}, }; @@ -1052,6 +1055,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 e9b6d9990..08eb7a93a 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 |
