Skip to contentSkip to conversation

execlist port handling improvements

PATCH In review Mika Kuoppala 3 participants 7 messages Nov 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover execlist port handling improvements

Hi,

Seems that the dust has now settled on guc side enough that these could go in. There are some stuff (engine info and execlist setup patches) still in flight but should only cause trivial conflicts.

I dropped r-b on first patch due to not-so-simple rebase.

If these are ok, I will send another series for CI with guc enabled.

-Mika

Mika Kuoppala (2):
drm/i915: Introduce execlist_port_* accessors drm/i915: Move execlists port head instead of memmoving array

 drivers/gpu/drm/i915/i915_gpu_error.c       |  5 +-
 drivers/gpu/drm/i915/intel_engine_cs.c      | 18 +++++---
 drivers/gpu/drm/i915/intel_guc_submission.c | 71 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/intel_lrc.c            | 55 +++++++++++++---------
 drivers/gpu/drm/i915/intel_ringbuffer.h     | 54 +++++++++++++++++++---
 5 files changed, 144 insertions(+), 59 deletions(-)
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/2 drm/i915: Introduce execlist_port_* accessors

From: Mika Kuoppala <[email protected]>

Instead of trusting that first available port is at index 0, use accessor to hide this. This is a preparation for a following patches where head can be at arbitrary location in the port array.

v2: improved commit message, elsp_ready readability (Chris)
v3: s/execlist_port_index/execlist_port (Chris)
v4: rebase to new naming
v5: fix port_next indexing
v6: adapt to preempt
v7: improved _port_next (Chris)
v8: whitespace, for loop (Chris),
find_first_unset and GEM_BUG_ON after next_port in guc submission

Cc Michał Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gpu_error.c       |  5 +-
 drivers/gpu/drm/i915/intel_engine_cs.c      | 18 +++++---
 drivers/gpu/drm/i915/intel_guc_submission.c | 71 ++++++++++++++++++++---------
 drivers/gpu/drm/i915/intel_lrc.c            | 55 +++++++++++++---------
 drivers/gpu/drm/i915/intel_ringbuffer.h     | 44 +++++++++++++++++-
 5 files changed, 139 insertions(+), 54 deletions(-)
