Skip to content

Commit 0239113

Browse files
ifdulutzbichler
authored andcommitted
drm/xe/uapi: Expose the L3 bank mask
The L3 bank mask is already generated and stored internally with the rest of the GT topology. In user space, the compute runtime now needs this information to be added to the device properties therefore the topology mask query is extended to provide a new mask which represents the L3 banks enabled on the GT. The changes in the compute runtime are ready and approved, see link below. v2: Rewrite commit message and add a link to the compute runtime PR (Francois Dugast) Cc: Matt Roper <[email protected]> Cc: Robert Krzemien <[email protected]> Cc: Mateusz Jablonski <[email protected]> Link: intel/compute-runtime#722 Signed-off-by: Francois Dugast <[email protected]> Acked-by: Mateusz Jablonski <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1e67ce7 commit 0239113

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

drivers/gpu/drm/xe/xe_query.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,10 @@ static int query_hwconfig(struct xe_device *xe,
457457
static size_t calc_topo_query_size(struct xe_device *xe)
458458
{
459459
return xe->info.gt_count *
460-
(3 * sizeof(struct drm_xe_query_topology_mask) +
460+
(4 * sizeof(struct drm_xe_query_topology_mask) +
461461
sizeof_field(struct xe_gt, fuse_topo.g_dss_mask) +
462462
sizeof_field(struct xe_gt, fuse_topo.c_dss_mask) +
463+
sizeof_field(struct xe_gt, fuse_topo.l3_bank_mask) +
463464
sizeof_field(struct xe_gt, fuse_topo.eu_mask_per_dss));
464465
}
465466

@@ -513,6 +514,12 @@ static int query_gt_topology(struct xe_device *xe,
513514
if (err)
514515
return err;
515516

517+
topo.type = DRM_XE_TOPO_L3_BANK;
518+
err = copy_mask(&query_ptr, &topo, gt->fuse_topo.l3_bank_mask,
519+
sizeof(gt->fuse_topo.l3_bank_mask));
520+
if (err)
521+
return err;
522+
516523
topo.type = DRM_XE_TOPO_EU_PER_DSS;
517524
err = copy_mask(&query_ptr, &topo,
518525
gt->fuse_topo.eu_mask_per_dss,

include/uapi/drm/xe_drm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ struct drm_xe_query_gt_list {
508508
* containing the following in mask:
509509
* ``DSS_COMPUTE ff ff ff ff 00 00 00 00``
510510
* means 32 DSS are available for compute.
511+
* - %DRM_XE_TOPO_L3_BANK - To query the mask of enabled L3 banks
511512
* - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)
512513
* available per Dual Sub Slices (DSS). For example a query response
513514
* containing the following in mask:
@@ -520,6 +521,7 @@ struct drm_xe_query_topology_mask {
520521

521522
#define DRM_XE_TOPO_DSS_GEOMETRY 1
522523
#define DRM_XE_TOPO_DSS_COMPUTE 2
524+
#define DRM_XE_TOPO_L3_BANK 3
523525
#define DRM_XE_TOPO_EU_PER_DSS 4
524526
/** @type: type of mask */
525527
__u16 type;

0 commit comments

Comments
 (0)