summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_tuning.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe/xe_tuning.c')
-rw-r--r--drivers/gpu/drm/xe/xe_tuning.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/gpu/drm/xe/xe_tuning.c b/drivers/gpu/drm/xe/xe_tuning.c
index 9a1b3862e192..bf3fad9cdbef 100644
--- a/drivers/gpu/drm/xe/xe_tuning.c
+++ b/drivers/gpu/drm/xe/xe_tuning.c
@@ -20,7 +20,7 @@
#undef XE_REG_MCR
#define XE_REG_MCR(...) XE_REG(__VA_ARGS__, .mcr = 1)
-static const struct xe_rtp_entry_sr gt_tunings[] = {
+static const struct xe_rtp_table_sr gt_tunings = XE_RTP_TABLE_SR(
{ XE_RTP_NAME("Tuning: Blend Fill Caching Optimization Disable"),
XE_RTP_RULES(PLATFORM(DG2)),
XE_RTP_ACTIONS(SET(XEHP_L3SCQREG7, BLEND_FILL_CACHING_OPT_DIS))
@@ -100,9 +100,9 @@ static const struct xe_rtp_entry_sr gt_tunings[] = {
XE_RTP_ACTIONS(FIELD_SET(GAMSTLB_CTRL, BANK_HASH_MODE,
BANK_HASH_4KB_MODE))
},
-};
+);
-static const struct xe_rtp_entry_sr engine_tunings[] = {
+static const struct xe_rtp_table_sr engine_tunings = XE_RTP_TABLE_SR(
{ XE_RTP_NAME("Tuning: L3 Hashing Mask"),
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1210),
FUNC(xe_rtp_match_first_render_or_compute)),
@@ -129,9 +129,9 @@ static const struct xe_rtp_entry_sr engine_tunings[] = {
FUNC(xe_rtp_match_first_render_or_compute)),
XE_RTP_ACTIONS(SET(TDL_TSL_CHICKEN2, TILEY_LOCALID))
},
-};
+);
-static const struct xe_rtp_entry_sr lrc_tunings[] = {
+static const struct xe_rtp_table_sr lrc_tunings = XE_RTP_TABLE_SR(
{ XE_RTP_NAME("Tuning: Windower HW Filtering"),
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(3000, 3599), ENGINE_CLASS(RENDER)),
XE_RTP_ACTIONS(SET(XEHP_COMMON_SLICE_CHICKEN4, HW_FILTERING))
@@ -171,7 +171,7 @@ static const struct xe_rtp_entry_sr lrc_tunings[] = {
XE_RTP_ACTIONS(FIELD_SET(FF_MODE, VS_HIT_MAX_VALUE_MASK,
REG_FIELD_PREP(VS_HIT_MAX_VALUE_MASK, 0x3f)))
},
-};
+);
/**
* xe_tuning_init - initialize gt with tunings bookkeeping
@@ -185,9 +185,9 @@ int xe_tuning_init(struct xe_gt *gt)
size_t n_lrc, n_engine, n_gt, total;
unsigned long *p;
- n_gt = BITS_TO_LONGS(ARRAY_SIZE(gt_tunings));
- n_engine = BITS_TO_LONGS(ARRAY_SIZE(engine_tunings));
- n_lrc = BITS_TO_LONGS(ARRAY_SIZE(lrc_tunings));
+ n_gt = BITS_TO_LONGS(gt_tunings.n_entries);
+ n_engine = BITS_TO_LONGS(engine_tunings.n_entries);
+ n_lrc = BITS_TO_LONGS(lrc_tunings.n_entries);
total = n_gt + n_engine + n_lrc;
p = drmm_kzalloc(&xe->drm, sizeof(*p) * total, GFP_KERNEL);
@@ -210,9 +210,8 @@ void xe_tuning_process_gt(struct xe_gt *gt)
xe_rtp_process_ctx_enable_active_tracking(&ctx,
gt->tuning_active.gt,
- ARRAY_SIZE(gt_tunings));
- xe_rtp_process_to_sr(&ctx, gt_tunings, ARRAY_SIZE(gt_tunings),
- &gt->reg_sr, false);
+ gt_tunings.n_entries);
+ xe_rtp_process_to_sr(&ctx, &gt_tunings, &gt->reg_sr, false);
}
EXPORT_SYMBOL_IF_KUNIT(xe_tuning_process_gt);
@@ -222,9 +221,8 @@ void xe_tuning_process_engine(struct xe_hw_engine *hwe)
xe_rtp_process_ctx_enable_active_tracking(&ctx,
hwe->gt->tuning_active.engine,
- ARRAY_SIZE(engine_tunings));
- xe_rtp_process_to_sr(&ctx, engine_tunings, ARRAY_SIZE(engine_tunings),
- &hwe->reg_sr, false);
+ engine_tunings.n_entries);
+ xe_rtp_process_to_sr(&ctx, &engine_tunings, &hwe->reg_sr, false);
}
EXPORT_SYMBOL_IF_KUNIT(xe_tuning_process_engine);
@@ -242,9 +240,8 @@ void xe_tuning_process_lrc(struct xe_hw_engine *hwe)
xe_rtp_process_ctx_enable_active_tracking(&ctx,
hwe->gt->tuning_active.lrc,
- ARRAY_SIZE(lrc_tunings));
- xe_rtp_process_to_sr(&ctx, lrc_tunings, ARRAY_SIZE(lrc_tunings),
- &hwe->reg_lrc, true);
+ lrc_tunings.n_entries);
+ xe_rtp_process_to_sr(&ctx, &lrc_tunings, &hwe->reg_lrc, true);
}
/**
@@ -259,18 +256,18 @@ int xe_tuning_dump(struct xe_gt *gt, struct drm_printer *p)
size_t idx;
drm_printf(p, "GT Tunings\n");
- for_each_set_bit(idx, gt->tuning_active.gt, ARRAY_SIZE(gt_tunings))
- drm_printf_indent(p, 1, "%s\n", gt_tunings[idx].name);
+ for_each_set_bit(idx, gt->tuning_active.gt, gt_tunings.n_entries)
+ drm_printf_indent(p, 1, "%s\n", gt_tunings.entries[idx].name);
drm_puts(p, "\n");
drm_printf(p, "Engine Tunings\n");
- for_each_set_bit(idx, gt->tuning_active.engine, ARRAY_SIZE(engine_tunings))
- drm_printf_indent(p, 1, "%s\n", engine_tunings[idx].name);
+ for_each_set_bit(idx, gt->tuning_active.engine, engine_tunings.n_entries)
+ drm_printf_indent(p, 1, "%s\n", engine_tunings.entries[idx].name);
drm_puts(p, "\n");
drm_printf(p, "LRC Tunings\n");
- for_each_set_bit(idx, gt->tuning_active.lrc, ARRAY_SIZE(lrc_tunings))
- drm_printf_indent(p, 1, "%s\n", lrc_tunings[idx].name);
+ for_each_set_bit(idx, gt->tuning_active.lrc, lrc_tunings.n_entries)
+ drm_printf_indent(p, 1, "%s\n", lrc_tunings.entries[idx].name);
return 0;
}