Re: [PATCH v2] drm/scheduler: rework entity creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxx>.

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.


_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux