[igt-dev] [PATCH i-g-t 1/1] lib/i915/gem_ring : set the engine to default context

Bommu Krishnaiah krishnaiah.bommu at intel.com
Mon Feb 17 05:50:19 UTC 2020


Copy the existing engine map from default context to
newly created  default context

Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu at intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 lib/i915/gem_ring.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
index 99f4741c..c2eae836 100644
--- a/lib/i915/gem_ring.c
+++ b/lib/i915/gem_ring.c
@@ -143,11 +143,13 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
  * Number of batches that fit in the ring
  */
 unsigned int
-gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags flags)
+gem_measure_ring_inflight(int sfd, unsigned int engine, enum measure_ring_flags flags)
 {
 	unsigned int min = ~0u;
+	uint32_t fd;
 
-	fd = gem_reopen_driver(fd);
+	fd = gem_reopen_driver(sfd);
+	gem_context_copy_engines(sfd, 0, fd, 0);
 
 	/* When available, disable execbuf throttling */
 	fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_NONBLOCK);
-- 
2.25.0.4.g0ad7144999



More information about the igt-dev mailing list