From: Oak Zeng <oak.zeng@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: thomas.hellstrom@intel.com, matthew.brost@intel.com,
brian.welty@intel.com, himal.prasad.ghimiray@intel.com
Subject: [PATCH 3/8] drm/xe: Introduce helper to get tile from memory region
Date: Tue, 19 Mar 2024 23:44:20 -0400 [thread overview]
Message-ID: <20240320034425.1785007-4-oak.zeng@intel.com> (raw)
In-Reply-To: <20240320034425.1785007-1-oak.zeng@intel.com>
Introduce a simple helper to retrieve tile from memory region
v1: move the function to xe_device.h (Matt)
improve commit message, add kerneldoc (Thomas)
Signed-off-by: Oak Zeng <oak.zeng@intel.com>
---
drivers/gpu/drm/xe/xe_device.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index d413bc2c6be5..3f74c460bb14 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -176,4 +176,13 @@ void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p);
u64 xe_device_canonicalize_addr(struct xe_device *xe, u64 address);
u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address);
+/**
+ * xe_mem_region_to_tile() - retrieve tile from memory region
+ * @mr: the memory region we retrieve tile from
+ */
+static inline struct xe_tile *xe_mem_region_to_tile(struct xe_mem_region *mr)
+{
+ return container_of(mr, struct xe_tile, mem.vram);
+}
+
#endif
--
2.26.3
next prev parent reply other threads:[~2024-03-20 3:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 3:44 [PATCH 0/8] Use hmm_range_fault to populate user page Oak Zeng
2024-03-20 3:37 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-20 3:37 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-20 3:38 ` ✗ CI.KUnit: failure " Patchwork
2024-03-20 3:44 ` [PATCH 1/8] drm/xe/svm: Remap and provide memmap backing for GPU vram Oak Zeng
2024-03-20 3:44 ` [PATCH 2/8] drm/xe/svm: Introduce DRM_XE_SVM kernel config Oak Zeng
2024-03-20 3:44 ` Oak Zeng [this message]
2024-03-20 3:44 ` [PATCH 4/8] drm/xe: Introduce a helper to get dpa from pfn Oak Zeng
2024-03-20 21:41 ` Welty, Brian
2024-03-20 22:34 ` Zeng, Oak
2024-03-20 3:44 ` [PATCH 5/8] drm/xe/svm: Get xe memory region from page Oak Zeng
2024-03-20 3:44 ` [PATCH 6/8] drm/xe: Introduce helper to populate userptr Oak Zeng
2024-03-20 19:19 ` Welty, Brian
2024-03-20 20:02 ` Zeng, Oak
2024-03-20 3:44 ` [PATCH 7/8] drm/xe: Introduce a helper to free sg table Oak Zeng
2024-03-20 3:44 ` [PATCH 8/8] drm/xe: Use hmm_range_fault to populate user pages Oak Zeng
-- strict thread matches above, loose matches on Subject: below --
2024-03-20 3:24 [PATCH 0/8] Use hmm_range_fault to populate user page Oak Zeng
2024-03-20 3:24 ` [PATCH 3/8] drm/xe: Introduce helper to get tile from memory region Oak Zeng
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=20240320034425.1785007-4-oak.zeng@intel.com \
--to=oak.zeng@intel.com \
--cc=brian.welty@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=thomas.hellstrom@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