Skip to content

Commit cdb7345

Browse files
Tvrtko UrsulinPhilipp Stanner
authored andcommitted
drm/imagination: Use the drm_sched_job_has_dependency helper
Instead of manually peeking into the DRM scheduler implementation details lets use the previously added helper. Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: Christian König <[email protected]> Cc: Danilo Krummrich <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Philipp Stanner <[email protected]> Cc: Frank Binns <[email protected]> Cc: Matt Coster <[email protected]> Reviewed-by: Matt Coster <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 51678bb commit cdb7345

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/gpu/drm/imagination/pvr_job.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,6 @@ update_job_resvs_for_each(struct pvr_job_data *job_data, u32 job_count)
597597
static bool can_combine_jobs(struct pvr_job *a, struct pvr_job *b)
598598
{
599599
struct pvr_job *geom_job = a, *frag_job = b;
600-
struct dma_fence *fence;
601-
unsigned long index;
602600

603601
/* Geometry and fragment jobs can be combined if they are queued to the
604602
* same context and targeting the same HWRT.
@@ -609,13 +607,9 @@ static bool can_combine_jobs(struct pvr_job *a, struct pvr_job *b)
609607
a->hwrt != b->hwrt)
610608
return false;
611609

612-
xa_for_each(&frag_job->base.dependencies, index, fence) {
613-
/* We combine when we see an explicit geom -> frag dep. */
614-
if (&geom_job->base.s_fence->scheduled == fence)
615-
return true;
616-
}
617-
618-
return false;
610+
/* We combine when we see an explicit geom -> frag dep. */
611+
return drm_sched_job_has_dependency(&frag_job->base,
612+
&geom_job->base.s_fence->scheduled);
619613
}
620614

621615
static struct dma_fence *

0 commit comments

Comments
 (0)