diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-11-14 13:34:31 +0000 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:44:38 -0500 |
commit | b02606d32376b8d51b33211f8c069b16165390eb (patch) | |
tree | 44fe345c100867d5932137f53d9eefa6a377a22d /drivers/gpu/drm | |
parent | 45c30d80008264d55915f4b87c6f9bbb3261071c (diff) | |
download | lwn-b02606d32376b8d51b33211f8c069b16165390eb.tar.gz lwn-b02606d32376b8d51b33211f8c069b16165390eb.zip |
drm/xe/uapi: Rename query's mem_usage to mem_regions
'Usage' gives an impression of telemetry information where someone
would query to see how the memory is currently used and available
size, etc. However this API is more than this. It is about a global
view of all the memory regions available in the system and user
space needs to have this information so they can then use the
mem_region masks that are returned for the engine access.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/xe/xe_query.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c index 8b5136460ea6..d495716b2c96 100644 --- a/drivers/gpu/drm/xe/xe_query.c +++ b/drivers/gpu/drm/xe/xe_query.c @@ -230,7 +230,7 @@ static int query_engines(struct xe_device *xe, return 0; } -static size_t calc_memory_usage_size(struct xe_device *xe) +static size_t calc_mem_regions_size(struct xe_device *xe) { u32 num_managers = 1; int i; @@ -239,15 +239,15 @@ static size_t calc_memory_usage_size(struct xe_device *xe) if (ttm_manager_type(&xe->ttm, i)) num_managers++; - return offsetof(struct drm_xe_query_mem_usage, regions[num_managers]); + return offsetof(struct drm_xe_query_mem_regions, regions[num_managers]); } -static int query_memory_usage(struct xe_device *xe, - struct drm_xe_device_query *query) +static int query_mem_regions(struct xe_device *xe, + struct drm_xe_device_query *query) { - size_t size = calc_memory_usage_size(xe); - struct drm_xe_query_mem_usage *usage; - struct drm_xe_query_mem_usage __user *query_ptr = + size_t size = calc_mem_regions_size(xe); + struct drm_xe_query_mem_regions *usage; + struct drm_xe_query_mem_regions __user *query_ptr = u64_to_user_ptr(query->data); struct ttm_resource_manager *man; int ret, i; @@ -499,7 +499,7 @@ static int query_gt_topology(struct xe_device *xe, static int (* const xe_query_funcs[])(struct xe_device *xe, struct drm_xe_device_query *query) = { query_engines, - query_memory_usage, + query_mem_regions, query_config, query_gt_list, query_hwconfig, |