summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-23 11:17:42 -0800
committerKeith Packard <keithp@keithp.com>2011-02-23 11:17:42 -0800
commit9e8c20b0d49783d6b9334d4c11c4e6e3ba273524 (patch)
treea9b7a096bbc1969861605173dad764ce0bfbc1e5 /randr
parent9f47780ecdc7693f756587a758ec0141e75cb1eb (diff)
Revert "randr: Add per-crtc pixmaps"
Diffstat (limited to 'randr')
-rw-r--r--randr/Makefile.am1
-rw-r--r--randr/mirrcrtc.c3
-rw-r--r--randr/randr.c15
-rw-r--r--randr/randrstr.h48
-rw-r--r--randr/rrcrtc.c31
-rw-r--r--randr/rrinfo.c2
-rw-r--r--randr/rrpixmap.c154
-rw-r--r--randr/rrscreen.c8
8 files changed, 16 insertions, 246 deletions
diff --git a/randr/Makefile.am b/randr/Makefile.am
index b7664c686..a1c88dcb8 100644
--- a/randr/Makefile.am
+++ b/randr/Makefile.am
@@ -16,7 +16,6 @@ librandr_la_SOURCES = \
rrinfo.c \
rrmode.c \
rroutput.c \
- rrpixmap.c \
rrpointer.c \
rrproperty.c \
rrscreen.c \
diff --git a/randr/mirrcrtc.c b/randr/mirrcrtc.c
index cc76797d6..b1e2c9f34 100644
--- a/randr/mirrcrtc.c
+++ b/randr/mirrcrtc.c
@@ -66,8 +66,7 @@ miRRSetCrtcConfig(RRCrtcConfigPtr crtc_config)
y,
crtc_config->rotation,
crtc_config->numOutputs,
- crtc_config->outputs,
- crtc_config->pixmap);
+ crtc_config->outputs);
}
Bool
diff --git a/randr/randr.c b/randr/randr.c
index c22657ee2..607770520 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -98,7 +98,6 @@ RRCloseScreen (int i, ScreenPtr pScreen)
free(pScrPriv->crtcs);
free(pScrPriv->outputs);
- free(pScrPriv->scanout_info);
free(pScrPriv);
RRNScreens -= 1; /* ok, one fewer screen with RandR running */
return (*pScreen->CloseScreen) (i, pScreen);
@@ -249,8 +248,6 @@ Bool RRScreenInit(ScreenPtr pScreen)
pScrPriv->rrCrtcSet = NULL;
pScrPriv->rrCrtcSetGamma = NULL;
#endif
- pScrPriv->scanout_info = NULL;
- pScrPriv->n_scanout_info = 0;
#if RANDR_10_INTERFACE
pScrPriv->rrSetConfig = 0;
pScrPriv->rotations = RR_Rotate_0;
@@ -485,18 +482,6 @@ RRVerticalRefresh (xRRModeInfo *mode)
return (CARD16) refresh;
}
-RRScanoutPixmapInfo *
-RRQueryScanoutPixmapInfo(ScreenPtr screen, int *n_info)
-{
- rrScrPriv(screen);
-
- if (!pScrPriv->scanout_info && pScrPriv->rrQueryScanoutPixmaps)
- pScrPriv->scanout_info = pScrPriv->rrQueryScanoutPixmaps(screen,
- &pScrPriv->n_scanout_info);
- *n_info = pScrPriv->n_scanout_info;
- return pScrPriv->scanout_info;
-}
-
static int
ProcRRDispatch (ClientPtr client)
{
diff --git a/randr/randrstr.h b/randr/randrstr.h
index c23197219..2fe960234 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -123,7 +123,6 @@ struct _rrCrtc {
CARD16 *gammaGreen;
void *devPrivate;
Bool transforms;
- PixmapPtr scanoutPixmap;
RRTransformRec client_pending_transform;
RRTransformRec client_current_transform;
PictTransform client_sprite_position_transform;
@@ -199,8 +198,7 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
int y,
Rotation rotation,
int numOutputs,
- RROutputPtr *outputs,
- PixmapPtr scanout_pixmap);
+ RROutputPtr *outputs);
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen,
RRCrtcPtr crtc);
@@ -266,20 +264,6 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
#endif
-typedef struct {
- PictFormatPtr format;
- int maxWidth, maxHeight;
- int depth;
- Rotation rotations;
-} RRScanoutPixmapInfo;
-
-typedef RRScanoutPixmapInfo *(*RRQueryScanoutPixmapsPtr) (ScreenPtr pScreen,
- int *num_info);
-
-typedef PixmapPtr (*RRCreateScanoutPixmapPtr) (ScreenPtr pScreen,
- int width, int height, int depth,
- Rotation rotations,
- PictFormatPtr format);
typedef void (*RRSetCrtcSpriteTransformPtr) (ScreenPtr pScreen,
RRCrtcPtr randr_crtc,
@@ -319,8 +303,6 @@ typedef struct _rrScrPriv {
RRGetPanningProcPtr rrGetPanning;
RRSetPanningProcPtr rrSetPanning;
#endif
- RRQueryScanoutPixmapsPtr rrQueryScanoutPixmaps;
- RRCreateScanoutPixmapPtr rrCreateScanoutPixmap;
RRSetCrtcSpriteTransformPtr rrSetCrtcSpriteTransform;
RRGetCrtcSpriteTransformPtr rrGetCrtcSpriteTransform;
RRSetCrtcConfigsPtr rrSetCrtcConfigs;
@@ -351,8 +333,6 @@ typedef struct _rrScrPriv {
/* Last known pointer position */
RRCrtcPtr pointerCrtc;
- RRScanoutPixmapInfo *scanout_info;
- int n_scanout_info;
#ifdef RANDR_10_INTERFACE
/*
* Configuration information
@@ -367,7 +347,6 @@ typedef struct _rrScrPriv {
int rate;
int size;
#endif
-
} rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
@@ -542,9 +521,6 @@ RRGetRotation (ScreenPtr pScreen);
extern _X_EXPORT CARD16
RRVerticalRefresh (xRRModeInfo *mode);
-extern _X_EXPORT RRScanoutPixmapInfo *
-RRQueryScanoutPixmapInfo(ScreenPtr screen, int *n_info);
-
#ifdef RANDR_10_INTERFACE
/*
* This is the old interface, deprecated but left
@@ -623,8 +599,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
Rotation rotation,
RRTransformPtr transform,
int numOutputs,
- RROutputPtr *outputs,
- PixmapPtr scanoutPixmap);
+ RROutputPtr *outputs);
extern _X_EXPORT void
RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
@@ -639,8 +614,7 @@ RRCrtcSet (RRCrtcPtr crtc,
int y,
Rotation rotation,
int numOutput,
- RROutputPtr *outputs,
- PixmapPtr scanout_pixmap);
+ RROutputPtr *outputs);
/*
* Request that the Crtc gamma be changed
@@ -669,10 +643,6 @@ RRCrtcGammaGet(RRCrtcPtr crtc);
extern _X_EXPORT Bool
RRCrtcGammaNotify (RRCrtcPtr crtc);
-void
-RRModeGetScanoutSize (RRModePtr mode, struct pixman_f_transform *transform,
- int *width, int *height);
-
/*
* Set the size of the gamma table at server startup time
*/
@@ -808,23 +778,11 @@ RRCrtcSpriteTransformSet(RRCrtcPtr crtc,
struct pict_f_transform *f_image_transform);
int
-ProcRRQueryScanoutPixmaps (ClientPtr client);
-
-int
-ProcRRCreateScanoutPixmap (ClientPtr client);
-
-int
-ProcRRSetCrtcPixmapConfig (ClientPtr client);
-
-int
ProcRRSetCrtcSpriteTransform (ClientPtr client);
int
ProcRRGetCrtcSpriteTransform (ClientPtr client);
-int
-ProcRRSetCrtcConfigs (ClientPtr client);
-
/* rrdispatch.c */
extern _X_EXPORT Bool
RRClientKnowsRates (ClientPtr pClient);
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 12982a896..1f8f2e662 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -138,8 +138,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
Rotation rotation,
RRTransformPtr transform,
int numOutputs,
- RROutputPtr *outputs,
- PixmapPtr scanoutPixmap)
+ RROutputPtr *outputs)
{
int i, j;
@@ -237,15 +236,6 @@ RRCrtcNotify (RRCrtcPtr crtc,
RRCrtcChanged (crtc, TRUE);
}
- if (scanoutPixmap != crtc->scanoutPixmap)
- {
- if (scanoutPixmap)
- ++scanoutPixmap->refcnt;
- if (crtc->scanoutPixmap)
- (*crtc->scanoutPixmap->drawable.pScreen->DestroyPixmap) (crtc->scanoutPixmap);
- crtc->scanoutPixmap = scanoutPixmap;
- }
-
if (crtc->changed && mode)
{
RRTransformCompute (x, y,
@@ -322,8 +312,7 @@ RRCrtcSet (RRCrtcPtr crtc,
int y,
Rotation rotation,
int numOutputs,
- RROutputPtr *outputs,
- PixmapPtr scanout_pixmap)
+ RROutputPtr *outputs)
{
ScreenPtr pScreen = crtc->pScreen;
Bool ret = FALSE;
@@ -337,8 +326,7 @@ RRCrtcSet (RRCrtcPtr crtc,
crtc->numOutputs == numOutputs &&
!memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)) &&
!RRCrtcPendingProperties (crtc) &&
- !RRCrtcPendingTransform (crtc) &&
- crtc->scanoutPixmap == scanout_pixmap)
+ !RRCrtcPendingTransform (crtc))
{
ret = TRUE;
}
@@ -348,7 +336,7 @@ RRCrtcSet (RRCrtcPtr crtc,
if (pScrPriv->rrCrtcSet)
{
ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y,
- rotation, numOutputs, outputs, scanout_pixmap);
+ rotation, numOutputs, outputs);
}
else
#endif
@@ -361,7 +349,7 @@ RRCrtcSet (RRCrtcPtr crtc,
if (!mode)
{
- RRCrtcNotify (crtc, NULL, x, y, rotation, NULL, 0, NULL, scanout_pixmap);
+ RRCrtcNotify (crtc, NULL, x, y, rotation, NULL, 0, NULL);
ret = TRUE;
}
else
@@ -387,7 +375,7 @@ RRCrtcSet (RRCrtcPtr crtc,
*/
if (ret)
{
- RRCrtcNotify (crtc, mode, x, y, rotation, NULL, 1, outputs, scanout_pixmap);
+ RRCrtcNotify (crtc, mode, x, y, rotation, NULL, 1, outputs);
RRScreenSizeNotify (pScreen);
}
}
@@ -585,10 +573,7 @@ RRCrtcGammaNotify (RRCrtcPtr crtc)
return TRUE; /* not much going on here */
}
-/*
- * Compute overall scanout buffer requirements for the specified mode
- */
-void
+static void
RRModeGetScanoutSize (RRModePtr mode, struct pixman_f_transform *transform,
int *width, int *height)
{
@@ -1064,7 +1049,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
}
if (!RRCrtcSet (crtc, mode, stuff->x, stuff->y,
- rotation, numOutputs, outputs, NULL))
+ rotation, numOutputs, outputs))
{
rep.status = RRSetConfigFailed;
goto sendReply;
diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index 549ebcc8d..fdf372607 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -168,7 +168,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
/* notice current mode */
if (newMode)
RRCrtcNotify (crtc, newMode, 0, 0, pScrPriv->rotation,
- NULL, 1, &output, NULL);
+ NULL, 1, &output);
}
#endif
diff --git a/randr/rrpixmap.c b/randr/rrpixmap.c
deleted file mode 100644
index 7d4543c22..000000000
--- a/randr/rrpixmap.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright © 2010 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "randrstr.h"
-#include "xace.h"
-
-int
-ProcRRQueryScanoutPixmaps (ClientPtr client)
-{
- REQUEST(xRRQueryScanoutPixmapsReq);
- xRRQueryScanoutPixmapsReply rep;
- RRScanoutPixmapInfo *info;
- xRRScanoutPixmapInfo *x_info;
- int n_info;
- int rc;
- DrawablePtr drawable;
- ScreenPtr screen;
- rrScrPrivPtr screen_priv;
- int n, s;
-
- REQUEST_SIZE_MATCH(xRRQueryScanoutPixmapsReq);
- rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixGetAttrAccess);
- if (rc != Success) {
- client->errorValue = stuff->drawable;
- return rc;
- }
-
- screen = drawable->pScreen;
- screen_priv = rrGetScrPriv(screen);
-
- rep.type = X_Reply;
- /* rep.status has already been filled in */
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- info = RRQueryScanoutPixmapInfo(screen, &n_info);
- x_info = calloc(n_info, sizeof (xRRScanoutPixmapInfo));
- if (n_info && !x_info)
- return BadAlloc;
- rep.length += (n_info * sizeof (xRRScanoutPixmapInfo)) >> 2;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
-
- for (s = 0; s < n_info; s++) {
- x_info[s].format = info[s].format->id;
- x_info[s].maxWidth = info[s].maxWidth;
- x_info[s].maxHeight = info[s].maxHeight;
- x_info[s].rotations = info[s].rotations;
- if (client->swapped) {
- swapl(&x_info[s].format, n);
- swaps(&x_info[s].maxWidth, n);
- swaps(&x_info[s].maxHeight, n);
- swaps(&x_info[s].rotations, n);
- }
- }
-
- WriteToClient(client, sizeof(rep), (char *)&rep);
- if (n_info)
- WriteToClient(client, n_info * sizeof (xRRScanoutPixmapInfo),
- (char *) x_info);
- return Success;
-}
-
-int
-ProcRRCreateScanoutPixmap (ClientPtr client)
-{
- REQUEST(xRRCreateScanoutPixmapReq);
- int rc;
- DrawablePtr drawable;
- ScreenPtr screen;
- rrScrPrivPtr screen_priv;
- PixmapPtr pixmap;
- int n_info;
- RRScanoutPixmapInfo *info;
- int s;
-
- REQUEST_SIZE_MATCH(xRRCreateScanoutPixmapReq);
- client->errorValue = stuff->pid;
- LEGAL_NEW_RESOURCE(stuff->pid, client);
-
- rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixGetAttrAccess);
- if (rc != Success) {
- client->errorValue = stuff->drawable;
- return rc;
- }
- screen = drawable->pScreen;
- screen_priv = rrGetScrPriv(screen);
- if (!screen_priv)
- return BadValue;
-
- info = RRQueryScanoutPixmapInfo(screen, &n_info);
- for (s = 0; s < n_info; s++) {
- if (info[s].format->id == stuff->format)
- break;
- }
- if (s == n_info || !screen_priv->rrCreateScanoutPixmap) {
- client->errorValue = stuff->format;
- return BadValue;
- }
- info = &info[s];
- if (!stuff->width || stuff->width > info->maxWidth) {
- client->errorValue = stuff->width;
- return BadValue;
- }
- if (!stuff->height || stuff->height > info->maxHeight) {
- client->errorValue = stuff->height;
- return BadValue;
- }
- if ((stuff->rotations & info->rotations) != stuff->rotations) {
- client->errorValue = stuff->rotations;
- return BadValue;
- }
-
- pixmap = screen_priv->rrCreateScanoutPixmap (screen,
- stuff->width, stuff->height,
- info->depth,
- stuff->rotations,
- info->format);
- if (!pixmap)
- return BadAlloc;
-
- pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
- pixmap->drawable.id = stuff->pid;
- rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP,
- pixmap, RT_NONE, NULL, DixCreateAccess);
- if (rc != Success) {
- screen->DestroyPixmap(pixmap);
- return rc;
- }
- if (!AddResource(stuff->pid, RT_PIXMAP, pixmap))
- return BadAlloc;
- return Success;
-}
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index c7387267a..af09f6852 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -794,10 +794,8 @@ ProcRRSetScreenConfig (ClientPtr client)
}
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
- if (rc != Success) {
- client->errorValue = stuff->drawable;
+ if (rc != Success)
return rc;
- }
pScreen = pDraw->pScreen;
@@ -954,7 +952,7 @@ ProcRRSetScreenConfig (ClientPtr client)
for (c = 0; c < pScrPriv->numCrtcs; c++)
{
if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0,
- 0, NULL, NULL))
+ 0, NULL))
{
rep.status = RRSetConfigFailed;
/* XXX recover from failure */
@@ -970,7 +968,7 @@ ProcRRSetScreenConfig (ClientPtr client)
}
}
- if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output, NULL))
+ if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output))
rep.status = RRSetConfigFailed;
else {
pScrPriv->lastSetTime = time;