All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Zhanjun Dong <zhanjun.dong@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [PATCH v5 1/2] drm/xe/query: Define and use a constant for the number of masks
Date: Mon, 25 Mar 2024 16:22:03 -0500	[thread overview]
Message-ID: <nwogfwjufbp6now5u4huaumpxf2cfeggeyobumovdm4vuv5ong@siqwktqabnrk> (raw)
In-Reply-To: <20240325111439.7-1-francois.dugast@intel.com>

On Mon, Mar 25, 2024 at 11:14:38AM +0000, Francois Dugast wrote:
>Replace a magic value by a constant with an explicit name to make clear
>what it stands for: the number of masks returned by the topology query.
>
>Suggested-by: Zhanjun Dong <zhanjun.dong@intel.com>
>Signed-off-by: Francois Dugast <francois.dugast@intel.com>
>---
> drivers/gpu/drm/xe/xe_query.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
>index df407d73e5f5..109a96212310 100644
>--- a/drivers/gpu/drm/xe/xe_query.c
>+++ b/drivers/gpu/drm/xe/xe_query.c
>@@ -23,6 +23,8 @@
> #include "xe_mmio.h"
> #include "xe_ttm_vram_mgr.h"
>
>+#define TOPO_NUMBER_OF_MASKS   (3)
>+
> static const u16 xe_to_user_engine_class[] = {
> 	[XE_ENGINE_CLASS_RENDER] = DRM_XE_ENGINE_CLASS_RENDER,
> 	[XE_ENGINE_CLASS_COPY] = DRM_XE_ENGINE_CLASS_COPY,
>@@ -454,7 +456,8 @@ 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) +
>+		(TOPO_NUMBER_OF_MASKS
>+		 * sizeof(struct drm_xe_query_topology_mask) +

actually no.... the number here should match the entries below

> 		 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.eu_mask_per_dss));

what do we gain moving it elsewhere? I think it should match the number
of types and hence maybe use same "namespace", but that also leads me to
another odd thing:  why is drm_xe_query_topology_mask.type handled like
a mask rather than an index?

+Matt Roper who implemented this originally afaics in commit
eaa6ccf582f5e3252aedea81559fcbf71ed9ccde.

Lucaas De Marchi


>-- 
>2.34.1
>

  parent reply	other threads:[~2024-03-25 21:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 11:14 [PATCH v5 1/2] drm/xe/query: Define and use a constant for the number of masks Francois Dugast
2024-03-25 11:14 ` [PATCH v5 2/2] drm/xe/uapi: Add L3 bank mask to topology query Francois Dugast
2024-03-26  0:17   ` Matt Roper
2024-03-27 23:13     ` Matt Roper
2024-03-25 11:41 ` ✓ CI.Patch_applied: success for series starting with [v5,1/2] drm/xe/query: Define and use a constant for the number of masks Patchwork
2024-03-25 11:42 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-25 11:43 ` ✓ CI.KUnit: success " Patchwork
2024-03-25 11:54 ` ✓ CI.Build: " Patchwork
2024-03-25 11:57 ` ✗ CI.Hooks: failure " Patchwork
2024-03-25 11:59 ` ✓ CI.checksparse: success " Patchwork
2024-03-25 12:24 ` ✓ CI.BAT: " Patchwork
2024-03-25 17:45 ` [PATCH v5 1/2] " Dong, Zhanjun
2024-03-25 21:22 ` Lucas De Marchi [this message]
2024-03-27 23:23   ` Matt Roper

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=nwogfwjufbp6now5u4huaumpxf2cfeggeyobumovdm4vuv5ong@siqwktqabnrk \
    --to=lucas.demarchi@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.