summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna.h4
-rw-r--r--src/sna/sna_accel.c11
-rw-r--r--src/sna/sna_dri2.c11
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);
}