[PATCH 2/2] drm/imagination: Use the drm_sched_job_has_dependency helper
Matt Coster
Matt.Coster at imgtec.com
Thu Jan 16 12:58:51 UTC 2025
On 16/01/2025 10:02, Philipp Stanner wrote:
> On Mon, 2025-01-13 at 10:33 +0000, Tvrtko Ursulin wrote:
>> Instead of manually peeking into the DRM scheduler implementation
>> details
>> lets use the previously added helper.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
>> Cc: Christian König <christian.koenig at amd.com>
>> Cc: Danilo Krummrich <dakr at redhat.com>
>> Cc: Matthew Brost <matthew.brost at intel.com>
>> Cc: Philipp Stanner <pstanner at redhat.com>
>> Cc: Frank Binns <frank.binns at imgtec.com>
>> Cc: Matt Coster <matt.coster at imgtec.com>
>> Reviewed-by: Matt Coster <matt.coster at imgtec.com>
>
> Matt, just to be sure, you're OK with me pulling those two into drm-
> misc-next, aren't you?
Yup, all good! Thanks for checking :)
--
Matt Coster
E: matt.coster at imgtec.com
>
> P.
>
>> ---
>> drivers/gpu/drm/imagination/pvr_job.c | 12 +++---------
>> 1 file changed, 3 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/imagination/pvr_job.c
>> b/drivers/gpu/drm/imagination/pvr_job.c
>> index 618503a212a7..1cdb3cfd058d 100644
>> --- a/drivers/gpu/drm/imagination/pvr_job.c
>> +++ b/drivers/gpu/drm/imagination/pvr_job.c
>> @@ -597,8 +597,6 @@ update_job_resvs_for_each(struct pvr_job_data
>> *job_data, u32 job_count)
>> static bool can_combine_jobs(struct pvr_job *a, struct pvr_job *b)
>> {
>> struct pvr_job *geom_job = a, *frag_job = b;
>> - struct dma_fence *fence;
>> - unsigned long index;
>>
>> /* Geometry and fragment jobs can be combined if they are
>> queued to the
>> * same context and targeting the same HWRT.
>> @@ -609,13 +607,9 @@ static bool can_combine_jobs(struct pvr_job *a,
>> struct pvr_job *b)
>> a->hwrt != b->hwrt)
>> return false;
>>
>> - xa_for_each(&frag_job->base.dependencies, index, fence) {
>> - /* We combine when we see an explicit geom -> frag
>> dep. */
>> - if (&geom_job->base.s_fence->scheduled == fence)
>> - return true;
>> - }
>> -
>> - return false;
>> + /* We combine when we see an explicit geom -> frag dep. */
>> + return drm_sched_job_has_dependency(&frag_job->base,
>> + &geom_job->base.s_fence-
>>> scheduled);
>> }
>>
>> static struct dma_fence *
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250116/76ead0eb/attachment.sig>
More information about the dri-devel
mailing list