All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karolina Drobnik <karolina.drobnik@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/i915: Use correct type for gen parameter
Date: Tue, 31 May 2022 12:56:54 +0200	[thread overview]
Message-ID: <20220531105654.1029576-1-karolina.drobnik@intel.com> (raw)

intel_gen is designed to return a big unsigned number for an unknown device.
The value is interpreted to be the newest generation possible, and the matching
configuration is used. Some functions incorrectly pass the gen value as a signed
number, meaning it becomes negative, and the oldest configuration is used
instead of the newest one. This leads to GPU hangs in some cases.

Update the definition of submit functions in gem_exec_gttfill and gem_softpin,
and has_cs_timestamp in gem_ctx_engines to use a correct type for gen parameter.

Signed-off-by: Karolina Drobnik <karolina.drobnik@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_ctx_engines.c  | 2 +-
 tests/i915/gem_exec_gttfill.c | 2 +-
 tests/i915/gem_softpin.c      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c
index 19cf9b05..4b8e5145 100644
--- a/tests/i915/gem_ctx_engines.c
+++ b/tests/i915/gem_ctx_engines.c
@@ -437,7 +437,7 @@ static uint32_t read_result(int timeline, uint32_t *map, int idx)
 	return map[idx];
 }
 
-static bool has_cs_timestamp(const struct intel_execution_engine2 *e, int gen)
+static bool has_cs_timestamp(const struct intel_execution_engine2 *e, unsigned int gen)
 {
 	if (gen >= 7)
 		return true;
diff --git a/tests/i915/gem_exec_gttfill.c b/tests/i915/gem_exec_gttfill.c
index ebe6d2d3..037275f5 100644
--- a/tests/i915/gem_exec_gttfill.c
+++ b/tests/i915/gem_exec_gttfill.c
@@ -46,7 +46,7 @@ static void xchg_batch(void *array, unsigned int i, unsigned int j)
 	batches[j] = tmp;
 }
 
-static void submit(int fd, uint64_t ahnd, int gen,
+static void submit(int fd, uint64_t ahnd, unsigned int gen,
 		   struct drm_i915_gem_execbuffer2 *eb,
 		   struct drm_i915_gem_relocation_entry *reloc,
 		   struct batch *batches, unsigned int count)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index 00912fd3..6c8b46f3 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -898,7 +898,7 @@ static void xchg_batch(void *array, unsigned int i, unsigned int j)
 	batches[j] = tmp;
 }
 
-static void submit(int fd, int gen,
+static void submit(int fd, unsigned int gen,
 		   struct drm_i915_gem_execbuffer2 *eb,
 		   struct batch *batches, unsigned int count,
 		   uint64_t ahnd)
-- 
2.25.1

             reply	other threads:[~2022-05-31 10:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 10:56 Karolina Drobnik [this message]
2022-05-31 11:15 ` [igt-dev] [PATCH i-g-t] tests/i915: Use correct type for gen parameter Petri Latvala
2022-05-31 12:23 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2022-05-31 12:30   ` Petri Latvala
2022-05-31 17:05     ` Vudum, Lakshminarayana
2022-05-31 15:18 ` Patchwork
2022-05-31 16:25 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-05-31 17:31 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-06-01  6:16   ` Karolina Drobnik
2022-06-01 18:29     ` Vudum, Lakshminarayana
2022-06-01 15:34 ` Patchwork
2022-06-01 17:01 ` Patchwork
2022-06-01 18:15 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220531105654.1029576-1-karolina.drobnik@intel.com \
    --to=karolina.drobnik@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.