Skip to content

Commit 6fb086e

Browse files
dceraolodanvet
authored andcommitted
drm/i915/guc: use probe_error log for CT enablement failure
We have a couple of failure injection points in the CT enablement path, so we need to use i915_probe_error() to select the appropriate log level. A new macro (CT_PROBE_ERROR) has been added to the set of CT logging macros to be used in this scenario and upcoming ones. While adding the new macros, fix the underlying logging mechanics used by the existing ones (DRM_DEV_* -> drm_*) and move the inlines to before they're used inside the macros. Signed-off-by: Matthew Brost <[email protected]> Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1fb12c5 commit 6fb086e

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

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

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,36 @@
77
#include "intel_guc_ct.h"
88
#include "gt/intel_gt.h"
99

10+
static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
11+
{
12+
return container_of(ct, struct intel_guc, ct);
13+
}
14+
15+
static inline struct intel_gt *ct_to_gt(struct intel_guc_ct *ct)
16+
{
17+
return guc_to_gt(ct_to_guc(ct));
18+
}
19+
20+
static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
21+
{
22+
return ct_to_gt(ct)->i915;
23+
}
24+
25+
static inline struct drm_device *ct_to_drm(struct intel_guc_ct *ct)
26+
{
27+
return &ct_to_i915(ct)->drm;
28+
}
29+
1030
#define CT_ERROR(_ct, _fmt, ...) \
11-
DRM_DEV_ERROR(ct_to_dev(_ct), "CT: " _fmt, ##__VA_ARGS__)
31+
drm_err(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
1232
#ifdef CONFIG_DRM_I915_DEBUG_GUC
1333
#define CT_DEBUG(_ct, _fmt, ...) \
14-
DRM_DEV_DEBUG_DRIVER(ct_to_dev(_ct), "CT: " _fmt, ##__VA_ARGS__)
34+
drm_dbg(ct_to_drm(_ct), "CT: " _fmt, ##__VA_ARGS__)
1535
#else
1636
#define CT_DEBUG(...) do { } while (0)
1737
#endif
38+
#define CT_PROBE_ERROR(_ct, _fmt, ...) \
39+
i915_probe_error(ct_to_i915(ct), "CT: " _fmt, ##__VA_ARGS__)
1840

1941
struct ct_request {
2042
struct list_head link;
@@ -47,26 +69,6 @@ void intel_guc_ct_init_early(struct intel_guc_ct *ct)
4769
INIT_WORK(&ct->requests.worker, ct_incoming_request_worker_func);
4870
}
4971

50-
static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
51-
{
52-
return container_of(ct, struct intel_guc, ct);
53-
}
54-
55-
static inline struct intel_gt *ct_to_gt(struct intel_guc_ct *ct)
56-
{
57-
return guc_to_gt(ct_to_guc(ct));
58-
}
59-
60-
static inline struct drm_i915_private *ct_to_i915(struct intel_guc_ct *ct)
61-
{
62-
return ct_to_gt(ct)->i915;
63-
}
64-
65-
static inline struct device *ct_to_dev(struct intel_guc_ct *ct)
66-
{
67-
return ct_to_i915(ct)->drm.dev;
68-
}
69-
7072
static inline const char *guc_ct_buffer_type_to_str(u32 type)
7173
{
7274
switch (type) {
@@ -264,7 +266,7 @@ int intel_guc_ct_enable(struct intel_guc_ct *ct)
264266
err_deregister:
265267
ct_deregister_buffer(ct, INTEL_GUC_CT_BUFFER_TYPE_RECV);
266268
err_out:
267-
CT_ERROR(ct, "Failed to open open CT channel (err=%d)\n", err);
269+
CT_PROBE_ERROR(ct, "Failed to open channel (err=%d)\n", err);
268270
return err;
269271
}
270272

0 commit comments

Comments
 (0)