summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-10-31 20:38:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-10-31 20:40:59 +0000
commitcc3b8a542ecb1ba873efefaeab630fa8f69b5b96 (patch)
tree5e7ed6eede963a3dc031b4fd4f65bcac4c0c9bd8 /src/sna/kgem.c
parent122f6065604480a57b86f04d5d09011ee6e8829b (diff)
sna: Treat external bo carefully when marking as idle
When we flag a bo as being externally modified, we set a special flag on its request pointer. This forces us to inspect whether the bo is busy before accessing it the next, and if it is idle, we must be careful that we then do not dereference the special request. Fixes regression from commit 9115406b651eb11779f37c4b048d55188b9d6e02 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Oct 30 19:21:02 2014 +0000 sna: Retire all requests when a bo is found to be not busy Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f5cdc6c2..eb2a3d9a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2704,13 +2704,17 @@ bool __kgem_ring_is_idle(struct kgem *kgem, int ring)
return true;
}
-void __kgem_retire_requests_upto(struct kgem *kgem, struct kgem_request *rq)
+void __kgem_retire_requests_upto(struct kgem *kgem, struct kgem_bo *bo)
{
+ struct kgem_request *rq = bo->rq, *tmp;
struct list *requests = &kgem->requests[RQ_RING(rq) == I915_EXEC_BLT];
- struct kgem_request *tmp;
rq = RQ(rq);
assert(rq != &kgem->static_request);
+ if (rq == (struct kgem_request *)kgem) {
+ __kgem_bo_clear_busy(bo);
+ return;
+ }
do {
tmp = list_first_entry(requests, struct kgem_request, list);