summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/qxl/qxl_fence.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-07-23 04:16:42 (GMT)
committerDave Airlie <airlied@redhat.com>2013-07-24 01:58:10 (GMT)
commit8002db6336dd361fc13214e9515fe5d52ff294ee (patch)
tree67a6fad200b33eada21944d3e42911a32f523705 /drivers/gpu/drm/qxl/qxl_fence.c
parent4f49ec92be64ad1d96cf5d26fc8276f9849202a3 (diff)
downloadlinux-fsl-qoriq-8002db6336dd361fc13214e9515fe5d52ff294ee.tar.xz
qxl: convert qxl driver to proper use for reservations
The recent addition of lockdep support to reservations and their subsequent use by TTM showed up a number of potential problems with the way qxl was using TTM objects. a) it was allocating objects, and reserving them later without validating underneath the reservation, which meant in extreme conditions the objects could be evicted before the reservation ever used them. b) it was reserving objects straight after allocating them, but with no ability to back off should the reservations fail. It now allocates the necessary objects then does a complete reservation pass on them to avoid deadlocks. c) it had two lists per release tracking objects, unnecessary complicating the reservation process. This patch removes the dual object tracking, adds reservations ticket support to the release and fence object handling. It then ports the internal fb drawing code and the userspace facing ioctl to use the new interfaces properly, along with cleanup up the error path handling in some codepaths. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_fence.c')
-rw-r--r--drivers/gpu/drm/qxl/qxl_fence.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_fence.c b/drivers/gpu/drm/qxl/qxl_fence.c
index 63c6715..ae59e91 100644
--- a/drivers/gpu/drm/qxl/qxl_fence.c
+++ b/drivers/gpu/drm/qxl/qxl_fence.c
@@ -49,17 +49,11 @@
For some reason every so often qxl hw fails to release, things go wrong.
*/
-
-
-int qxl_fence_add_release(struct qxl_fence *qfence, uint32_t rel_id)
+/* must be called with the fence lock held */
+void qxl_fence_add_release_locked(struct qxl_fence *qfence, uint32_t rel_id)
{
- struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence);
-
- spin_lock(&bo->tbo.bdev->fence_lock);
radix_tree_insert(&qfence->tree, rel_id, qfence);
qfence->num_active_releases++;
- spin_unlock(&bo->tbo.bdev->fence_lock);
- return 0;
}
int qxl_fence_remove_release(struct qxl_fence *qfence, uint32_t rel_id)