[PATCH v2] drm/scheduler: rework entity creation
Nirmoy
nirmodas at amd.com
Thu Dec 5 16:08:11 UTC 2019
On 12/5/19 4:43 PM, Christian König wrote:
> Am 05.12.19 um 15:48 schrieb Nirmoy Das:
>>
>> Â EXPORT_SYMBOL(drm_sched_entity_set_priority);
>> @@ -490,18 +474,20 @@ void drm_sched_entity_select_rq(struct
>> drm_sched_entity *entity)
>> Â Â Â Â Â struct dma_fence *fence;
>> Â Â Â Â Â struct drm_sched_rq *rq;
>> Â -Â Â Â if (spsc_queue_count(&entity->job_queue) ||
>> entity->num_rq_list <= 1)
>> +Â Â Â if (spsc_queue_count(&entity->job_queue) ||
>> entity->num_sched_list <= 1)
>> Â Â Â Â Â Â Â Â Â return;
>> Â Â Â Â Â Â fence = READ_ONCE(entity->last_scheduled);
>> Â Â Â Â Â if (fence && !dma_fence_is_signaled(fence))
>> Â Â Â Â Â Â Â Â Â return;
>> Â +Â Â Â spin_lock(&entity->rq_lock);
>> Â Â Â Â Â rq = drm_sched_entity_get_free_sched(entity);
>> -Â Â Â if (rq == entity->rq)
>> +Â Â Â if (rq == entity->rq) {
>> +Â Â Â Â Â Â Â spin_unlock(&entity->rq_lock);
>> Â Â Â Â Â Â Â Â Â return;
>> +Â Â Â }
>
> Should we redesign that into:
>
> if (rq != entity->rq) {
>> -Â Â Â spin_lock(&entity->rq_lock);
>> Â Â Â Â Â drm_sched_rq_remove_entity(entity->rq, entity);
>> Â Â Â Â Â entity->rq = rq;
> }
>
> Would probably be easier to understand.
>
Yes, looks much cleaner with that. Sent a v3 with that change.
> Apart from that the patch is Reviewed-by: Christian König
> <christian.koenig at amd.com>.
>
> Do you want to work on a follow up patch first or should I push this
> to drm-misc-next?
Please push this to drm-misc-next for now. I am thinking of doing rest
of cleanup and on-demad entity creation for each HW IP together.
>
> Regards,
> Christian.
>
>
More information about the amd-gfx
mailing list