summaryrefslogtreecommitdiff
path: root/src/sna/sna_blt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-23 21:42:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-23 21:44:56 +0100
commitc6008068372709c73034163eddc902b47bf87d24 (patch)
treefecb14023efb69af1923e2f95742545116ad38f8 /src/sna/sna_blt.c
parent5ed840881c26e90eb8e00521b6d77b0ea514de5e (diff)
sna: Check against op->dst.bo rather than priv->cpu_bo for composite upload
In this case, we may also be handling an unattached pixmap, so avoid the deferences of the sna_pixmap unless we are sure it will exist. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_blt.c')
-rw-r--r--src/sna/sna_blt.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index b5d7ea7f..94b5f4a7 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1871,19 +1871,19 @@ clear:
goto put;
}
} else {
- struct sna_pixmap *priv;
-
put:
- priv = sna_pixmap(tmp->dst.pixmap);
- if (priv->cpu_bo && tmp->dst.bo == priv->cpu_bo) {
- assert(kgem_bo_is_busy(tmp->dst.bo));
- tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
- FORCE_GPU | PREFER_GPU,
- &dst_box,
- &tmp->damage);
+ if (tmp->dst.bo) {
+ struct sna_pixmap *priv = sna_pixmap(tmp->dst.pixmap);
if (tmp->dst.bo == priv->cpu_bo) {
- DBG(("%s: forcing the stall to overwrite a busy CPU bo\n", __FUNCTION__));
- tmp->dst.bo = NULL;
+ assert(kgem_bo_is_busy(tmp->dst.bo));
+ tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
+ FORCE_GPU | PREFER_GPU,
+ &dst_box,
+ &tmp->damage);
+ if (tmp->dst.bo == priv->cpu_bo) {
+ DBG(("%s: forcing the stall to overwrite a busy CPU bo\n", __FUNCTION__));
+ tmp->dst.bo = NULL;
+ }
}
}