<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 1, 2018 at 7:58 PM Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since we now deal with multiple rq we need to update all of them, not<br>
just the current one.<br>
<br>
Signed-off-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>><br></blockquote><div>Acked-by: Nayan Deshmukh <<a href="mailto:nayan26deshmukh@gmail.com">nayan26deshmukh@gmail.com</a>> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +--<br>
drivers/gpu/drm/scheduler/gpu_scheduler.c | 36 ++++++++++++++++++++-----------<br>
include/drm/gpu_scheduler.h | 5 ++---<br>
3 files changed, 26 insertions(+), 18 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c<br>
index df6965761046..9fcc14e2dfcf 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c<br>
@@ -407,12 +407,11 @@ void amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx,<br>
for (i = 0; i < adev->num_rings; i++) {<br>
ring = adev->rings[i];<br>
entity = &ctx->rings[i].entity;<br>
- rq = &ring->sched.sched_rq[ctx_prio];<br>
<br>
if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ)<br>
continue;<br>
<br>
- drm_sched_entity_set_rq(entity, rq);<br>
+ drm_sched_entity_set_priority(entity, ctx_prio);<br>
}<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
index 05dc6ecd4003..85908c7f913e 100644<br>
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c<br>
@@ -419,29 +419,39 @@ static void drm_sched_entity_clear_dep(struct dma_fence *f, struct dma_fence_cb<br>
}<br>
<br>
/**<br>
- * drm_sched_entity_set_rq - Sets the run queue for an entity<br>
+ * drm_sched_entity_set_rq_priority - helper for drm_sched_entity_set_priority<br>
+ */<br>
+static void drm_sched_entity_set_rq_priority(struct drm_sched_rq **rq,<br>
+ enum drm_sched_priority priority)<br>
+{<br>
+ *rq = &(*rq)->sched->sched_rq[priority];<br>
+}<br>
+<br>
+/**<br>
+ * drm_sched_entity_set_priority - Sets priority of the entity<br>
*<br>
* @entity: scheduler entity<br>
- * @rq: scheduler run queue<br>
+ * @priority: scheduler priority<br>
*<br>
- * Sets the run queue for an entity and removes the entity from the previous<br>
- * run queue in which was present.<br>
+ * Update the priority of runqueus used for the entity.<br>
*/<br>
-void drm_sched_entity_set_rq(struct drm_sched_entity *entity,<br>
- struct drm_sched_rq *rq)<br>
+void drm_sched_entity_set_priority(struct drm_sched_entity *entity,<br>
+ enum drm_sched_priority priority)<br>
{<br>
- if (entity->rq == rq)<br>
- return;<br>
-<br>
- BUG_ON(!rq);<br>
+ unsigned int i;<br>
<br>
spin_lock(&entity->rq_lock);<br>
+<br>
+ for (i = 0; i < entity->num_rq_list; ++i)<br>
+ drm_sched_entity_set_rq_priority(&entity->rq_list[i], priority);<br>
+<br>
drm_sched_rq_remove_entity(entity->rq, entity);<br>
- entity->rq = rq;<br>
- drm_sched_rq_add_entity(rq, entity);<br>
+ drm_sched_entity_set_rq_priority(&entity->rq, priority);<br>
+ drm_sched_rq_add_entity(entity->rq, entity);<br>
+<br>
spin_unlock(&entity->rq_lock);<br>
}<br>
-EXPORT_SYMBOL(drm_sched_entity_set_rq);<br>
+EXPORT_SYMBOL(drm_sched_entity_set_priority);<br>
<br>
/**<br>
* drm_sched_dependency_optimized<br>
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h<br>
index 0c4cfe689d4c..22c0f88f7d8f 100644<br>
--- a/include/drm/gpu_scheduler.h<br>
+++ b/include/drm/gpu_scheduler.h<br>
@@ -298,9 +298,8 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity);<br>
void drm_sched_entity_destroy(struct drm_sched_entity *entity);<br>
void drm_sched_entity_push_job(struct drm_sched_job *sched_job,<br>
struct drm_sched_entity *entity);<br>
-void drm_sched_entity_set_rq(struct drm_sched_entity *entity,<br>
- struct drm_sched_rq *rq);<br>
-<br>
+void drm_sched_entity_set_priority(struct drm_sched_entity *entity,<br>
+ enum drm_sched_priority priority);<br>
struct drm_sched_fence *drm_sched_fence_create(<br>
struct drm_sched_entity *s_entity, void *owner);<br>
void drm_sched_fence_scheduled(struct drm_sched_fence *fence);<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div></div>