From patchwork Mon Oct 1 12:31:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sharat Masetty X-Patchwork-Id: 10622001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0FEB16B1 for ; Mon, 1 Oct 2018 12:32:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FEE929561 for ; Mon, 1 Oct 2018 12:32:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9453C29567; Mon, 1 Oct 2018 12:32:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 335A229563 for ; Mon, 1 Oct 2018 12:32:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2F6F6E17A; Mon, 1 Oct 2018 12:32:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE3A96E16A; Mon, 1 Oct 2018 12:32:07 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AB50760C64; Mon, 1 Oct 2018 12:32:07 +0000 (UTC) Received: from smasetty-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: smasetty@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 249FD60C84; Mon, 1 Oct 2018 12:32:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 249FD60C84 From: Sharat Masetty To: freedreno@lists.freedesktop.org Subject: [PATCH 04/13] drm/msm: Change the name of the fence to hw_fence Date: Mon, 1 Oct 2018 18:01:36 +0530 Message-Id: <1538397105-19581-5-git-send-email-smasetty@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538397105-19581-1-git-send-email-smasetty@codeaurora.org> References: <1538397105-19581-1-git-send-email-smasetty@codeaurora.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Sharat Masetty , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We are going to soon deal with lot more fences, so change the generic name 'fence' to hw_fence to denote association with an actual hardware submission. Signed-off-by: Sharat Masetty --- drivers/gpu/drm/msm/msm_gem.h | 2 +- drivers/gpu/drm/msm/msm_gem_submit.c | 17 ++++++++--------- drivers/gpu/drm/msm/msm_gpu.c | 16 ++++++++-------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h index 289abe5..cae3aa5 100644 --- a/drivers/gpu/drm/msm/msm_gem.h +++ b/drivers/gpu/drm/msm/msm_gem.h @@ -143,7 +143,7 @@ struct msm_gem_submit { struct list_head bo_list; struct ww_acquire_ctx ticket; uint32_t seqno; /* Sequence number of the submit on the ring */ - struct dma_fence *fence; + struct dma_fence *hw_fence; int out_fence_id; struct msm_gpu_submitqueue *queue; struct pid *pid; /* submitting process */ diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 14906b9..fd28ace 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -48,7 +48,7 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev, submit->dev = dev; submit->gpu = gpu; submit->ctx = ctx; - submit->fence = NULL; + submit->hw_fence = NULL; submit->out_fence_id = -1; submit->pid = get_pid(task_pid(current)); submit->cmd = (void *)&submit->bos[nr_bos]; @@ -70,7 +70,7 @@ void msm_gem_submit_free(struct msm_gem_submit *submit) { idr_remove(&submit->ring->fence_idr, submit->out_fence_id); - dma_fence_put(submit->fence); + dma_fence_put(submit->hw_fence); list_del(&submit->node); put_pid(submit->pid); msm_submitqueue_put(submit->queue); @@ -563,9 +563,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, submit->nr_cmds = i; msm_gpu_submit(submit); - if (IS_ERR(submit->fence)) { - ret = PTR_ERR(submit->fence); - submit->fence = NULL; + if (IS_ERR(submit->hw_fence)) { + ret = PTR_ERR(submit->hw_fence); + submit->hw_fence = NULL; goto out; } @@ -573,9 +573,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, * No protection should be okay here since this is protected by the big * GPU lock. */ - submit->out_fence_id = idr_alloc_cyclic(&ring->fence_idr, submit->fence, - 0, INT_MAX, GFP_KERNEL); - + submit->out_fence_id = idr_alloc_cyclic(&ring->fence_idr, + submit->hw_fence, 0, INT_MAX, GFP_KERNEL); if (submit->out_fence_id < 0) { ret = -ENOMEM; goto out; @@ -584,7 +583,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, args->fence = submit->out_fence_id; if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) { - sync_file = sync_file_create(submit->fence); + sync_file = sync_file_create(submit->hw_fence); if (!sync_file) { ret = -ENOMEM; goto out; diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 5f9cd85..449cc23 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -287,7 +287,7 @@ static void update_fences(struct msm_gpu *gpu, struct msm_ringbuffer *ring, break; msm_update_fence(submit->ring->fctx, - submit->fence->seqno); + submit->hw_fence->seqno); } } @@ -573,7 +573,7 @@ static void retire_submits(struct msm_gpu *gpu) struct msm_ringbuffer *ring = gpu->rb[i]; list_for_each_entry_safe(submit, tmp, &ring->submits, node) { - if (dma_fence_is_signaled(submit->fence)) + if (dma_fence_is_signaled(submit->hw_fence)) retire_submit(gpu, submit); } } @@ -612,9 +612,9 @@ struct dma_fence *msm_gpu_submit(struct msm_gem_submit *submit) WARN_ON(!mutex_is_locked(&dev->struct_mutex)); - submit->fence = msm_fence_alloc(ring->fctx); - if (IS_ERR(submit->fence)) - return submit->fence; + submit->hw_fence = msm_fence_alloc(ring->fctx); + if (IS_ERR(submit->hw_fence)) + return submit->hw_fence; pm_runtime_get_sync(&gpu->pdev->dev); @@ -643,9 +643,9 @@ struct dma_fence *msm_gpu_submit(struct msm_gem_submit *submit) submit->gpu->aspace, &iova); if (submit->bos[i].flags & MSM_SUBMIT_BO_WRITE) - msm_gem_move_to_active(&msm_obj->base, gpu, true, submit->fence); + msm_gem_move_to_active(&msm_obj->base, gpu, true, submit->hw_fence); else if (submit->bos[i].flags & MSM_SUBMIT_BO_READ) - msm_gem_move_to_active(&msm_obj->base, gpu, false, submit->fence); + msm_gem_move_to_active(&msm_obj->base, gpu, false, submit->hw_fence); } gpu->funcs->submit(gpu, submit, submit->ctx); @@ -653,7 +653,7 @@ struct dma_fence *msm_gpu_submit(struct msm_gem_submit *submit) hangcheck_timer_reset(gpu); - return submit->fence; + return submit->hw_fence; } /*