drivers/gpu/drm/i915/i915_gpu_error.c +3 -2
index 876be8f1d930..02bae7d697da 100644
@@ -1350,11 +1350,12 @@ static void engine_record_requests(struct intel_engine_cs *engine,
 static void error_record_engine_execlists(struct intel_engine_cs *engine,
 					  struct drm_i915_error_engine *ee)
 {
-	const struct intel_engine_execlists * const execlists = &engine->execlists;
+	struct intel_engine_execlists * const execlists = &engine->execlists;
 	unsigned int n;
 
 	for (n = 0; n < execlists_num_ports(execlists); n++) {
-		struct drm_i915_gem_request *rq = port_request(&execlists->port[n]);
+		struct drm_i915_gem_request *rq =
+			port_request(execlists_port(execlists, n));
 
 		if (!rq)
 			break;
drivers/gpu/drm/i915/intel_engine_cs.c +11 -7
index cffd0c812b7e..e954a50d20cf 100644
@@ -1667,7 +1667,7 @@ static void print_request(struct drm_printer *m,
 void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 {
 	struct intel_breadcrumbs * const b = &engine->breadcrumbs;
-	const struct intel_engine_execlists * const execlists = &engine->execlists;
+	struct intel_engine_execlists * const execlists = &engine->execlists;
 	struct i915_gpu_error * const error = &engine->i915->gpu_error;
 	struct drm_i915_private *dev_priv = engine->i915;
 	struct drm_i915_gem_request *rq;
@@ -1780,16 +1780,20 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 
 		rcu_read_lock();
 		for (idx = 0; idx < execlists_num_ports(execlists); idx++) {
-			unsigned int count;
+			struct execlist_port *port;
+			unsigned int count, idx_abs;
+
+			port = execlists_port(execlists, idx);
+			idx_abs = port_index(port, execlists);
 
-			rq = port_unpack(&execlists->port[idx], &count);
+			rq = port_unpack(port, &count);
 			if (rq) {
-				drm_printf(m, "\t\tELSP[%d] count=%d, ",
-					   idx, count);
+				drm_printf(m, "\t\tELSP[%d:%d] count=%d, ",
+					   idx, idx_abs, count);
 				print_request(m, rq, "rq: ");
 			} else {
-				drm_printf(m, "\t\tELSP[%d] idle\n",
-					   idx);
+				drm_printf(m, "\t\tELSP[%d:%d] idle\n",
+					   idx, idx_abs);
 			}
 		}
 		drm_printf(m, "\t\tHW active? 0x%x\n", execlists->active);
drivers/gpu/drm/i915/intel_guc_submission.c +50 -21

132 lines not on this page · raw message

drivers/gpu/drm/i915/intel_lrc.c +33 -22

168 lines not on this page · raw message

drivers/gpu/drm/i915/intel_ringbuffer.h +42 -2

62 lines not on this page · raw message

Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors

Quoting Mika Kuoppala (2017-11-30 09:10:27)

Quoted 16 lines

From: Mika Kuoppala <[email protected]>

Instead of trusting that first available port is at index 0, use accessor to hide this. This is a preparation for a following patches where head can be at arbitrary location in the port array.

v2: improved commit message, elsp_ready readability (Chris)
v3: s/execlist_port_index/execlist_port (Chris)
v4: rebase to new naming
v5: fix port_next indexing
v6: adapt to preempt
v7: improved _port_next (Chris)
v8: whitespace, for loop (Chris),
find_first_unset and GEM_BUG_ON after next_port in guc submission

Quoted 4 lines
Cc Michał Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>

I get
add/remove: 0/0 grow/shrink: 4/2 up/down: 380/-2 (378)
function old new delta

guc_submission_tasklet                      1488    1660    +172
execlists_submission_tasklet                2129    2245    +116
intel_engine_dump                           2234    2281     +47
execlists_cancel_port_requests               254     299     +45
intel_engine_init_cmd_parser                1134    1133      -1
capture                                     5700    5699      -1

Not the end of the world, just something we may be able to tweak.

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

PATCH 2/2 drm/i915: Move execlists port head instead of memmoving array

In reply to Mika Kuoppala

From: Mika Kuoppala <[email protected]>

As all our access to execlist ports are through head and tail helpers, we can now move the head instead of memmoving the array.

v2: use memset (Chris)

Cc Michał Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_ringbuffer.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.h +5 -5
index 17f1fb4ded89..6a3cb8e09ed6 100644
@@ -685,13 +685,13 @@ static inline struct execlist_port *
 execlists_head_complete(struct intel_engine_execlists * const execlists,
 			struct execlist_port * const port)
 {
-	const unsigned int m = execlists->port_mask;
-
-	GEM_BUG_ON(port_index(port, execlists) != 0);
+	GEM_BUG_ON(port_index(port, execlists) != execlists->port_head);
+	GEM_BUG_ON(!port_isset(port));
 	GEM_BUG_ON(!execlists_is_active(execlists, EXECLISTS_ACTIVE_USER));
 
-	memmove(port, port + 1, m * sizeof(struct execlist_port));
-	memset(port + m, 0, sizeof(struct execlist_port));
+	memset(port, 0, sizeof(*port));
+
+	execlists->port_head = port_head_add(execlists, 1);
 
 	return execlists_port_head(execlists);
 }
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 2/2] drm/i915: Move execlists port head instead of memmoving array

Quoting Mika Kuoppala (2017-11-30 09:10:28)

Quoted 5 lines

From: Mika Kuoppala <[email protected]>

As all our access to execlist ports are through head and tail helpers, we can now move the head instead of memmoving the array.

Quoted 7 lines

v2: use memset (Chris)

Cc Michał Winiarski <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Chris Wilson <[email protected]>

This patch:
add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-58 (-58)

function                                     old     new   delta
execlists_cancel_port_requests               299     288     -11
guc_submission_tasklet                      1660    1643     -17
execlists_submission_tasklet                2245    2215     -30

Overall:
add/remove: 0/0 grow/shrink: 4/2 up/down: 322/-2 (320)
function old new delta

guc_submission_tasklet                      1488    1643    +155
execlists_submission_tasklet                2129    2215     +86
intel_engine_dump                           2234    2281     +47
execlists_cancel_port_requests               254     288     +34
intel_engine_init_cmd_parser                1134    1133      -1
capture                                     5700    5699      -1

Better. Still room for improvement, 2215 bytes worth :) -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✓ Fi.CI.BAT: success for execlist port handling improvements

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: execlist port handling improvements
URL : https://patchwork.freedesktop.org/series/34676/
State : success

== Summary ==

Series 34676v1 execlist port handling improvements
https://patchwork.freedesktop.org/api/1.0/series/34676/revisions/1/mbox/

Test gem_exec_reloc:

        Subgroup basic-cpu-active:
                fail       -> PASS       (fi-gdg-551) fdo#102582 +1

fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:440s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:440s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:379s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:515s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:500s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:508s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:489s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:474s
fi-elk-e7500     total:224  pass:162  dwarn:16  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 time:267s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:536s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:357s
fi-hsw-4770r     total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  time:260s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:401s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-ivb-3770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:449s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:490s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:524s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:478s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:536s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:594s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:458s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:540s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-skl-6700k     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:521s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:450s
fi-snb-2520m     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:546s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:417s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:611s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:487s

6d6c48b9b35806aba461d2c8285db2689de9095f drm-tip: 2017y-11m-30d-12h-22m-59s UTC integration manifest c4bd94d5cb94 drm/i915: Move execlists port head instead of memmoving array 63bb3aeb8d14 drm/i915: Introduce execlist_port_* accessors

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7370/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✓ Fi.CI.IGT: success for execlist port handling improvements

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: execlist port handling improvements
URL : https://patchwork.freedesktop.org/series/34676/
State : success

== Summary ==

Warning: bzip Patchwork_7370/shard-snb1/results17.json.bz2 wasn't in correct JSON format Test gem_busy:

        Subgroup close-race:
                fail       -> PASS       (shard-snb) fdo#103829
Test drv_module_reload:
        Subgroup basic-no-display:
                pass       -> DMESG-WARN (shard-snb) fdo#102707

fdo#103829 https://bugs.freedesktop.org/show_bug.cgi?id=103829
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707

shard-hsw        total:2650 pass:1527 dwarn:1   dfail:0   fail:8   skip:1113 time:9221s
shard-snb        total:2588 pass:1270 dwarn:2   dfail:0   fail:11  skip:1305 time:7819s

Blacklisted hosts:
shard-apl total:2663 pass:1689 dwarn:1 dfail:0 fail:24 skip:949 time:13672s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7370/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx