intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning
@ 2022-11-15  7:28 Andrzej Hajda
  2022-11-22  7:22 ` Andrzej Hajda
  2022-11-22  8:26 ` Kamil Konieczny
  0 siblings, 2 replies; 3+ messages in thread
From: Andrzej Hajda @ 2022-11-15  7:28 UTC (permalink / raw)
  To: igt-dev, intel-gfx; +Cc: Matthew Auld, Chris Wilson, Andrzej Hajda

test_plane_panning requires about 10 times bigger amount of memory than
memory required by framebuffer in default display mode. In case of some
configurations it can exceed available memory (4k modes on small-bar
systems), causing test aborts.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6824
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 tests/kms_plane.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 8a54ba6645c..fc530d2cfd3 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -342,14 +342,14 @@ test_plane_panning_with_output(data_t *data,
 	drmModeModeInfo *mode;
 	igt_crc_t crc;
 
-	igt_info("Testing connector %s using pipe %s\n",
-		 igt_output_name(output), kmstest_pipe_name(pipe));
-
 	igt_output_set_pipe(output, pipe);
 
 	mode = igt_output_get_mode(output);
 	primary = igt_output_get_plane(output, 0);
 
+	igt_info("Testing connector %s using pipe %s, mode %s\n",
+		 igt_output_name(output), kmstest_pipe_name(pipe), mode->name);
+
 	create_fb_for_mode_panning(data, mode, &primary_fb);
 	igt_plane_set_fb(primary, &primary_fb);
 
@@ -381,6 +381,8 @@ test_plane_panning_with_output(data_t *data,
 static void
 test_plane_panning(data_t *data, enum pipe pipe)
 {
+	bool mode_found = false;
+	uint64_t mem_size = 0;
 	igt_output_t *output;
 	igt_crc_t ref_crc;
 
@@ -389,6 +391,26 @@ test_plane_panning(data_t *data, enum pipe pipe)
 
 	test_init(data, pipe);
 
+	for_each_memory_region(r, data->drm_fd)
+		if (r->ci.memory_class == I915_MEMORY_CLASS_DEVICE)
+			mem_size = r->cpu_size;
+
+	for_each_connector_mode(output) {
+		drmModeModeInfo *m = &output->config.connector->modes[j__];
+		uint32_t fb_size = m->hdisplay * m->vdisplay * 4;
+
+		/* test allocates 2 double-dim fbs, add one more, to be safe */
+		if (mem_size && 3 * 4 * fb_size > mem_size) {
+			igt_debug("Skipping mode %s due to low memory\n", m->name);
+			continue;
+		}
+
+		igt_output_override_mode(output, m);
+		mode_found = true;
+		break;
+	}
+	igt_require(mode_found);
+
 	if (data->flags & TEST_PANNING_TOP_LEFT)
 		test_grab_crc(data, output, pipe, &red, data->flags, &ref_crc);
 	else
-- 
2.34.1


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

* Re: [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning
  2022-11-15  7:28 [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning Andrzej Hajda
@ 2022-11-22  7:22 ` Andrzej Hajda
  2022-11-22  8:26 ` Kamil Konieczny
  1 sibling, 0 replies; 3+ messages in thread
From: Andrzej Hajda @ 2022-11-22  7:22 UTC (permalink / raw)
  To: igt-dev, intel-gfx; +Cc: Chris Wilson, Matthew Auld

Gently ping.

Regards
Andrzej

On 15.11.2022 08:28, Andrzej Hajda wrote:
> test_plane_panning requires about 10 times bigger amount of memory than
> memory required by framebuffer in default display mode. In case of some
> configurations it can exceed available memory (4k modes on small-bar
> systems), causing test aborts.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6824
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> ---
>   tests/kms_plane.c | 28 +++++++++++++++++++++++++---
>   1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 8a54ba6645c..fc530d2cfd3 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -342,14 +342,14 @@ test_plane_panning_with_output(data_t *data,
>   	drmModeModeInfo *mode;
>   	igt_crc_t crc;
>   
> -	igt_info("Testing connector %s using pipe %s\n",
> -		 igt_output_name(output), kmstest_pipe_name(pipe));
> -
>   	igt_output_set_pipe(output, pipe);
>   
>   	mode = igt_output_get_mode(output);
>   	primary = igt_output_get_plane(output, 0);
>   
> +	igt_info("Testing connector %s using pipe %s, mode %s\n",
> +		 igt_output_name(output), kmstest_pipe_name(pipe), mode->name);
> +
>   	create_fb_for_mode_panning(data, mode, &primary_fb);
>   	igt_plane_set_fb(primary, &primary_fb);
>   
> @@ -381,6 +381,8 @@ test_plane_panning_with_output(data_t *data,
>   static void
>   test_plane_panning(data_t *data, enum pipe pipe)
>   {
> +	bool mode_found = false;
> +	uint64_t mem_size = 0;
>   	igt_output_t *output;
>   	igt_crc_t ref_crc;
>   
> @@ -389,6 +391,26 @@ test_plane_panning(data_t *data, enum pipe pipe)
>   
>   	test_init(data, pipe);
>   
> +	for_each_memory_region(r, data->drm_fd)
> +		if (r->ci.memory_class == I915_MEMORY_CLASS_DEVICE)
> +			mem_size = r->cpu_size;
> +
> +	for_each_connector_mode(output) {
> +		drmModeModeInfo *m = &output->config.connector->modes[j__];
> +		uint32_t fb_size = m->hdisplay * m->vdisplay * 4;
> +
> +		/* test allocates 2 double-dim fbs, add one more, to be safe */
> +		if (mem_size && 3 * 4 * fb_size > mem_size) {
> +			igt_debug("Skipping mode %s due to low memory\n", m->name);
> +			continue;
> +		}
> +
> +		igt_output_override_mode(output, m);
> +		mode_found = true;
> +		break;
> +	}
> +	igt_require(mode_found);
> +
>   	if (data->flags & TEST_PANNING_TOP_LEFT)
>   		test_grab_crc(data, output, pipe, &red, data->flags, &ref_crc);
>   	else


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

* Re: [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning
  2022-11-15  7:28 [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning Andrzej Hajda
  2022-11-22  7:22 ` Andrzej Hajda
@ 2022-11-22  8:26 ` Kamil Konieczny
  1 sibling, 0 replies; 3+ messages in thread
From: Kamil Konieczny @ 2022-11-22  8:26 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: Andrzej Hajda, Matthew Auld, Chris Wilson

Hi Andrzej,

On 2022-11-15 at 08:28:34 +0100, Andrzej Hajda wrote:
> test_plane_panning requires about 10 times bigger amount of memory than
> memory required by framebuffer in default display mode. In case of some
> configurations it can exceed available memory (4k modes on small-bar
> systems), causing test aborts.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6824
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> ---
>  tests/kms_plane.c | 28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 8a54ba6645c..fc530d2cfd3 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -342,14 +342,14 @@ test_plane_panning_with_output(data_t *data,
>  	drmModeModeInfo *mode;
>  	igt_crc_t crc;
>  
> -	igt_info("Testing connector %s using pipe %s\n",
> -		 igt_output_name(output), kmstest_pipe_name(pipe));
> -
>  	igt_output_set_pipe(output, pipe);
>  
>  	mode = igt_output_get_mode(output);
>  	primary = igt_output_get_plane(output, 0);
>  
> +	igt_info("Testing connector %s using pipe %s, mode %s\n",
> +		 igt_output_name(output), kmstest_pipe_name(pipe), mode->name);
> +
>  	create_fb_for_mode_panning(data, mode, &primary_fb);
>  	igt_plane_set_fb(primary, &primary_fb);
>  
> @@ -381,6 +381,8 @@ test_plane_panning_with_output(data_t *data,
>  static void
>  test_plane_panning(data_t *data, enum pipe pipe)
>  {
> +	bool mode_found = false;
> +	uint64_t mem_size = 0;
>  	igt_output_t *output;
>  	igt_crc_t ref_crc;
>  
> @@ -389,6 +391,26 @@ test_plane_panning(data_t *data, enum pipe pipe)
>  
>  	test_init(data, pipe);
>  
> +	for_each_memory_region(r, data->drm_fd)
> +		if (r->ci.memory_class == I915_MEMORY_CLASS_DEVICE)
> +			mem_size = r->cpu_size;

imho either max(mem_size, r->cpu_size) or just break after
assign but maybe I overcomplicate this, so

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> +
> +	for_each_connector_mode(output) {
> +		drmModeModeInfo *m = &output->config.connector->modes[j__];
> +		uint32_t fb_size = m->hdisplay * m->vdisplay * 4;
> +
> +		/* test allocates 2 double-dim fbs, add one more, to be safe */
> +		if (mem_size && 3 * 4 * fb_size > mem_size) {
> +			igt_debug("Skipping mode %s due to low memory\n", m->name);
> +			continue;
> +		}
> +
> +		igt_output_override_mode(output, m);
> +		mode_found = true;
> +		break;
> +	}
> +	igt_require(mode_found);
> +
>  	if (data->flags & TEST_PANNING_TOP_LEFT)
>  		test_grab_crc(data, output, pipe, &red, data->flags, &ref_crc);
>  	else
> -- 
> 2.34.1
> 

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

end of thread, other threads:[~2022-11-22  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  7:28 [Intel-gfx] [i-g-t] tests/kms_plane: skip memory demanding modes in test_plane_panning Andrzej Hajda
2022-11-22  7:22 ` Andrzej Hajda
2022-11-22  8:26 ` Kamil Konieczny

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).