sna/dri: Make sure we discard the existing mappings when swapping GPU bo
If the GPU bo is currently mapped to the Pixmap, we need to be sure to invalidate that mapping if we swap the GPU bo (for SwapBuffers). If we forget, we leave a dangling pointer to chase. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60042 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
cf9b9ac318
commit
de28027ffc
|
|
@ -498,6 +498,12 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
|
|||
if (priv->gpu_bo != bo) {
|
||||
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
|
||||
priv->gpu_bo = ref(bo);
|
||||
if (priv->mapped) {
|
||||
assert(!priv->shm && priv->stride);
|
||||
pixmap->devPrivate.ptr = PTR(priv->ptr);
|
||||
pixmap->devKind = priv->stride;
|
||||
priv->mapped = false;
|
||||
}
|
||||
}
|
||||
if (bo->domain != DOMAIN_GPU)
|
||||
bo->domain = DOMAIN_NONE;
|
||||
|
|
|
|||
Loading…
Reference in New Issue