Skip to content

Commit 65774ef

Browse files
committed
drm/xe/debugfs: Update xe_pat_dump signature
Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print() functions to return int. New signature allows us to drop wrapper. While around, move kernel-doc closer to the function definition, as suggested in the doc-guide. Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Rodrigo Vivi <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ab6ccd4 commit 65774ef

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

drivers/gpu/drm/xe/xe_gt_debugfs.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@ static int register_save_restore(struct xe_gt *gt, struct drm_printer *p)
167167
return 0;
168168
}
169169

170-
static int pat(struct xe_gt *gt, struct drm_printer *p)
171-
{
172-
xe_pat_dump(gt, p);
173-
return 0;
174-
}
175-
176170
static int rcs_default_lrc(struct xe_gt *gt, struct drm_printer *p)
177171
{
178172
xe_lrc_dump_default(p, gt, XE_ENGINE_CLASS_RENDER);
@@ -232,7 +226,7 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
232226
static const struct drm_info_list pf_only_debugfs_list[] = {
233227
{ "hw_engines", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engines },
234228
{ "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = xe_mocs_dump },
235-
{ "pat", .show = xe_gt_debugfs_show_with_rpm, .data = pat },
229+
{ "pat", .show = xe_gt_debugfs_show_with_rpm, .data = xe_pat_dump },
236230
{ "powergate_info", .show = xe_gt_debugfs_show_with_rpm, .data = xe_gt_idle_pg_print },
237231
{ "steering", .show = xe_gt_debugfs_show_with_rpm, .data = steering },
238232
};

drivers/gpu/drm/xe/xe_pat.c

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct xe_pat_ops {
5757
int n_entries);
5858
void (*program_media)(struct xe_gt *gt, const struct xe_pat_table_entry table[],
5959
int n_entries);
60-
void (*dump)(struct xe_gt *gt, struct drm_printer *p);
60+
int (*dump)(struct xe_gt *gt, struct drm_printer *p);
6161
};
6262

6363
static const struct xe_pat_table_entry xelp_pat_table[] = {
@@ -194,15 +194,15 @@ static void program_pat_mcr(struct xe_gt *gt, const struct xe_pat_table_entry ta
194194
xe_gt_mcr_multicast_write(gt, XE_REG_MCR(_PAT_PTA), xe->pat.pat_pta->value);
195195
}
196196

197-
static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
197+
static int xelp_dump(struct xe_gt *gt, struct drm_printer *p)
198198
{
199199
struct xe_device *xe = gt_to_xe(gt);
200200
unsigned int fw_ref;
201201
int i;
202202

203203
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
204204
if (!fw_ref)
205-
return;
205+
return -ETIMEDOUT;
206206

207207
drm_printf(p, "PAT table:\n");
208208

@@ -215,22 +215,23 @@ static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
215215
}
216216

217217
xe_force_wake_put(gt_to_fw(gt), fw_ref);
218+
return 0;
218219
}
219220

220221
static const struct xe_pat_ops xelp_pat_ops = {
221222
.program_graphics = program_pat,
222223
.dump = xelp_dump,
223224
};
224225

225-
static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
226+
static int xehp_dump(struct xe_gt *gt, struct drm_printer *p)
226227
{
227228
struct xe_device *xe = gt_to_xe(gt);
228229
unsigned int fw_ref;
229230
int i;
230231

231232
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
232233
if (!fw_ref)
233-
return;
234+
return -ETIMEDOUT;
234235

235236
drm_printf(p, "PAT table:\n");
236237

@@ -245,22 +246,23 @@ static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
245246
}
246247

247248
xe_force_wake_put(gt_to_fw(gt), fw_ref);
249+
return 0;
248250
}
249251

250252
static const struct xe_pat_ops xehp_pat_ops = {
251253
.program_graphics = program_pat_mcr,
252254
.dump = xehp_dump,
253255
};
254256

255-
static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
257+
static int xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
256258
{
257259
struct xe_device *xe = gt_to_xe(gt);
258260
unsigned int fw_ref;
259261
int i;
260262

261263
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
262264
if (!fw_ref)
263-
return;
265+
return -ETIMEDOUT;
264266

265267
drm_printf(p, "PAT table:\n");
266268

@@ -273,22 +275,23 @@ static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
273275
}
274276

275277
xe_force_wake_put(gt_to_fw(gt), fw_ref);
278+
return 0;
276279
}
277280

278281
static const struct xe_pat_ops xehpc_pat_ops = {
279282
.program_graphics = program_pat_mcr,
280283
.dump = xehpc_dump,
281284
};
282285

283-
static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
286+
static int xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
284287
{
285288
struct xe_device *xe = gt_to_xe(gt);
286289
unsigned int fw_ref;
287290
int i;
288291

289292
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
290293
if (!fw_ref)
291-
return;
294+
return -ETIMEDOUT;
292295

293296
drm_printf(p, "PAT table:\n");
294297

@@ -306,6 +309,7 @@ static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
306309
}
307310

308311
xe_force_wake_put(gt_to_fw(gt), fw_ref);
312+
return 0;
309313
}
310314

311315
/*
@@ -318,7 +322,7 @@ static const struct xe_pat_ops xelpg_pat_ops = {
318322
.dump = xelpg_dump,
319323
};
320324

321-
static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
325+
static int xe2_dump(struct xe_gt *gt, struct drm_printer *p)
322326
{
323327
struct xe_device *xe = gt_to_xe(gt);
324328
unsigned int fw_ref;
@@ -327,7 +331,7 @@ static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
327331

328332
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
329333
if (!fw_ref)
330-
return;
334+
return -ETIMEDOUT;
331335

332336
drm_printf(p, "PAT table:\n");
333337

@@ -367,6 +371,7 @@ static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
367371
pat);
368372

369373
xe_force_wake_put(gt_to_fw(gt), fw_ref);
374+
return 0;
370375
}
371376

372377
static const struct xe_pat_ops xe2_pat_ops = {
@@ -462,12 +467,19 @@ void xe_pat_init(struct xe_gt *gt)
462467
xe->pat.ops->program_graphics(gt, xe->pat.table, xe->pat.n_entries);
463468
}
464469

465-
void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
470+
/**
471+
* xe_pat_dump() - Dump GT PAT table into a drm printer.
472+
* @gt: the &xe_gt
473+
* @p: the &drm_printer
474+
*
475+
* Return: 0 on success or a negative error code on failure.
476+
*/
477+
int xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
466478
{
467479
struct xe_device *xe = gt_to_xe(gt);
468480

469481
if (!xe->pat.ops)
470-
return;
482+
return -EOPNOTSUPP;
471483

472-
xe->pat.ops->dump(gt, p);
484+
return xe->pat.ops->dump(gt, p);
473485
}

drivers/gpu/drm/xe/xe_pat.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ void xe_pat_init_early(struct xe_device *xe);
4343
*/
4444
void xe_pat_init(struct xe_gt *gt);
4545

46-
/**
47-
* xe_pat_dump - Dump PAT table
48-
* @gt: GT structure
49-
* @p: Printer to dump info to
50-
*/
51-
void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);
46+
int xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);
5247

5348
/**
5449
* xe_pat_index_get_coh_mode - Extract the coherency mode for the given

0 commit comments

Comments
 (0)