Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] i915/gem_shrink: Open the device before using it!
@ 2019-03-20 16:01 Chris Wilson
  2019-03-20 19:26 ` [igt-dev] " Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2019-03-20 16:01 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110212
Fixes: 8ae86621d6ff ("lib/igt_device: Move intel_get_pci_device under igt_device")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
 tests/i915/gem_shrink.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
index 73b6be725..51d1343ba 100644
--- a/tests/i915/gem_shrink.c
+++ b/tests/i915/gem_shrink.c
@@ -403,7 +403,12 @@ igt_main
 		unsigned int engine;
 		int fd;
 
-		/* Spawn enough processes to use all memory, but each only
+		fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_gem(fd);
+
+
+		/*
+		 * Spawn enough processes to use all memory, but each only
 		 * uses half the available mappable aperture ~128MiB.
 		 * Individually the processes would be ok, but en masse
 		 * we expect the shrinker to start purging objects,
@@ -418,9 +423,6 @@ igt_main
 		intel_require_memory(num_processes, alloc_size,
 				     CHECK_SWAP | CHECK_RAM);
 
-		fd = drm_open_driver(DRIVER_INTEL);
-		igt_require_gem(fd);
-
 		nengine = 0;
 		for_each_engine(fd, engine)
 			engines[nengine++] = engine;
-- 
2.20.1

_______________________________________________
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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_shrink: Open the device before using it!
  2019-03-20 16:01 [PATCH i-g-t] i915/gem_shrink: Open the device before using it! Chris Wilson
@ 2019-03-20 19:26 ` Ville Syrjälä
  2019-03-20 20:38   ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2019-03-20 19:26 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Wed, Mar 20, 2019 at 04:01:51PM +0000, Chris Wilson wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110212
> Fixes: 8ae86621d6ff ("lib/igt_device: Move intel_get_pci_device under igt_device")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> ---
>  tests/i915/gem_shrink.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
> index 73b6be725..51d1343ba 100644
> --- a/tests/i915/gem_shrink.c
> +++ b/tests/i915/gem_shrink.c
> @@ -403,7 +403,12 @@ igt_main
>  		unsigned int engine;
>  		int fd;
>  
> -		/* Spawn enough processes to use all memory, but each only
> +		fd = drm_open_driver(DRIVER_INTEL);
> +		igt_require_gem(fd);
> +
> +

Bonus newline?

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +		/*
> +		 * Spawn enough processes to use all memory, but each only
>  		 * uses half the available mappable aperture ~128MiB.
>  		 * Individually the processes would be ok, but en masse
>  		 * we expect the shrinker to start purging objects,
> @@ -418,9 +423,6 @@ igt_main
>  		intel_require_memory(num_processes, alloc_size,
>  				     CHECK_SWAP | CHECK_RAM);
>  
> -		fd = drm_open_driver(DRIVER_INTEL);
> -		igt_require_gem(fd);
> -
>  		nengine = 0;
>  		for_each_engine(fd, engine)
>  			engines[nengine++] = engine;
> -- 
> 2.20.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

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

* Re: [igt-dev] [PATCH i-g-t] i915/gem_shrink: Open the device before using it!
  2019-03-20 19:26 ` [igt-dev] " Ville Syrjälä
@ 2019-03-20 20:38   ` Chris Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2019-03-20 20:38 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, intel-gfx

Quoting Ville Syrjälä (2019-03-20 19:26:29)
> On Wed, Mar 20, 2019 at 04:01:51PM +0000, Chris Wilson wrote:
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110212
> > Fixes: 8ae86621d6ff ("lib/igt_device: Move intel_get_pci_device under igt_device")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Michał Winiarski <michal.winiarski@intel.com>
> > ---
> >  tests/i915/gem_shrink.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
> > index 73b6be725..51d1343ba 100644
> > --- a/tests/i915/gem_shrink.c
> > +++ b/tests/i915/gem_shrink.c
> > @@ -403,7 +403,12 @@ igt_main
> >               unsigned int engine;
> >               int fd;
> >  
> > -             /* Spawn enough processes to use all memory, but each only
> > +             fd = drm_open_driver(DRIVER_INTEL);
> > +             igt_require_gem(fd);
> > +
> > +
> 
> Bonus newline?

It's a 2-for-one, time-limited offer.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2019-03-20 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-20 16:01 [PATCH i-g-t] i915/gem_shrink: Open the device before using it! Chris Wilson
2019-03-20 19:26 ` [igt-dev] " Ville Syrjälä
2019-03-20 20:38   ` Chris Wilson

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