From patchwork Thu Feb 9 12:44:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13134515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E7DFC636D6 for ; Thu, 9 Feb 2023 12:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFC1510EAC1; Thu, 9 Feb 2023 12:46:38 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71E3410EAC1 for ; Thu, 9 Feb 2023 12:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Inj1IBfV14c20dmyZ/J7NK00GJjIwFxr42LgpgkWDvQ=; b=GBcbDHHbHYZN3vgkVcFmO5yNX9 KpOpvept3jMZFnUrRAhPYB0IT/3WQLEAy701EC1HANgLkv0YW1IArJcp1SbpMVYlrEp8mA5J/YPbc mduXxOjqA2q6Rlad5unNg4DAzpmKID0t07RXhV416FUoYNYvazOseTKuCwvgThZmc+b32DNNQwhTe MGmfULV8sHTMGAcw+oFo53f2aVporMlKMmQ5XNvVtDbVDNS3UmcWRxCPx+J3j4Dc8DiKl2++mtmgc R3fZCJ6nc+4Q8qQIscEofH5Tqi53pCFuCppdr7KysbqgB+BvaVs/igXCig9NA4yIFlpQTMdTLr5hc cpx65ZrA==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pQ6Jn-00DvU2-Js; Thu, 09 Feb 2023 13:46:28 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Luben Tuikov , David Airlie , Daniel Vetter , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Qiang Yu , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Rob Clark , Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Melissa Wen Subject: [PATCH v2 5/5] drm/v3d: Use drm_sched_job_add_syncobj_dependency() Date: Thu, 9 Feb 2023 09:44:48 -0300 Message-Id: <20230209124447.467867-6-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230209124447.467867-1-mcanal@igalia.com> References: <20230209124447.467867-1-mcanal@igalia.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ma=C3=ADra_Canal?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As v3d_job_add_deps() performs the same steps as drm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in v3d in order to simply use the DRM function. Signed-off-by: MaĆ­ra Canal Reviewed-by: Melissa Wen --- drivers/gpu/drm/v3d/v3d_gem.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 5da1806f3969..24cc65ffb4df 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -396,20 +396,6 @@ v3d_wait_bo_ioctl(struct drm_device *dev, void *data, return ret; } -static int -v3d_job_add_deps(struct drm_file *file_priv, struct v3d_job *job, - u32 in_sync, u32 point) -{ - struct dma_fence *in_fence = NULL; - int ret; - - ret = drm_syncobj_find_fence(file_priv, in_sync, point, 0, &in_fence); - if (ret == -EINVAL) - return ret; - - return drm_sched_job_add_dependency(&job->base, in_fence); -} - static int v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, void **container, size_t size, void (*free)(struct kref *ref), @@ -447,14 +433,14 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv, DRM_DEBUG("Failed to copy wait dep handle.\n"); goto fail_deps; } - ret = v3d_job_add_deps(file_priv, job, in.handle, 0); - if (ret) + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in.handle, 0); + if (ret && ret != -ENOENT) goto fail_deps; } } } else { - ret = v3d_job_add_deps(file_priv, job, in_sync, 0); - if (ret) + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, 0); + if (ret && ret != -ENOENT) goto fail_deps; }