summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-15 15:45:48 +0000
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:47:01 -0500
commit535881a8c50b79085327e7dbe26a4c55f3e1591b (patch)
treef1e9019c5ec063613c0910b0b9c7fdfc9011612b /include
parent4b437893a826b2f1d15f73e72506349656ea14b2 (diff)
downloadlinux-stable-535881a8c50b79085327e7dbe26a4c55f3e1591b.tar.gz
linux-stable-535881a8c50b79085327e7dbe26a4c55f3e1591b.tar.bz2
linux-stable-535881a8c50b79085327e7dbe26a4c55f3e1591b.zip
drm/xe/uapi: Document the memory_region bitmask
The uAPI should stay generic in regarding to the bitmask. It is the userspace responsibility to check for the type/class of the memory, without any assumption. Also add comments inside the code to explain how it is actually constructed so we don't accidentally change the assignment of the instance and the masks. No functional change in this patch. It only explains and document the memory_region masks. A further follow-up work with the organization of all memory regions around struct xe_mem_regions is desired, but not part of this patch. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: José Roberto de Souza <jose.souza@intel.com> Acked-by: Mateusz Naklicki <mateusz.naklicki@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/drm/xe_drm.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 5a01d033b780..6c719ba8fc8e 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -256,10 +256,9 @@ struct drm_xe_mem_region {
*/
__u16 mem_class;
/**
- * @instance: The instance for this region.
- *
- * The @mem_class and @instance taken together will always give
- * a unique pair.
+ * @instance: The unique ID for this region, which serves as the
+ * index in the placement bitmask used as argument for
+ * &DRM_IOCTL_XE_GEM_CREATE
*/
__u16 instance;
/**
@@ -404,6 +403,10 @@ struct drm_xe_gt {
* @near_mem_regions: Bit mask of instances from
* drm_xe_query_mem_regions that are nearest to the current engines
* of this GT.
+ * Each index in this mask refers directly to the struct
+ * drm_xe_query_mem_regions' instance, no assumptions should
+ * be made about order. The type of each region is described
+ * by struct drm_xe_query_mem_regions' mem_class.
*/
__u64 near_mem_regions;
/**
@@ -412,6 +415,10 @@ struct drm_xe_gt {
* In general, they have extra indirections when compared to the
* @near_mem_regions. For a discrete device this could mean system
* memory and memory living in a different tile.
+ * Each index in this mask refers directly to the struct
+ * drm_xe_query_mem_regions' instance, no assumptions should
+ * be made about order. The type of each region is described
+ * by struct drm_xe_query_mem_regions' mem_class.
*/
__u64 far_mem_regions;
/** @reserved: Reserved */
@@ -652,7 +659,13 @@ struct drm_xe_gem_create {
*/
__u64 size;
- /** @placement: A mask of memory instances of where BO can be placed. */
+ /**
+ * @placement: A mask of memory instances of where BO can be placed.
+ * Each index in this mask refers directly to the struct
+ * drm_xe_query_mem_regions' instance, no assumptions should
+ * be made about order. The type of each region is described
+ * by struct drm_xe_query_mem_regions' mem_class.
+ */
__u32 placement;
#define DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING (1 << 0)