Lines Matching defs:rq

92 	struct drm_sched_rq *rq = entity->rq;
95 rb_erase_cached(&entity->rb_tree_node, &rq->rb_tree_root);
103 * Both locks need to be grabbed, one to protect from entity->rq change
108 spin_lock(&entity->rq->lock);
114 rb_add_cached(&entity->rb_tree_node, &entity->rq->rb_tree_root,
117 spin_unlock(&entity->rq->lock);
125 * @rq: scheduler run queue
130 struct drm_sched_rq *rq)
132 mtx_init(&rq->lock, IPL_NONE);
133 INIT_LIST_HEAD(&rq->entities);
134 rq->rb_tree_root = RB_ROOT_CACHED;
135 rq->current_entity = NULL;
136 rq->sched = sched;
142 * @rq: scheduler run queue
147 void drm_sched_rq_add_entity(struct drm_sched_rq *rq,
153 spin_lock(&rq->lock);
155 atomic_inc(rq->sched->score);
156 list_add_tail(&entity->list, &rq->entities);
158 spin_unlock(&rq->lock);
164 * @rq: scheduler run queue
169 void drm_sched_rq_remove_entity(struct drm_sched_rq *rq,
175 spin_lock(&rq->lock);
177 atomic_dec(rq->sched->score);
180 if (rq->current_entity == entity)
181 rq->current_entity = NULL;
186 spin_unlock(&rq->lock);
192 * @rq: scheduler run queue to check.
197 drm_sched_rq_select_entity_rr(struct drm_sched_rq *rq)
201 spin_lock(&rq->lock);
203 entity = rq->current_entity;
205 list_for_each_entry_continue(entity, &rq->entities, list) {
207 rq->current_entity = entity;
209 spin_unlock(&rq->lock);
215 list_for_each_entry(entity, &rq->entities, list) {
218 rq->current_entity = entity;
220 spin_unlock(&rq->lock);
224 if (entity == rq->current_entity)
228 spin_unlock(&rq->lock);
236 * @rq: scheduler run queue to check.
241 drm_sched_rq_select_entity_fifo(struct drm_sched_rq *rq)
245 spin_lock(&rq->lock);
246 for (rb = rb_first_cached(&rq->rb_tree_root); rb; rb = rb_next(rb)) {
251 rq->current_entity = entity;
256 spin_unlock(&rq->lock);
641 if (!entity->rq)
685 sched = entity->rq->sched;
688 job->s_priority = entity->rq - sched->sched_rq;
1158 struct drm_sched_rq *rq = &sched->sched_rq[i];
1160 spin_lock(&rq->lock);
1161 list_for_each_entry(s_entity, &rq->entities, list)
1164 * it will removed from rq in drm_sched_entity_fini
1168 spin_unlock(&rq->lock);
1207 struct drm_sched_rq *rq = &sched->sched_rq[i];
1209 spin_lock(&rq->lock);
1210 list_for_each_entry_safe(entity, tmp, &rq->entities, list) {
1218 spin_unlock(&rq->lock);
1219 if (&entity->list != &rq->entities)