drm/i915: Pull printing GT capabilities on error to err_print_gt
diff mbox series

Message ID 20200710193239.5419-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • drm/i915: Pull printing GT capabilities on error to err_print_gt
Related show

Commit Message

Chris Wilson July 10, 2020, 7:32 p.m. UTC
We try not to assume that we captured any information, and so have to
check that error->gt exists before reporting. This check was missed in
err_print_capabilities, so lets break up the capability info and push it
into the GT dump.

We are still a long way from yamlifying this output!

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 792592e72aba ("drm/i915: Move the engine mask to intel_gt_info")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Daniele Ceraolo Spurio July 10, 2020, 8:25 p.m. UTC | #1
On 7/10/2020 12:32 PM, Chris Wilson wrote:
> We try not to assume that we captured any information, and so have to
> check that error->gt exists before reporting. This check was missed in
> err_print_capabilities, so lets break up the capability info and push it
> into the GT dump.
>
> We are still a long way from yamlifying this output!
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 792592e72aba ("drm/i915: Move the engine mask to intel_gt_info")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Daniele

> ---
>   drivers/gpu/drm/i915/i915_gpu_error.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 678ddec3237f..6a3a2ce0b394 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -626,8 +626,6 @@ static void err_print_capabilities(struct drm_i915_error_state_buf *m,
>   
>   	intel_device_info_print_static(&error->device_info, &p);
>   	intel_device_info_print_runtime(&error->runtime_info, &p);
> -	intel_gt_info_print(&error->gt->info, &p);
> -	intel_sseu_print_topology(&error->gt->info.sseu, &p);
>   	intel_driver_caps_print(&error->driver_caps, &p);
>   }
>   
> @@ -678,6 +676,15 @@ static void err_free_sgl(struct scatterlist *sgl)
>   	}
>   }
>   
> +static void err_print_gt_info(struct drm_i915_error_state_buf *m,
> +			      struct intel_gt_coredump *gt)
> +{
> +	struct drm_printer p = i915_error_printer(m);
> +
> +	intel_gt_info_print(&gt->info, &p);
> +	intel_sseu_print_topology(&gt->info.sseu, &p);
> +}
> +
>   static void err_print_gt(struct drm_i915_error_state_buf *m,
>   			 struct intel_gt_coredump *gt)
>   {
> @@ -734,6 +741,8 @@ static void err_print_gt(struct drm_i915_error_state_buf *m,
>   
>   	if (gt->uc)
>   		err_print_uc(m, gt->uc);
> +
> +	err_print_gt_info(m, gt);
>   }
>   
>   static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 678ddec3237f..6a3a2ce0b394 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -626,8 +626,6 @@  static void err_print_capabilities(struct drm_i915_error_state_buf *m,
 
 	intel_device_info_print_static(&error->device_info, &p);
 	intel_device_info_print_runtime(&error->runtime_info, &p);
-	intel_gt_info_print(&error->gt->info, &p);
-	intel_sseu_print_topology(&error->gt->info.sseu, &p);
 	intel_driver_caps_print(&error->driver_caps, &p);
 }
 
@@ -678,6 +676,15 @@  static void err_free_sgl(struct scatterlist *sgl)
 	}
 }
 
+static void err_print_gt_info(struct drm_i915_error_state_buf *m,
+			      struct intel_gt_coredump *gt)
+{
+	struct drm_printer p = i915_error_printer(m);
+
+	intel_gt_info_print(&gt->info, &p);
+	intel_sseu_print_topology(&gt->info.sseu, &p);
+}
+
 static void err_print_gt(struct drm_i915_error_state_buf *m,
 			 struct intel_gt_coredump *gt)
 {
@@ -734,6 +741,8 @@  static void err_print_gt(struct drm_i915_error_state_buf *m,
 
 	if (gt->uc)
 		err_print_uc(m, gt->uc);
+
+	err_print_gt_info(m, gt);
 }
 
 static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,