History

drm/xe/uapi: Align on a common way to return arrays (gt)

The uAPI provides queries which return arrays of elements. As of now the format used in the struct is different depending on which element is queried. However, aligning on the new common pattern: struct drm_xe_query_Xs { __u32 num_Xs; struct drm_xe_X Xs[]; ... } ... would mean bringing back the name "gts" which is avoided per commit fca54ba12470 ("drm/xe/uapi: Rename gts to gt_list") so make an exception for gt and leave gt_list. Also, this change removes "query" in the name of struct drm_xe_query_gt as it is not returned from the query IOCTL. There is no functional change. v2: Leave gt_list (Matt Roper)

Francois Dugast committed 2 years ago

Commit 71c625a1 parent 4bc9dd92 files · +4 −4Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/xe/xe_query.c +1 −1
  2. include/uapi/drm/xe_drm.h +3 −3
drivers/gpu/drm/xe/xe_query.c+1−1
@@ -354,7 +354,7 @@ static int query_gt_list(struct xe_device *xe, struct drm_xe_device_query *query · 353 unmodified lines
354354 {
355355 struct xe_gt *gt;
356356 size_t size = sizeof(struct drm_xe_query_gt_list) +
357− xe->info.gt_count * sizeof(struct drm_xe_query_gt);
357+ xe->info.gt_count * sizeof(struct drm_xe_gt);
358358 struct drm_xe_query_gt_list __user *query_ptr =
359359 u64_to_user_ptr(query->data);
360360 struct drm_xe_query_gt_list *gt_list;
include/uapi/drm/xe_drm.h+3−3
@@ -357,14 +357,14 @@ struct drm_xe_query_config { · 356 unmodified lines
357357 };
358358
359359 /**
360− * struct drm_xe_query_gt - describe an individual GT.
360+ * struct drm_xe_gt - describe an individual GT.
361361 *
362362 * To be used with drm_xe_query_gt_list, which will return a list with all the
363363 * existing GT individual descriptions.
364364 * Graphics Technology (GT) is a subset of a GPU/tile that is responsible for
365365 * implementing graphics and/or media operations.
366366 */
367−struct drm_xe_query_gt {
367+struct drm_xe_gt {
368368 #define DRM_XE_QUERY_GT_TYPE_MAIN 0
369369 #define DRM_XE_QUERY_GT_TYPE_MEDIA 1
370370 /** @type: GT type: Main or Media */
@@ -404,7 +404,7 @@ struct drm_xe_query_gt_list { · 33 unmodified lines
404404 /** @pad: MBZ */
405405 __u32 pad;
406406 /** @gt_list: The GT list returned for this device */
407− struct drm_xe_query_gt gt_list[];
407+ struct drm_xe_gt gt_list[];
408408 };
409409
410410 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t