Rebased ref, commits from common ancestor: commit 14983286c489ea1ec6ba4fadbeaec5c2d2ee34e1 Author: Keith Packard <kei...@keithp.com> Date: Mon Dec 6 20:45:35 2010 -0800
Version bumped to 1.9.99.901 (1.10 RC1) Signed-off-by: Keith Packard <kei...@keithp.com> diff --git a/configure.ac b/configure.ac index d1fc379..b56d3e8 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.9.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2010-10-01" +AC_INIT([xorg-server], 1.9.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2010-12-06" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE commit d96d5f5443358e33e47d1a61f9bd2afd8064a8dd Author: James Jones <jajo...@nvidia.com> Date: Sun Dec 5 19:42:41 2010 -0800 Bump extension ABI to 5 Commit 606e079cc4d9a9db3197652ca51683c36f74efb8 moved the visual field in WindowOptRec, breaking the extension module ABI. Signed-off-by: James Jones <jajo...@nvidia.com> Reviewed-by: Keith Packard <kei...@keithp.com> Signed-off-by: Keith Packard <kei...@keithp.com> diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 72f6cf0..af7b778 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -84,7 +84,7 @@ typedef enum { #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 commit 435361bd73b9fc733f093d81af6b839953e35176 Author: Keith Packard <kei...@keithp.com> Date: Mon Dec 6 20:38:14 2010 -0800 sync: syncObject may be None in SyncInitTrigger And often is, especially when called from ProcSyncCreateAlarm. Crashing in this case seems unwise. Signed-off-by: Keith Packard <kei...@keithp.com> diff --git a/Xext/sync.c b/Xext/sync.c index ce00755..ab8f20d 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -296,7 +296,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XID syncObject, /* if system counter, ask it what the current value is */ - if (SYNC_COUNTER == pSync->type) + if (pSync && SYNC_COUNTER == pSync->type) { pCounter = (SyncCounter *)pSync; @@ -320,7 +320,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XID syncObject, if (changes & XSyncCATestType) { - if (SYNC_FENCE == pSync->type) + if (pSync && SYNC_FENCE == pSync->type) { pTrigger->CheckTrigger = SyncCheckTriggerFence; } commit 0d01b66df9081ef48843b3bad81c56bb2cd1ae69 Author: Keith Packard <kei...@keithp.com> Date: Sun Dec 5 23:35:28 2010 -0800 randr: handle RRSetCrtcConfigs request with zero configs Need to actually return a reply in this case. Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 0fc8188..5fe6900 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1750,9 +1750,6 @@ ProcRRSetCrtcConfigs (ClientPtr client) screen_config.mm_width = stuff->widthInMillimeters; screen_config.mm_height = stuff->heightInMillimeters; - if (num_configs == 0) - return Success; - output_ids = (RROutput *) (x_configs + num_configs); /* @@ -1760,7 +1757,7 @@ ProcRRSetCrtcConfigs (ClientPtr client) * server crtc configurations */ configs = calloc(num_configs, sizeof (RRCrtcConfigRec)); - if (!configs) + if (num_configs > 0 && configs == NULL) return BadAlloc; for (i = 0; i < num_configs; i++) { rc = RRConvertCrtcConfig(client, screen, &screen_config, @@ -1773,7 +1770,8 @@ ProcRRSetCrtcConfigs (ClientPtr client) output_ids += x_configs[i].nOutput; } - if (!RRSetCrtcConfigs (screen, &screen_config, configs, num_configs)) + if (num_configs && + !RRSetCrtcConfigs (screen, &screen_config, configs, num_configs)) { rep.status = RRSetConfigFailed; goto sendReply; commit b0f4bd61f0caf80f3be9a176f1f7a707bc6628d8 Author: Keith Packard <kei...@keithp.com> Date: Sun Dec 5 21:53:25 2010 -0800 ProcRRSetCrtcConfigs uses 'configs' without being initialized If the client sends invalid data for this request, the server will jump to 'sendReply' and call RRFreeCrtcConfigs, passing it the uninitialized 'configs' and 'num_configs' values. Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 97aa3d7..0fc8188 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1682,9 +1682,9 @@ ProcRRSetCrtcConfigs (ClientPtr client) rrScrPrivPtr scr_priv; xRRCrtcConfig *x_configs; RRScreenConfigRec screen_config; - RRCrtcConfigPtr configs; + RRCrtcConfigPtr configs = NULL; RROutput *output_ids; - int num_configs; + int num_configs = 0; int rc, i; int extra_len; int num_output_ids; commit 752c368421c1c824752cf467fba9318d75d2ca2c Author: Keith Packard <kei...@keithp.com> Date: Sun Dec 5 20:57:47 2010 -0800 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 <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index ea0acbf..01f9864 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1038,7 +1038,12 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) RegionInit(&pWin->winSize, &box, 1); RegionInit(&pWin->borderSize, &box, 1); if (WasViewable) + { + PixmapPtr pPixmap = (*pScreen->GetScreenPixmap) (pScreen); + box.x2 = pPixmap->drawable.width; + box.y2 = pPixmap->drawable.height; RegionReset(&pWin->borderClip, &box); + } pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; RegionBreak(&pWin->clipList); @@ -1116,7 +1121,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) */ if (!xf86Resetting) xf86SetRootClip (pScreen, TRUE); - } else { diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index dfe2cc3..407bf35 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -659,10 +659,12 @@ xf86RandR12SetConfig (ScreenPtr pScreen, static Bool xf86RandR12ScreenSetSize (ScreenPtr pScreen, - CARD16 width, - CARD16 height, - CARD32 mmWidth, - CARD32 mmHeight) + CARD16 width, + CARD16 height, + CARD16 pixWidth, + CARD16 pixHeight, + CARD32 mmWidth, + CARD32 mmHeight) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); @@ -670,6 +672,8 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix; Bool ret = FALSE; + Bool pixSizeChanged = FALSE; + Bool winSizeChanged = FALSE; int c; if (xf86RandR12Key) { @@ -677,46 +681,85 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; + pixSizeChanged = TRUE; } } - if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); - /* Let the driver update virtualX and virtualY */ - if (!(*config->funcs->resize)(pScrn, width, height)) - goto finish; + pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); + if (pixWidth != pScrnPix->drawable.width || + pixHeight != pScrnPix->drawable.height) + pixSizeChanged = TRUE; + + if (width != pScreen->width || height != pScreen->height) + winSizeChanged = TRUE; + + if (pixSizeChanged) + { + if (pRoot && pScrn->vtSema) + (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); + + /* Let the driver update virtualX and virtualY */ + if (!(*config->funcs->resize)(pScrn, pixWidth, pixHeight)) + goto finish; + } ret = TRUE; - /* Update panning information */ - for (c = 0; c < config->num_crtc; c++) { - xf86CrtcPtr crtc = config->crtc[c]; - if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 || - crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) { - if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1) - crtc->panningTotalArea.x2 += width - pScreen->width; - if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1) - crtc->panningTotalArea.y2 += height - pScreen->height; - if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1) - crtc->panningTrackingArea.x2 += width - pScreen->width; - if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1) - crtc->panningTrackingArea.y2 += height - pScreen->height; - xf86RandR13VerifyPanningArea (crtc, width, height); - xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY); + + if (winSizeChanged) + { + /* Update panning information */ + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 || + crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) { + if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1) + crtc->panningTotalArea.x2 += width - pScreen->width; + if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1) + crtc->panningTotalArea.y2 += height - pScreen->height; + if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1) + crtc->panningTrackingArea.x2 += width - pScreen->width; + if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1) + crtc->panningTrackingArea.y2 += height - pScreen->height; + xf86RandR13VerifyPanningArea (crtc, width, height); + xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY); + } } } pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); - pScreen->width = pScrnPix->drawable.width = width; - pScreen->height = pScrnPix->drawable.height = height; + pScreen->width = width; + pScreen->height = height; + if (pRoot) + { + BoxRec box; + + pRoot->drawable.width = width; + pRoot->drawable.height = height; + box.x1 = 0; + box.y1 = 0; + box.x2 = width; + box.y2 = height; + RegionInit(&pRoot->winSize, &box, 1); + RegionInit(&pRoot->borderSize, &box, 1); + } + pScrnPix->drawable.width = pixWidth; + pScrnPix->drawable.height = pixHeight; randrp->mmWidth = pScreen->mmWidth = mmWidth; randrp->mmHeight = pScreen->mmHeight = mmHeight; - xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1); - xf86SetViewport (pScreen, 0, 0); + if (winSizeChanged) + { + xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1); + xf86SetViewport (pScreen, 0, 0); + } finish: - if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); + if (pixSizeChanged) + { + if (pRoot && pScrn->vtSema) + (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); + } + #if RANDR_12_INTERFACE if (xf86RandR12Key && pScreen->root && ret) RRScreenSizeNotify (pScreen); @@ -818,6 +861,8 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86RandR12ScreenSetSize (pScreen, width, height, + width, + height, mmWidth, mmHeight); } diff --git a/randr/mirrcrtc.c b/randr/mirrcrtc.c index d493a0e..a9ee6b4 100644 --- a/randr/mirrcrtc.c +++ b/randr/mirrcrtc.c @@ -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); } diff --git a/randr/randrstr.h b/randr/randrstr.h index 8240824..7c553f2 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -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); diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 0b2bc28..97aa3d7 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -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, diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 0c52347..292163f 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -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 @@ -318,6 +321,7 @@ ProcRRSetScreenSize (ClientPtr client) } 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; commit a88d70fb20a2bc3152b84adff4380857e6cfadf5 Author: Keith Packard <kei...@keithp.com> Date: Sun Dec 5 20:55:46 2010 -0800 Set sprite transforms from RRSetCrtcConfigs These were getting ignored. Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index b0eabdd..dfe2cc3 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1819,8 +1819,8 @@ xf86RRConvertCrtcConfig(xf86CrtcSetConfigPtr xf86_config, return FALSE; for (o = 0; o < rr_config->numOutputs; o++) xf86_config->outputs[o] = rr_config->outputs[o]->devPrivate; - xf86_config->sprite_position_transform = rr_config->sprite_position_transform; - xf86_config->sprite_image_transform = rr_config->sprite_image_transform; + xf86_config->sprite_position_transform = rr_config->sprite_position_f_transform; + xf86_config->sprite_image_transform = rr_config->sprite_image_f_transform; xf86_config->pixmap = rr_config->pixmap; xf86_config->pixmap_x = rr_config->pixmap_x; xf86_config->pixmap_y = rr_config->pixmap_y; diff --git a/randr/mirrcrtc.c b/randr/mirrcrtc.c index cc76797..d493a0e 100644 --- a/randr/mirrcrtc.c +++ b/randr/mirrcrtc.c @@ -60,14 +60,21 @@ miRRSetCrtcConfig(RRCrtcConfigPtr crtc_config) x = crtc_config->pixmap_x; y = crtc_config->pixmap_y; } - return RRCrtcSet(crtc_config->crtc, - crtc_config->mode, - x, - y, - crtc_config->rotation, - crtc_config->numOutputs, - crtc_config->outputs, - crtc_config->pixmap); + if (!RRCrtcSet(crtc_config->crtc, + crtc_config->mode, + x, + y, + crtc_config->rotation, + crtc_config->numOutputs, + crtc_config->outputs, + crtc_config->pixmap)) + return FALSE; + RRCrtcSpriteTransformSet(crtc_config->crtc, + &crtc_config->sprite_position_transform, + &crtc_config->sprite_image_transform, + &crtc_config->sprite_position_f_transform, + &crtc_config->sprite_image_f_transform); + return TRUE; } Bool diff --git a/randr/randrstr.h b/randr/randrstr.h index c231972..8240824 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -154,8 +154,10 @@ struct _rrCrtcConfig { Rotation rotation; int numOutputs; RROutputPtr *outputs; - struct pict_f_transform sprite_position_transform; - struct pict_f_transform sprite_image_transform; + PictTransform sprite_position_transform; + PictTransform sprite_image_transform; + struct pict_f_transform sprite_position_f_transform; + struct pict_f_transform sprite_image_f_transform; PixmapPtr pixmap; int pixmap_x, pixmap_y; }; diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 12982a8..0b2bc28 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -430,8 +430,10 @@ RRCrtcCurrentConfig(RRCrtcPtr crtc, if (!crtc_config->outputs) return FALSE; memcpy(crtc_config->outputs, crtc->outputs, crtc->numOutputs * sizeof (RROutputPtr)); - crtc_config->sprite_position_transform = crtc->client_sprite_f_position_transform; - crtc_config->sprite_image_transform = crtc->client_sprite_f_image_transform; + crtc_config->sprite_position_transform = crtc->client_sprite_position_transform; + crtc_config->sprite_image_transform = crtc->client_sprite_image_transform; + 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; @@ -718,8 +720,8 @@ RRScreenCoversCrtc(RRScreenConfigPtr screen_config, crtc_config->mode->mode.width, crtc_config->mode->mode.height, crtc_config->rotation, client_transform, - &crtc_config->sprite_position_transform, - &crtc_config->sprite_image_transform, + &crtc_config->sprite_position_f_transform, + &crtc_config->sprite_image_f_transform, NULL, &f_transform, NULL, NULL, NULL, NULL); RRModeGetScanoutSize (crtc_config->mode, &f_transform, @@ -1469,15 +1471,6 @@ ProcRRGetCrtcTransform (ClientPtr client) return Success; } -static void -pixman_f_transform_from_xRenderTransform(struct pixman_f_transform *f_transform, - xRenderTransform *x_transform) -{ - struct pixman_transform transform; - PictTransform_from_xRenderTransform(&transform, x_transform); - pixman_f_transform_from_pixman_transform(f_transform, &transform); -} - static int RRConvertCrtcConfig(ClientPtr client, ScreenPtr screen, RRScreenConfigPtr screen_config, @@ -1594,10 +1587,14 @@ RRConvertCrtcConfig(ClientPtr client, ScreenPtr screen, config->rotation = x->rotation; config->numOutputs = x->nOutput; config->outputs = outputs; - pixman_f_transform_from_xRenderTransform(&config->sprite_position_transform, + PictTransform_from_xRenderTransform(&config->sprite_position_transform, &x->spritePositionTransform); - pixman_f_transform_from_xRenderTransform(&config->sprite_image_transform, + PictTransform_from_xRenderTransform(&config->sprite_image_transform, &x->spriteImageTransform); + pixman_f_transform_from_pixman_transform(&config->sprite_position_f_transform, + &config->sprite_position_transform); + pixman_f_transform_from_pixman_transform(&config->sprite_image_f_transform, + &config->sprite_image_transform); config->pixmap = pixmap; config->pixmap_x = x->xPixmap; config->pixmap_y = x->yPixmap; commit 96b4d4787bf82edd9d06eb9a6e94bc45412c7df2 Author: Keith Packard <kei...@keithp.com> Date: Sun Dec 5 20:49:19 2010 -0800 DIX is responsible for ref counting scanout pixmaps. Remove some extra ref counting inside hw/xfree86/modes Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 5bf12f0..08d384f 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -414,10 +414,6 @@ done: crtc->active = TRUE; if (scrn->pScreen) xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); - if (crtc->scanoutPixmap) - ++crtc->scanoutPixmap->refcnt; - if (saved_scanout_pixmap) - (*scrn->pScreen->DestroyPixmap)(saved_scanout_pixmap); if (scrn->ModeSet) scrn->ModeSet(scrn); } else { commit afb6ebf1d5829346c40fe1053c9f50afe926e6c6 Author: Keith Packard <kei...@keithp.com> Date: Fri Dec 3 13:04:37 2010 -0800 randr: Hook up the new RandR 1.4 functionality This bumps the supported RandR protocol version and adds the dispatch hooks needed to call the new functions Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/include/protocol-versions.h b/include/protocol-versions.h index 1d33bdd..c8c7f5f 100644 --- a/include/protocol-versions.h +++ b/include/protocol-versions.h @@ -65,7 +65,7 @@ /* RandR */ #define SERVER_RANDR_MAJOR_VERSION 1 -#define SERVER_RANDR_MINOR_VERSION 3 +#define SERVER_RANDR_MINOR_VERSION 4 /* Record */ #define SERVER_RECORD_MAJOR_VERSION 1 diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index ebfda57..aed746b 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -224,5 +224,11 @@ int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = { ProcRRSetPanning, /* 29 */ ProcRRSetOutputPrimary, /* 30 */ ProcRRGetOutputPrimary, /* 31 */ +/* V1.4 additions */ + ProcRRQueryScanoutPixmaps, /* 32 */ + ProcRRCreateScanoutPixmap, /* 33 */ + ProcRRSetCrtcSpriteTransform,/* 34 */ + ProcRRGetCrtcSpriteTransform,/* 35 */ + ProcRRSetCrtcConfigs, /* 36 */ }; diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c index e16090a..c848f91 100644 --- a/randr/rrsdispatch.c +++ b/randr/rrsdispatch.c @@ -461,6 +461,132 @@ SProcRRGetOutputPrimary (ClientPtr client) return ProcRandrVector[stuff->randrReqType](client); } +static int +SProcRRQueryScanoutPixmaps (ClientPtr client) +{ + int n; + REQUEST(xRRQueryScanoutPixmapsReq); + + REQUEST_SIZE_MATCH(xRRQueryScanoutPixmapsReq); + swaps(&stuff->length, n); + swapl(&stuff->drawable, n); + return ProcRandrVector[stuff->randrReqType](client); +} + +static int +SProcRRCreateScanoutPixmap (ClientPtr client) +{ + int n; + REQUEST(xRRCreateScanoutPixmapReq); + + REQUEST_SIZE_MATCH(xRRCreateScanoutPixmapReq); + swaps(&stuff->length, n); + swapl(&stuff->pid, n); + swapl(&stuff->drawable, n); + swaps(&stuff->width, n); + swaps(&stuff->height, n); + swapl(&stuff->format, n); + swaps(&stuff->rotations, n); + return ProcRandrVector[stuff->randrReqType](client); +} + +static void +swap_transform(xRenderTransform *t) +{ + int n; + swapl(&t->matrix11, n); + swapl(&t->matrix12, n); + swapl(&t->matrix13, n); + swapl(&t->matrix21, n); + swapl(&t->matrix22, n); + swapl(&t->matrix23, n); + swapl(&t->matrix31, n); + swapl(&t->matrix32, n); + swapl(&t->matrix33, n); +} + +static int +SProcRRSetCrtcSpriteTransform (ClientPtr client) +{ + int n; + REQUEST(xRRSetCrtcSpriteTransformReq); + + REQUEST_SIZE_MATCH(xRRSetCrtcSpriteTransformReq); + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + swap_transform(&stuff->positionTransform); + swap_transform(&stuff->imageTransform); + return ProcRandrVector[stuff->randrReqType](client); +} + +static int +SProcRRGetCrtcSpriteTransform (ClientPtr client) +{ + int n; + REQUEST(xRRGetCrtcSpriteTransformReq); + + REQUEST_SIZE_MATCH(xRRGetCrtcSpriteTransformReq); + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + return ProcRandrVector[stuff->randrReqType](client); +} + +static int +SProcRRSetCrtcConfigs (ClientPtr client) +{ + int n; + REQUEST(xRRSetCrtcConfigsReq); + int c; + int extra_len; + int num_configs; + int num_output_ids; + xRRCrtcConfig *x_configs; + + REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigsReq); + swaps(&stuff->length, n); + swapl(&stuff->drawable, n); + swaps(&stuff->screenPixmapWidth, n); + swaps(&stuff->screenPixmapHeight, n); + swaps(&stuff->screenWidth, n); + swaps(&stuff->screenHeight, n); + swapl(&stuff->widthInMillimeters, n); + swapl(&stuff->heightInMillimeters, n); + swaps(&stuff->nConfigs, n); + + extra_len = client->req_len - bytes_to_int32(sizeof(xRRSetCrtcConfigsReq)); + + num_configs = stuff->nConfigs; + + /* Check request length against number of configs specified */ + if (num_configs * (sizeof (xRRCrtcConfig) >> 2) > extra_len) + return BadLength; + + x_configs = (xRRCrtcConfig *) (stuff + 1); + for (c = 0; c < num_configs; c++) { + swapl(&x_configs->crtc, n); + swaps(&x_configs->x, n); + swaps(&x_configs->y, n); + swapl(&x_configs->mode, n); + swaps(&x_configs->rotation, n); + swaps(&x_configs->nOutput, n); + swap_transform(&x_configs->spritePositionTransform); + swap_transform(&x_configs->spriteImageTransform); + swapl(&x_configs->pixmap, n); + swaps(&x_configs->xPixmap, n); + swaps(&x_configs->yPixmap, n); + x_configs++; + } + + /* Let the other dispatch function deal with verifying that + * the right number of output ids are present, just + * swap whatever is here + */ + num_output_ids = extra_len - (num_configs * (sizeof (xRRCrtcConfig)) >> 2); + SwapLongs((CARD32 *) x_configs, num_output_ids); + + return ProcRandrVector[stuff->randrReqType](client); +} + int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = { SProcRRQueryVersion, /* 0 */ /* we skip 1 to make old clients fail pretty immediately */ @@ -499,5 +625,11 @@ int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = { SProcRRSetPanning, /* 29 */ SProcRRSetOutputPrimary, /* 30 */ SProcRRGetOutputPrimary, /* 31 */ +/* V1.4 additions */ + SProcRRQueryScanoutPixmaps, /* 32 */ + SProcRRCreateScanoutPixmap, /* 33 */ + SProcRRSetCrtcSpriteTransform,/* 34 */ + SProcRRGetCrtcSpriteTransform,/* 35 */ + SProcRRSetCrtcConfigs, /* 36 */ }; commit 82612045e11f2b882ae132e184a9629f43f1c424 Author: Keith Packard <kei...@keithp.com> Date: Fri Dec 3 13:00:46 2010 -0800 randr: Add per-crtc pixmaps This adds new driver hooks to allocate scanout pixmaps and changes the mode setting APIs to pass the new scanout pixmaps along from DIX. DIX is responsible for reference counting the pixmaps by tracking them through RRCrtcNotify. Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Aaron Plattner <aplatt...@nvidia.com> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 3fccaea..5bf12f0 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -82,6 +82,17 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, config->maxHeight = maxHeight; } +void +xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn, + int num_formats, + xf86CrtcScanoutFormat *formats) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + config->num_scanout_formats = num_formats; + config->scanout_formats = formats; +} + /* * Crtc functions */ @@ -265,6 +276,7 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) Rotation saved_rotation; RRTransformRec saved_transform; Bool saved_transform_present; + PixmapPtr saved_scanout_pixmap; crtc->enabled = xf86CrtcInUse (crtc); @@ -284,6 +296,7 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) saved_x = crtc->x; saved_y = crtc->y; saved_rotation = crtc->rotation; + saved_scanout_pixmap = crtc->scanoutPixmap; if (crtc->transformPresent) { RRTransformInit (&saved_transform); RRTransformCopy (&saved_transform, &crtc->transform); @@ -301,6 +314,8 @@ xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) } if (set->flags & XF86CrtcSetRotation) crtc->rotation = set->rotation; + if (set->flags & XF86CrtcSetScanoutPixmap) + crtc->scanoutPixmap = set->scanout_pixmap; if (set->flags & XF86CrtcSetTransform) { if (set->transform) { @@ -399,6 +414,10 @@ done: crtc->active = TRUE; if (scrn->pScreen) xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); + if (crtc->scanoutPixmap) + ++crtc->scanoutPixmap->refcnt; + if (saved_scanout_pixmap) + (*scrn->pScreen->DestroyPixmap)(saved_scanout_pixmap); if (scrn->ModeSet) scrn->ModeSet(scrn); } else { @@ -409,6 +428,7 @@ done: if (saved_transform_present) RRTransformCopy (&crtc->transform, &saved_transform); crtc->transformPresent = saved_transform_present; + crtc->scanoutPixmap = saved_scanout_pixmap; } if (adjusted_mode) { diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index c2e8131..9a520fc 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -79,6 +79,7 @@ typedef enum _xf86CrtcSetFlags { XF86CrtcSetTransform = 8, /* transform */ XF86CrtcSetRotation = 16, /* rotation */ XF86CrtcSetProperty = 32, /* output property */ + XF86CrtcSetScanoutPixmap = 64, /* scanout pixmap */ } xf86CrtcSetFlags; typedef struct _xf86CrtcSet { @@ -87,6 +88,7 @@ typedef struct _xf86CrtcSet { Rotation rotation; RRTransformPtr transform; int x, y; + PixmapPtr scanout_pixmap; } xf86CrtcSetRec; typedef struct _xf86CrtcFuncs { @@ -277,6 +279,7 @@ struct _xf86Crtc { Rotation rotation; PixmapPtr rotatedPixmap; void *rotatedData; + PixmapPtr scanoutPixmap; /** * Position on screen @@ -670,6 +673,14 @@ typedef struct _xf86CrtcSetConfig { int pixmap_x, pixmap_y; } xf86CrtcSetConfigRec, *xf86CrtcSetConfigPtr; +typedef struct _xf86CrtcScanoutFormat { + int depth; + int bitsPerPixel; + int maxWidth, maxHeight; + Rotation rotations; + PictFormatShort format; +} xf86CrtcScanoutFormat; + typedef struct _xf86CrtcConfigFuncs { /** * Requests that the driver resize the screen. @@ -693,6 +704,17 @@ typedef struct _xf86CrtcConfigFuncs { RRScreenConfigPtr screen_config, xf86CrtcSetConfigPtr crtc_configs, int num_configs); + + /** + * Create a scanout pixmap + */ + PixmapPtr + (*create_scanout_pixmap)(ScrnInfoPtr scrn, + int width, + int height, + Rotation rotations, + xf86CrtcScanoutFormat *format); + } xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr; typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen); @@ -752,6 +774,11 @@ typedef struct _xf86CrtcConfig { /* callback when crtc configuration changes */ xf86_crtc_notify_proc_ptr xf86_crtc_notify; + /* + * Supported scanout pixmap formats + */ + int num_scanout_formats; + xf86CrtcScanoutFormat *scanout_formats; } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern _X_EXPORT int xf86CrtcConfigPrivateIndex; @@ -797,6 +824,11 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, int minWidth, int minHeight, int maxWidth, int maxHeight); +extern _X_EXPORT void +xf86CrtcSetScanoutFormats (ScrnInfoPtr scrn, + int num_formats, + xf86CrtcScanoutFormat *formats); + /* * Crtc functions */ diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index e3330f4..b0eabdd 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1083,7 +1083,7 @@ xf86RandR12CrtcNotify (RRCrtcPtr randr_crtc) ret = RRCrtcNotify (randr_crtc, randr_mode, x, y, rotation, crtc->transformPresent ? &crtc->transform : NULL, - numOutputs, randr_outputs); + numOutputs, randr_outputs, crtc->scanoutPixmap); free(randr_outputs); return ret; } @@ -1126,7 +1126,8 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, int y, Rotation rotation, -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1ppnhk-0003gx...@alioth.debian.org