From a253c95ec63b2b075e66ae7380fed6a73469eba5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 15 Jul 2012 13:32:35 +0100 Subject: sna: Prefer uploads to be staged in snoopable bo Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 92aca239..bc73dee1 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2995,6 +2995,25 @@ static bool upload_inplace(struct sna *sna, return false; } + if (sna->kgem.has_llc) { + if (priv->cpu_bo) { + if (priv->cpu_damage && + kgem_bo_is_busy(priv->cpu_bo) && + !region_subsumes_damage(region, priv->cpu_damage)) { + DBG(("%s? yes, CPU bo is busy\n", __FUNCTION__)); + return true; + } + + DBG(("%s? no, have CPU bo\n", __FUNCTION__)); + return false; + } + + if (priv->create & KGEM_CAN_CREATE_CPU) { + DBG(("%s? no, can create CPU bo\n", __FUNCTION__)); + return false; + } + } + if (priv->gpu_bo) { assert(priv->gpu_bo->proxy == NULL); @@ -3016,13 +3035,6 @@ static bool upload_inplace(struct sna *sna, } - if (priv->cpu_bo) { - if (kgem_bo_is_busy(priv->cpu_bo)) { - DBG(("%s? yes, CPU bo is busy\n", __FUNCTION__)); - return true; - } - } - DBG(("%s? no\n", __FUNCTION__)); return false; } -- cgit v1.2.3