From e0463036bbd4e5f0201e122f9b29dd776ba4446f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 9 Jan 2015 16:45:32 +0000 Subject: [PATCH] sna: Replace assert with conditional setting of sna_pixmap->mapped The status of sna_pixmap->mapped was changed with the introduction of mmap(wc), but the code was still asserting that the mmap could only be cached. References: https://bugs.freedesktop.org/show_bug.cgi?id=88112#c20 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index bc936746..f1c028c2 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4873,6 +4873,7 @@ try_upload__inplace(PixmapPtr pixmap, RegionRec *region, pixmap->devPrivate.ptr = dst; pixmap->devKind = priv->gpu_bo->pitch; priv->mapped = dst == MAP(priv->gpu_bo->map__cpu) ? MAPPED_CPU : MAPPED_GTT; + priv->cpu &= priv->mapped == MAPPED_CPU; assert(has_coherent_ptr(sna, priv, MOVE_WRITE)); box = region_rects(region); @@ -6274,12 +6275,14 @@ upload_inplace: } while (--n); if (!dst_priv->shm) { - assert(ptr == MAP(dst_priv->gpu_bo->map__cpu)); dst_pixmap->devPrivate.ptr = ptr; dst_pixmap->devKind = dst_priv->gpu_bo->pitch; - dst_priv->mapped = MAPPED_CPU; + if (ptr == MAP(dst_priv->gpu_bo->map__cpu)) { + dst_priv->mapped = MAPPED_CPU; + dst_priv->cpu = true; + } else + dst_priv->cpu = false; assert_pixmap_map(dst_pixmap, dst_priv); - dst_priv->cpu = true; } } @@ -16855,7 +16858,7 @@ sna_get_image__inplace(PixmapPtr pixmap, pixmap->devKind = priv->gpu_bo->pitch; priv->mapped = src == MAP(priv->gpu_bo->map__cpu) ? MAPPED_CPU : MAPPED_GTT; assert_pixmap_map(pixmap, priv); - priv->cpu = true; + priv->cpu &= priv->mapped == MAPPED_CPU; } }