summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-10-04 12:14:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-10-04 12:16:33 +0100
commit4d3b849c57d78f0447334c5c0871d8bd78e0af24 (patch)
treeea6d1379ebb8815fe2b61907dd7f8249744f2977 /src
parent4608e482615d4b4599608c7bc17ac8a9f9293840 (diff)
sna: Avoid using the gpu for uploads whilst wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_accel.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 5ebedad9..c159f43b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1377,12 +1377,16 @@ static inline bool use_cpu_bo_for_download(struct sna *sna,
return true;
}
-static inline bool use_cpu_bo_for_upload(struct sna_pixmap *priv,
+static inline bool use_cpu_bo_for_upload(struct sna *sna,
+ struct sna_pixmap *priv,
unsigned flags)
{
if (DBG_NO_CPU_UPLOAD)
return false;
+ if (wedged(sna))
+ return false;
+
if (priv->cpu_bo == NULL)
return false;
@@ -2425,7 +2429,7 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
if (n) {
bool ok = false;
- if (use_cpu_bo_for_upload(priv, 0)) {
+ if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,
@@ -2469,7 +2473,7 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
} else if (DAMAGE_IS_ALL(priv->cpu_damage) ||
sna_damage_contains_box__no_reduce(priv->cpu_damage, box)) {
bool ok = false;
- if (use_cpu_bo_for_upload(priv, 0)) {
+ if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,
@@ -2504,7 +2508,7 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
box = REGION_RECTS(&i);
ok = false;
- if (use_cpu_bo_for_upload(priv, 0)) {
+ if (use_cpu_bo_for_upload(sna, priv, 0)) {
DBG(("%s: using CPU bo for upload to GPU, %d boxes\n", __FUNCTION__, n));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,
@@ -3099,7 +3103,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
flags |= MOVE_ASYNC_HINT;
ok = false;
- if (use_cpu_bo_for_upload(priv, flags)) {
+ if (use_cpu_bo_for_upload(sna, priv, flags)) {
DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__));
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->cpu_bo, 0, 0,