]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/imagination: Update check to skip prepare_job() for fragment jobs
authorAlessio Belle <alessio.belle@imgtec.com>
Mon, 30 Mar 2026 07:56:42 +0000 (08:56 +0100)
committerMatt Coster <matt.coster@imgtec.com>
Wed, 8 Apr 2026 10:17:14 +0000 (11:17 +0100)
By the time prepare_job() is called on a paired fragment job, the paired
geometry job might already be finished and its PM reference dropped.

Check the fragment job's PM reference instead which is a bit more likely
to be still set. This is a very minor optimization.

Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>
Reviewed-by: Brajesh Gupta <brajesh.gupta@imgtec.com>
Link: https://patch.msgid.link/20260330-job-submission-fixes-cleanup-v1-7-7de8c09cef8c@imgtec.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
drivers/gpu/drm/imagination/pvr_queue.c

index 4a49d954562e02c6a94bf978aa6e3cab6d471c05..303f4d6cc09e87b6b7ecf13fc200fba87c79e500 100644 (file)
@@ -553,12 +553,13 @@ pvr_queue_prepare_job(struct drm_sched_job *sched_job,
 
        if (job->type == DRM_PVR_JOB_TYPE_FRAGMENT && job->paired_job) {
                /*
-                * This will be called on a paired fragment job after being
-                * submitted to firmware. We can tell if this is the case and
-                * bail early from whether run_job() has been called on the
-                * geometry job, which would issue a pm ref.
+                * This will be called on a paired fragment job after being submitted
+                * to the firmware as part of the paired geometry job's submission.
+                * We can tell if this is the case and bail early from whether run_job()
+                * has been called on the geometry job, which would issue a pm ref on
+                * this job as well.
                 */
-               if (job->paired_job->has_pm_ref)
+               if (job->has_pm_ref)
                        return NULL;
        }