Skip to content

Commit f0c4fc4

Browse files
mwajdecztursulin
authored andcommitted
drm/i915/guc: Update GuC messages in intel_guc_submission.c
Use new macros to have common prefix that also include GT#. v2: improve few existing messages Signed-off-by: Michal Wajdeczko <[email protected]> Cc: John Harrison <[email protected]> Reviewed-by: John Harrison <[email protected]> Signed-off-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 357d420 commit f0c4fc4

File tree

1 file changed

+26
-35
lines changed

1 file changed

+26
-35
lines changed

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "intel_guc_ads.h"
2929
#include "intel_guc_capture.h"
30+
#include "intel_guc_print.h"
3031
#include "intel_guc_submission.h"
3132

3233
#include "i915_drv.h"
@@ -1443,8 +1444,7 @@ static void guc_init_engine_stats(struct intel_guc *guc)
14431444
int ret = guc_action_enable_usage_stats(guc);
14441445

14451446
if (ret)
1446-
drm_err(&gt->i915->drm,
1447-
"Failed to enable usage stats: %d!\n", ret);
1447+
guc_err(guc, "Failed to enable usage stats: %pe\n", ERR_PTR(ret));
14481448
}
14491449
}
14501450

@@ -3586,8 +3586,7 @@ static int guc_request_alloc(struct i915_request *rq)
35863586
intel_context_sched_disable_unpin(ce);
35873587
else if (intel_context_is_closed(ce))
35883588
if (wait_for(context_close_done(ce), 1500))
3589-
drm_warn(&guc_to_gt(guc)->i915->drm,
3590-
"timed out waiting on context sched close before realloc\n");
3589+
guc_warn(guc, "timed out waiting on context sched close before realloc\n");
35913590
/*
35923591
* Call pin_guc_id here rather than in the pinning step as with
35933592
* dma_resv, contexts can be repeatedly pinned / unpinned trashing the
@@ -4350,11 +4349,14 @@ static int __guc_action_set_scheduling_policies(struct intel_guc *guc,
43504349

43514350
ret = intel_guc_send(guc, (u32 *)&policy->h2g,
43524351
__guc_scheduling_policy_action_size(policy));
4353-
if (ret < 0)
4352+
if (ret < 0) {
4353+
guc_probe_error(guc, "Failed to configure global scheduling policies: %pe!\n",
4354+
ERR_PTR(ret));
43544355
return ret;
4356+
}
43554357

43564358
if (ret != policy->count) {
4357-
drm_warn(&guc_to_gt(guc)->i915->drm, "GuC global scheduler policy processed %d of %d KLVs!",
4359+
guc_warn(guc, "global scheduler policy processed %d of %d KLVs!",
43584360
ret, policy->count);
43594361
if (ret > policy->count)
43604362
return -EPROTO;
@@ -4368,7 +4370,7 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
43684370
struct scheduling_policy policy;
43694371
struct intel_gt *gt = guc_to_gt(guc);
43704372
intel_wakeref_t wakeref;
4371-
int ret = 0;
4373+
int ret;
43724374

43734375
if (GUC_SUBMIT_VER(guc) < MAKE_GUC_VER(1, 1, 0))
43744376
return 0;
@@ -4386,10 +4388,6 @@ static int guc_init_global_schedule_policy(struct intel_guc *guc)
43864388
yield, ARRAY_SIZE(yield));
43874389

43884390
ret = __guc_action_set_scheduling_policies(guc, &policy);
4389-
if (ret)
4390-
i915_probe_error(gt->i915,
4391-
"Failed to configure global scheduling policies: %pe!\n",
4392-
ERR_PTR(ret));
43934391
}
43944392

43954393
return ret;
@@ -4488,21 +4486,18 @@ g2h_context_lookup(struct intel_guc *guc, u32 ctx_id)
44884486
struct intel_context *ce;
44894487

44904488
if (unlikely(ctx_id >= GUC_MAX_CONTEXT_ID)) {
4491-
drm_err(&guc_to_gt(guc)->i915->drm,
4492-
"Invalid ctx_id %u\n", ctx_id);
4489+
guc_err(guc, "Invalid ctx_id %u\n", ctx_id);
44934490
return NULL;
44944491
}
44954492

44964493
ce = __get_context(guc, ctx_id);
44974494
if (unlikely(!ce)) {
4498-
drm_err(&guc_to_gt(guc)->i915->drm,
4499-
"Context is NULL, ctx_id %u\n", ctx_id);
4495+
guc_err(guc, "Context is NULL, ctx_id %u\n", ctx_id);
45004496
return NULL;
45014497
}
45024498

45034499
if (unlikely(intel_context_is_child(ce))) {
4504-
drm_err(&guc_to_gt(guc)->i915->drm,
4505-
"Context is child, ctx_id %u\n", ctx_id);
4500+
guc_err(guc, "Context is child, ctx_id %u\n", ctx_id);
45064501
return NULL;
45074502
}
45084503

@@ -4517,7 +4512,7 @@ int intel_guc_deregister_done_process_msg(struct intel_guc *guc,
45174512
u32 ctx_id;
45184513

45194514
if (unlikely(len < 1)) {
4520-
drm_err(&guc_to_gt(guc)->i915->drm, "Invalid length %u\n", len);
4515+
guc_err(guc, "Invalid length %u\n", len);
45214516
return -EPROTO;
45224517
}
45234518
ctx_id = msg[0];
@@ -4569,7 +4564,7 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
45694564
u32 ctx_id;
45704565

45714566
if (unlikely(len < 2)) {
4572-
drm_err(&guc_to_gt(guc)->i915->drm, "Invalid length %u\n", len);
4567+
guc_err(guc, "Invalid length %u\n", len);
45734568
return -EPROTO;
45744569
}
45754570
ctx_id = msg[0];
@@ -4581,8 +4576,7 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
45814576
if (unlikely(context_destroyed(ce) ||
45824577
(!context_pending_enable(ce) &&
45834578
!context_pending_disable(ce)))) {
4584-
drm_err(&guc_to_gt(guc)->i915->drm,
4585-
"Bad context sched_state 0x%x, ctx_id %u\n",
4579+
guc_err(guc, "Bad context sched_state 0x%x, ctx_id %u\n",
45864580
ce->guc_state.sched_state, ctx_id);
45874581
return -EPROTO;
45884582
}
@@ -4674,8 +4668,7 @@ static void guc_handle_context_reset(struct intel_guc *guc,
46744668
capture_error_state(guc, ce);
46754669
guc_context_replay(ce);
46764670
} else {
4677-
drm_info(&guc_to_gt(guc)->i915->drm,
4678-
"Ignoring context reset notification of exiting context 0x%04X on %s",
4671+
guc_info(guc, "Ignoring context reset notification of exiting context 0x%04X on %s",
46794672
ce->guc_id.id, ce->engine->name);
46804673
}
46814674
}
@@ -4688,7 +4681,7 @@ int intel_guc_context_reset_process_msg(struct intel_guc *guc,
46884681
int ctx_id;
46894682

46904683
if (unlikely(len != 1)) {
4691-
drm_err(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
4684+
guc_err(guc, "Invalid length %u", len);
46924685
return -EPROTO;
46934686
}
46944687

@@ -4721,13 +4714,13 @@ int intel_guc_error_capture_process_msg(struct intel_guc *guc,
47214714
u32 status;
47224715

47234716
if (unlikely(len != 1)) {
4724-
drm_dbg(&guc_to_gt(guc)->i915->drm, "Invalid length %u", len);
4717+
guc_dbg(guc, "Invalid length %u", len);
47254718
return -EPROTO;
47264719
}
47274720

47284721
status = msg[0] & INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_MASK;
47294722
if (status == INTEL_GUC_STATE_CAPTURE_EVENT_STATUS_NOSPACE)
4730-
drm_warn(&guc_to_gt(guc)->i915->drm, "G2H-Error capture no space");
4723+
guc_warn(guc, "No space for error capture");
47314724

47324725
intel_guc_capture_process(guc);
47334726

@@ -4783,13 +4776,12 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
47834776
const u32 *msg, u32 len)
47844777
{
47854778
struct intel_engine_cs *engine;
4786-
struct intel_gt *gt = guc_to_gt(guc);
47874779
u8 guc_class, instance;
47884780
u32 reason;
47894781
unsigned long flags;
47904782

47914783
if (unlikely(len != 3)) {
4792-
drm_err(&gt->i915->drm, "Invalid length %u", len);
4784+
guc_err(guc, "Invalid length %u", len);
47934785
return -EPROTO;
47944786
}
47954787

@@ -4799,16 +4791,15 @@ int intel_guc_engine_failure_process_msg(struct intel_guc *guc,
47994791

48004792
engine = intel_guc_lookup_engine(guc, guc_class, instance);
48014793
if (unlikely(!engine)) {
4802-
drm_err(&gt->i915->drm,
4803-
"Invalid engine %d:%d", guc_class, instance);
4794+
guc_err(guc, "Invalid engine %d:%d", guc_class, instance);
48044795
return -EPROTO;
48054796
}
48064797

48074798
/*
48084799
* This is an unexpected failure of a hardware feature. So, log a real
48094800
* error message not just the informational that comes with the reset.
48104801
*/
4811-
drm_err(&gt->i915->drm, "GuC engine reset request failed on %d:%d (%s) because 0x%08X",
4802+
guc_err(guc, "Engine reset failed on %d:%d (%s) because 0x%08X",
48124803
guc_class, instance, engine->name, reason);
48134804

48144805
spin_lock_irqsave(&guc->submission_state.lock, flags);
@@ -5371,8 +5362,8 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count,
53715362

53725363
GEM_BUG_ON(!is_power_of_2(sibling->mask));
53735364
if (sibling->mask & ve->base.mask) {
5374-
DRM_DEBUG("duplicate %s entry in load balancer\n",
5375-
sibling->name);
5365+
guc_dbg(guc, "duplicate %s entry in load balancer\n",
5366+
sibling->name);
53765367
err = -EINVAL;
53775368
goto err_put;
53785369
}
@@ -5381,8 +5372,8 @@ guc_create_virtual(struct intel_engine_cs **siblings, unsigned int count,
53815372
ve->base.logical_mask |= sibling->logical_mask;
53825373

53835374
if (n != 0 && ve->base.class != sibling->class) {
5384-
DRM_DEBUG("invalid mixing of engine class, sibling %d, already %d\n",
5385-
sibling->class, ve->base.class);
5375+
guc_dbg(guc, "invalid mixing of engine class, sibling %d, already %d\n",
5376+
sibling->class, ve->base.class);
53865377
err = -EINVAL;
53875378
goto err_put;
53885379
} else if (n == 0) {

0 commit comments

Comments
 (0)