All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH v2 2/5] drm/i915/uc: Move uC WOPCM setup in uc_init_hw
Date: Wed, 31 Jul 2019 11:00:57 +0200	[thread overview]
Message-ID: <op.z5sbbvfmxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20190730230743.19542-2-daniele.ceraolospurio@intel.com>

On Wed, 31 Jul 2019 01:07:40 +0200, Daniele Ceraolo Spurio  
<daniele.ceraolospurio@intel.com> wrote:

> The register we write are not WOPCM regs but uC ones related to how
> GuC and HuC are going to use the WOPCM, so it makes logical sense
> for them to be programmed as part of uc_init_hw. The WOPCM map on the
> other side is not uC-specific (although that is our main use-case), so
> keep that separate.
>
> v2: move write_and_verify to uncore, fix log, re-use err_out tag,
>     add intel_wopcm_guc_base, fix log
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---

> --- a/drivers/gpu/drm/i915/intel_uncore.h
> +++ b/drivers/gpu/drm/i915/intel_uncore.h
> @@ -393,6 +393,18 @@ static inline void intel_uncore_rmw_fw(struct  
> intel_uncore *uncore,
>  	intel_uncore_write_fw(uncore, reg, val);
>  }
> +static inline int intel_uncore_write_and_verify(struct intel_uncore  
> *uncore,
> +						i915_reg_t reg, u32 val,
> +						u32 mask, u32 expected_val)
> +{
> +	u32 reg_val;
> +
> +	intel_uncore_write(uncore, reg, val);
> +	reg_val = intel_uncore_read(uncore, reg);
> +
> +	return (reg_val & mask) != expected_val ? -EINVAL : 0;
> +}

nit: I'm not sure that -EINVAL is the best choice (not sure about
-ENODATA or -ENOKEY either) that's why I wanted to use bool ;)

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-07-31  9:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 23:07 [PATCH v2 1/5] drm/i915/uc: Don't enable communication twice on resume Daniele Ceraolo Spurio
2019-07-30 23:07 ` [PATCH v2 2/5] drm/i915/uc: Move uC WOPCM setup in uc_init_hw Daniele Ceraolo Spurio
2019-07-31  7:17   ` Chris Wilson
2019-07-31  9:00   ` Michal Wajdeczko [this message]
2019-07-31  9:05     ` Chris Wilson
2019-07-31 12:40   ` Chris Wilson
2019-07-30 23:07 ` [PATCH v2 3/5] drm/i915/gt: Move gt_cleanup_early out of gem_cleanup_early Daniele Ceraolo Spurio
2019-07-31  7:23   ` Chris Wilson
2019-07-30 23:07 ` [PATCH v2 4/5] drm/i915/uc: Move uC early functions inside the GT ones Daniele Ceraolo Spurio
2019-07-30 23:07 ` [PATCH v2 5/5] drm/i915/gt: Introduce intel_gt_runtime_suspend/resume Daniele Ceraolo Spurio
2019-07-31  0:16 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/5] drm/i915/uc: Don't enable communication twice on resume Patchwork
2019-07-31  7:11 ` [PATCH v2 1/5] " Chris Wilson
2019-07-31  8:43 ` Michal Wajdeczko

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=op.z5sbbvfmxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=daniele.ceraolospurio@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 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.