summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_device_types.h
diff options
context:
space:
mode:
authorOak Zeng <oak.zeng@intel.com>2023-07-12 00:46:09 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:40:19 +0300
commit0887a2e7ab620510093d55f4587c407362363b6d (patch)
tree0fb8135a614d6bdce1244bf94442880de1edba94 /drivers/gpu/drm/xe/xe_device_types.h
parenta20c75dba192af6ba63d618514a064268dbbe7db (diff)
downloadlinux-0887a2e7ab620510093d55f4587c407362363b6d.tar.xz
drm/xe: Make xe_mem_region struct
Make a xe_mem_region structure which will be used in the coming patches. The new structure is used in both xe device level (xe->mem.vram) and xe_tile level (tile->vram). Make the definition of xe_mem_region.dpa_base to be the DPA base of this memory region and change codes according to this new definition. v1: - rename xe_mem_region.base to dpa_base per conversation with Mike Ruhl Signed-off-by: Oak Zeng <oak.zeng@intel.com> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_device_types.h')
-rw-r--r--drivers/gpu/drm/xe/xe_device_types.h94
1 files changed, 40 insertions, 54 deletions
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 128e0a953692..5575d13395fe 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -51,6 +51,44 @@ struct xe_ggtt;
struct xe_tile * : (tile__)->xe)
/**
+ * struct xe_mem_region - memory region structure
+ * This is used to describe a memory region in xe
+ * device, such as HBM memory or CXL extension memory.
+ */
+struct xe_mem_region {
+ /** @io_start: IO start address of this VRAM instance */
+ resource_size_t io_start;
+ /**
+ * @io_size: IO size of this VRAM instance
+ *
+ * This represents how much of this VRAM we can access
+ * via the CPU through the VRAM BAR. This can be smaller
+ * than @usable_size, in which case only part of VRAM is CPU
+ * accessible (typically the first 256M). This
+ * configuration is known as small-bar.
+ */
+ resource_size_t io_size;
+ /** @dpa_base: This memory regions's DPA (device physical address) base */
+ resource_size_t dpa_base;
+ /**
+ * @usable_size: usable size of VRAM
+ *
+ * Usable size of VRAM excluding reserved portions
+ * (e.g stolen mem)
+ */
+ resource_size_t usable_size;
+ /**
+ * @actual_physical_size: Actual VRAM size
+ *
+ * Actual VRAM size including reserved portions
+ * (e.g stolen mem)
+ */
+ resource_size_t actual_physical_size;
+ /** @mapping: pointer to VRAM mappable space */
+ void *__iomem mapping;
+};
+
+/**
* struct xe_tile - hardware tile structure
*
* From a driver perspective, a "tile" is effectively a complete GPU, containing
@@ -107,38 +145,7 @@ struct xe_tile {
* Although VRAM is associated with a specific tile, it can
* still be accessed by all tiles' GTs.
*/
- struct {
- /** @io_start: IO start address of this VRAM instance */
- resource_size_t io_start;
- /**
- * @io_size: IO size of this VRAM instance
- *
- * This represents how much of this VRAM we can access
- * via the CPU through the VRAM BAR. This can be smaller
- * than @size, in which case only part of VRAM is CPU
- * accessible (typically the first 256M). This
- * configuration is known as small-bar.
- */
- resource_size_t io_size;
- /** @base: offset of VRAM starting base */
- resource_size_t base;
- /**
- * @usable_size: usable size of VRAM
- *
- * Usable size of VRAM excluding reserved portions
- * (e.g stolen mem)
- */
- resource_size_t usable_size;
- /**
- * @actual_physical_size: Actual VRAM size
- *
- * Actual VRAM size including reserved portions
- * (e.g stolen mem)
- */
- resource_size_t actual_physical_size;
- /** @mapping: pointer to VRAM mappable space */
- void *__iomem mapping;
- } vram;
+ struct xe_mem_region vram;
/** @vram_mgr: VRAM TTM manager */
struct xe_ttm_vram_mgr *vram_mgr;
@@ -247,28 +254,7 @@ struct xe_device {
/** @mem: memory info for device */
struct {
/** @vram: VRAM info for device */
- struct {
- /** @io_start: IO start address of VRAM */
- resource_size_t io_start;
- /**
- * @io_size: IO size of VRAM.
- *
- * This represents how much of VRAM the CPU can access
- * via the VRAM BAR.
- * On systems that do not support large BAR IO space,
- * this can be smaller than the actual memory size, in
- * which case only part of VRAM is CPU accessible
- * (typically the first 256M). This configuration is
- * known as small-bar.
- */
- resource_size_t io_size;
- /** @size: Total size of VRAM */
- resource_size_t size;
- /** @base: Offset to apply for Device Physical Address control */
- resource_size_t base;
- /** @mapping: pointer to VRAM mappable space */
- void *__iomem mapping;
- } vram;
+ struct xe_mem_region vram;
/** @sys_mgr: system TTM manager */
struct ttm_resource_manager sys_mgr;
} mem;