All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] drm/xe/query: Define and use a constant for the number of masks
@ 2024-03-21 14:25 Francois Dugast
  2024-03-21 14:25 ` [PATCH v4 2/2] drm/xe/uapi: Add L3 bank mask to topology query Francois Dugast
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Francois Dugast @ 2024-03-21 14:25 UTC (permalink / raw)
  To: intel-xe; +Cc: Francois Dugast, Zhanjun Dong

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 e80321b34918..fa8de1a77b1e 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,
@@ -453,7 +455,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) +
 		 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));
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-22 16:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21 14:25 [PATCH v4 1/2] drm/xe/query: Define and use a constant for the number of masks Francois Dugast
2024-03-21 14:25 ` [PATCH v4 2/2] drm/xe/uapi: Add L3 bank mask to topology query Francois Dugast
2024-03-22 16:21   ` Lucas De Marchi
2024-03-21 15:28 ` ✓ CI.Patch_applied: success for series starting with [v4,1/2] drm/xe/query: Define and use a constant for the number of masks Patchwork
2024-03-21 15:29 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-21 15:30 ` ✓ CI.KUnit: success " Patchwork
2024-03-21 15:41 ` ✓ CI.Build: " Patchwork
2024-03-21 15:45 ` ✗ CI.Hooks: failure " Patchwork
2024-03-21 15:46 ` ✓ CI.checksparse: success " Patchwork
2024-03-21 16:09 ` ✓ CI.BAT: " Patchwork

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.