From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 2/5] drm/xe: Add helper to calculate adjusted register offset
Date: Thu, 18 Apr 2024 17:27:59 +0200 [thread overview]
Message-ID: <20240418152802.182-3-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240418152802.182-1-michal.wajdeczko@intel.com>
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;
+}
+
#endif
--
2.43.0
next prev parent reply other threads:[~2024-04-18 15:28 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 ` Michal Wajdeczko [this message]
2024-04-22 10:29 ` [PATCH 2/5] drm/xe: Add helper to calculate adjusted register offset Piotr Piórkowski
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=20240418152802.182-3-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@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