[igt-dev] [PATCH 1/2] tests/intel/i915_pipe_stress: Fix create_buf function

Stanislav Lisovskiy stanislav.lisovskiy at intel.com
Tue Sep 12 13:18:31 UTC 2023


create_buf currently does wrong assumption what it gets
width in bytes, however reality is that it gets width
in pixels, so "width/4" must be "width * 4" for bpp 32.

v2: - /width * 4/width for intel_buf_init_using_handle
      (Zbigniew Kempczyński)

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>
---
 tests/intel/i915_pipe_stress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/intel/i915_pipe_stress.c b/tests/intel/i915_pipe_stress.c
index 9ceb056a09..3cd84d027f 100644
--- a/tests/intel/i915_pipe_stress.c
+++ b/tests/intel/i915_pipe_stress.c
@@ -201,9 +201,9 @@ create_buf(struct data *data, int width, int height, uint32_t region)
 	 * Legacy code uses 32 bpp after buffer creation.
 	 * Let's do the same due to keep shader intact.
 	 */
-	handle = gem_create_in_memory_regions(data->drm_fd, width * height, region);
+	handle = gem_create_in_memory_regions(data->drm_fd, width * 4 * height, region);
 	intel_buf_init_using_handle(data->bops, handle, buf,
-				    width/4, height, 32, 0,
+				    width, height, 32, 0,
 				    I915_TILING_NONE, 0);
 
 	return buf;
-- 
2.37.3



More information about the igt-dev mailing list