From 86cafb8affea448bdf58300044e755201b822d2a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 5 Oct 2009 14:17:25 +1000 Subject: kms: don't use scratch pixmaps when copying fbcon. scratch pixmaps seem to interact badly with mixed pixmaps, it appears some state may be getting left around in the privates somewhere, since scratch pixmap headers don't get destroyed. --- src/drmmode_display.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 1b5f0ac..6f3f6df 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -156,16 +156,19 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode, return NULL; } - pixmap = GetScratchPixmapHeader(pScreen, - fbcon->width, fbcon->height, - fbcon->depth, fbcon->bpp, - fbcon->pitch, NULL); - if (pixmap == NULL) { + pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, fbcon->depth, 0); + if (!pixmap) + return NULL; + + if (!(*pScreen->ModifyPixmapHeader)(pixmap, fbcon->width, fbcon->height, + fbcon->depth, fbcon->bpp, + fbcon->pitch, NULL)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't allocate pixmap fbcon contents\n"); return NULL; } - + + exaMoveInPixmap(pixmap); radeon_set_pixmap_bo(pixmap, bo); radeon_bo_unref(bo); @@ -199,10 +202,17 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) if (!src) return; - dst = GetScratchPixmapHeader(pScreen, - pScrn->virtualX, pScrn->virtualY, - pScrn->depth, pScrn->bitsPerPixel, - pitch, NULL); + dst = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth, 0); + if (!dst) + goto out_free_src; + + if (!(*pScreen->ModifyPixmapHeader)(dst, pScrn->virtualX, + pScrn->virtualY, pScrn->depth, + pScrn->bitsPerPixel, pitch, + NULL)) + goto out_free_dst; + + exaMoveInPixmap(dst); radeon_set_pixmap_bo(dst, info->front_bo); info->accel_state->exa->PrepareCopy (src, dst, -1, -1, GXcopy, FB_ALLONES); @@ -210,8 +220,9 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) pScrn->virtualX, pScrn->virtualY); info->accel_state->exa->DoneCopy (dst); radeon_cs_flush_indirect(pScrn); - + out_free_dst: (*pScreen->DestroyPixmap)(dst); + out_free_src: (*pScreen->DestroyPixmap)(src); } -- cgit v1.2.3