Skip to content

Commit a6f4628

Browse files
Tvrtko UrsulinPhilipp Stanner
authored andcommitted
drm/sched: Re-order struct drm_sched_rq members for clarity
Current kerneldoc for struct drm_sched_rq incompletely documents what fields are protected by the lock. This is not good because it is misleading. Lets fix it by listing all the elements which are protected by the lock. While at it, lets also re-order the members so all protected by the lock are in a single group. v2: * Refer variables by kerneldoc syntax, more verbose commit text. (Philipp) Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Luben Tuikov <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Philipp Stanner <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Philipp Stanner <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6a31357 commit a6f4628

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

include/drm/gpu_scheduler.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,23 @@ struct drm_sched_entity {
243243
/**
244244
* struct drm_sched_rq - queue of entities to be scheduled.
245245
*
246-
* @lock: to modify the entities list.
247246
* @sched: the scheduler to which this rq belongs to.
248-
* @entities: list of the entities to be scheduled.
247+
* @lock: protects @entities, @rb_tree_root and @current_entity.
249248
* @current_entity: the entity which is to be scheduled.
249+
* @entities: list of the entities to be scheduled.
250250
* @rb_tree_root: root of time based priority queue of entities for FIFO scheduling
251251
*
252252
* Run queue is a set of entities scheduling command submissions for
253253
* one specific ring. It implements the scheduling policy that selects
254254
* the next entity to emit commands from.
255255
*/
256256
struct drm_sched_rq {
257-
spinlock_t lock;
258257
struct drm_gpu_scheduler *sched;
259-
struct list_head entities;
258+
259+
spinlock_t lock;
260+
/* Following members are protected by the @lock: */
260261
struct drm_sched_entity *current_entity;
262+
struct list_head entities;
261263
struct rb_root_cached rb_tree_root;
262264
};
263265

0 commit comments

Comments
 (0)