[PATCH 2/2] drm/i915/overlay: convert intel_overlay_print_error_state() to drm_printer

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


On Thu, Jun 06, 2024 at 05:07:05PM +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>
> ---
>  drivers/gpu/drm/i915/display/intel_overlay.c | 11 +++++------
>  drivers/gpu/drm/i915/display/intel_overlay.h |  6 +++---
>  drivers/gpu/drm/i915/i915_gpu_error.c        |  2 +-
>  3 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
> index 1c2099ed5514..b97087f8e311 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.c
> @@ -1485,15 +1485,14 @@ intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
>  }
>  
>  void
> -intel_overlay_print_error_state(struct drm_i915_error_state_buf *m,
> +intel_overlay_print_error_state(struct drm_printer *p,
>  				struct intel_overlay_error_state *error)
>  {
> -	i915_error_printf(m, "Overlay, status: 0x%08x, interrupt: 0x%08x\n",
> -			  error->dovsta, error->isr);
> -	i915_error_printf(m, "  Register file at 0x%08lx:\n",
> -			  error->base);
> +	drm_printf(p, "Overlay, status: 0x%08x, interrupt: 0x%08x\n",
> +		   error->dovsta, error->isr);
> +	drm_printf(p, "  Register file at 0x%08lx:\n", error->base);
>  
> -#define P(x) i915_error_printf(m, "    " #x ":	0x%08x\n", error->regs.x)
> +#define P(x) drm_printf(p, "    " #x ": 0x%08x\n", error->regs.x)
>  	P(OBUF_0Y);
>  	P(OBUF_1Y);
>  	P(OBUF_0U);

I always prefer the direct code, then macros like this, but orthogonal to
this patch:

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

> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.h b/drivers/gpu/drm/i915/display/intel_overlay.h
> index c3f68fce6f08..f28a09c062d0 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.h
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.h
> @@ -8,8 +8,8 @@
>  
>  struct drm_device;
>  struct drm_file;
> -struct drm_i915_error_state_buf;
>  struct drm_i915_private;
> +struct drm_printer;
>  struct intel_overlay;
>  struct intel_overlay_error_state;
>  
> @@ -24,7 +24,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
>  void intel_overlay_reset(struct drm_i915_private *dev_priv);
>  struct intel_overlay_error_state *
>  intel_overlay_capture_error_state(struct drm_i915_private *dev_priv);
> -void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e,
> +void intel_overlay_print_error_state(struct drm_printer *p,
>  				     struct intel_overlay_error_state *error);
>  #else
>  static inline void intel_overlay_setup(struct drm_i915_private *dev_priv)
> @@ -55,7 +55,7 @@ intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
>  {
>  	return NULL;
>  }
> -static inline void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e,
> +static inline void intel_overlay_print_error_state(struct drm_printer *p,
>  						   struct intel_overlay_error_state *error)
>  {
>  }
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 3fee7ad0ec51..96c6cafd5b9e 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -905,7 +905,7 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
>  	}
>  
>  	if (error->overlay)
> -		intel_overlay_print_error_state(m, error->overlay);
> +		intel_overlay_print_error_state(&p, error->overlay);
>  
>  	err_print_capabilities(m, error);
>  	err_print_params(m, &error->params);
> -- 
> 2.39.2
> 


More information about the Intel-gfx mailing list