@@ -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
6363static 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
220221static 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
250252static 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
278281static 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
372377static 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}
0 commit comments