From: Daniel Vetter <daniel@ffwll.ch>
To: yu.dai@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 18/18] drm/i915: Notify GuC when RC6 state is changed
Date: Fri, 27 Mar 2015 09:54:51 +0100 [thread overview]
Message-ID: <20150327085451.GL23521@phenom.ffwll.local> (raw)
In-Reply-To: <1427398885-31988-19-git-send-email-yu.dai@intel.com>
On Thu, Mar 26, 2015 at 12:41:25PM -0700, yu.dai@intel.com wrote:
> From: Alex Dai <yu.dai@intel.com>
>
> Whenever RC6 state (0xA210) is changed, driver needs to notify GuC
> via guc_action.
>
> Issue: VIZ-4884
> Change-Id: I15c661a915c670691d020471ecaccb00f7afb624
> Signed-off-by: Alex Dai <yu.dai@intel.com>
What exactly is the interaction here? Please elaborate in the commit
message, since as-is this looks extremely racy: If the guc can fall over
if we change rc6 behind it's back it can still fall over right between
when we change rc6 mode and when we tell the guc.
Also note that rc6 setup is delayed in resume/driver load (because it
takes forever) and we expect the gpu to be fully working while we enable
rc6. If the guc falls over on resume because of this there's a problem. We
might need specific igt testcases which race resume against gpu
submissions.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_guc.h | 1 +
> drivers/gpu/drm/i915/intel_guc_api.h | 1 +
> drivers/gpu/drm/i915/intel_guc_client.c | 16 ++++++++++++++++
> drivers/gpu/drm/i915/intel_guc_scheduler.c | 3 +++
> drivers/gpu/drm/i915/intel_pm.c | 4 ++++
> 5 files changed, 25 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
> index 3c41483..baa2446 100644
> --- a/drivers/gpu/drm/i915/intel_guc.h
> +++ b/drivers/gpu/drm/i915/intel_guc.h
> @@ -181,5 +181,6 @@ void i915_guc_client_free(struct drm_device *dev,
> int i915_guc_client_submit(struct i915_guc_client *client,
> struct intel_context *ctx,
> struct intel_engine_cs *ring);
> +int host2guc_sample_forcewake(struct intel_guc *guc, bool enable);
>
> #endif
> diff --git a/drivers/gpu/drm/i915/intel_guc_api.h b/drivers/gpu/drm/i915/intel_guc_api.h
> index 3d4f74a..94c914e 100644
> --- a/drivers/gpu/drm/i915/intel_guc_api.h
> +++ b/drivers/gpu/drm/i915/intel_guc_api.h
> @@ -190,6 +190,7 @@ struct guc_context_desc {
> /* This Action will be programmed in C180 - SOFT_SCRATCH_O_REG */
> enum host2guc_action {
> HOST2GUC_ACTION_DEFAULT = 0x0,
> + HOST2GUC_ACTION_SAMPLE_FORCEWAKE = 0x6,
> HOST2GUC_ACTION_ALLOCATE_DOORBELL = 0x10,
> HOST2GUC_ACTION_DEALLOCATE_DOORBELL = 0x20,
> HOST2GUC_ACTION_LIMIT
> diff --git a/drivers/gpu/drm/i915/intel_guc_client.c b/drivers/gpu/drm/i915/intel_guc_client.c
> index 264e0ab..29450d2 100644
> --- a/drivers/gpu/drm/i915/intel_guc_client.c
> +++ b/drivers/gpu/drm/i915/intel_guc_client.c
> @@ -262,6 +262,22 @@ static int host2guc_release_doorbell(struct intel_guc *guc,
> return intel_guc_action(guc, data, 2);
> }
>
> +int host2guc_sample_forcewake(struct intel_guc *guc, bool enable)
> +{
> + u32 data[2];
> +
> + if (guc->guc_fw.uc_fw_load_status != INTEL_UC_FIRMWARE_SUCCESS)
> + return -ENODEV;
> +
> + data[0] = HOST2GUC_ACTION_SAMPLE_FORCEWAKE;
> + if (enable)
> + data[1] = 3; /* Bit0: Render, Bit1: Media */
> + else
> + data[1] = 0;
> +
> + return intel_guc_action(guc, data, 2);
> +}
> +
> static void init_doorbell(struct intel_guc *guc,
> struct i915_guc_client *client)
> {
> diff --git a/drivers/gpu/drm/i915/intel_guc_scheduler.c b/drivers/gpu/drm/i915/intel_guc_scheduler.c
> index ea1ff28..bd7ea0e 100644
> --- a/drivers/gpu/drm/i915/intel_guc_scheduler.c
> +++ b/drivers/gpu/drm/i915/intel_guc_scheduler.c
> @@ -139,6 +139,9 @@ int guc_scheduler_enable(struct drm_device *dev)
>
> direct_interrupts_to_guc(dev_priv);
>
> + flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> + host2guc_sample_forcewake(guc, dev_priv->rps.enabled);
> +
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index fa4ccb3..dfde98d 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4113,6 +4113,8 @@ static void gen9_disable_rps(struct drm_device *dev)
>
> I915_WRITE(GEN6_RC_CONTROL, 0);
> I915_WRITE(GEN9_PG_ENABLE, 0);
> +
> + host2guc_sample_forcewake(&dev_priv->guc, 0);
> }
>
> static void gen6_disable_rps(struct drm_device *dev)
> @@ -4330,6 +4332,8 @@ static void gen9_enable_rc6(struct drm_device *dev)
>
> intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
>
> + host2guc_sample_forcewake(&dev_priv->guc,
> + rc6_mask & GEN6_RC_CTL_RC6_ENABLE);
> }
>
> static void gen8_enable_rps(struct drm_device *dev)
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-27 8:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 19:41 [PATCH 00/18] Command submission via GuC for SKL yu.dai
2015-03-26 19:41 ` [PATCH 01/18] drm/i915: Add guc firmware interface headers yu.dai
2015-03-26 19:41 ` [PATCH 02/18] drm/i915: Add i915_gem_object_write() to i915_gem.c yu.dai
2015-03-26 19:41 ` [PATCH 03/18] drm/i915: Unified firmware loading mechanism yu.dai
2015-03-26 19:41 ` [PATCH 04/18] drm/i915: GuC firmware loader yu.dai
2015-03-26 19:41 ` [PATCH 05/18] drm/i915: Add firmware version check yu.dai
2015-03-26 19:41 ` [PATCH 06/18] drm/i915: Defer default hardware context initialisation until first open yu.dai
2015-03-27 8:45 ` Daniel Vetter
2015-03-30 19:11 ` Yu Dai
2015-03-31 13:11 ` Daniel Vetter
2015-03-31 9:29 ` Chris Wilson
2015-03-26 19:41 ` [PATCH 07/18] drm/i915: Move execlists defines from .c to .h yu.dai
2015-03-26 19:41 ` [PATCH 08/18] drm/i915: Make several execlist helper functions external yu.dai
2015-03-26 19:41 ` [PATCH 09/18] drm/i915: Add functions to allocate / release gem obj for GuC yu.dai
2015-03-27 8:48 ` Daniel Vetter
2015-03-27 8:49 ` Daniel Vetter
2015-03-26 19:41 ` [PATCH 10/18] drm/i915: Functions to support command submission via GuC yu.dai
2015-03-26 19:41 ` [PATCH 11/18] drm/i915: Integration of GuC client yu.dai
2015-03-26 19:41 ` [PATCH 12/18] drm/i915: Interrupt routing for GuC scheduler yu.dai
2015-03-26 19:41 ` [PATCH 13/18] drm/i915: Enable commands submission via GuC yu.dai
2015-03-26 19:41 ` [PATCH 14/18] drm/i915: debugfs of GuC status yu.dai
2015-03-26 19:41 ` [PATCH 15/18] drm/i915: Enable GuC firmware log yu.dai
2015-03-26 19:41 ` [PATCH 16/18] drm/i915: Ring Context allocating for GuC yu.dai
2015-03-26 19:41 ` [PATCH 17/18] drm/i915: Taking forcewake during GuC load yu.dai
2015-03-27 8:55 ` Daniel Vetter
2015-03-26 19:41 ` [PATCH 18/18] drm/i915: Notify GuC when RC6 state is changed yu.dai
2015-03-27 1:24 ` shuang.he
2015-03-27 8:54 ` Daniel Vetter [this message]
2015-03-27 8:59 ` [PATCH 00/18] Command submission via GuC for SKL Daniel Vetter
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=20150327085451.GL23521@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=yu.dai@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