[PATCH 1/2] drm/i915/dmc: convert intel_dmc_print_error_state() to drm_printer

Rodrigo Vivi rodrigo.vivi at intel.com
Thu Jun 6 14:25:41 UTC 2024


On Thu, Jun 06, 2024 at 05:07:04PM +0300, Jani Nikula wrote:
> Use the regular drm printer, so we can drop the i915_error_printf()
> usage.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dmc.c | 15 +++++++--------
>  drivers/gpu/drm/i915/display/intel_dmc.h |  6 +++---
>  drivers/gpu/drm/i915/i915_gpu_error.c    |  3 ++-
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
> index 852c11aa3205..73977b173898 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
> @@ -26,7 +26,6 @@
>  #include <linux/firmware.h>
>  
>  #include "i915_drv.h"
> -#include "i915_gpu_error.h"
>  #include "i915_reg.h"
>  #include "intel_de.h"
>  #include "intel_dmc.h"
> @@ -1185,7 +1184,7 @@ void intel_dmc_fini(struct drm_i915_private *i915)
>  	}
>  }
>  
> -void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m,
> +void intel_dmc_print_error_state(struct drm_printer *p,
>  				 struct drm_i915_private *i915)
>  {
>  	struct intel_dmc *dmc = i915_to_dmc(i915);
> @@ -1193,13 +1192,13 @@ void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m,
>  	if (!HAS_DMC(i915))
>  		return;
>  
> -	i915_error_printf(m, "DMC initialized: %s\n", str_yes_no(dmc));
> -	i915_error_printf(m, "DMC loaded: %s\n",
> -			  str_yes_no(intel_dmc_has_payload(i915)));
> +	drm_printf(p, "DMC initialized: %s\n", str_yes_no(dmc));
> +	drm_printf(p, "DMC loaded: %s\n",
> +		   str_yes_no(intel_dmc_has_payload(i915)));
>  	if (dmc)
> -		i915_error_printf(m, "DMC fw version: %d.%d\n",
> -				  DMC_VERSION_MAJOR(dmc->version),
> -				  DMC_VERSION_MINOR(dmc->version));
> +		drm_printf(p, "DMC fw version: %d.%d\n",
> +			   DMC_VERSION_MAJOR(dmc->version),
> +			   DMC_VERSION_MINOR(dmc->version));
>  }
>  
>  static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.h b/drivers/gpu/drm/i915/display/intel_dmc.h
> index fd607afff2ef..54cff6002e31 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc.h
> +++ b/drivers/gpu/drm/i915/display/intel_dmc.h
> @@ -8,9 +8,9 @@
>  
>  #include <linux/types.h>
>  
> -struct drm_i915_error_state_buf;
> -struct drm_i915_private;
>  enum pipe;
> +struct drm_i915_private;
> +struct drm_printer;
>  
>  void intel_dmc_init(struct drm_i915_private *i915);
>  void intel_dmc_load_program(struct drm_i915_private *i915);
> @@ -22,7 +22,7 @@ void intel_dmc_suspend(struct drm_i915_private *i915);
>  void intel_dmc_resume(struct drm_i915_private *i915);
>  bool intel_dmc_has_payload(struct drm_i915_private *i915);
>  void intel_dmc_debugfs_register(struct drm_i915_private *i915);
> -void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m,
> +void intel_dmc_print_error_state(struct drm_printer *p,
>  				 struct drm_i915_private *i915);
>  
>  void assert_dmc_loaded(struct drm_i915_private *i915);
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 625b3c024540..3fee7ad0ec51 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -836,6 +836,7 @@ static void err_print_gt_engines(struct drm_i915_error_state_buf *m,
>  static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
>  			       struct i915_gpu_coredump *error)
>  {
> +	struct drm_printer p = i915_error_printer(m);
>  	const struct intel_engine_coredump *ee;
>  	struct timespec64 ts;
>  
> @@ -873,7 +874,7 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
>  
>  	err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
>  
> -	intel_dmc_print_error_state(m, m->i915);
> +	intel_dmc_print_error_state(&p, m->i915);
>  
>  	err_printf(m, "RPM wakelock: %s\n", str_yes_no(error->wakelock));
>  	err_printf(m, "PM suspended: %s\n", str_yes_no(error->suspended));
> -- 
> 2.39.2
> 


More information about the Intel-gfx mailing list