Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/sched: Move drm_sched_entity_is_ready to internal header

Helper is for scheduler internal use so lets hide it from DRM drivers
completely.

At the same time we change the method of checking whethere there is
anything in the queue from peeking to looking at the node count.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250221105038.79665-5-tvrtko.ursulin@igalia.com

authored by

Tvrtko Ursulin and committed by
Philipp Stanner
4b7320bf b76f1467

+13 -13
-12
drivers/gpu/drm/scheduler/sched_entity.c
··· 151 151 return false; 152 152 } 153 153 154 - /* Return true if entity could provide a job. */ 155 - bool drm_sched_entity_is_ready(struct drm_sched_entity *entity) 156 - { 157 - if (spsc_queue_peek(&entity->job_queue) == NULL) 158 - return false; 159 - 160 - if (READ_ONCE(entity->dependency)) 161 - return false; 162 - 163 - return true; 164 - } 165 - 166 154 /** 167 155 * drm_sched_entity_error - return error of last scheduled job 168 156 * @entity: scheduler entity to check
+13
drivers/gpu/drm/scheduler/sched_internal.h
··· 45 45 return container_of(node, struct drm_sched_job, queue_node); 46 46 } 47 47 48 + /* Return true if entity could provide a job. */ 49 + static inline bool 50 + drm_sched_entity_is_ready(struct drm_sched_entity *entity) 51 + { 52 + if (!spsc_queue_count(&entity->job_queue)) 53 + return false; 54 + 55 + if (READ_ONCE(entity->dependency)) 56 + return false; 57 + 58 + return true; 59 + } 60 + 48 61 #endif
-1
include/drm/gpu_scheduler.h
··· 632 632 void drm_sched_entity_push_job(struct drm_sched_job *sched_job); 633 633 void drm_sched_entity_set_priority(struct drm_sched_entity *entity, 634 634 enum drm_sched_priority priority); 635 - bool drm_sched_entity_is_ready(struct drm_sched_entity *entity); 636 635 int drm_sched_entity_error(struct drm_sched_entity *entity); 637 636 638 637 struct drm_sched_fence *drm_sched_fence_alloc(