[PATCH 12/22] drm/i915/guc: Don't touch guc_state.sched_state without a lock

2021-08-16 Thread Matthew Brost
n was called from the submission path. Remove this dead code and add a GEM_BUG_ON if this path is ever attempted to be used. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 57 ++- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/driver

[PATCH 16/22] drm/i915/guc: Release submit fence from an IRQ

2021-08-16 Thread Matthew Brost
se went holding ce->guc_state.lock and the releasing of the can acquire sched_engine->lock. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 15 ++- drivers/gpu/drm/i915/i915_request.h | 5 + 2 files changed, 19 insertions(+), 1 d

[PATCH 08/22] drm/i915/guc: Don't enable scheduling on a banned context, guc_id invalid, not registered

2021-08-16 Thread Matthew Brost
When unblocking a context, do not enable scheduling if the context is banned, guc_id invalid, or not registered. Fixes: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 +++ 1 file

[PATCH 07/22] drm/i915/selftests: Add a cancel request selftest that triggers a reset

2021-08-16 Thread Matthew Brost
Add a cancel request selftest that results in an engine reset to cancel the request as it is non-preemptable. Also insert a NOP request after the cancelled request and confirm that it completely successfully. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/selftests/i915_request.c | 100

[PATCH 10/22] drm/i915/selftests: Add initial GuC selftest for scrubbing lost G2H

2021-08-16 Thread Matthew Brost
rrors dropping various G2H and then issues a full GT reset proving that the scrubbing of these G2H doesn't blow up. v2: (Daniel Vetter) - Use ifdef instead of macros for selftests v3: (Checkpatch) - A space after 'switch' statement Signed-off-by: Matthew Brost --- dri

[PATCH 20/22] drm/i915/guc: Drop pin count check trick between sched_disable and re-pin

2021-08-16 Thread Matthew Brost
Drop pin count check trick between a sched_disable and re-pin, now rely on the lock and counter of the number of committed requests to determine if scheduling should be disabled on the context. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 2 + .../gpu/drm

[PATCH 22/22] drm/i915/guc: Add GuC kernel doc

2021-08-16 Thread Matthew Brost
Add GuC kernel doc for all structures added thus far for GuC submission and update the main GuC submission section with the new interface details. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 42 +--- drivers/gpu/drm/i915/gt/uc/intel_guc.h| 19

[PATCH 17/22] drm/i915/guc: Move guc_blocked fence to struct guc_state

2021-08-16 Thread Matthew Brost
Move guc_blocked fence to struct guc_state as the lock which protects the fence lives there. s/ce->guc_blocked/ce->guc_state.blocked_fence/g Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c| 5 +++-- drivers/gpu/drm/i915/gt/intel_context_types.h

[PATCH 05/22] drm/i915/guc: Workaround reset G2H is received after schedule done G2H

2021-08-16 Thread Matthew Brost
: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Cc: --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 43 --- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gp

[PATCH 19/22] drm/i915/guc: Proper xarray usage for contexts_lookup

2021-08-16 Thread Matthew Brost
Lock the xarray and take ref to the context if needed. v2: (Checkpatch) - Add new line after declaration Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 84 --- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 21/22] drm/i915/guc: Move GuC priority fields in context under guc_active

2021-08-16 Thread Matthew Brost
Move GuC management fields in context under guc_active struct as this is where the lock that protects theses fields lives. Also only set guc_prio field once during context init. Fixes: ee242ca704d3 ("drm/i915/guc: Implement GuC priority management") Signed-off-by: Matthew Brost Cc: --

[PATCH 18/22] drm/i915/guc: Rework and simplify locking

2021-08-16 Thread Matthew Brost
ock -> guc_state.lock. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 5 +- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 186 -- drivers/gpu/drm/i915/i915_trace.h | 6 +- 3 files changed, 89 insertions(+), 108 deletions(-) diff -

[PATCH 15/22] drm/i915/guc: Flush G2H work queue during reset

2021-08-16 Thread Matthew Brost
It isn't safe to scrub for missing G2H or continue with the reset until all G2H processing is complete. Flush the G2H work queue during reset to ensure it is done running. Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Bros

