From 961105ba95a89b6e97e75d7c18f6e58a8d07e28f Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Wed, 17 Jul 2013 23:40:01 -0700 Subject: [PATCH] xorg driver, randr working now --- xorg/server/module/rdpRandR.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/xorg/server/module/rdpRandR.c b/xorg/server/module/rdpRandR.c index bcd01928..8ad4989b 100644 --- a/xorg/server/module/rdpRandR.c +++ b/xorg/server/module/rdpRandR.c @@ -97,12 +97,15 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, { WindowPtr root; PixmapPtr screenPixmap; + PixmapPtr rootWindowPixmap; BoxRec box; ScrnInfoPtr pScrn; rdpPtr dev; + char *oldpfbMemory; LLOGLN(0, ("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d", width, height, (int)mmWidth, (int)mmHeight)); + pScrn = xf86Screens[pScreen->myNum]; dev = XRDPPTR(pScrn); root = rdpGetRootWindowPtr(pScreen); @@ -123,23 +126,29 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, pScreen->mmHeight = mmHeight; screenPixmap = pScreen->GetScreenPixmap(pScreen); + rootWindowPixmap = pScreen->GetWindowPixmap(root); + + oldpfbMemory = dev->pfbMemory; + dev->pfbMemory = (char *) malloc(dev->sizeInBytes); if (screenPixmap != 0) { - LLOGLN(0, (" resizing screenPixmap [%p] to %dx%d, " - "currently at %dx%d", (void *)screenPixmap, width, height, - screenPixmap->drawable.width, screenPixmap->drawable.height)); - free(dev->pfbMemory); - dev->pfbMemory = (char *) malloc(dev->sizeInBytes); pScreen->ModifyPixmapHeader(screenPixmap, width, height, - dev->depth, dev->bitsPerPixel, + -1, -1, + dev->paddedWidthInBytes, + dev->pfbMemory); + } + + if (rootWindowPixmap != 0) + { + pScreen->ModifyPixmapHeader(rootWindowPixmap, width, height, + -1, -1, dev->paddedWidthInBytes, dev->pfbMemory); - LLOGLN(0, (" pixmap resized to %dx%d", - screenPixmap->drawable.width, screenPixmap->drawable.height)); } - LLOGLN(10, (" root window %p", (void *)root)); + free(oldpfbMemory); + box.x1 = 0; box.y1 = 0; box.x2 = width; @@ -152,8 +161,11 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, root->drawable.height = height; ResizeChildrenWinSize(root, 0, 0, 0, 0); RRGetInfo(pScreen, 1); - //rdpInvalidateArea(g_pScreen, 0, 0, dev->width, dev->height); LLOGLN(0, (" screen resized to %dx%d", pScreen->width, pScreen->height)); + + xf86EnableDisableFBAccess(pScreen->myNum, 0); + xf86EnableDisableFBAccess(pScreen->myNum, 1); + return TRUE; }