drm/msm: move fence allocation out of msm_gpu_submit()
authorRob Clark <robdclark@gmail.com>
Thu, 16 Jun 2016 20:37:38 +0000 (16:37 -0400)
committerRob Clark <robdclark@gmail.com>
Thu, 15 Sep 2016 21:43:51 +0000 (17:43 -0400)
Prep work for next patch.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_gpu.h

index 3a4a8dd..65284fe 100644 (file)
@@ -488,7 +488,14 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
 
        submit->nr_cmds = i;
 
-       ret = msm_gpu_submit(gpu, submit, ctx);
+       submit->fence = msm_fence_alloc(gpu->fctx);
+       if (IS_ERR(submit->fence)) {
+               ret = PTR_ERR(submit->fence);
+               submit->fence = NULL;
+               goto out;
+       }
+
+       msm_gpu_submit(gpu, submit, ctx);
 
        args->fence = submit->fence->seqno;
 
index 36ed53e..5bb0983 100644 (file)
@@ -509,22 +509,15 @@ void msm_gpu_retire(struct msm_gpu *gpu)
 }
 
 /* add bo's to gpu's ring, and kick gpu: */
-int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
+void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
                struct msm_file_private *ctx)
 {
        struct drm_device *dev = gpu->dev;
        struct msm_drm_private *priv = dev->dev_private;
-       int i, ret;
+       int i;
 
        WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-       submit->fence = msm_fence_alloc(gpu->fctx);
-       if (IS_ERR(submit->fence)) {
-               ret = PTR_ERR(submit->fence);
-               submit->fence = NULL;
-               return ret;
-       }
-
        inactive_cancel(gpu);
 
        list_add_tail(&submit->node, &gpu->submit_list);
@@ -557,8 +550,6 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
        priv->lastctx = ctx;
 
        hangcheck_timer_reset(gpu);
-
-       return 0;
 }
 
 /*
index c902283..d61d98a 100644 (file)
@@ -163,7 +163,7 @@ int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime,
                uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs);
 
 void msm_gpu_retire(struct msm_gpu *gpu);
-int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
+void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
                struct msm_file_private *ctx);
 
 int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,