Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] lib/i915: Fix is_physical_engine advancement
@ 2020-01-29 12:16 Chris Wilson
  2020-01-29 12:35 ` Andi Shyti
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2020-01-29 12:16 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Update the local var e after iterating to the next engine when searching
for the next non-virtual engine. Otherwise, it is prone to loop forever.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 lib/i915/gem_engine_topology.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index 43a99e0ff..9daa03df4 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -180,10 +180,8 @@ intel_get_current_physical_engine(struct intel_engine_data *ed)
 {
 	struct intel_execution_engine2 *e;
 
-	for (e = intel_get_current_engine(ed);
-	     e && e->is_virtual;
-	     intel_next_engine(ed))
-		;
+	while ((e = intel_get_current_engine(ed)) && e->is_virtual)
+	     intel_next_engine(ed);
 
 	return e;
 }
-- 
2.25.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-29 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-29 12:16 [Intel-gfx] [PATCH i-g-t] lib/i915: Fix is_physical_engine advancement Chris Wilson
2020-01-29 12:35 ` Andi Shyti
2020-01-29 12:37   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox