summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-05-11 16:50:43 -0700
committerKeith Packard <keithp@keithp.com>2015-05-11 16:50:43 -0700
commit0409b6e6d63e9cfb5dc71bb27de4b1ed0152dd9b (patch)
treef8008c34b5cebd04f83c7e245979b8b9cad93de4 /randr
parentc39c3a97508dc384c0757a0990c07b5d7b2fe97a (diff)
parent23702dd2689e2e1e65be5767ac0303a985bb04a0 (diff)
Merge remote-tracking branch 'evelikov/master'
Diffstat (limited to 'randr')
-rw-r--r--randr/rrcrtc.c42
-rw-r--r--randr/rrscreen.c7
2 files changed, 25 insertions, 24 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 63d94e26a..e95b049df 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -394,7 +394,7 @@ rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height,
Bool ret;
int depth;
PixmapPtr mscreenpix;
- PixmapPtr protopix = crtc->pScreen->current_master->GetScreenPixmap(crtc->pScreen->current_master);
+ PixmapPtr protopix = master->GetScreenPixmap(master);
rrScrPriv(crtc->pScreen);
/* create a pixmap on the master screen,
@@ -428,7 +428,7 @@ rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height,
ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix);
if (ret == FALSE) {
- ErrorF("failed to set shadow slave pixmap\n");
+ ErrorF("randr: failed to set shadow slave pixmap\n");
return FALSE;
}
@@ -457,18 +457,20 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
/* have to iterate all the crtcs of the attached gpu masters
and all their output slaves */
for (c = 0; c < pScrPriv->numCrtcs; c++) {
- if (pScrPriv->crtcs[c] == rr_crtc) {
+ RRCrtcPtr crtc = pScrPriv->crtcs[c];
+
+ if (crtc == rr_crtc) {
newbox.x1 = x;
newbox.x2 = x + w;
newbox.y1 = y;
newbox.y2 = y + h;
} else {
- if (!pScrPriv->crtcs[c]->mode)
+ if (!crtc->mode)
continue;
- newbox.x1 = pScrPriv->crtcs[c]->x;
- newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width;
- newbox.y1 = pScrPriv->crtcs[c]->y;
- newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height;
+ newbox.x1 = crtc->x;
+ newbox.x2 = crtc->x + crtc->mode->mode.width;
+ newbox.y1 = crtc->y;
+ newbox.y2 = crtc->y + crtc->mode->mode.height;
}
RegionInit(&new_crtc_region, &newbox, 1);
RegionUnion(&total_region, &total_region, &new_crtc_region);
@@ -477,19 +479,21 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
rrScrPrivPtr slave_priv = rrGetScrPriv(slave);
for (c = 0; c < slave_priv->numCrtcs; c++) {
- if (slave_priv->crtcs[c] == rr_crtc) {
+ RRCrtcPtr slave_crtc = slave_priv->crtcs[c];
+
+ if (slave_crtc == rr_crtc) {
newbox.x1 = x;
newbox.x2 = x + w;
newbox.y1 = y;
newbox.y2 = y + h;
}
else {
- if (!slave_priv->crtcs[c]->mode)
+ if (!slave_crtc->mode)
continue;
- newbox.x1 = slave_priv->crtcs[c]->x;
- newbox.x2 = slave_priv->crtcs[c]->x + slave_priv->crtcs[c]->mode->mode.width;
- newbox.y1 = slave_priv->crtcs[c]->y;
- newbox.y2 = slave_priv->crtcs[c]->y + slave_priv->crtcs[c]->mode->mode.height;
+ newbox.x1 = slave_crtc->x;
+ newbox.x2 = slave_crtc->x + slave_crtc->mode->mode.width;
+ newbox.y1 = slave_crtc->y;
+ newbox.y2 = slave_crtc->y + slave_crtc->mode->mode.height;
}
RegionInit(&new_crtc_region, &newbox, 1);
RegionUnion(&total_region, &total_region, &new_crtc_region);
@@ -502,7 +506,6 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
if (new_width == screen_pixmap->drawable.width &&
new_height == screen_pixmap->drawable.height) {
- ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2);
} else {
pScrPriv->rrScreenSetSize(pScreen, new_width, new_height, 0, 0);
}
@@ -557,7 +560,6 @@ RRCrtcSet(RRCrtcPtr crtc,
width = mode->mode.width;
height = mode->mode.height;
}
- ErrorF("have a master to look out for\n");
ret = rrCheckPixmapBounding(master, crtc,
x, y, width, height);
if (!ret)
@@ -565,8 +567,6 @@ RRCrtcSet(RRCrtcPtr crtc,
if (pScreen->current_master) {
ret = rrCreateSharedPixmap(crtc, width, height, x, y);
- ErrorF("need to create shared pixmap %d", ret);
-
}
}
#if RANDR_12_INTERFACE
@@ -1575,7 +1575,8 @@ ProcRRGetCrtcTransform(ClientPtr client)
return Success;
}
-static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
+static Bool
+check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
{
rrScrPriv(pScreen);
int i;
@@ -1595,7 +1596,8 @@ static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y)
return FALSE;
}
-static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y)
+static Bool
+constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y)
{
rrScrPriv(pScreen);
int i;
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index e7ea49ddf..d0ca91e0e 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -400,8 +400,6 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
update_totals(iter, pScrPriv);
}
- ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len);
-
pScrPriv = rrGetScrPriv(pScreen);
rep = (xRRGetScreenResourcesReply) {
.type = X_Reply,
@@ -415,8 +413,9 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
.nbytesNames = total_name_len
};
- rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
- bytes_to_int32(rep.nbytesNames));
+ rep.length = (total_crtcs + total_outputs +
+ total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) +
+ bytes_to_int32(total_name_len));
extraLen = rep.length << 2;
if (extraLen) {