aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/randr')
-rw-r--r--xorg-server/randr/rrmode.c4
-rw-r--r--xorg-server/randr/rrproperty.c12
-rw-r--r--xorg-server/randr/rrproviderproperty.c12
-rw-r--r--xorg-server/randr/rrxinerama.c20
4 files changed, 42 insertions, 6 deletions
diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c
index 56e5977b5..f5d3f9e54 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 7f0909287..67b546728 100644
--- a/xorg-server/randr/rrproperty.c
+++ b/xorg-server/randr/rrproperty.c
@@ -217,6 +217,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);
@@ -342,12 +344,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 e0a814ff8..ab601da9a 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 87d6a73e8..76d728c70 100644
--- a/xorg-server/randr/rrxinerama.c
+++ b/xorg-server/randr/rrxinerama.c
@@ -157,6 +157,7 @@ static int
RRXineramaScreenCount(ScreenPtr pScreen)
{
int i, n;
+ ScreenPtr slave;
n = 0;
if (rrGetScrPriv(pScreen)) {
@@ -165,6 +166,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;
}
@@ -308,6 +318,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
xXineramaQueryScreensReply rep;
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
int n = 0;
+ int i;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
@@ -330,8 +341,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) {
@@ -347,6 +358,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;