Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
authorDave Airlie <airlied@redhat.com>
Tue, 7 Aug 2018 20:07:06 +0000 (06:07 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Aug 2018 20:07:30 +0000 (06:07 +1000)
From: Lucas Stach <l.stach@pengutronix.de>
"not much to de-stage this time. Changes from Philipp and Souptick to
use memset32 more and switch the fault handler to the new vm_fault_t
and two small fixes for issues that can be hit in rare corner cases
from me."

Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1533563808.2809.7.camel@pengutronix.de
1  2 
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
drivers/gpu/drm/etnaviv/etnaviv_sched.c

Simple merge
@@@ -140,15 -140,21 +140,21 @@@ static const struct drm_sched_backend_o
  int etnaviv_sched_push_job(struct drm_sched_entity *sched_entity,
                           struct etnaviv_gem_submit *submit)
  {
-       int ret;
+       int ret = 0;
+       /*
+        * Hold the fence lock across the whole operation to avoid jobs being
+        * pushed out of order with regard to their sched fence seqnos as
+        * allocated in drm_sched_job_init.
+        */
+       mutex_lock(&submit->gpu->fence_lock);
  
 -      ret = drm_sched_job_init(&submit->sched_job, &submit->gpu->sched,
 -                               sched_entity, submit->cmdbuf.ctx);
 +      ret = drm_sched_job_init(&submit->sched_job, sched_entity,
 +                               submit->cmdbuf.ctx);
        if (ret)
-               return ret;
+               goto out_unlock;
  
        submit->out_fence = dma_fence_get(&submit->sched_job.s_fence->finished);
-       mutex_lock(&submit->gpu->fence_idr_lock);
        submit->out_fence_id = idr_alloc_cyclic(&submit->gpu->fence_idr,
                                                submit->out_fence, 0,
                                                INT_MAX, GFP_KERNEL);