aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-03-22 12:23:43 +0100
committerLucas Stach <l.stach@pengutronix.de>2017-03-29 15:52:26 +0200
commitb27734c29c9ac50f7f843bc5372a7b4665aade87 (patch)
tree7ea31bf4b47cf0526cf3c7e70af9fe26abf8b434 /drivers/gpu/drm/etnaviv
parentBackMerge tag 'v4.11-rc3' into drm-next (diff)
downloadlinux-dev-b27734c29c9ac50f7f843bc5372a7b4665aade87.tar.xz
linux-dev-b27734c29c9ac50f7f843bc5372a7b4665aade87.zip
drm/etnaviv: add lockdep assert to fence allocation
Make sure the GPU lock is taken, so that fence completion order matches seqno order. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 130d7d517a19..a81a2e84f6ad 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1051,6 +1051,12 @@ static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu)
{
struct etnaviv_fence *f;
+ /*
+ * GPU lock must already be held, otherwise fence completion order might
+ * not match the seqno order assigned here.
+ */
+ lockdep_assert_held(&gpu->lock);
+
f = kzalloc(sizeof(*f), GFP_KERNEL);
if (!f)
return NULL;