Commit 72404978 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Flesh out device_info pretty printer

Include all the number fields for describing the GT, as well as the
current boolean flags, primarily for inclusion in error states.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207182937.2583002-1-chris@chris-wilson.co.uk
parent 8d65859a
...@@ -61,24 +61,14 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node) ...@@ -61,24 +61,14 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
static int i915_capabilities(struct seq_file *m, void *data) static int i915_capabilities(struct seq_file *m, void *data)
{ {
struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_i915_private *i915 = node_to_i915(m->private);
const struct intel_device_info *info = INTEL_INFO(dev_priv);
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
const char *msg;
seq_printf(m, "gen: %d\n", INTEL_GEN(dev_priv)); seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(i915));
seq_printf(m, "platform: %s\n", intel_platform_name(info->platform));
seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev_priv));
msg = "n/a";
#ifdef CONFIG_INTEL_IOMMU
msg = enableddisabled(intel_iommu_gfx_mapped);
#endif
seq_printf(m, "iommu: %s\n", msg);
intel_device_info_dump_flags(info, &p); intel_device_info_print_static(INTEL_INFO(i915), &p);
intel_device_info_dump_runtime(RUNTIME_INFO(dev_priv), &p); intel_device_info_print_runtime(RUNTIME_INFO(i915), &p);
intel_driver_caps_print(&dev_priv->caps, &p); intel_driver_caps_print(&i915->caps, &p);
kernel_param_lock(THIS_MODULE); kernel_param_lock(THIS_MODULE);
i915_params_dump(&i915_modparams, &p); i915_params_dump(&i915_modparams, &p);
...@@ -2759,7 +2749,7 @@ static int i915_rcs_topology(struct seq_file *m, void *unused) ...@@ -2759,7 +2749,7 @@ static int i915_rcs_topology(struct seq_file *m, void *unused)
struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_i915_private *dev_priv = node_to_i915(m->private);
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
intel_device_info_dump_topology(&RUNTIME_INFO(dev_priv)->sseu, &p); intel_device_info_print_topology(&RUNTIME_INFO(dev_priv)->sseu, &p);
return 0; return 0;
} }
......
...@@ -1397,8 +1397,8 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv) ...@@ -1397,8 +1397,8 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
INTEL_INFO(dev_priv)->platform), INTEL_INFO(dev_priv)->platform),
INTEL_GEN(dev_priv)); INTEL_GEN(dev_priv));
intel_device_info_dump_flags(INTEL_INFO(dev_priv), &p); intel_device_info_print_static(INTEL_INFO(dev_priv), &p);
intel_device_info_dump_runtime(RUNTIME_INFO(dev_priv), &p); intel_device_info_print_runtime(RUNTIME_INFO(dev_priv), &p);
} }
if (IS_ENABLED(CONFIG_DRM_I915_DEBUG)) if (IS_ENABLED(CONFIG_DRM_I915_DEBUG))
......
...@@ -599,9 +599,10 @@ static void err_print_capabilities(struct drm_i915_error_state_buf *m, ...@@ -599,9 +599,10 @@ static void err_print_capabilities(struct drm_i915_error_state_buf *m,
{ {
struct drm_printer p = i915_error_printer(m); struct drm_printer p = i915_error_printer(m);
intel_device_info_dump_flags(info, &p); intel_device_info_print_static(info, &p);
intel_device_info_print_runtime(runtime, &p);
intel_device_info_print_topology(&runtime->sseu, &p);
intel_driver_caps_print(caps, &p); intel_driver_caps_print(caps, &p);
intel_device_info_dump_topology(&runtime->sseu, &p);
} }
static void err_print_params(struct drm_i915_error_state_buf *m, static void err_print_params(struct drm_i915_error_state_buf *m,
......
...@@ -73,9 +73,30 @@ const char *intel_platform_name(enum intel_platform platform) ...@@ -73,9 +73,30 @@ const char *intel_platform_name(enum intel_platform platform)
return platform_names[platform]; return platform_names[platform];
} }
void intel_device_info_dump_flags(const struct intel_device_info *info, static const char *iommu_name(void)
{
const char *msg = "n/a";
#ifdef CONFIG_INTEL_IOMMU
msg = enableddisabled(intel_iommu_gfx_mapped);
#endif
return msg;
}
void intel_device_info_print_static(const struct intel_device_info *info,
struct drm_printer *p) struct drm_printer *p)
{ {
drm_printf(p, "engines: %x\n", info->engine_mask);
drm_printf(p, "gen: %d\n", info->gen);
drm_printf(p, "gt: %d\n", info->gt);
drm_printf(p, "iommu: %s\n", iommu_name());
drm_printf(p, "memory-regions: %x\n", info->memory_regions);
drm_printf(p, "page-sizes: %x\n", info->page_sizes);
drm_printf(p, "platform: %s\n", intel_platform_name(info->platform));
drm_printf(p, "ppgtt-size: %d\n", info->ppgtt_size);
drm_printf(p, "ppgtt-type: %d\n", info->ppgtt_type);
#define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, yesno(info->name)); #define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, yesno(info->name));
DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG); DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG);
#undef PRINT_FLAG #undef PRINT_FLAG
...@@ -106,7 +127,7 @@ static void sseu_dump(const struct sseu_dev_info *sseu, struct drm_printer *p) ...@@ -106,7 +127,7 @@ static void sseu_dump(const struct sseu_dev_info *sseu, struct drm_printer *p)
drm_printf(p, "has EU power gating: %s\n", yesno(sseu->has_eu_pg)); drm_printf(p, "has EU power gating: %s\n", yesno(sseu->has_eu_pg));
} }
void intel_device_info_dump_runtime(const struct intel_runtime_info *info, void intel_device_info_print_runtime(const struct intel_runtime_info *info,
struct drm_printer *p) struct drm_printer *p)
{ {
sseu_dump(&info->sseu, p); sseu_dump(&info->sseu, p);
...@@ -148,7 +169,7 @@ static void sseu_set_eus(struct sseu_dev_info *sseu, int slice, int subslice, ...@@ -148,7 +169,7 @@ static void sseu_set_eus(struct sseu_dev_info *sseu, int slice, int subslice,
} }
} }
void intel_device_info_dump_topology(const struct sseu_dev_info *sseu, void intel_device_info_print_topology(const struct sseu_dev_info *sseu,
struct drm_printer *p) struct drm_printer *p)
{ {
int s, ss; int s, ss;
......
...@@ -230,11 +230,12 @@ const char *intel_platform_name(enum intel_platform platform); ...@@ -230,11 +230,12 @@ const char *intel_platform_name(enum intel_platform platform);
void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv); void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv);
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv); void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
void intel_device_info_dump_flags(const struct intel_device_info *info,
void intel_device_info_print_static(const struct intel_device_info *info,
struct drm_printer *p); struct drm_printer *p);
void intel_device_info_dump_runtime(const struct intel_runtime_info *info, void intel_device_info_print_runtime(const struct intel_runtime_info *info,
struct drm_printer *p); struct drm_printer *p);
void intel_device_info_dump_topology(const struct sseu_dev_info *sseu, void intel_device_info_print_topology(const struct sseu_dev_info *sseu,
struct drm_printer *p); struct drm_printer *p);
void intel_device_info_init_mmio(struct drm_i915_private *dev_priv); void intel_device_info_init_mmio(struct drm_i915_private *dev_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment