diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-24 11:53:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-24 11:53:17 +0100 |
commit | 669378cd8db8af89d12f1b95a07fc1ead0b1569c (patch) | |
tree | 1d4714855f5e7b6bb9cac0e305a212d4db5c02bd /src/sna/sna_display.c | |
parent | 33b2ea0392fe944b210ef744398aa22989bfdf33 (diff) |
sna: Wrap the fbcon in a scratch pixmap for render-copy across depth changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 21554f1e..285a39b7 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -506,6 +506,7 @@ void sna_copy_fbcon(struct sna *sna) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn); drmModeFBPtr fbcon; + PixmapPtr scratch; struct sna_pixmap *priv; struct kgem_bo *bo; BoxRec box; @@ -533,7 +534,15 @@ void sna_copy_fbcon(struct sna *sna) if (fbcon == NULL) return; - if (fbcon->depth != sna->front->drawable.depth) + /* Wrap the fbcon in a pixmap so that we select the right formats + * in the render copy in case we need to preserve the fbcon + * across a depth change upon starting X. + */ + scratch = GetScratchPixmapHeader(sna->scrn->pScreen, + fbcon->width, fbcon->height, + fbcon->depth, fbcon->bpp, + 0, NULL); + if (scratch == NullPixmap) goto cleanup_fbcon; box.x1 = box.y1 = 0; @@ -542,7 +551,7 @@ void sna_copy_fbcon(struct sna *sna) bo = sna_create_bo_for_fbcon(sna, fbcon); if (bo == NULL) - goto cleanup_fbcon; + goto cleanup_scratch; priv = sna_pixmap(sna->front); assert(priv && priv->gpu_bo); @@ -560,7 +569,7 @@ void sna_copy_fbcon(struct sna *sna) dy = (sna->front->drawable.height - box.y2) / 2.; ok = sna->render.copy_boxes(sna, GXcopy, - sna->front, bo, sx, sy, + scratch, bo, sx, sy, sna->front, priv->gpu_bo, dx, dy, &box, 1); sna_damage_add_box(&priv->gpu_damage, &box); @@ -569,6 +578,8 @@ void sna_copy_fbcon(struct sna *sna) sna->scrn->pScreen->canDoBGNoneRoot = ok; +cleanup_scratch: + FreeScratchPixmapHeader(scratch); cleanup_fbcon: drmModeFreeFB(fbcon); } |