Separate out screen size and screen pixmap sizes in RRScreenSizeSet

This provides for separate sizes for the screen scanout and rendering
buffer and the application-visible screen size.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
This commit is contained in:
Keith Packard 2010-12-05 20:57:47 -08:00
commit 752c368421
6 changed files with 96 additions and 41 deletions

View file

@ -28,11 +28,6 @@ miRRSetScreenConfig(ScreenPtr screen,
{
RRScreenConfigRec old_screen_config;
/* XXX deal with separate pixmap/screen sizes */
if (screen_config->screen_pixmap_width != screen_config->screen_width ||
screen_config->screen_pixmap_height != screen_config->screen_height)
return FALSE;
RRScreenCurrentConfig(screen, &old_screen_config);
/* Check and see if nothing has changed */
@ -47,6 +42,8 @@ miRRSetScreenConfig(ScreenPtr screen,
return RRScreenSizeSet(screen,
screen_config->screen_width,
screen_config->screen_height,
screen_config->screen_pixmap_width,
screen_config->screen_pixmap_height,
screen_config->mm_width,
screen_config->mm_height);
}

View file

@ -191,6 +191,8 @@ struct _rrOutput {
typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD16 pixWidth,
CARD16 pixHeight,
CARD32 mmWidth,
CARD32 mmHeight);
@ -478,6 +480,8 @@ extern _X_EXPORT Bool
RRScreenSizeSet (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD16 pixWidth,
CARD16 pixHeight,
CARD32 mmWidth,
CARD32 mmHeight);

View file

@ -435,10 +435,9 @@ RRCrtcCurrentConfig(RRCrtcPtr crtc,
crtc_config->sprite_position_f_transform = crtc->client_sprite_f_position_transform;
crtc_config->sprite_image_f_transform = crtc->client_sprite_f_image_transform;
/* XXX add pixmap stuff */
crtc_config->pixmap = NULL;
crtc_config->pixmap_x = 0;
crtc_config->pixmap_y = 0;
crtc_config->pixmap = crtc->scanoutPixmap;
crtc_config->pixmap_x = crtc->x;
crtc_config->pixmap_y = crtc->y;
return TRUE;
}
@ -1510,6 +1509,8 @@ RRConvertCrtcConfig(ClientPtr client, ScreenPtr screen,
if (x->pixmap == None)
pixmap = NULL;
else if (x->pixmap == RR_CurrentScanoutPixmap)
pixmap = crtc->scanoutPixmap;
else
{
rc = dixLookupResourceByType((pointer *) &pixmap, x->pixmap,

View file

@ -168,6 +168,8 @@ Bool
RRScreenSizeSet (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD16 pixWidth,
CARD16 pixHeight,
CARD32 mmWidth,
CARD32 mmHeight)
{
@ -178,6 +180,7 @@ RRScreenSizeSet (ScreenPtr pScreen,
{
return (*pScrPriv->rrScreenSetSize) (pScreen,
width, height,
pixWidth, pixHeight,
mmWidth, mmHeight);
}
#endif
@ -317,6 +320,7 @@ ProcRRSetScreenSize (ClientPtr client)
return BadValue;
}
if (!RRScreenSizeSet (pScreen,
stuff->width, stuff->height,
stuff->width, stuff->height,
stuff->widthInMillimeters,
stuff->heightInMillimeters))
@ -949,7 +953,7 @@ ProcRRSetScreenConfig (ClientPtr client)
goto sendReply;
}
}
if (!RRScreenSizeSet (pScreen, width, height,
if (!RRScreenSizeSet (pScreen, width, height, width, height,
pScreen->mmWidth, pScreen->mmHeight))
{
rep.status = RRSetConfigFailed;