Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device
@ 2020-11-05  0:21 Chris Wilson
  2020-11-05  0:21 ` [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device Chris Wilson
  2020-11-05  1:49 ` [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Dixit, Ashutosh
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2020-11-05  0:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Reopen the existing device, rather than relying on the filtering in
drm_open_driver().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_exec_whisper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index 9acf6c306..b63d791d1 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -87,12 +87,12 @@ struct hang {
 	int fd;
 };
 
-static void init_hang(struct hang *h)
+static void init_hang(struct hang *h, int fd)
 {
 	uint32_t *batch;
 	int i, gen;
 
-	h->fd = drm_open_driver(DRIVER_INTEL);
+	h->fd = gem_reopen_driver(fd);
 	igt_allow_hang(h->fd, 0, 0);
 
 	gen = intel_gen(intel_get_drm_devid(h->fd));
@@ -224,7 +224,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
 		igt_require(gem_has_queues(fd));
 
 	if (flags & HANG)
-		init_hang(&hang);
+		init_hang(&hang, fd);
 
 	nchild = 1;
 	if (flags & FORKED)
@@ -304,7 +304,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
 		}
 		if (flags & FDS) {
 			for (n = 0; n < 64; n++)
-				fds[n] = drm_open_driver(DRIVER_INTEL);
+				fds[n] = gem_reopen_driver(fd);
 		}
 
 		memset(batches, 0, sizeof(batches));
-- 
2.29.2

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

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

* [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device
  2020-11-05  0:21 [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Chris Wilson
@ 2020-11-05  0:21 ` Chris Wilson
  2020-11-05  1:51   ` Dixit, Ashutosh
  2020-11-05  1:49 ` [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Dixit, Ashutosh
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2020-11-05  0:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Use gem_reopen_driver() to always reopen the same device without relying
on the filtering in drm_open_driver().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_ctx_thrash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/i915/gem_ctx_thrash.c b/tests/i915/gem_ctx_thrash.c
index d32619d5d..d9ddd6689 100644
--- a/tests/i915/gem_ctx_thrash.c
+++ b/tests/i915/gem_ctx_thrash.c
@@ -250,7 +250,7 @@ static void processes(void)
 	fds = malloc(num_ctx * sizeof(int));
 	igt_assert(fds);
 	for (unsigned n = 0; n < num_ctx; n++) {
-		fds[n] = drm_open_driver(DRIVER_INTEL);
+		fds[n] = gem_reopen_driver(fd);
 		if (fds[n] == -1) {
 			int err = errno;
 			for (unsigned i = n; i--; )
-- 
2.29.2

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

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

* Re: [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device
  2020-11-05  0:21 [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Chris Wilson
  2020-11-05  0:21 ` [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device Chris Wilson
@ 2020-11-05  1:49 ` Dixit, Ashutosh
  1 sibling, 0 replies; 4+ messages in thread
From: Dixit, Ashutosh @ 2020-11-05  1:49 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, 04 Nov 2020 16:21:23 -0800, Chris Wilson wrote:
>
> Reopen the existing device, rather than relying on the filtering in
> drm_open_driver().

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_exec_whisper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
> index 9acf6c306..b63d791d1 100644
> --- a/tests/i915/gem_exec_whisper.c
> +++ b/tests/i915/gem_exec_whisper.c
> @@ -87,12 +87,12 @@ struct hang {
>	int fd;
>  };
>
> -static void init_hang(struct hang *h)
> +static void init_hang(struct hang *h, int fd)
>  {
>	uint32_t *batch;
>	int i, gen;
>
> -	h->fd = drm_open_driver(DRIVER_INTEL);
> +	h->fd = gem_reopen_driver(fd);
>	igt_allow_hang(h->fd, 0, 0);
>
>	gen = intel_gen(intel_get_drm_devid(h->fd));
> @@ -224,7 +224,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
>		igt_require(gem_has_queues(fd));
>
>	if (flags & HANG)
> -		init_hang(&hang);
> +		init_hang(&hang, fd);
>
>	nchild = 1;
>	if (flags & FORKED)
> @@ -304,7 +304,7 @@ static void whisper(int fd, unsigned engine, unsigned flags)
>		}
>		if (flags & FDS) {
>			for (n = 0; n < 64; n++)
> -				fds[n] = drm_open_driver(DRIVER_INTEL);
> +				fds[n] = gem_reopen_driver(fd);
>		}
>
>		memset(batches, 0, sizeof(batches));
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device
  2020-11-05  0:21 ` [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device Chris Wilson
@ 2020-11-05  1:51   ` Dixit, Ashutosh
  0 siblings, 0 replies; 4+ messages in thread
From: Dixit, Ashutosh @ 2020-11-05  1:51 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, 04 Nov 2020 16:21:24 -0800, Chris Wilson wrote:
>
> Use gem_reopen_driver() to always reopen the same device without relying
> on the filtering in drm_open_driver().

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_ctx_thrash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/i915/gem_ctx_thrash.c b/tests/i915/gem_ctx_thrash.c
> index d32619d5d..d9ddd6689 100644
> --- a/tests/i915/gem_ctx_thrash.c
> +++ b/tests/i915/gem_ctx_thrash.c
> @@ -250,7 +250,7 @@ static void processes(void)
>	fds = malloc(num_ctx * sizeof(int));
>	igt_assert(fds);
>	for (unsigned n = 0; n < num_ctx; n++) {
> -		fds[n] = drm_open_driver(DRIVER_INTEL);
> +		fds[n] = gem_reopen_driver(fd);
>		if (fds[n] == -1) {
>			int err = errno;
>			for (unsigned i = n; i--; )
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2020-11-05  1:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-05  0:21 [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Chris Wilson
2020-11-05  0:21 ` [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_ctx_thrash: Reopen the same device Chris Wilson
2020-11-05  1:51   ` Dixit, Ashutosh
2020-11-05  1:49 ` [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_whisper: Reopen existing device Dixit, Ashutosh

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