Skip to content

Commit

Permalink
drm/xe/uapi: Expose the L3 bank mask
Browse files Browse the repository at this point in the history
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 <matthew.d.roper@intel.com>
Cc: Robert Krzemien <robert.krzemien@intel.com>
Cc: Mateusz Jablonski <mateusz.jablonski@intel.com>
Link: intel/compute-runtime#722
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Acked-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240416145037.7-2-francois.dugast@intel.com
  • Loading branch information
ifdu authored and lutzbichler committed Sep 6, 2024
1 parent 78267be commit e0cae56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/xe/xe_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,10 @@ static int query_hwconfig(struct xe_device *xe,
static size_t calc_topo_query_size(struct xe_device *xe)
{
return xe->info.gt_count *
(3 * sizeof(struct drm_xe_query_topology_mask) +
(4 * sizeof(struct drm_xe_query_topology_mask) +
sizeof_field(struct xe_gt, fuse_topo.g_dss_mask) +
sizeof_field(struct xe_gt, fuse_topo.c_dss_mask) +
sizeof_field(struct xe_gt, fuse_topo.l3_bank_mask) +
sizeof_field(struct xe_gt, fuse_topo.eu_mask_per_dss));
}

Expand Down Expand Up @@ -513,6 +514,12 @@ static int query_gt_topology(struct xe_device *xe,
if (err)
return err;

topo.type = DRM_XE_TOPO_L3_BANK;
err = copy_mask(&query_ptr, &topo, gt->fuse_topo.l3_bank_mask,
sizeof(gt->fuse_topo.l3_bank_mask));
if (err)
return err;

topo.type = DRM_XE_TOPO_EU_PER_DSS;
err = copy_mask(&query_ptr, &topo,
gt->fuse_topo.eu_mask_per_dss,
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/drm/xe_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ struct drm_xe_query_gt_list {
* containing the following in mask:
* ``DSS_COMPUTE ff ff ff ff 00 00 00 00``
* means 32 DSS are available for compute.
* - %DRM_XE_TOPO_L3_BANK - To query the mask of enabled L3 banks
* - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)
* available per Dual Sub Slices (DSS). For example a query response
* containing the following in mask:
Expand All @@ -520,6 +521,7 @@ struct drm_xe_query_topology_mask {

#define DRM_XE_TOPO_DSS_GEOMETRY 1
#define DRM_XE_TOPO_DSS_COMPUTE 2
#define DRM_XE_TOPO_L3_BANK 3
#define DRM_XE_TOPO_EU_PER_DSS 4
/** @type: type of mask */
__u16 type;
Expand Down

0 comments on commit e0cae56

Please sign in to comment.