xf86-video-intel: 2 commits - src/sna/kgem.c src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Wed Aug 15 10:16:35 PDT 2012
src/sna/kgem.c | 3 ++-
src/sna/sna_accel.c | 25 +++++++++++++++++++++----
2 files changed, 23 insertions(+), 5 deletions(-)
New commits:
commit 2554d0d76e0fcae6e324938c28bb50deeb8814dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 15 18:04:18 2012 +0100
sna: Submit the batch upon destroying a ShmPixmap
The midlayer has already detached the pixmap from the segment (possibly
destroying that segment in the process, thanks midlayer!) so we need to
submit the batch asap before the segment disappears.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6db986f..a3df628 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2186,13 +2186,14 @@ void _kgem_submit(struct kgem *kgem)
break;
}
}
- ErrorF("exec[%d] = handle:%d, presumed offset: %x, size: %d, tiling %d, fenced %d, deleted %d\n",
+ ErrorF("exec[%d] = handle:%d, presumed offset: %x, size: %d, tiling %d, fenced %d, snooped %d, deleted %d\n",
i,
kgem->exec[i].handle,
(int)kgem->exec[i].offset,
found ? kgem_bo_size(found) : -1,
found ? found->tiling : -1,
(int)(kgem->exec[i].flags & EXEC_OBJECT_NEEDS_FENCE),
+ found ? found->snoop : -1,
found ? found->purged : -1);
}
for (i = 0; i < kgem->nreloc; i++) {
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 95d2b1a..661dde0 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1033,6 +1033,7 @@ static void __sna_free_pixmap(struct sna *sna,
sna_pixmap_free_cpu(sna, priv);
if (priv->header) {
+ assert(!priv->shm);
pixmap->devPrivate.ptr = sna->freed_pixmap;
sna->freed_pixmap = pixmap;
} else {
@@ -1062,9 +1063,10 @@ static Bool sna_destroy_pixmap(PixmapPtr pixmap)
if (priv->gpu_bo)
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
- if (priv->shm && priv->cpu_bo->rq)
+ if (priv->shm && kgem_bo_is_busy(priv->cpu_bo)) {
+ kgem_bo_submit(&sna->kgem, priv->cpu_bo); /* XXX ShmDetach */
add_flush_pixmap(sna, priv);
- else
+ } else
__sna_free_pixmap(sna, pixmap, priv);
return TRUE;
}
commit 4e604d721be5a1c0f8eaf91e3a5cf8c01a609a69
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 15 16:53:20 2012 +0100
sna: Flush shm pixmaps after upload
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0e99aa6..95d2b1a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1264,8 +1264,7 @@ skip_inplace_map:
if (kgem_bo_is_busy(priv->cpu_bo)) {
DBG(("%s: discarding busy CPU bo\n", __FUNCTION__));
- assert(priv->gpu_bo);
- assert(priv->gpu_damage == NULL);
+ assert(priv->gpu_bo == NULL || priv->gpu_damage == NULL);
sna_damage_destroy(&priv->cpu_damage);
priv->undamaged = false;
@@ -2209,6 +2208,10 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, n, 0);
+ if (ok && priv->shm) {
+ assert(!priv->flush);
+ add_flush_pixmap(sna, priv);
+ }
}
if (!ok) {
if (pixmap->devPrivate.ptr == NULL) {
@@ -2249,6 +2252,10 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, 1, 0);
+ if (ok && priv->shm) {
+ assert(!priv->flush);
+ add_flush_pixmap(sna, priv);
+ }
}
if (!ok) {
if (pixmap->devPrivate.ptr == NULL) {
@@ -2280,6 +2287,10 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, n, 0);
+ if (ok && priv->shm) {
+ assert(!priv->flush);
+ add_flush_pixmap(sna, priv);
+ }
}
if (!ok) {
if (pixmap->devPrivate.ptr == NULL) {
@@ -2776,6 +2787,10 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
pixmap, priv->cpu_bo, 0, 0,
pixmap, priv->gpu_bo, 0, 0,
box, n, 0);
+ if (ok && priv->shm) {
+ assert(!priv->flush);
+ add_flush_pixmap(sna, priv);
+ }
}
if (!ok) {
if (pixmap->devPrivate.ptr == NULL) {
More information about the xorg-commit
mailing list