[PATCH 13/22] drm/i915/guc: Reset LRC descriptor if register returns -ENODEV

2021-08-16 Thread Matthew Brost
Reset LRC descriptor if a context register returns -ENODEV as this means we are mid-reset. Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 -- 1 file changed, 4

[PATCH 04/22] drm/i915/guc: Don't drop ce->guc_active.lock when unwinding context

2021-08-16 Thread Matthew Brost
new GuC interface") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index bc51caba50d0..3cd2da6f5c

[PATCH 14/22] drm/i915: Allocate error capture in atomic context

2021-08-16 Thread Matthew Brost
, thus now we have a circular dependency. To work around this, allocate the error capture in an atomic context. Fixes: dc0dad365c5e ("Fix for error capture after full GPU reset with GuC") Fixes: 573ba126aef3 ("Capture error state on context reset") Signed-off-by: Matthew Brost

Re: [PATCH 05/22] drm/i915/guc: Workaround reset G2H is received after schedule done G2H

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 11:32:56AM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:22AM -0700, Matthew Brost wrote: > > If the context is reset as a result of the request cancelation the > > context reset G2H is received after schedule disable done G2H which is >

Re: [PATCH 06/22] drm/i915/execlists: Do not propagate errors to dependent fences

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 11:21:27AM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:23AM -0700, Matthew Brost wrote: > > Progagating errors to dependent fences is wrong, don't do it. Selftest > > in following patch exposes this bug. > > Please explain what &

Re: [Intel-gfx] [PATCH 19/22] drm/i915/guc: Proper xarray usage for contexts_lookup

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 12:27:29PM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:36AM -0700, Matthew Brost wrote: > > Lock the xarray and take ref to the context if needed. > > > > v2: > > (Checkpatch) > > - Add new line after declaration >

Re: [PATCH 18/22] drm/i915/guc: Rework and simplify locking

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 12:15:21PM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:35AM -0700, Matthew Brost wrote: > > Rework and simplify the locking with GuC subission. Drop > > sched_state_no_lock and move all fields under the guc_state.sched_state > > and pro

Re: [PATCH 14/22] drm/i915: Allocate error capture in atomic context

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 12:06:16PM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:31AM -0700, Matthew Brost wrote: > > Error captures can now be done in a work queue processing G2H messages. > > These messages need to be completely done being processed in the reset >

Re: [PATCH 22/22] drm/i915/guc: Add GuC kernel doc

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 01:11:41PM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:39AM -0700, Matthew Brost wrote: > > Add GuC kernel doc for all structures added thus far for GuC submission > > and update the main GuC submission section with the new interf

Re: [PATCH 08/22] drm/i915/guc: Don't enable scheduling on a banned context, guc_id invalid, not registered

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 11:47:53AM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:25AM -0700, Matthew Brost wrote: > > When unblocking a context, do not enable scheduling if the context is > > banned, guc_id invalid, or not registered. > > > > Fixes:

Re: [Intel-gfx] [PATCH 19/22] drm/i915/guc: Proper xarray usage for contexts_lookup

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 07:13:33PM +0200, Daniel Vetter wrote: > On Tue, Aug 17, 2021 at 08:26:28AM -0700, Matthew Brost wrote: > > On Tue, Aug 17, 2021 at 12:27:29PM +0200, Daniel Vetter wrote: > > > On Mon, Aug 16, 2021 at 06:51:36AM -0700, Matthew Brost wrote: > > >

Re: [PATCH 02/22] drm/i915/guc: Fix outstanding G2H accounting

2021-08-17 Thread Matthew Brost
On Tue, Aug 17, 2021 at 11:39:29AM +0200, Daniel Vetter wrote: > On Mon, Aug 16, 2021 at 06:51:19AM -0700, Matthew Brost wrote: > > A small race that could result in incorrect accounting of the number > > of outstanding G2H. Basically prior to this patch we did not increment &g

[PATCH 03/27] drm/i915/guc: Unwind context requests in reverse order

2021-08-18 Thread Matthew Brost
5/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/

[PATCH 04/27] drm/i915/guc: Don't drop ce->guc_active.lock when unwinding context

2021-08-18 Thread Matthew Brost
new GuC interface") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 9ca0ba4ea85a..e4a099f8f8

[PATCH 01/27] drm/i915/guc: Fix blocked context accounting

2021-08-18 Thread Matthew Brost
217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Reviewed-by: Daniel Vetter Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/d

[PATCH 05/27] drm/i915/guc: Process all G2H message at once in work queue

2021-08-18 Thread Matthew Brost
Rather than processing 1 G2H at a time and re-queuing the work queue if more messages exist, process all the G2H in a single pass of the work queue. Signed-off-by: Matthew Brost Cc: Daniel Vetter Cc: Michal Wajdeczko --- drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 6 +++--- 1 file changed, 3

[PATCH 12/27] drm/i915/selftests: Add initial GuC selftest for scrubbing lost G2H

2021-08-18 Thread Matthew Brost
rrors dropping various G2H and then issues a full GT reset proving that the scrubbing of these G2H doesn't blow up. v2: (Daniel Vetter) - Use ifdef instead of macros for selftests v3: (Checkpatch) - A space after 'switch' statement Signed-off-by: Matthew Brost --- dri

[PATCH 02/27] drm/i915/guc: Fix outstanding G2H accounting

2021-08-18 Thread Matthew Brost
a G2H response thus the counter should be incremented. Also always use helper when decrementing this value. Fixes: f4eb1f3fe946 ("drm/i915/guc: Ensure G2H response has space in buffer") Signed-off-by: Matthew Brost Cc: --- .../gpu/drm/i915/gt/uc/intel_guc_submiss

[PATCH 15/27] drm/i915/guc: Reset LRC descriptor if register returns -ENODEV

2021-08-18 Thread Matthew Brost
Reset LRC descriptor if a context register returns -ENODEV as this means we are mid-reset. Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 -- 1 file changed, 4

[PATCH 09/27] drm/i915/guc: Kick tasklet after queuing a request

2021-08-18 Thread Matthew Brost
Kick tasklet after queuing a request so it submitted in a timely manner. Fixes: 3a4cdf1982f0 ("drm/i915/guc: Implement GuC context operations for new inteface") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 10/27] drm/i915/guc: Don't enable scheduling on a banned context, guc_id invalid, not registered

2021-08-18 Thread Matthew Brost
When unblocking a context, do not enable scheduling if the context is banned, guc_id invalid, or not registered. Fixes: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 +++ 1 file

[PATCH 08/27] drm/i915/selftests: Add a cancel request selftest that triggers a reset

2021-08-18 Thread Matthew Brost
Add a cancel request selftest that results in an engine reset to cancel the request as it is non-preemptable. Also insert a NOP request after the cancelled request and confirm that it completely successfully. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/selftests/i915_request.c | 100

[PATCH 16/27] drm/i915: Allocate error capture in nowait context

2021-08-18 Thread Matthew Brost
tate on context reset") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/i915_gpu_error.c | 39 +-- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 0f08bcfbe964.

[PATCH 06/27] drm/i915/guc: Workaround reset G2H is received after schedule done G2H

2021-08-18 Thread Matthew Brost
: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Cc: --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 43 --- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gp

[PATCH 13/27] drm/i915/guc: Take context ref when cancelling request

2021-08-18 Thread Matthew Brost
A context can get destroyed after cancelling a request so take a reference to context when cancelling a request. Fixes: 62eaf0ae217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 5 - 1 file

[PATCH 00/27] Clean up GuC CI failures, simplify locking, and kernel DOC

2021-08-18 Thread Matthew Brost
ssue kicking tasklet, drop guc_active, fix ref counting in xarray, add guc_id sub structure, drop inline fuctions, and various other cleanup suggested by Daniel Signed-off-by: Matthew Brost Matthew Brost (27): drm/i915/guc: Fix blocked context accounting drm/i915/guc: Fix outstanding G2H accou

[PATCH 07/27] Revert "drm/i915/gt: Propagate change in error status to children on unhold"

2021-08-18 Thread Matthew Brost
e908a (Revert "drm/i915: Propagate errors on awaiting already signaled fences") Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/

[PATCH 18/27] drm/i915/guc: Release submit fence from an irq_work

