]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: host1x: Add job release callback
authorMikko Perttunen <mperttunen@nvidia.com>
Thu, 10 Jun 2021 11:04:44 +0000 (14:04 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 10 Aug 2021 12:41:02 +0000 (14:41 +0200)
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
include/linux/host1x.h

index 8f59b34672c2207f7a5c3059cc931340bfbbd769..09097e19c0d09d44a250f06f0fa2c33b7d258b8d 100644 (file)
@@ -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);
index 8da088ad0b5e2fe9ffaeb495d6ea1734a5519618..57271ab1fee84ca6ec283bc89c4db05124227c51 100644 (file)
@@ -268,6 +268,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,