intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH i-g-t] igt/gen3_*_blits: Add memory requirement checks
@ 2018-09-14 13:35 Chris Wilson
  2018-09-14 13:45 ` [igt-dev] " Ville Syrjälä
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2018-09-14 13:35 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Check we have sufficient memory to run the tests before getting trapped
in the swap of despair.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107935
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gen3_mixed_blits.c         | 1 +
 tests/gen3_render_linear_blits.c | 1 +
 tests/gen3_render_mixed_blits.c  | 1 +
 tests/gen3_render_tiledx_blits.c | 1 +
 tests/gen3_render_tiledy_blits.c | 1 +
 5 files changed, 5 insertions(+)

diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index fa64598a6..948f4e6a7 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -458,6 +458,7 @@ int main(int argc, char **argv)
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
+	intel_require_memory(count, 1024*1024, CHECK_RAM);
 
 	handle = malloc(sizeof(uint32_t)*count*3);
 	tiling = handle + count;
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index a03d7fc06..9d1499a59 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -333,6 +333,7 @@ int main(int argc, char **argv)
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
+	intel_require_memory(count, 1024*1024, CHECK_RAM);
 
 	handle = malloc(sizeof(uint32_t)*count*2);
 	start_val = handle + count;
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index 2f127d993..afb53a598 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -352,6 +352,7 @@ int main(int argc, char **argv)
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
+	intel_require_memory(count, 1024*1024, CHECK_RAM);
 
 	handle = malloc(sizeof(uint32_t)*count*3);
 	tiling = handle + count;
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 06cdda382..e6246f2b0 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -339,6 +339,7 @@ int main(int argc, char **argv)
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
+	intel_require_memory(count, 1024*1024, CHECK_RAM);
 
 	handle = malloc(sizeof(uint32_t)*count*2);
 	start_val = handle + count;
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 9e4f4b77b..17502ccb7 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -339,6 +339,7 @@ int main(int argc, char **argv)
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 	igt_info("Using %d 1MiB buffers\n", count);
+	intel_require_memory(count, 1024*1024, CHECK_RAM);
 
 	handle = malloc(sizeof(uint32_t)*count*2);
 	start_val = handle + count;
-- 
2.19.0

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

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

* Re: [igt-dev] [PATCH i-g-t] igt/gen3_*_blits: Add memory requirement checks
  2018-09-14 13:35 [PATCH i-g-t] igt/gen3_*_blits: Add memory requirement checks Chris Wilson
@ 2018-09-14 13:45 ` Ville Syrjälä
  0 siblings, 0 replies; 2+ messages in thread
From: Ville Syrjälä @ 2018-09-14 13:45 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev, intel-gfx

On Fri, Sep 14, 2018 at 02:35:38PM +0100, Chris Wilson wrote:
> Check we have sufficient memory to run the tests before getting trapped
> in the swap of despair.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107935
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Looks consistent with the igt_info().

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

> ---
>  tests/gen3_mixed_blits.c         | 1 +
>  tests/gen3_render_linear_blits.c | 1 +
>  tests/gen3_render_mixed_blits.c  | 1 +
>  tests/gen3_render_tiledx_blits.c | 1 +
>  tests/gen3_render_tiledy_blits.c | 1 +
>  5 files changed, 5 insertions(+)
> 
> diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
> index fa64598a6..948f4e6a7 100644
> --- a/tests/gen3_mixed_blits.c
> +++ b/tests/gen3_mixed_blits.c
> @@ -458,6 +458,7 @@ int main(int argc, char **argv)
>  	if (count == 0)
>  		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
>  	igt_info("Using %d 1MiB buffers\n", count);
> +	intel_require_memory(count, 1024*1024, CHECK_RAM);
>  
>  	handle = malloc(sizeof(uint32_t)*count*3);
>  	tiling = handle + count;
> diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
> index a03d7fc06..9d1499a59 100644
> --- a/tests/gen3_render_linear_blits.c
> +++ b/tests/gen3_render_linear_blits.c
> @@ -333,6 +333,7 @@ int main(int argc, char **argv)
>  	if (count == 0)
>  		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
>  	igt_info("Using %d 1MiB buffers\n", count);
> +	intel_require_memory(count, 1024*1024, CHECK_RAM);
>  
>  	handle = malloc(sizeof(uint32_t)*count*2);
>  	start_val = handle + count;
> diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
> index 2f127d993..afb53a598 100644
> --- a/tests/gen3_render_mixed_blits.c
> +++ b/tests/gen3_render_mixed_blits.c
> @@ -352,6 +352,7 @@ int main(int argc, char **argv)
>  	if (count == 0)
>  		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
>  	igt_info("Using %d 1MiB buffers\n", count);
> +	intel_require_memory(count, 1024*1024, CHECK_RAM);
>  
>  	handle = malloc(sizeof(uint32_t)*count*3);
>  	tiling = handle + count;
> diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
> index 06cdda382..e6246f2b0 100644
> --- a/tests/gen3_render_tiledx_blits.c
> +++ b/tests/gen3_render_tiledx_blits.c
> @@ -339,6 +339,7 @@ int main(int argc, char **argv)
>  	if (count == 0)
>  		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
>  	igt_info("Using %d 1MiB buffers\n", count);
> +	intel_require_memory(count, 1024*1024, CHECK_RAM);
>  
>  	handle = malloc(sizeof(uint32_t)*count*2);
>  	start_val = handle + count;
> diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
> index 9e4f4b77b..17502ccb7 100644
> --- a/tests/gen3_render_tiledy_blits.c
> +++ b/tests/gen3_render_tiledy_blits.c
> @@ -339,6 +339,7 @@ int main(int argc, char **argv)
>  	if (count == 0)
>  		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
>  	igt_info("Using %d 1MiB buffers\n", count);
> +	intel_require_memory(count, 1024*1024, CHECK_RAM);
>  
>  	handle = malloc(sizeof(uint32_t)*count*2);
>  	start_val = handle + count;
> -- 
> 2.19.0
> 
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2018-09-14 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-14 13:35 [PATCH i-g-t] igt/gen3_*_blits: Add memory requirement checks Chris Wilson
2018-09-14 13:45 ` [igt-dev] " Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).