From patchwork Wed Feb 8 19:48:13 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: 13133640 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 3F7A6C636D3 for ; Wed, 8 Feb 2023 19:49:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9959810E844; Wed, 8 Feb 2023 19:49:02 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id B8EB410E18F for ; Wed, 8 Feb 2023 19:48:59 +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=iUG1WhmhL6DueyVykI/Mnd37jhIwHZYrkso70sb5BWg=; b=E8B/Fhu6dNONP7Gf3IElMhKTsR NS8FywW+ifZj+r6aF9yXq1jMH/yTpM5ORJ8xJqjLFU9jv6aYy1C0+pbLcE/x7xiPcdNqUsJZ/AUen MfnQG1c1JpVAjtjgLihcX59TpspC5O+HPYIlx9IZzl0l5b6iO68k+9tvmexZiI8K39rZwmDCSgqfg EtriNk/byNo9+SoxykUXCEP5utONiT2mkXJThc+0BNkhfjmKH0Dc0FS2mOq+E0Qos6cSn95LGOLsC idNAJKPVcmd/Y+sPh1SAIipUFke51jWy7085iGctmzroLQAczBTOqZ/YjmchF03adv7UuGboITe0Y 4vpxvpsA==; 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 1pPqQv-00DCm6-TW; Wed, 08 Feb 2023 20:48:46 +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 1/5] drm/sched: Create wrapper to add a syncobj dependency to job Date: Wed, 8 Feb 2023 16:48:13 -0300 Message-Id: <20230208194817.199932-2-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208194817.199932-1-mcanal@igalia.com> References: <20230208194817.199932-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" In order to add a syncobj's fence as a dependency to a job, it is necessary to call drm_syncobj_find_fence() to find the fence and then add the dependency with drm_sched_job_add_dependency(). So, wrap these steps in one single function, drm_sched_job_add_syncobj_dependency(). Signed-off-by: Maíra Canal --- drivers/gpu/drm/scheduler/sched_main.c | 29 ++++++++++++++++++++++++++ include/drm/gpu_scheduler.h | 6 ++++++ 2 files changed, 35 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 0e4378420271..d5331b1877a3 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -718,6 +719,34 @@ int drm_sched_job_add_dependency(struct drm_sched_job *job, } EXPORT_SYMBOL(drm_sched_job_add_dependency); +/** + * drm_sched_job_add_syncobj_dependency - adds a syncobj's fence as a job dependency + * @job: scheduler job to add the dependencies to + * @file_private: drm file private pointer + * @handle: syncobj handle to lookup + * @point: timeline point + * + * This adds the fence matching the given syncobj to @job. + * + * Returns: + * 0 on success, or an error on failing to expand the array. + */ +int drm_sched_job_add_syncobj_dependency(struct drm_sched_job *job, + struct drm_file *file, + u32 handle, + u32 point) +{ + struct dma_fence *fence; + int ret = 0; + + ret = drm_syncobj_find_fence(file, handle, point, 0, &fence); + if (ret) + return ret; + + return drm_sched_job_add_dependency(job, fence); +} +EXPORT_SYMBOL(drm_sched_job_add_syncobj_dependency); + /** * drm_sched_job_add_resv_dependencies - add all fences from the resv to the job * @job: scheduler job to add the dependencies to diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 9935d1e2ff69..4cc54f8b57b4 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -48,6 +48,8 @@ struct drm_gem_object; struct drm_gpu_scheduler; struct drm_sched_rq; +struct drm_file; + /* These are often used as an (initial) index * to an array, and as such should start at 0. */ @@ -515,6 +517,10 @@ int drm_sched_job_init(struct drm_sched_job *job, void drm_sched_job_arm(struct drm_sched_job *job); int drm_sched_job_add_dependency(struct drm_sched_job *job, struct dma_fence *fence); +int drm_sched_job_add_syncobj_dependency(struct drm_sched_job *job, + struct drm_file *file, + u32 handle, + u32 point); int drm_sched_job_add_resv_dependencies(struct drm_sched_job *job, struct dma_resv *resv, enum dma_resv_usage usage); From patchwork Wed Feb 8 19:48:14 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: 13133641 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 ADBCBC636D6 for ; Wed, 8 Feb 2023 19:49:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03D1E10E84A; Wed, 8 Feb 2023 19:49:10 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB39910E850 for ; Wed, 8 Feb 2023 19:49:07 +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=wAVkk88UB+qmi2JVNKR/kpIZ2+DOKPhGRy3Uq4cU4R0=; b=T9WyGxyIJCejL/SUsHc4fefiPv sROw3VK86V18rY4OeI5F+ruQYBgtWHA8DpPA8G9/SQeFn5jSecsL37EDgIA3Gz9UNKZksOCdrPbL2 ePC4KwBbNulw0EL19de5QEPfab5D9p2u/I8srX89dHbfBTfJU6Ee2xLYzft59VvqtoN1o68SEE3Ll TvjirDfUxzXOvXZo6YKnpu8vxDvSJ1Z8CjslOIDYH9nDDIExWktWreaZ3GhrOkELR7c4d9YMB8Mcq eioNnDx3rxEgO0apfYe3mIwSKfx8OdVpQHKUJHXjpm6E9vTOa5XqE6cXcftfkyeMLJTOAzTvDCxoN WADKaxvg==; 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 1pPqR2-00DCm6-6T; Wed, 08 Feb 2023 20:48:52 +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 2/5] drm/lima: Use drm_sched_job_add_syncobj_dependency() Date: Wed, 8 Feb 2023 16:48:14 -0300 Message-Id: <20230208194817.199932-3-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208194817.199932-1-mcanal@igalia.com> References: <20230208194817.199932-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 lima_gem_add_deps() performs the same steps as drm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in Lima in order to simply, using the DRM function. Signed-off-by: Maíra Canal --- drivers/gpu/drm/lima/lima_gem.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 0f1ca0b0db49..10252dc11a22 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -277,21 +277,13 @@ static int lima_gem_add_deps(struct drm_file *file, struct lima_submit *submit) int i, err; for (i = 0; i < ARRAY_SIZE(submit->in_sync); i++) { - struct dma_fence *fence = NULL; - if (!submit->in_sync[i]) continue; - err = drm_syncobj_find_fence(file, submit->in_sync[i], - 0, 0, &fence); + err = drm_sched_job_add_syncobj_dependency(&submit->task->base, file, + submit->in_sync[i], 0); if (err) return err; - - err = drm_sched_job_add_dependency(&submit->task->base, fence); - if (err) { - dma_fence_put(fence); - return err; - } } return 0; From patchwork Wed Feb 8 19:48:15 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: 13133642 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 7314BC636D3 for ; Wed, 8 Feb 2023 19:49:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADF5410E84C; Wed, 8 Feb 2023 19:49:11 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AD5D10E850 for ; Wed, 8 Feb 2023 19:49:08 +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=kn107+SXlxAWmhC4HEpIit/pXkRYGFQc+mDnsy3ujr4=; b=BjQChNRgNo05LjogkrCidR+j2F S4hsoYMOw1JKEkxxegsFBj7rAeuqhtQNs1elwoJwZZzsJJa6FHsgIH0p3Dii+V+KCgip+++/fNqBC 7QhgX5XItAEtcuqamaDkEsuiZy+En5PTT/DqOQZq08du/4VGaC/SHhJuVyLp7XdvMNJsWD4wGXU4Q T/JCMZgZ5qqOhxl7sgqAdEB0O596057Jp0S7Z3p/DMDFH1qmEZsXu/Re9MouGXUA4Ydm0hDAN+FOA VTmr2p+0FrW5j8yMTxnmWwnORRRvIrxrC3vEz/3bsrJAQdkBVR6fqBxgJZ8n6mM42RRx0tMFru+X9 pjuwqBSw==; 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 1pPqR8-00DCm6-6X; Wed, 08 Feb 2023 20:48:58 +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 3/5] drm/msm: Use drm_sched_job_add_syncobj_dependency() Date: Wed, 8 Feb 2023 16:48:15 -0300 Message-Id: <20230208194817.199932-4-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208194817.199932-1-mcanal@igalia.com> References: <20230208194817.199932-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 msm_parse_deps() performs the same steps as drm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in msm in order to simply, using the DRM function. Signed-off-by: Maíra Canal --- drivers/gpu/drm/msm/msm_gem_submit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 73a2ca122c57..622f1e27fcca 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -570,12 +570,8 @@ static struct drm_syncobj **msm_parse_deps(struct msm_gem_submit *submit, break; } - ret = drm_syncobj_find_fence(file, syncobj_desc.handle, - syncobj_desc.point, 0, &fence); - if (ret) - break; - - ret = drm_sched_job_add_dependency(&submit->base, fence); + ret = drm_sched_job_add_syncobj_dependency(&submit->base, file, + syncobj_desc.handle, syncobj_desc.point); if (ret) break; From patchwork Wed Feb 8 19:48:16 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: 13133643 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 B5AFFC636D3 for ; Wed, 8 Feb 2023 19:49:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6E8610E84D; Wed, 8 Feb 2023 19:49:18 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6EEA410E850 for ; Wed, 8 Feb 2023 19:49:15 +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=0pGl79w6iXpODRxnsOAlv49cl0bK3ENT/e5Yifg/O84=; b=oVrb+7FKAIU2bAUFeUytFNkemI jcfCK/71aBm1JcHrIwWu3hfDkECAIOm5WmnMiOTaG0TsAbvrC7UK44V3Ikf1ai0hxuPE6bADCICDF fNASgtIwM9wRzpwt1OT0ZsmONSP15CQMquXKQ5QbtfbeHZ8CjohZSi1OytnXTOhgLIgCDGkjowxIF mKW4FSiMv5ZNNANxgdDLwbsSXoyN+Utpf2VpmHbWQ2L6Dc78eveoCS2UahWXhjKGEHTTEinn/xkEm Lxw76eIdglx1o1kXcxt+ahRQlkfC0nLjCTLySEqISOtW0zzHLCZr0fGfbgzjV8i9uW5KGtJ+7pNwe CqJquv9w==; 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 1pPqRE-00DCm6-Eb; Wed, 08 Feb 2023 20:49:04 +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 4/5] drm/panfrost: Use drm_sched_job_add_syncobj_dependency() Date: Wed, 8 Feb 2023 16:48:16 -0300 Message-Id: <20230208194817.199932-5-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208194817.199932-1-mcanal@igalia.com> References: <20230208194817.199932-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 panfrost_copy_in_sync() performs the same steps as drm_sched_job_add_syncobj_dependency(), replace the open-coded implementation in Panfrost in order to simply, using the DRM function. Signed-off-by: Maíra Canal --- drivers/gpu/drm/panfrost/panfrost_drv.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index abb0dadd8f63..f49096f53141 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -220,15 +220,8 @@ panfrost_copy_in_sync(struct drm_device *dev, } for (i = 0; i < in_fence_count; i++) { - struct dma_fence *fence; - - ret = drm_syncobj_find_fence(file_priv, handles[i], 0, 0, - &fence); - if (ret) - goto fail; - - ret = drm_sched_job_add_dependency(&job->base, fence); - + ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, + handles[i], 0); if (ret) goto fail; } From patchwork Wed Feb 8 19:48:17 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: 13133644 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 2CDB0C636D3 for ; Wed, 8 Feb 2023 19:49:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 494CB10E854; Wed, 8 Feb 2023 19:49:24 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F42810E855 for ; Wed, 8 Feb 2023 19:49:21 +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=k0/uxf79xcZGJzJuX9Qph76mcvt2kbY+NPwywTHWTdY=; b=iGUp9blHzq1cH8h2yr/aO111a8 xGKdtve6rQxSvAPRxx9MclWK4MafZOgOJZyfxJCX16v9mU05nBR59aGwHUhuAXwuO41nZuEIoFEYB ijmkwhypDRgvwlshumyErMvG6Zs4VMf4xiw6Wf6AWBUqLg27Rv8mDif+N/H/+qUhUee9i9Kn/hY80 uqsJinXYvQZm446FtYSO8wn+w6dcu0XDXPxNv8yRvpI6OOdU5crsoY2J/uPACR1FX1ZlWe0rwzGnP UW+p5o+nRblUNHYcR3f7URuAFKeJ+ty4BQVRclYKotiSSlqKZnhWBwpoYH+YfSi2hsA8pm+7iRyVF 7CjLMpQA==; 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 1pPqRL-00DCm6-3R; Wed, 08 Feb 2023 20:49:11 +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 5/5] drm/v3d: Use drm_sched_job_add_syncobj_dependency() Date: Wed, 8 Feb 2023 16:48:17 -0300 Message-Id: <20230208194817.199932-6-mcanal@igalia.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208194817.199932-1-mcanal@igalia.com> References: <20230208194817.199932-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, using the DRM function. Signed-off-by: Maíra Canal --- drivers/gpu/drm/v3d/v3d_gem.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 5da1806f3969..f149526ec971 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -400,14 +400,7 @@ 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); + return drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, point); } static int