Skip to content

Commit 3c57295

Browse files
hoshinolinajannau
authored andcommitted
fixup! rust: drm: sched: Add GPU scheduler abstraction
1 parent 643c2f6 commit 3c57295

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rust/kernel/drm/sched.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ impl<T: JobImpl> Entity<T> {
270270
/// Create a new job on this entity.
271271
///
272272
/// The entity must outlive the pending job until it transitions into the submitted state,
273-
/// after which the scheduler owns it.
274-
pub fn new_job(&self, credits: u32, inner: T) -> Result<PendingJob<'_, T>> {
273+
/// after which the scheduler owns it. Since jobs must be submitted in creation order,
274+
/// this requires a mutable reference to the entity, ensuring that only one new job can be
275+
/// in flight at once.
276+
pub fn new_job(&mut self, credits: u32, inner: T) -> Result<PendingJob<'_, T>> {
275277
let mut job: Box<MaybeUninit<Job<T>>> = Box::try_new_zeroed()?;
276278

277279
// SAFETY: We hold a reference to the entity (which is a valid pointer),

0 commit comments

Comments
 (0)