sna/display: Apply damage for the fbcon copy

... so that any immediate shadow usage will read back the fbcon
contents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-06-17 09:37:15 +01:00
parent 39f0b0ae17
commit f3869d60cc
1 changed files with 11 additions and 6 deletions

View File

@ -498,7 +498,8 @@ void sna_copy_fbcon(struct sna *sna)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn);
drmModeFBPtr fbcon;
struct kgem_bo *fbcon_bo;
struct sna_pixmap *priv;
struct kgem_bo *bo;
BoxRec box;
int i;
@ -525,18 +526,22 @@ void sna_copy_fbcon(struct sna *sna)
box.x2 = fbcon->width;
box.y2 = fbcon->height;
fbcon_bo = sna_create_bo_for_fbcon(sna, fbcon);
if (fbcon_bo == NULL)
bo = sna_create_bo_for_fbcon(sna, fbcon);
if (bo == NULL)
goto cleanup_fbcon;
priv = sna_pixmap(sna->front);
assert(priv && priv->gpu_bo);
sna->render.copy_boxes(sna, GXcopy,
sna->front, fbcon_bo, 0, 0,
sna->front, sna_pixmap_get_bo(sna->front),
sna->front, bo, 0, 0,
sna->front, priv->gpu_bo,
(sna->front->drawable.width - fbcon->width)/2,
(sna->front->drawable.height - fbcon->height)/2,
&box, 1);
sna_damage_add_box(&priv->gpu_damage, &box);
kgem_bo_destroy(&sna->kgem, fbcon_bo);
kgem_bo_destroy(&sna->kgem, bo);
cleanup_fbcon:
drmModeFreeFB(fbcon);