From: "Jakub Bartmiński" <jakub.bartminski@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Jakub Bartmiński" <jakub.bartminski@intel.com>
Subject: [PATCH 1/2] drm/i915: Keep local modparams copy for mock selftests
Date: Thu, 12 Jul 2018 16:07:18 +0200 [thread overview]
Message-ID: <20180712140719.14215-1-jakub.bartminski@intel.com> (raw)
Some functions used within mock selftests may expect platform-dependent
automatic modparams parameters to have already been resolved, resulting
in failed assertions.
Backing up the modparams before mock selftests and manually setting
offending parameters inside the affected selftests should fix the issue.
Signed-off-by: Jakub Bartmiński <jakub.bartminski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
---
drivers/gpu/drm/i915/i915_pci.c | 10 ++++++++++
drivers/gpu/drm/i915/selftests/i915_gem_context.c | 6 ++++++
2 files changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 55543f1b0236..9e41851f5ca2 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -733,11 +733,21 @@ static int __init i915_init(void)
{
bool use_kms = true;
int err;
+ struct i915_params *backup_modparams;
+
+ backup_modparams = kmalloc(sizeof(*backup_modparams), GFP_KERNEL);
+ if (!backup_modparams)
+ return -ENOMEM;
+ memcpy(backup_modparams, &i915_modparams, sizeof(*backup_modparams));
err = i915_mock_selftests();
if (err)
return err > 0 ? 0 : err;
+ /* Revert any modparams modifications made inside mock selftests */
+ memcpy(&i915_modparams, backup_modparams, sizeof(*backup_modparams));
+ kfree(backup_modparams);
+
/*
* Enable KMS by default, unless explicitly overriden by
* either the i915.modeset prarameter or by the
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
index ab2590242033..de6aad832ac9 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
@@ -597,6 +597,12 @@ int i915_gem_context_mock_selftests(void)
if (!i915)
return -ENOMEM;
+ /*
+ * Platform defaults have not been resolved yet, so we need to prevent
+ * assertion failure on an unresolved enable_guc.
+ */
+ i915_modparams.enable_guc = 0;
+
err = i915_subtests(tests, i915);
drm_dev_put(&i915->drm);
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-07-12 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 14:07 Jakub Bartmiński [this message]
2018-07-12 14:07 ` [PATCH 2/2] HAX enable GuC for CI Jakub Bartmiński
2018-07-12 14:26 ` [PATCH 1/2] drm/i915: Keep local modparams copy for mock selftests Chris Wilson
2018-07-12 14:49 ` Daniel Vetter
2018-07-12 14:48 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " 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=20180712140719.14215-1-jakub.bartminski@intel.com \
--to=jakub.bartminski@intel.com \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox