Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>, maarten.lankhorst@intel.com
Subject: [Intel-xe] [PATCH 6/7] drm/xe/reg_sr: Save errors for kunit integration
Date: Tue, 21 Mar 2023 15:05:26 -0700	[thread overview]
Message-ID: <20230321220527.595462-7-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20230321220527.595462-1-lucas.demarchi@intel.com>

When there's an entry that is dropped when xe_reg_sr_add(), there's
not much we can do other than reporting the error - it's for certain a
driver issue or conflicting workarounds/tunings. Save the number of
errors to be used later by kunit to report where it happens.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/xe_reg_sr.c       | 8 ++++++++
 drivers/gpu/drm/xe/xe_reg_sr_types.h | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
index 9eaf1be27886..83f29aeb9250 100644
--- a/drivers/gpu/drm/xe/xe_reg_sr.c
+++ b/drivers/gpu/drm/xe/xe_reg_sr.c
@@ -84,6 +84,13 @@ static bool compatible_entries(const struct xe_reg_sr_entry *e1,
 	return true;
 }
 
+static void reg_sr_inc_error(struct xe_reg_sr *sr)
+{
+#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
+	sr->errors++;
+#endif
+}
+
 int xe_reg_sr_add(struct xe_reg_sr *sr, u32 reg,
 		  const struct xe_reg_sr_entry *e)
 {
@@ -121,6 +128,7 @@ int xe_reg_sr_add(struct xe_reg_sr *sr, u32 reg,
 	DRM_ERROR("Discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s): ret=%d\n",
 		  idx, e->clr_bits, e->set_bits,
 		  str_yes_no(e->masked_reg), ret);
+	reg_sr_inc_error(sr);
 
 	return ret;
 }
diff --git a/drivers/gpu/drm/xe/xe_reg_sr_types.h b/drivers/gpu/drm/xe/xe_reg_sr_types.h
index 3d2257891005..91469784fd90 100644
--- a/drivers/gpu/drm/xe/xe_reg_sr_types.h
+++ b/drivers/gpu/drm/xe/xe_reg_sr_types.h
@@ -32,6 +32,10 @@ struct xe_reg_sr {
 	} pool;
 	struct xarray xa;
 	const char *name;
+
+#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
+	unsigned int errors;
+#endif
 };
 
 #endif
-- 
2.39.0


  parent reply	other threads:[~2023-03-21 22:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 22:05 [Intel-xe] [PATCH 0/7] Unit tests for rtp and GT wa/tuning Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 1/7] drm/xe: Add basic unit tests for rtp Lucas De Marchi
2023-03-27 17:56   ` Michał Winiarski
2023-03-31 13:43     ` Lucas De Marchi
2023-04-01  8:59       ` Lucas De Marchi
2023-04-01 18:54         ` Michał Winiarski
2023-04-02  1:24           ` Lucas De Marchi
2023-04-02 10:51             ` Michal Wajdeczko
2023-03-31 14:34     ` Lucas De Marchi
2023-04-01  8:54       ` Lucas De Marchi
2023-04-01 18:26         ` Michał Winiarski
2023-04-02  1:34           ` Lucas De Marchi
2023-04-02 11:17             ` Michal Wajdeczko
2023-04-02 21:54               ` Lucas De Marchi
2023-04-03  7:38                 ` Michal Wajdeczko
2023-04-03 13:02                   ` Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 2/7] drm/xe: Extract function to initialize xe->info Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 3/7] drm/xe: Move test infra out of xe_pci.[ch] Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 4/7] drm/xe: Use XE_KUNIT for symbol namespace Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 5/7] drm/xe: Generalize fake device creation Lucas De Marchi
2023-03-21 22:05 ` Lucas De Marchi [this message]
2023-03-27 18:29   ` [Intel-xe] [PATCH 6/7] drm/xe/reg_sr: Save errors for kunit integration Michał Winiarski
2023-03-31 14:43     ` Lucas De Marchi
2023-03-21 22:05 ` [Intel-xe] [PATCH 7/7] drm/xe: Add test for GT workarounds and tunings Lucas De Marchi
2023-03-21 22:08 ` [Intel-xe] ✓ CI.Patch_applied: success for Unit tests for rtp and GT wa/tuning Patchwork
2023-03-31 15:14   ` Lucas De Marchi
2023-04-03  6:08     ` Mauro Carvalho Chehab
2023-03-21 22:09 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-03-21 22:13 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-03-21 22:25 ` [Intel-xe] ○ CI.BAT: info " 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=20230321220527.595462-7-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox