diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-15 21:42:10 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-16 07:00:40 +0100 |
commit | 243bd26ad31776b2dc45563107e669cf7b45fd91 (patch) | |
tree | c17effd0074708980f71864364cfd583d7f106a8 /src | |
parent | 500e77d765580e8581c95117b941a4daa940c21e (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna.h | 4 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 11 | ||||
-rw-r--r-- | src/sna/sna_dri2.c | 11 |
3 files changed, 21 insertions, 5 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index a532b4af..76869444 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -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; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 930c40a2..d48321da 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -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; } diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 4bcc018e..9801aab6 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -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); } |