summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-11-17 11:14:58 +0100
committerLucas Stach <l.stach@pengutronix.de>2018-01-02 17:02:48 +0100
commitd6a8743dd8cc1e2ca5e40e07fe3de7557ac117a0 (patch)
tree87b60be60f5b9b9250bb5456f67d86d17fbe5da8 /drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
parentb9a48aa76c72fb4d0990425f82fdeb4fdff2b2b1 (diff)
drm/etnaviv: split obj locks in different classes depending on the obj type
Userptr, prime and shmem buffer objects have different lock ordering requirements. This is mostly due to the fact that we don't allow to mmap userptr buffers, so we won't ever end up in our fault handler for those, so some of the code paths are never called with the mmap_sem held. To avoid lockdep false positives, split them up into different lock classes. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
index ae884723e9b1..ea87bf87b187 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -19,6 +19,7 @@
#include "etnaviv_drv.h"
#include "etnaviv_gem.h"
+static struct lock_class_key etnaviv_prime_lock_class;
struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)
{
@@ -125,6 +126,8 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
if (ret < 0)
return ERR_PTR(ret);
+ lockdep_set_class(&etnaviv_obj->lock, &etnaviv_prime_lock_class);
+
npages = size / PAGE_SIZE;
etnaviv_obj->sgt = sgt;