diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-15 13:32:35 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-15 15:13:23 +0100 |
commit | a253c95ec63b2b075e66ae7380fed6a73469eba5 (patch) | |
tree | 48b89509f9eb4b4cd16443d823d7e1407b934c36 /src/sna/sna_accel.c | |
parent | ef6d94a8444927941db108811e1a26357dc3f18e (diff) |
sna: Prefer uploads to be staged in snoopable bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r-- | src/sna/sna_accel.c | 26 |
1 files 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; } |