summaryrefslogtreecommitdiff
path: root/src/sna/sna_io.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-12 14:04:50 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-12 14:58:51 +0100
commit0d17208a66a7e54d4106f8a4034d3a928e28bb62 (patch)
treea20adecdc28883009e9eae86baaa33b1b78441ce /src/sna/sna_io.c
parent4b4abdaae94d164d5d0b2755907e76b9cbe0c988 (diff)
sna: Avoid readback inplace if the target is unmappable
We have to use the tiling indirect path, or else fail. References: https://bugs.freedesktop.org/show_bug.cgi?id=54808 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_io.c')
-rw-r--r--src/sna/sna_io.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 0860dec2..d17f387f 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -80,6 +80,9 @@ static void read_boxes_inplace(struct kgem *kgem,
DBG(("%s x %d, tiling=%d\n", __FUNCTION__, n, bo->tiling));
+ if (!kgem_bo_can_map(kgem, bo))
+ return false;
+
kgem_bo_submit(kgem, bo);
src = kgem_bo_map(kgem, bo);
@@ -114,6 +117,9 @@ static void read_boxes_inplace(struct kgem *kgem,
static bool download_inplace(struct kgem *kgem, struct kgem_bo *bo)
{
+ if (!kgem_bo_can_map(kgem, bo))
+ return false;
+
if (FORCE_INPLACE)
return FORCE_INPLACE > 0;
@@ -531,12 +537,12 @@ static bool upload_inplace(struct kgem *kgem,
const BoxRec *box,
int n, int bpp)
{
- if (FORCE_INPLACE)
- return FORCE_INPLACE > 0;
-
if (!kgem_bo_can_map(kgem, bo))
return false;
+ if (FORCE_INPLACE)
+ return FORCE_INPLACE > 0;
+
/* If we are writing through the GTT, check first if we might be
* able to almagamate a series of small writes into a single
* operation.