From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH] drm/i915: Don't try to handle GuC when GuC is not supported.
Date: Wed, 21 Sep 2016 18:00:16 -0300 [thread overview]
Message-ID: <1474491616.2593.57.camel@intel.com> (raw)
In-Reply-To: <1474482121-1663-1-git-send-email-rodrigo.vivi@intel.com>
Em Qua, 2016-09-21 às 11:22 -0700, Rodrigo Vivi escreveu:
> Avoid any kind of GuC handling if GuC is not supported
> on a giving platform.
>
> Besides being useless handling, our driver needs
> to be smarter than the user trying to use an invalid paramenter.
So the problem is when a platform doesn't support guc and the user
passes i915.enable_guc_something=1, right?
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: Christophe Prigent <christophe.prigent@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97573
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_guc_loader.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c
> b/drivers/gpu/drm/i915/intel_guc_loader.c
> index 6fd39ef..da0f5ed 100644
> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
> @@ -720,6 +720,13 @@ void intel_guc_init(struct drm_device *dev)
> struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
> const char *fw_path;
>
> + if (!HAS_GUC(dev)) {
> + i915.enable_guc_loading = 0;
> + i915.enable_guc_submission = 0;
> + fw_path = NULL;
> + return;
> + }
Instead of this, how about we just patch the code below with:
if (!HAS_GUC(dev_priv)) {
i915.enable_guc_loading = 0;
i915.enable_guc_submission = 0;
} else {
/* A negative value means "use platform default" */
if (i915.enable_guc_loading < 0)
i915.enable_guc_loading = HAS_GUC_UCODE(dev_priv);
if (i915.enable_guc_submission < 0)
i915.enable_guc_submission = HAS_GUC_SCHED(dev_priv);
}
Or we could even go with our current "design pattern" and create
intel_sanitize_guc_options().
This way we'll be able to avoid adding a second failure code path,
since we already have one for platforms with guc but options disabled.
> +
> /* A negative value means "use platform default" */
> if (i915.enable_guc_loading < 0)
> i915.enable_guc_loading = HAS_GUC_UCODE(dev);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-09-21 21:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 18:22 [PATCH] drm/i915: Don't try to handle GuC when GuC is not supported Rodrigo Vivi
2016-09-21 18:49 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-09-21 21:00 ` Paulo Zanoni [this message]
2016-09-22 16:55 ` [PATCH] " Vivi, Rodrigo
2016-10-05 13:50 ` Daniel Vetter
2016-10-05 23:37 ` Vivi, Rodrigo
2016-10-06 12:36 ` Paulo Zanoni
2016-10-06 13:31 ` Jani Nikula
2016-10-06 20:56 ` Vivi, Rodrigo
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=1474491616.2593.57.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=rodrigo.vivi@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 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.