]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Flesh out device_info pretty printer
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 7 Dec 2019 18:29:37 +0000 (18:29 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 9 Dec 2019 09:58:51 +0000 (09:58 +0000)
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: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207182937.2583002-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/intel_device_info.c
drivers/gpu/drm/i915/intel_device_info.h

index eb80a2c4b55bef1b93c7e247199290a1aa9d0933..062e5bef637a8f7c2d6c51a7b83146767a8e0126 100644 (file)
@@ -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)
 {
-       struct drm_i915_private *dev_priv = node_to_i915(m->private);
-       const struct intel_device_info *info = INTEL_INFO(dev_priv);
+       struct drm_i915_private *i915 = node_to_i915(m->private);
        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, "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);
+       seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(i915));
 
-       intel_device_info_dump_flags(info, &p);
-       intel_device_info_dump_runtime(RUNTIME_INFO(dev_priv), &p);
-       intel_driver_caps_print(&dev_priv->caps, &p);
+       intel_device_info_print_static(INTEL_INFO(i915), &p);
+       intel_device_info_print_runtime(RUNTIME_INFO(i915), &p);
+       intel_driver_caps_print(&i915->caps, &p);
 
        kernel_param_lock(THIS_MODULE);
        i915_params_dump(&i915_modparams, &p);
@@ -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_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;
 }
index 5d7e119277298e7c8a7a6bdef237843d36c2a338..1234bd64db2ff87b8ec633f56145610adf82361b 100644 (file)
@@ -1397,8 +1397,8 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
                                             INTEL_INFO(dev_priv)->platform),
                           INTEL_GEN(dev_priv));
 
-               intel_device_info_dump_flags(INTEL_INFO(dev_priv), &p);
-               intel_device_info_dump_runtime(RUNTIME_INFO(dev_priv), &p);
+               intel_device_info_print_static(INTEL_INFO(dev_priv), &p);
+               intel_device_info_print_runtime(RUNTIME_INFO(dev_priv), &p);
        }
 
        if (IS_ENABLED(CONFIG_DRM_I915_DEBUG))
index 2b30a45fa25c483c352ebab5438edb550d768911..8374d50c0770124c9f5937559d1dfb946788b083 100644 (file)
@@ -599,9 +599,10 @@ static void err_print_capabilities(struct drm_i915_error_state_buf *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_device_info_dump_topology(&runtime->sseu, &p);
 }
 
 static void err_print_params(struct drm_i915_error_state_buf *m,
index a5b571364cf60a42e103e57b281b3e1371af30c2..2cde0bac27d33ecffda289d036bab95a0796de44 100644 (file)
@@ -73,9 +73,30 @@ const char *intel_platform_name(enum intel_platform platform)
        return platform_names[platform];
 }
 
-void intel_device_info_dump_flags(const struct intel_device_info *info,
-                                 struct drm_printer *p)
+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)
+{
+       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));
        DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG);
 #undef PRINT_FLAG
@@ -106,8 +127,8 @@ 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));
 }
 
-void intel_device_info_dump_runtime(const struct intel_runtime_info *info,
-                                   struct drm_printer *p)
+void intel_device_info_print_runtime(const struct intel_runtime_info *info,
+                                    struct drm_printer *p)
 {
        sseu_dump(&info->sseu, p);
 
@@ -148,8 +169,8 @@ 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,
-                                    struct drm_printer *p)
+void intel_device_info_print_topology(const struct sseu_dev_info *sseu,
+                                     struct drm_printer *p)
 {
        int s, ss;
 
index 4bdf8a6cfb47518a5ee82411cafb13c020a0b1fa..2725cb7fc169b474a0312db646b024cb56a5e740 100644 (file)
@@ -230,12 +230,13 @@ 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_runtime_init(struct drm_i915_private *dev_priv);
-void intel_device_info_dump_flags(const struct intel_device_info *info,
-                                 struct drm_printer *p);
-void intel_device_info_dump_runtime(const struct intel_runtime_info *info,
+
+void intel_device_info_print_static(const struct intel_device_info *info,
                                    struct drm_printer *p);
-void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,
+void intel_device_info_print_runtime(const struct intel_runtime_info *info,
                                     struct drm_printer *p);
+void intel_device_info_print_topology(const struct sseu_dev_info *sseu,
+                                     struct drm_printer *p);
 
 void intel_device_info_init_mmio(struct drm_i915_private *dev_priv);