Skip to contentSkip to conversation

drm/i915: Use execlists_num_ports instead of size of array

PATCH In review Mika Kuoppala 4 participants 6 messages Oct 10, 2017

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

PATCH 1/1 drm/i915: Use execlists_num_ports instead of size of array

There is function to tell how many ports we have, so use it. We still have direct relationship with array size and port count, so no harm was done.

Fixes 76e70087d360 ("drm/i915: Make execlist port count variable")
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 2 +-
 drivers/gpu/drm/i915/intel_lrc.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_guc_submission.c +1 -1
index 31381a327347..f15de4dcefde 100644
@@ -500,7 +500,7 @@ static void i915_guc_submit(struct intel_engine_cs *engine)
 	const unsigned int engine_id = engine->id;
 	unsigned int n;
 
-	for (n = 0; n < ARRAY_SIZE(execlists->port); n++) {
+	for (n = 0; n < execlists_num_ports(execlists); n++) {
 		struct drm_i915_gem_request *rq;
 		unsigned int count;
 
drivers/gpu/drm/i915/intel_lrc.c +1 -1
index 721432ddf403..fbfcf88d7fe3 100644
@@ -691,7 +691,7 @@ static void
 execlist_cancel_port_requests(struct intel_engine_execlists *execlists)
 {
 	struct execlist_port *port = execlists->port;
-	unsigned int num_ports = ARRAY_SIZE(execlists->port);
+	unsigned int num_ports = execlists_num_ports(execlists);
 
 	while (num_ports-- && port_isset(port)) {
 		struct drm_i915_gem_request *rq = port_request(port);
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/1
#1 lore raw

Quoting Mika Kuoppala (2017-10-10 12:48:57)

Quoted 8 lines

There is function to tell how many ports we have, so use it. We still have direct relationship with array size and port count, so no harm was done.

Fixes 76e70087d360 ("drm/i915: Make execlist port count variable")
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

I had a sweepstake on how long that ARRAY_SIZE would last.

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

#2 lore raw

✓ Fi.CI.BAT: success for drm/i915: Use execlists_num_ports instead of size of array

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: drm/i915: Use execlists_num_ports instead of size of array
URL : https://patchwork.freedesktop.org/series/31647/
State : success

== Summary ==

Series 31647v1 drm/i915: Use execlists_num_ports instead of size of array
https://patchwork.freedesktop.org/api/1.0/series/31647/revisions/1/mbox/

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:447s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:473s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:390s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:572s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:288s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:523s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:520s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:540s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:518s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:560s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:633s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:433s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:602s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:433s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:419s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:466s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:508s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:481s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:510s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:580s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:491s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:587s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:666s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:472s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:661s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:537s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:517s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:474s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:588s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:437s

6bcaf2275e52e258c737bc355e73072640be5ac3 drm-tip: 2017y-10m-10d-10h-57m-51s UTC integration manifest 3ff26db5d744 drm/i915: Use execlists_num_ports instead of size of array

== Logs ==

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

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Mika Kuoppala
Quoted 8 lines · Mika Kuoppala

There is function to tell how many ports we have, so use it. We still have direct relationship with array size and port count, so no harm was done.

Fixes 76e70087d360 ("drm/i915: Make execlist port count variable")
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

<SNIP>

drivers/gpu/drm/i915/i915_guc_submission.c static void i915_guc_submit(struct intel_engine_cs *engine) · line 503

Quoted 7 lines

+++ b/drivers/gpu/drm/i915/i915_guc_submission.c

drivers/gpu/drm/i915/i915_guc_submission.c +1 -1
@@ -500,7 +500,7 @@ static void i915_guc_submit(struct intel_engine_cs *engine)
 	const unsigned int engine_id = engine->id;
 	unsigned int n;
 
-	for (n = 0; n < ARRAY_SIZE(execlists->port); n++) {
+	for (n = 0; n < execlists_num_ports(execlists); n++) {

For a while I was looking this delta in reverse and could not figure it out.

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 17 lines · Joonas Lahtinen
Quoted 8 lines · Mika Kuoppala

There is function to tell how many ports we have, so use it. We still have direct relationship with array size and port count, so no harm was done.

Fixes 76e70087d360 ("drm/i915: Make execlist port count variable")
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

<SNIP>

Quoted 5 lines

+++ b/drivers/gpu/drm/i915/i915_guc_submission.c

drivers/gpu/drm/i915/i915_guc_submission.c +0 -0
@@ -500,7 +500,7 @@ static void i915_guc_submit(struct intel_engine_cs *engine)
 	const unsigned int engine_id = engine->id;
 	unsigned int n;
 
Quoted 8 lines

drivers/gpu/drm/i915/i915_guc_submission.c static void i915_guc_submit(struct intel_engine_cs *engine) · line 503

Quoted 2 lines
drivers/gpu/drm/i915/i915_guc_submission.c +1 -1
-	for (n = 0; n < ARRAY_SIZE(execlists->port); n++) {
+	for (n = 0; n < execlists_num_ports(execlists); n++) {

For a while I was looking this delta in reverse and could not figure it out.

I think I messed atleast on one of these missing on the countless rebases.

Thanks for reviews. Pushed.
-Mika
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.IGT: failure for drm/i915: Use execlists_num_ports instead of size of array

In reply to Mika Kuoppala
== Series Details ==

== Series Details ==

Series: drm/i915: Use execlists_num_ports instead of size of array
URL : https://patchwork.freedesktop.org/series/31647/
State : failure

== Summary ==

Test perf:

        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test kms_flip:
        Subgroup modeset-vs-vblank-race-interruptible:
                pass       -> FAIL       (shard-hsw)

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

shard-hsw total:2552 pass:1428 dwarn:6 dfail:0 fail:15 skip:1103 time:9651s

== Logs ==

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