2021-08-18 Thread Matthew Brost
se went holding ce->guc_state.lock and the releasing of the can acquire sched_engine->lock. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 15 ++- drivers/gpu/drm/i915/i915_request.h | 5 + 2 files changed, 19 insertions(+), 1 d

[PATCH 14/27] drm/i915/guc: Don't touch guc_state.sched_state without a lock

2021-08-18 Thread Matthew Brost
n was called from the submission path. Remove this dead code and add a GEM_BUG_ON if this path is ever attempted to be used. v2: (kernel test robo ) - Add __maybe_unused to sched_state_is_init() Signed-off-by: Matthew Brost Reported-by: kernel test robot --- .../gpu/drm/i915/

[PATCH 24/27] drm/i915/guc: Move fields protected by guc->contexts_lock into sub structure

2021-08-18 Thread Matthew Brost
To make ownership of locking clear move fields (guc_id, guc_id_ref, guc_id_link) to sub structure guc_id in intel_context. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 4 +- drivers/gpu/drm/i915/gt/intel_context_types.h | 18 +-- drivers/gpu/drm/i915/gt

[PATCH 19/27] drm/i915/guc: Move guc_blocked fence to struct guc_state

2021-08-18 Thread Matthew Brost
Move guc_blocked fence to struct guc_state as the lock which protects the fence lives there. s/ce->guc_blocked/ce->guc_state.blocked_fence/g Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c| 5 +++-- drivers/gpu/drm/i915/gt/intel_context_types.h

[PATCH 23/27] drm/i915/guc: Move GuC priority fields in context under guc_active

2021-08-18 Thread Matthew Brost
Move GuC management fields in context under guc_active struct as this is where the lock that protects theses fields lives. Also only set guc_prio field once during context init. Fixes: ee242ca704d3 ("drm/i915/guc: Implement GuC priority management") Signed-off-by: Matthew Brost Cc: --

[PATCH 17/27] drm/i915/guc: Flush G2H work queue during reset

2021-08-18 Thread Matthew Brost
It isn't safe to scrub for missing G2H or continue with the reset until all G2H processing is complete. Flush the G2H work queue during reset to ensure it is done running. Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Bros

[PATCH 11/27] drm/i915/selftests: Fix memory corruption in live_lrc_isolation

2021-08-18 Thread Matthew Brost
text redzone into the space that is trashed. To workaround this avoid poisoning the watchdog. v2: (Daniel Vetter) - Add VLK ref in code to workaround Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/selftest_lrc.c | 29 +- 1 file changed, 28 insertions(+), 1 dele

[PATCH 26/27] drm/i915/guc: Add GuC kernel doc

2021-08-18 Thread Matthew Brost
Add GuC kernel doc for all structures added thus far for GuC submission and update the main GuC submission section with the new interface details. v2: - Drop guc_active.lock DOC Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 44 ++--- drivers/gpu/drm/i915

[PATCH 25/27] drm/i915/guc: Drop guc_active move everything into guc_state

2021-08-18 Thread Matthew Brost
Now that we have locking hierarchy of sched_engine->lock -> ce->guc_state everything from guc_active can be moved into guc_state and protected the guc_state.lock. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 10 +-- drivers/gpu/dr

[PATCH 21/27] drm/i915/guc: Proper xarray usage for contexts_lookup

2021-08-18 Thread Matthew Brost
Lock the xarray and take ref to the context if needed. v2: (Checkpatch) - Add new line after declaration (Daniel Vetter) - Correct put / get accounting in xa_for_loops Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 103 +++--- 1 file changed

[PATCH 22/27] drm/i915/guc: Drop pin count check trick between sched_disable and re-pin

2021-08-18 Thread Matthew Brost
Drop pin count check trick between a sched_disable and re-pin, now rely on the lock and counter of the number of committed requests to determine if scheduling should be disabled on the context. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 2 + .../gpu/drm

[PATCH 27/27] drm/i915/guc: Drop static inline functions intel_guc_submission.c

2021-08-18 Thread Matthew Brost
s/static inline/static/g + fix function argument alignment to make checkpatch happy. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 116 +- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc

[PATCH 20/27] drm/i915/guc: Rework and simplify locking

