From: Thierry Reding <thierry.reding@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org, Dmitry Osipenko <digetx@gmail.com>,
dri-devel@lists.freedesktop.org,
Mikko Perttunen <mperttunen@nvidia.com>
Subject: [PATCH v8 03/14] gpu: host1x: Add job release callback
Date: Fri, 9 Jul 2021 21:31:35 +0200 [thread overview]
Message-ID: <20210709193146.2859516-4-thierry.reding@gmail.com> (raw)
In-Reply-To: <20210709193146.2859516-1-thierry.reding@gmail.com>
From: Mikko Perttunen <mperttunen@nvidia.com>
Add a callback field to the job structure, to be called just before
the job is to be freed. This allows the job's submitter to clean
up any of its own state, like decrement runtime PM refcounts.
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/host1x/job.c | 3 +++
include/linux/host1x.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index 8f59b34672c2..09097e19c0d0 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -79,6 +79,9 @@ static void job_free(struct kref *ref)
{
struct host1x_job *job = container_of(ref, struct host1x_job, ref);
+ if (job->release)
+ job->release(job);
+
if (job->waiter)
host1x_intr_put_ref(job->syncpt->host, job->syncpt->id,
job->waiter, false);
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index 5fc12db94ca1..7eecb0aa2519 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -269,6 +269,10 @@ struct host1x_job {
/* Fast-forward syncpoint increments on job timeout */
bool syncpt_recovery;
+
+ /* Callback called when job is freed */
+ void (*release)(struct host1x_job *job);
+ void *user_data;
};
struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
--
2.32.0
next prev parent reply other threads:[~2021-07-09 19:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 19:31 [PATCH v8 00/14] drm/tegra: Introduce a modern UABI Thierry Reding
2021-07-09 19:31 ` [PATCH v8 01/14] gpu: host1x: Add DMA fence implementation Thierry Reding
2021-07-15 15:26 ` Dmitry Osipenko
2021-07-09 19:31 ` [PATCH v8 02/14] gpu: host1x: Add no-recovery mode Thierry Reding
2021-07-09 19:31 ` Thierry Reding [this message]
2021-07-09 19:31 ` [PATCH v8 04/14] gpu: host1x: Add support for syncpoint waits in CDMA pushbuffer Thierry Reding
2021-07-09 19:31 ` [PATCH v8 05/14] drm/tegra: Extract tegra_gem_lookup Thierry Reding
2021-07-09 19:31 ` [PATCH v8 06/14] drm/tegra: Add new UAPI to header Thierry Reding
2021-07-09 19:31 ` [PATCH v8 07/14] drm/tegra: Boot VIC during runtime PM resume Thierry Reding
2021-07-09 19:31 ` [PATCH v8 08/14] drm/tegra: Allocate per-engine channel in core code Thierry Reding
2021-07-09 19:31 ` [PATCH v8 09/14] drm/tegra: Implement new UAPI Thierry Reding
2021-07-15 15:27 ` Dmitry Osipenko
2021-07-09 19:31 ` [PATCH v8 10/14] drm/tegra: Implement syncpoint management UAPI Thierry Reding
2021-07-09 19:31 ` [PATCH v8 11/14] drm/tegra: Implement syncpoint wait UAPI Thierry Reding
2021-07-09 19:31 ` [PATCH v8 12/14] drm/tegra: Implement job submission part of new UAPI Thierry Reding
2021-07-09 19:31 ` [PATCH v8 13/14] drm/tegra: Add job firewall Thierry Reding
2021-07-09 19:31 ` [PATCH v8 14/14] drm/tegra: Bump driver version Thierry Reding
2021-07-09 21:16 ` [PATCH v8 00/14] drm/tegra: Introduce a modern UABI Dmitry Osipenko
2021-07-14 8:30 ` Thierry Reding
2021-07-14 14:50 ` Dmitry Osipenko
2021-07-14 15:26 ` Mikko Perttunen
2021-07-15 13:53 ` Dmitry Osipenko
2021-07-30 15:26 ` Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210709193146.2859516-4-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox