-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915/gt: Distinguish the virtual breadcrumbs from the irq breadcr…
…umbs On the virtual engines, we only use the intel_breadcrumbs for tracking signaling of stale breadcrumbs from the irq_workers. They do not have any associated interrupt handling, active requests are passed to a physical engine and associated breadcrumb interrupt handler. This causes issues for us as we need to ensure that we do not actually try and enable interrupts and the powermanagement required for them on the virtual engine, as they will never be disabled. Instead, let's specify the physical engine used for interrupt handler on a particular breadcrumb. v2: Drop b->irq_armed = true mocking for no interrupt HW Fixes: 4fe6abb ("drm/i915/gt: Ignore irq enabling on the virtual engines") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200731154834.8378-4-chris@chris-wilson.co.uk Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
- Loading branch information
Chris Wilson
authored and
Joonas Lahtinen
committed
Sep 7, 2020
1 parent
56f581b
commit b3786b2
Showing
16 changed files
with
162 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2019 Intel Corporation | ||
*/ | ||
|
||
#ifndef __INTEL_BREADCRUMBS__ | ||
#define __INTEL_BREADCRUMBS__ | ||
|
||
#include <linux/irq_work.h> | ||
|
||
#include "intel_engine_types.h" | ||
|
||
struct drm_printer; | ||
struct i915_request; | ||
struct intel_breadcrumbs; | ||
|
||
struct intel_breadcrumbs * | ||
intel_breadcrumbs_create(struct intel_engine_cs *irq_engine); | ||
void intel_breadcrumbs_free(struct intel_breadcrumbs *b); | ||
|
||
void intel_breadcrumbs_reset(struct intel_breadcrumbs *b); | ||
void intel_breadcrumbs_park(struct intel_breadcrumbs *b); | ||
|
||
static inline void | ||
intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine) | ||
{ | ||
irq_work_queue(&engine->breadcrumbs->irq_work); | ||
} | ||
|
||
void intel_engine_print_breadcrumbs(struct intel_engine_cs *engine, | ||
struct drm_printer *p); | ||
|
||
bool i915_request_enable_breadcrumb(struct i915_request *request); | ||
void i915_request_cancel_breadcrumb(struct i915_request *request); | ||
|
||
#endif /* __INTEL_BREADCRUMBS__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2019 Intel Corporation | ||
*/ | ||
|
||
#ifndef __INTEL_BREADCRUMBS_TYPES__ | ||
#define __INTEL_BREADCRUMBS_TYPES__ | ||
|
||
#include <linux/irq_work.h> | ||
#include <linux/list.h> | ||
#include <linux/spinlock.h> | ||
#include <linux/types.h> | ||
|
||
/* | ||
* Rather than have every client wait upon all user interrupts, | ||
* with the herd waking after every interrupt and each doing the | ||
* heavyweight seqno dance, we delegate the task (of being the | ||
* bottom-half of the user interrupt) to the first client. After | ||
* every interrupt, we wake up one client, who does the heavyweight | ||
* coherent seqno read and either goes back to sleep (if incomplete), | ||
* or wakes up all the completed clients in parallel, before then | ||
* transferring the bottom-half status to the next client in the queue. | ||
* | ||
* Compared to walking the entire list of waiters in a single dedicated | ||
* bottom-half, we reduce the latency of the first waiter by avoiding | ||
* a context switch, but incur additional coherent seqno reads when | ||
* following the chain of request breadcrumbs. Since it is most likely | ||
* that we have a single client waiting on each seqno, then reducing | ||
* the overhead of waking that client is much preferred. | ||
*/ | ||
struct intel_breadcrumbs { | ||
spinlock_t irq_lock; /* protects the lists used in hardirq context */ | ||
|
||
/* Not all breadcrumbs are attached to physical HW */ | ||
struct intel_engine_cs *irq_engine; | ||
|
||
struct list_head signalers; | ||
struct list_head signaled_requests; | ||
|
||
struct irq_work irq_work; /* for use from inside irq_lock */ | ||
|
||
unsigned int irq_enabled; | ||
|
||
bool irq_armed; | ||
}; | ||
|
||
#endif /* __INTEL_BREADCRUMBS_TYPES__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.