2021-08-18 Thread Matthew Brost
ock -> guc_state.lock. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 5 +- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 186 -- drivers/gpu/drm/i915/i915_trace.h | 6 +- 3 files changed, 89 insertions(+), 108 deletions(-) diff -

Re: [Intel-gfx] [PATCH 02/27] drm/i915/guc: Fix outstanding G2H accounting

2021-08-19 Thread Matthew Brost
On Thu, Aug 19, 2021 at 02:31:51PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > A small race that could result in incorrect accounting of the number > > of outstanding G2H. Basically prior to this patch we did not increm

Re: [Intel-gfx] [PATCH 03/27] drm/i915/guc: Unwind context requests in reverse order

2021-08-19 Thread Matthew Brost
On Thu, Aug 19, 2021 at 04:54:00PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > When unwinding requests on a reset context, if other requests in the > > context are in the priority list the requests could be resubmitted o

Re: [Intel-gfx] [PATCH 04/27] drm/i915/guc: Don't drop ce->guc_active.lock when unwinding context

2021-08-19 Thread Matthew Brost
On Thu, Aug 19, 2021 at 05:01:03PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Don't drop ce->guc_active.lock when unwinding a context after reset. > > At one point we had to drop this because of a lock inversion but t

Re: [Intel-gfx] [PATCH 09/27] drm/i915/guc: Kick tasklet after queuing a request

