Skip to content

Commit

Permalink
drm/i915/guc: Rework and simplify locking
Browse files Browse the repository at this point in the history
Rework and simplify the locking with GuC subission. Drop
sched_state_no_lock and move all fields under the guc_state.sched_state
and protect all these fields with guc_state.lock . This requires
changing the locking hierarchy from guc_state.lock -> sched_engine.lock
to sched_engine.lock -> guc_state.lock.

v2:
 (Daniele)
  - Don't check fields outside of lock during sched disable, check less
    fields within lock as some of the outside are no longer needed

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210909164744.31249-18-matthew.brost@intel.com
  • Loading branch information
Matthew Brost authored and John Harrison committed Sep 13, 2021
1 parent 52d66c0 commit 0f79765
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 120 deletions.
5 changes: 1 addition & 4 deletions drivers/gpu/drm/i915/gt/intel_context_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct intel_context {
* sched_state: scheduling state of this context using GuC
* submission
*/
u16 sched_state;
u32 sched_state;
/*
* fences: maintains of list of requests that have a submit
* fence related to GuC submission
Expand All @@ -178,9 +178,6 @@ struct intel_context {
struct list_head requests;
} guc_active;

/* GuC scheduling state flags that do not require a lock. */
atomic_t guc_sched_state_no_lock;

/* GuC LRC descriptor ID */
u16 guc_id;

Expand Down
Loading

0 comments on commit 0f79765

Please sign in to comment.