diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-16 10:27:50 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-16 12:18:28 +0000 |
commit | 587452a6ad7ac57e37820c72220c4944451315a8 (patch) | |
tree | 422faf445cc6417356fd7baf3a47a34e7ba9ebe8 | |
parent | 40beee995e71b1fa4cd146a986f53e03595a4378 (diff) |
sna: Make the temporary upload pixmap as having a statically allocated pointer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f6aee3cb..fee58574 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3681,11 +3681,13 @@ sna_pixmap_create_upload(ScreenPtr screen, if (sna->freed_pixmap) { pixmap = sna->freed_pixmap; sna->freed_pixmap = pixmap->devPrivate.ptr; + assert(pixmap->refcnt == 0); pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pixmap->refcnt = 1; } else { - pixmap = create_pixmap(sna, screen, 0, 0, depth, 0); + pixmap = create_pixmap(sna, screen, 0, 0, depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pixmap) return NullPixmap; @@ -3725,6 +3727,8 @@ sna_pixmap_create_upload(ScreenPtr screen, pixmap->devKind = priv->gpu_bo->pitch; pixmap->devPrivate.ptr = ptr; + priv->ptr = MAKE_STATIC_PTR(ptr); + priv->stride = priv->gpu_bo->pitch; pixmap->usage_hint = 0; if (!kgem_buffer_is_inplace(priv->gpu_bo)) |