sna: Clear our private hints about front rendering exported bo

Unlike GLXWindows, GLXPixmaps are rendered directly into, without a
staging copy. Therefore we must treat those carefully when exported and
clear our hints everytime control passes back to the Client.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-15 21:42:10 +01:00
parent 500e77d765
commit 243bd26ad3
3 changed files with 21 additions and 5 deletions

View File

@ -148,7 +148,7 @@ struct sna_pixmap {
uint32_t clear_color;
#define SOURCE_BIAS 4
uint16_t source_count;
uint8_t source_count;
uint8_t pinned :4;
#define PIN_SCANOUT 0x1
#define PIN_DRI2 0x2
@ -159,7 +159,7 @@ struct sna_pixmap {
#define MAPPED_NONE 0
#define MAPPED_GTT 1
#define MAPPED_CPU 2
uint8_t flush :1;
uint8_t flush :2;
uint8_t shm :1;
uint8_t clear :1;
uint8_t header :1;

View File

@ -16659,8 +16659,15 @@ void sna_accel_flush(struct sna *sna)
priv->pixmap->drawable.serialNumber));
assert(priv->flush);
if (sna_pixmap_move_to_gpu(priv->pixmap,
MOVE_READ | __MOVE_FORCE))
kgem_bo_unclean(&sna->kgem, priv->gpu_bo);
MOVE_READ | __MOVE_FORCE)) {
if (priv->flush & 2) {
kgem_bo_unclean(&sna->kgem, priv->gpu_bo);
sna_damage_all(&priv->gpu_damage, priv->pixmap);
assert(priv->cpu_damage == NULL);
priv->clear = false;
priv->cpu = false;
}
}
}
(void)ret;
}

View File

@ -584,7 +584,16 @@ sna_dri2_create_buffer(DrawablePtr draw,
if (priv->gpu_bo->exec)
sna->kgem.flush = 1;
priv->flush = true;
priv->flush |= 1;
if (draw->type == DRAWABLE_PIXMAP) {
/* DRI2 renders directly into GLXPixmaps, treat as hostile */
kgem_bo_unclean(&sna->kgem, priv->gpu_bo);
sna_damage_all(&priv->gpu_damage, pixmap);
priv->clear = false;
priv->cpu = false;
priv->flush |= 2;
}
sna_accel_watch_flush(sna, 1);
}