Skip to content

Commit

Permalink
fixup! rust: drm: sched: Add GPU scheduler abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
asahilina committed Jul 11, 2024
1 parent 8978080 commit 55bb501
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rust/kernel/drm/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ impl<T: JobImpl> Entity<T> {
/// Create a new job on this entity.
///
/// The entity must outlive the pending job until it transitions into the submitted state,
/// after which the scheduler owns it.
pub fn new_job(&self, credits: u32, inner: T) -> Result<PendingJob<'_, T>> {
/// after which the scheduler owns it. Since jobs must be submitted in creation order,
/// this requires a mutable reference to the entity, ensuring that only one new job can be
/// in flight at once.
pub fn new_job(&mut self, credits: u32, inner: T) -> Result<PendingJob<'_, T>> {
let mut job: Box<MaybeUninit<Job<T>>> = Box::try_new_zeroed()?;

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

0 comments on commit 55bb501

Please sign in to comment.