Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 2/5] drm/xe: Add helper to calculate adjusted register offset
Date: Mon, 22 Apr 2024 12:29:25 +0200	[thread overview]
Message-ID: <20240422102925.ccs2gryz5l3wtv47@intel.com> (raw)
In-Reply-To: <20240418152802.182-3-michal.wajdeczko@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on czw [2024-kwi-18 17:27:59 +0200]:
> Our MMIO accessing functions automatically adjust addresses for the
> media registers based on mmio.adj_limit and mmio.adj_offset logic.
> Move it to the separate helper to avoid code duplication and to
> allow using it by the upcoming changes to PF driver code.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_mmio.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_mmio.h b/drivers/gpu/drm/xe/xe_mmio.h
> index a3cd7b3036c7..7d003bfb91a8 100644
> --- a/drivers/gpu/drm/xe/xe_mmio.h
> +++ b/drivers/gpu/drm/xe/xe_mmio.h
> @@ -36,4 +36,11 @@ u64 xe_mmio_read64_2x32(struct xe_gt *gt, struct xe_reg reg);
>  int xe_mmio_wait32(struct xe_gt *gt, struct xe_reg reg, u32 mask, u32 val, u32 timeout_us,
>  		   u32 *out_val, bool atomic);
>  
> +static inline u32 xe_mmio_adjusted_addr(struct xe_gt *gt, u32 addr)
> +{
> +	if (addr < gt->mmio.adj_limit)
> +		addr += gt->mmio.adj_offset;
> +	return addr;
> +}
> +

Since you already extracted it, didn't you think to use it in the xe_mmio_[read|write]_* functions ? 

Piotr
>  #endif
> -- 
> 2.43.0
> 

-- 

  reply	other threads:[~2024-04-22 10:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 15:27 [PATCH 0/5] Add SR-IOV GuC Relay PF services Michal Wajdeczko
2024-04-18 15:27 ` [PATCH 1/5] drm/xe/guc: Add GuC Relay ABI version 1.0 definitions Michal Wajdeczko
2024-04-22  9:25   ` Piotr Piórkowski
2024-04-22 10:26     ` Piotr Piórkowski
2024-04-18 15:27 ` [PATCH 2/5] drm/xe: Add helper to calculate adjusted register offset Michal Wajdeczko
2024-04-22 10:29   ` Piotr Piórkowski [this message]
2024-04-18 15:28 ` [PATCH 3/5] drm/xe: Add few more GT register definitions Michal Wajdeczko
2024-04-22  9:38   ` Piotr Piórkowski
2024-04-18 15:28 ` [PATCH 4/5] drm/xe/pf: Add SR-IOV GuC Relay PF services Michal Wajdeczko
2024-04-22 10:48   ` Piotr Piórkowski
2024-04-18 15:28 ` [PATCH 5/5] drm/xe/kunit: Add PF service tests Michal Wajdeczko
2024-04-22 12:01   ` Piotr Piórkowski
2024-04-18 19:48 ` ✓ CI.Patch_applied: success for Add SR-IOV GuC Relay PF services Patchwork
2024-04-18 19:48 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-18 19:49 ` ✓ CI.KUnit: success " Patchwork
2024-04-18 20:01 ` ✓ CI.Build: " Patchwork
2024-04-18 20:03 ` ✗ CI.Hooks: failure " Patchwork
2024-04-18 20:14 ` ✓ CI.checksparse: success " Patchwork
2024-04-18 20:38 ` ✗ CI.BAT: failure " Patchwork
2024-04-20  2:04 ` ✓ CI.Patch_applied: success for Add SR-IOV GuC Relay PF services (rev2) Patchwork
2024-04-20  2:04 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-20  2:05 ` ✓ CI.KUnit: success " Patchwork
2024-04-20  2:23 ` ✓ CI.Build: " Patchwork
2024-04-20  2:27 ` ✗ CI.Hooks: failure " Patchwork
2024-04-20  2:28 ` ✓ CI.checksparse: success " Patchwork
2024-04-20 11:30 ` ✗ CI.FULL: failure for Add SR-IOV GuC Relay PF services 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=20240422102925.ccs2gryz5l3wtv47@intel.com \
    --to=piotr.piorkowski@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@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