summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-10-05 14:17:25 +1000
committerDave Airlie <airlied@redhat.com>2009-10-05 14:19:31 +1000
commit86cafb8affea448bdf58300044e755201b822d2a (patch)
treefbd4801bbb2a2a31c317389dc5a98ab26b73119a
parentf8471512ea9f1d38140dfe98a0f832e9f935f51b (diff)
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.
-rw-r--r--src/drmmode_display.c33
1 files 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);
}