diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2017-09-22 08:43:07 -0400 |
---|---|---|
committer | Mika Kuoppala <mika.kuoppala@intel.com> | 2017-09-25 04:33:53 -0400 |
commit | 76e70087d360fdbe97f24c205d585ada04126e5f (patch) | |
tree | 2ad0fd9d5614b6d79367055577528318ececda1d /drivers/gpu/drm/i915/intel_ringbuffer.h | |
parent | 7a62cc6107f31e119a0df6f79fa9fae566b1a22e (diff) |
drm/i915: Make execlist port count variable
As we emulate execlists on top of the GuC workqueue, it is not
restricted to just 2 ports and we can increase that number arbitrarily
to trade-off queue depth (i.e. scheduling latency) against pipeline
bubbles.
v2: rebase. better commit msg (Chris)
v3: rebase
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20170922124307.10914-5-mika.kuoppala@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 0eae5936bc3c..56d7ae9f298b 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -234,7 +234,14 @@ struct intel_engine_execlists { | |||
234 | * @context_id: context ID for port | 234 | * @context_id: context ID for port |
235 | */ | 235 | */ |
236 | GEM_DEBUG_DECL(u32 context_id); | 236 | GEM_DEBUG_DECL(u32 context_id); |
237 | } port[2]; | 237 | |
238 | #define EXECLIST_MAX_PORTS 2 | ||
239 | } port[EXECLIST_MAX_PORTS]; | ||
240 | |||
241 | /** | ||
242 | * @port_mask: number of execlist ports - 1 | ||
243 | */ | ||
244 | unsigned int port_mask; | ||
238 | 245 | ||
239 | /** | 246 | /** |
240 | * @queue: queue of requests, in priority lists | 247 | * @queue: queue of requests, in priority lists |
@@ -511,16 +518,22 @@ struct intel_engine_cs { | |||
511 | u32 (*get_cmd_length_mask)(u32 cmd_header); | 518 | u32 (*get_cmd_length_mask)(u32 cmd_header); |
512 | }; | 519 | }; |
513 | 520 | ||
521 | static inline unsigned int | ||
522 | execlists_num_ports(const struct intel_engine_execlists * const execlists) | ||
523 | { | ||
524 | return execlists->port_mask + 1; | ||
525 | } | ||
526 | |||
514 | static inline void | 527 | static inline void |
515 | execlists_port_complete(struct intel_engine_execlists * const execlists, | 528 | execlists_port_complete(struct intel_engine_execlists * const execlists, |
516 | struct execlist_port * const port) | 529 | struct execlist_port * const port) |
517 | { | 530 | { |
518 | struct execlist_port * const port1 = &execlists->port[1]; | 531 | const unsigned int m = execlists->port_mask; |
519 | 532 | ||
520 | GEM_BUG_ON(port_index(port, execlists) != 0); | 533 | GEM_BUG_ON(port_index(port, execlists) != 0); |
521 | 534 | ||
522 | *port = *port1; | 535 | memmove(port, port + 1, m * sizeof(struct execlist_port)); |
523 | memset(port1, 0, sizeof(struct execlist_port)); | 536 | memset(port + m, 0, sizeof(struct execlist_port)); |
524 | } | 537 | } |
525 | 538 | ||
526 | static inline unsigned int | 539 | static inline unsigned int |