diff options
Diffstat (limited to 'xorg-server/randr')
-rw-r--r-- | xorg-server/randr/rrmode.c | 4 | ||||
-rw-r--r-- | xorg-server/randr/rrproperty.c | 12 | ||||
-rw-r--r-- | xorg-server/randr/rrproviderproperty.c | 12 | ||||
-rw-r--r-- | xorg-server/randr/rrxinerama.c | 20 |
4 files changed, 42 insertions, 6 deletions
diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c index ae1218e0e..c0fa709a0 100644 --- a/xorg-server/randr/rrmode.c +++ b/xorg-server/randr/rrmode.c @@ -89,8 +89,10 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) } mode->mode.id = FakeClientID(0); - if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) + if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) { + free(newModes); return NULL; + } modes = newModes; modes[num_modes++] = mode; diff --git a/xorg-server/randr/rrproperty.c b/xorg-server/randr/rrproperty.c index dc4a9f7a3..dcc640e29 100644 --- a/xorg-server/randr/rrproperty.c +++ b/xorg-server/randr/rrproperty.c @@ -216,6 +216,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, !pScrPriv->rrOutputSetProperty(output->pScreen, output, prop->propertyName, &new_value)) { free(new_value.data); + if (add) + RRDestroyOutputProperty(prop); return BadValue; } free(prop_value->data); @@ -340,12 +342,18 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, /* * ranges must have even number of values */ - if (range && (num_values & 1)) + if (range && (num_values & 1)) { + if (add) + RRDestroyOutputProperty(prop); return BadMatch; + } new_values = malloc(num_values * sizeof(INT32)); - if (!new_values && num_values) + if (!new_values && num_values) { + if (add) + RRDestroyOutputProperty(prop); return BadAlloc; + } if (num_values) memcpy(new_values, values, num_values * sizeof(INT32)); diff --git a/xorg-server/randr/rrproviderproperty.c b/xorg-server/randr/rrproviderproperty.c index a24d9d784..be54f259e 100644 --- a/xorg-server/randr/rrproviderproperty.c +++ b/xorg-server/randr/rrproviderproperty.c @@ -216,6 +216,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, if (pending && pScrPriv->rrProviderSetProperty && !pScrPriv->rrProviderSetProperty(provider->pScreen, provider, prop->propertyName, &new_value)) { + if (add) + RRDestroyProviderProperty(prop); free(new_value.data); return BadValue; } @@ -342,12 +344,18 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property, /* * ranges must have even number of values */ - if (range && (num_values & 1)) + if (range && (num_values & 1)) { + if (add) + RRDestroyProviderProperty(prop); return BadMatch; + } new_values = malloc(num_values * sizeof(INT32)); - if (!new_values && num_values) + if (!new_values && num_values) { + if (add) + RRDestroyProviderProperty(prop); return BadAlloc; + } if (num_values) memcpy(new_values, values, num_values * sizeof(INT32)); diff --git a/xorg-server/randr/rrxinerama.c b/xorg-server/randr/rrxinerama.c index 63e2a318b..86a19757b 100644 --- a/xorg-server/randr/rrxinerama.c +++ b/xorg-server/randr/rrxinerama.c @@ -156,6 +156,7 @@ static int RRXineramaScreenCount(ScreenPtr pScreen) { int i, n; + ScreenPtr slave; n = 0; if (rrGetScrPriv(pScreen)) { @@ -164,6 +165,15 @@ RRXineramaScreenCount(ScreenPtr pScreen) if (RRXineramaCrtcActive(pScrPriv->crtcs[i])) n++; } + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + rrScrPrivPtr pSlavePriv; + pSlavePriv = rrGetScrPriv(slave); + for (i = 0; i < pSlavePriv->numCrtcs; i++) + if (RRXineramaCrtcActive(pSlavePriv->crtcs[i])) + n++; + } + return n; } @@ -307,6 +317,7 @@ ProcRRXineramaQueryScreens(ClientPtr client) xXineramaQueryScreensReply rep; ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN]; int n = 0; + int i; REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); @@ -329,8 +340,8 @@ ProcRRXineramaQueryScreens(ClientPtr client) WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); if (n) { + ScreenPtr slave; rrScrPriv(pScreen); - int i; int has_primary = 0; if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) { @@ -346,6 +357,13 @@ ProcRRXineramaQueryScreens(ClientPtr client) } RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]); } + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + rrScrPrivPtr pSlavePriv; + pSlavePriv = rrGetScrPriv(slave); + for (i = 0; i < pSlavePriv->numCrtcs; i++) + RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]); + } } return Success; |