2021-08-20 Thread Matthew Brost
On Fri, Aug 20, 2021 at 11:31:56AM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Kick tasklet after queuing a request so it submitted in a timely manner. > > > > Fixes: 3a4cdf1982f0 ("drm/i915/guc: Implement GuC

Re: [Intel-gfx] [PATCH 10/27] drm/i915/guc: Don't enable scheduling on a banned context, guc_id invalid, not registered

2021-08-20 Thread Matthew Brost
On Fri, Aug 20, 2021 at 11:42:38AM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > When unblocking a context, do not enable scheduling if the context is > > banned, guc_id invalid, or not registered. > > > > Fixes: 62e

[PATCH 00/27] Parallel submission aka multi-bb execbuf

2021-08-20 Thread Matthew Brost
to be a series of loops inside the IOCTL rather than 1 large one on the outside, address Daniel Vetter's comments, rebase on [3] Signed-off-by: Matthew Brost [1] https://patchwork.freedesktop.org/series/92028/ [2] https://patchwork.freedesktop.org/series/93071/ [3]

[PATCH 08/27] drm/i915: Add logical engine mapping

2021-08-20 Thread Matthew Brost
Add logical engine mapping. This is required for split-frame, as workloads need to be placed on engines in a logically contiguous manner. v2: (Daniel Vetter) - Add kernel doc for new fields Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 60

[PATCH 09/27] drm/i915: Expose logical engine instance to user

2021-08-20 Thread Matthew Brost
expose the logical mapping with the existing query engine info IOCTL. IGT: https://patchwork.freedesktop.org/patch/445637/?series=92854&rev=1 media UMD: link coming soon v2: (Daniel Vetter) - Add IGT link, placeholder for media UMD Cc: Tvrtko Ursulin Signed-off-by: Matthew B

[PATCH 12/27] drm/i915/guc: Add multi-lrc context registration

2021-08-20 Thread Matthew Brost
Add multi-lrc context registration H2G. In addition a workqueue and process descriptor are setup during multi-lrc context registration as these data structures are needed for multi-lrc submission. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context_types.h | 12 ++ drivers

[PATCH 15/27] drm/i915/guc: Implement multi-lrc submission

2021-08-20 Thread Matthew Brost
coalesce requests into a single submission. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc.c| 21 ++ drivers/gpu/drm/i915/gt/uc/intel_guc.h| 8 + drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 24 +- drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 6

[PATCH 05/27] drm/i915: Add GT PM unpark worker

2021-08-20 Thread Matthew Brost
rates / drains the list + queues the workqueues. First user of this is deregistration of GuC contexts. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/gt/intel_gt.c| 3 ++ drivers/gpu/drm/i915/gt/intel_gt_pm.c

[PATCH 11/27] drm/i915/guc: Implement parallel context pin / unpin functions

2021-08-20 Thread Matthew Brost
ntext. v2: (Daniel Vetter) - Perma-pin parallel contexts Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 70 +++ 1 file changed, 70 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/

[PATCH 10/27] drm/i915/guc: Introduce context parent-child relationship

2021-08-20 Thread Matthew Brost
er to access parent to ensure safety Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 29 ++ drivers/gpu/drm/i915/gt/intel_context.h | 39 +++ drivers/gpu/drm/i915/gt/intel_context_types.h | 23 +++ 3 files changed, 91 inser

[PATCH 07/27] drm/i915/guc: Don't call switch_to_kernel_context with GuC submission

2021-08-20 Thread Matthew Brost
igned-off-by: Matthew Brost Reviewed-by: Daniel Vetter --- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c index 1f07ac4e0672..11fee66daf60 100644 --- a/dr

[PATCH 02/27] drm/i915/guc: Allow flexible number of context ids

2021-08-20 Thread Matthew Brost
Number of available GuC contexts ids might be limited. Stop referring in code to macro and use variable instead. Signed-off-by: Michal Wajdeczko Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/uc/intel_guc.h| 4 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 15

[PATCH 03/27] drm/i915/guc: Connect the number of guc_ids to debugfs

2021-08-20 Thread Matthew Brost
For testing purposes it may make sense to reduce the number of guc_ids available to be allocated. Add debugfs support for setting the number of guc_ids. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_debugfs.c| 31 +++ .../gpu/drm/i915/gt/uc

[PATCH 01/27] drm/i915/guc: Squash Clean up GuC CI failures, simplify locking, and kernel DOC

2021-08-20 Thread Matthew Brost
https://patchwork.freedesktop.org/series/93704/ Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 19 +- drivers/gpu/drm/i915/gt/intel_context_types.h | 81 +- .../drm/i915/gt/intel_execlists_submission.c | 4 - drivers/gpu/drm/i915/gt/selftest_hangcheck.c

[PATCH 04/27] drm/i915/guc: Take GT PM ref when deregistering context

2021-08-20 Thread Matthew Brost
Taking a PM reference to prevent intel_gt_wait_for_idle from short circuiting while a deregister context H2G is in flight. FIXME: Move locking / structure changes into different patch Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 2 + drivers/gpu/drm/i915

[PATCH 27/27] drm/i915/execlists: Weak parallel submission support for execlists

2021-08-20 Thread Matthew Brost
there for the existing (hopefully soon deprecated) bonding interface. We perma-pin these execlists contexts to align with GuC implementation. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 9 ++- drivers/gpu/drm/i915/gt/intel_context.c | 4 +- .../drm

[PATCH 06/27] drm/i915/guc: Take engine PM when a context is pinned with GuC submission

2021-08-20 Thread Matthew Brost
Taking a PM reference to prevent intel_gt_wait_for_idle from short circuiting while a scheduling of user context could be enabled. v2: (Daniel Vetter) - Add might_lock annotations to pin / unpin function Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 3

[PATCH 14/27] drm/i915/guc: Assign contexts in parent-child relationship consecutive guc_ids

2021-08-20 Thread Matthew Brost
is a precursor to the full GuC multi-lrc implementation but aligns to how GuC mutli-lrc interface is defined - guc_ids must be consecutive when using the GuC multi-lrc interface. v2: (Daniel Vetter) - Explictly state why we assign consecutive guc_ids Signed-off-by: Matthew Brost --- drivers

[PATCH 17/27] drm/i915/guc: Implement multi-lrc reset

2021-08-20 Thread Matthew Brost
Update context and full GPU reset to work with multi-lrc. The idea is parent context tracks all the active requests inflight for itself and its' children. The parent context owns the reset replaying / canceling requests as needed. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i9

[PATCH 16/27] drm/i915/guc: Insert submit fences between requests in parent-child relationship

2021-08-20 Thread Matthew Brost
to a single timeline. Signed-off-by: Matthew Brost Cc: John Harrison --- drivers/gpu/drm/i915/gt/intel_context.h | 5 + drivers/gpu/drm/i915/gt/intel_context_types.h | 7 + .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 5 +- drivers/gpu/drm/i915/i915_request.c | 120

[PATCH 23/27] drm/i915/guc: Implement no mid batch preemption for multi-lrc

2021-08-20 Thread Matthew Brost
a context is configured by set parallel extension. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gt/intel_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_context_types.h | 3 + drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 2 +- .../gpu/drm/i915/gt/uc/intel_guc_submissio

[PATCH 21/27] drm/i915/doc: Update parallel submit doc to point to i915_drm.h

2021-08-20 Thread Matthew Brost
Update parallel submit doc to point to i915_drm.h Signed-off-by: Matthew Brost --- Documentation/gpu/rfc/i915_parallel_execbuf.h | 122 -- Documentation/gpu/rfc/i915_scheduler.rst | 4 +- 2 files changed, 2 insertions(+), 124 deletions(-) delete mode 100644 Documentation

[PATCH 25/27] drm/i915/guc: Handle errors in multi-lrc requests

2021-08-20 Thread Matthew Brost
. If all the requests are not present this handshake doesn't work. To work around this, if multi-lrc request has an error we skip the handshake but still emit the breadcrumbs seqno. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 61 ++- 1

[PATCH 13/27] drm/i915/guc: Ensure GuC schedule operations do not operate on child contexts

2021-08-20 Thread Matthew Brost
In GuC parent-child contexts the parent context controls the scheduling, ensure only the parent does the scheduling operations. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 24 ++- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a

[PATCH 26/27] drm/i915: Enable multi-bb execbuf

2021-08-20 Thread Matthew Brost
Enable multi-bb execbuf by enabling the set_parallel extension. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c index

[PATCH 24/27] drm/i915: Multi-BB execbuf

2021-08-20 Thread Matthew Brost
o the user and to stick in dma resv slots. IGT: https://patchwork.freedesktop.org/patch/447008/?series=93071&rev=1 media UMD: link to come Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 765 -- drivers/gpu/drm/i915/gt/intel_context

[PATCH 22/27] drm/i915/guc: Add basic GuC multi-lrc selftest

2021-08-20 Thread Matthew Brost
Add very basic (single submission) multi-lrc selftest. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 1 + .../drm/i915/gt/uc/selftest_guc_multi_lrc.c | 180 ++ .../drm/i915/selftests/i915_live_selftests.h | 1 + 3 files changed, 182

[PATCH 19/27] drm/i915: Fix bug in user proto-context creation that leaked contexts

2021-08-20 Thread Matthew Brost
Set number of engines before attempting to create contexts so the function free_engines can clean up properly. Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Signed-off-by: Matthew Brost Cc: --- drivers/gpu/drm/i915/gem/i915_gem_con

[PATCH 20/27] drm/i915/guc: Connect UAPI to GuC multi-lrc interface

2021-08-20 Thread Matthew Brost
for media UMD link Cc: Tvrtko Ursulin Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 220 +- .../gpu/drm/i915/gem/i915_gem_context_types.h | 6 + drivers/gpu/drm/i915/gt/intel_context_types.h | 9 +- drivers/gpu/drm/i915/gt/intel_engine.

[PATCH 18/27] drm/i915/guc: Update debugfs for GuC multi-lrc

2021-08-20 Thread Matthew Brost
Display the workqueue status in debugfs for GuC contexts that are in parent-child relationship. Signed-off-by: Matthew Brost --- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 51 ++- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc

Re: [PATCH 13/27] drm/i915/guc: Take context ref when cancelling request

2021-08-24 Thread Matthew Brost
On Fri, Aug 20, 2021 at 05:07:27PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > A context can get destroyed after cancelling a request so take a > > reference to context when cancelling a request. > > Wh

Re: [PATCH 17/27] drm/i915/guc: Flush G2H work queue during reset

2021-08-24 Thread Matthew Brost
On Fri, Aug 20, 2021 at 05:25:41PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > It isn't safe to scrub for missing G2H or continue with the reset until > > all G2H processing is complete. Flush the G2H work queue during rese

Re: [Intel-gfx] [PATCH 14/27] drm/i915/guc: Don't touch guc_state.sched_state without a lock

2021-08-24 Thread Matthew Brost
On Tue, Aug 24, 2021 at 06:20:49PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Before we did some clever tricks to not use the a lock when touching > > guc_state.sched_state in certain cases. Don't do that, enfor

Re: [Intel-gfx] [PATCH 06/27] drm/i915/guc: Workaround reset G2H is received after schedule done G2H

2021-08-24 Thread Matthew Brost
On Tue, Aug 24, 2021 at 04:31:21PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > If the context is reset as a result of the request cancelation the > > context reset G2H is received after schedule disable done G2H which is >

Re: [Intel-gfx] [PATCH 20/27] drm/i915/guc: Rework and simplify locking

2021-08-25 Thread Matthew Brost
On Wed, Aug 25, 2021 at 09:52:06AM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Rework and simplify the locking with GuC subission. Drop > > sched_state_no_lock and move all fields under the guc_state.sched_state > > and pr

Re: [Intel-gfx] [PATCH 11/27] drm/i915/selftests: Fix memory corruption in live_lrc_isolation

2021-08-25 Thread Matthew Brost
On Tue, Aug 24, 2021 at 05:07:13PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > GuC submission has exposed an existing memory corruption in > > live_lrc_isolation. We believe that some writes to the watchdog offsets > > in

Re: [Intel-gfx] [PATCH 23/27] drm/i915/guc: Move GuC priority fields in context under guc_active

2021-08-25 Thread Matthew Brost
On Wed, Aug 25, 2021 at 02:51:11PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Move GuC management fields in context under guc_active struct as this is > > where the lock that protects theses fields lives. Also only set gu

Re: [Intel-gfx] [PATCH 23/27] drm/i915/guc: Move GuC priority fields in context under guc_active

2021-08-25 Thread Matthew Brost
On Wed, Aug 25, 2021 at 02:51:11PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Move GuC management fields in context under guc_active struct as this is > > where the lock that protects theses fields lives. Also only set gu

Re: [Intel-gfx] [PATCH 21/27] drm/i915/guc: Proper xarray usage for contexts_lookup

2021-08-25 Thread Matthew Brost
On Wed, Aug 25, 2021 at 05:44:11PM -0700, Daniele Ceraolo Spurio wrote: > > > On 8/18/2021 11:16 PM, Matthew Brost wrote: > > Lock the xarray and take ref to the context if needed. > > > > v2: > > (Checkpatch) > >- Add new line after declaration >

[PATCH 01/27] drm/i915/guc: Fix blocked context accounting

2021-08-25 Thread Matthew Brost
217d ("drm/i915/guc: Support request cancellation") Signed-off-by: Matthew Brost Reviewed-by: Daniel Vetter Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/d

[PATCH 03/27] drm/i915/guc: Unwind context requests in reverse order

2021-08-25 Thread Matthew Brost
5/guc: Reset implementation for new GuC interface") Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Cc: --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submi

[PATCH 02/27] drm/i915/guc: Fix outstanding G2H accounting

2021-08-25 Thread Matthew Brost
a G2H response thus the counter should be incremented. Also always use helper when decrementing this value. Fixes: f4eb1f3fe946 ("drm/i915/guc: Ensure G2H response has space in buffer") Signed-off-by: Matthew Brost Cc: --- .../gpu/drm/i915/gt/uc/intel_guc_submiss

[PATCH 05/27] drm/i915/guc: Process all G2H message at once in work queue

2021-08-25 Thread Matthew Brost
Rather than processing 1 G2H at a time and re-queuing the work queue if more messages exist, process all the G2H in a single pass of the work queue. Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Cc: Daniel Vetter Cc: Michal Wajdeczko --- drivers/gpu/drm/i915/gt/uc

[PATCH 08/27] drm/i915/selftests: Add a cancel request selftest that triggers a reset

2021-08-25 Thread Matthew Brost
Add a cancel request selftest that results in an engine reset to cancel the request as it is non-preemptable. Also insert a NOP request after the cancelled request and confirm that it completely successfully. Signed-off-by: Matthew Brost --- drivers/gpu/drm/i915/selftests/i915_request.c | 100

<    1   2   3   4   5   6   7   8   9   10   >