From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Matt Roper <matthew.d.roper@intel.com>,
Zhanjun Dong <zhanjun.dong@intel.com>
Subject: Re: [PATCH v6 2/3] drm/xe: Add helpers to loop over geometry and compute DSS
Date: Mon, 22 Apr 2024 21:24:25 -0400 [thread overview]
Message-ID: <ZicNyQegLO2tlhsT@intel.com> (raw)
In-Reply-To: <20240405182326.72157-2-jose.souza@intel.com>
On Fri, Apr 05, 2024 at 11:23:25AM -0700, José Roberto de Souza wrote:
> Some DSS can only be available for geometry while others can only be
> available for compute.
> So here adding helpers to loop only available DSS for given usage.
>
> User of this helper will come in the next patch.
>
> v2:
> - drop has_dss()
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Zhanjun Dong <zhanjun.dong@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_mcr.h | 24 ++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_gt_topology.c | 10 ++++++++++
> drivers/gpu/drm/xe/xe_gt_topology.h | 3 +++
> 3 files changed, 37 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.h b/drivers/gpu/drm/xe/xe_gt_mcr.h
> index a7f4ab1aa584b..e7d03e001a49f 100644
> --- a/drivers/gpu/drm/xe/xe_gt_mcr.h
> +++ b/drivers/gpu/drm/xe/xe_gt_mcr.h
> @@ -40,4 +40,28 @@ void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group,
> for_each_dss((dss), (gt)) \
> for_each_if((xe_gt_mcr_get_dss_steering((gt), (dss), &(group), &(instance)), true))
>
> +/*
> + * Loop over each DSS available for geometry and determine the group and
> + * instance IDs that should be used to steer MCR accesses toward this DSS.
> + * @dss: DSS ID to obtain steering for
> + * @gt: GT structure
> + * @group: steering group ID, data type: u16
> + * @instance: steering instance ID, data type: u16
> + */
> +#define for_each_geometry_dss(dss, gt, group, instance) \
> + for_each_dss_steering(dss, gt, group, instance) \
> + if (xe_gt_has_geometry_dss(gt, dss))
> +
> +/*
> + * Loop over each DSS available for compute and determine the group and
> + * instance IDs that should be used to steer MCR accesses toward this DSS.
> + * @dss: DSS ID to obtain steering for
> + * @gt: GT structure
> + * @group: steering group ID, data type: u16
> + * @instance: steering instance ID, data type: u16
> + */
> +#define for_each_compute_dss(dss, gt, group, instance) \
> + for_each_dss_steering(dss, gt, group, instance) \
> + if (xe_gt_has_compute_dss(gt, dss))
> +
> #endif /* _XE_GT_MCR_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_gt_topology.c b/drivers/gpu/drm/xe/xe_gt_topology.c
> index f5773a14f3c8e..e2eff4f10ad9b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_topology.c
> +++ b/drivers/gpu/drm/xe/xe_gt_topology.c
> @@ -166,3 +166,13 @@ bool xe_gt_topology_has_dss_in_quadrant(struct xe_gt *gt, int quad)
>
> return quad_first < (quad + 1) * dss_per_quad;
> }
> +
> +bool xe_gt_has_geometry_dss(struct xe_gt *gt, unsigned int dss)
> +{
> + return test_bit(dss, gt->fuse_topo.g_dss_mask);
> +}
> +
> +bool xe_gt_has_compute_dss(struct xe_gt *gt, unsigned int dss)
> +{
> + return test_bit(dss, gt->fuse_topo.c_dss_mask);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_gt_topology.h b/drivers/gpu/drm/xe/xe_gt_topology.h
> index b3e357777a6e7..746b325bbf6e4 100644
> --- a/drivers/gpu/drm/xe/xe_gt_topology.h
> +++ b/drivers/gpu/drm/xe/xe_gt_topology.h
> @@ -33,4 +33,7 @@ bool xe_dss_mask_empty(const xe_dss_mask_t mask);
> bool
> xe_gt_topology_has_dss_in_quadrant(struct xe_gt *gt, int quad);
>
> +bool xe_gt_has_geometry_dss(struct xe_gt *gt, unsigned int dss);
> +bool xe_gt_has_compute_dss(struct xe_gt *gt, unsigned int dss);
> +
> #endif /* _XE_GT_TOPOLOGY_H_ */
> --
> 2.44.0
>
next prev parent reply other threads:[~2024-04-23 1:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 18:23 [PATCH v6 1/3] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot José Roberto de Souza
2024-04-05 18:23 ` [PATCH v6 2/3] drm/xe: Add helpers to loop over geometry and compute DSS José Roberto de Souza
2024-04-23 1:24 ` Rodrigo Vivi [this message]
2024-04-05 18:23 ` [PATCH v6 3/3] drm/xe: Add INSTDONE registers to devcoredump José Roberto de Souza
2024-04-23 1:24 ` Rodrigo Vivi
2024-04-23 14:13 ` Souza, Jose
2024-04-23 14:17 ` Rodrigo Vivi
2024-04-05 20:11 ` ✓ CI.Patch_applied: success for series starting with [v6,1/3] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot Patchwork
2024-04-05 20:12 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-05 20:13 ` ✓ CI.KUnit: success " Patchwork
2024-04-05 20:24 ` ✓ CI.Build: " Patchwork
2024-04-05 20:27 ` ✓ CI.Hooks: " Patchwork
2024-04-05 20:28 ` ✓ CI.checksparse: " Patchwork
2024-04-05 20:42 ` ✗ CI.BAT: failure " Patchwork
2024-04-08 16:00 ` ✓ CI.Patch_applied: success for series starting with [v6,1/3] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot (rev2) Patchwork
2024-04-08 16:00 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-08 16:02 ` ✓ CI.KUnit: success " Patchwork
2024-04-08 16:14 ` ✓ CI.Build: " Patchwork
2024-04-08 16:18 ` ✓ CI.Hooks: " Patchwork
2024-04-08 16:19 ` ✓ CI.checksparse: " Patchwork
2024-04-08 16:50 ` ✓ CI.BAT: " Patchwork
2024-04-08 19:28 ` ✗ CI.FULL: failure " Patchwork
2024-04-23 1:12 ` [PATCH v6 1/3] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot Rodrigo Vivi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZicNyQegLO2tlhsT@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=zhanjun.dong@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox