[Intel-gfx] [PATCH 11/13] drm/i915/display: use struct drm_device based logging

Daniel Vetter daniel at ffwll.ch
Wed Mar 25 08:57:31 UTC 2020


On Fri, Mar 20, 2020 at 04:36:36PM +0200, Jani Nikula wrote:
> Convert all the DRM_* logging macros to the struct drm_device based
> macros to provide device specific logging.
> 
> No functional changes.
> 
> Generated using the following semantic patch, originally written by
> Wambui Karuga <wambui.karugax at gmail.com>, with manual fixups on top:
> 
> @@
> identifier fn, T;
> @@
> 
> fn(...,struct drm_i915_private *T,...) {
> <+...
> (
> -DRM_INFO(
> +drm_info(&T->drm,
> ...)
> |
> -DRM_NOTE(
> +drm_notice(&T->drm,
> ...)
> |
> -DRM_ERROR(
> +drm_err(&T->drm,
> ...)
> |
> -DRM_WARN(
> +drm_warn(&T->drm,
> ...)
> |
> -DRM_DEBUG_DRIVER(
> +drm_dbg(&T->drm,
> ...)
> |
> -DRM_DEBUG_KMS(
> +drm_dbg_kms(&T->drm,
> ...)
> |
> -DRM_DEBUG_ATOMIC(
> +drm_dbg_atomic(&T->drm,
> ...)
> )
> ...+>
> }
> 
> @@
> identifier fn, T;
> @@
> 
> fn(...) {
> ...
> struct drm_i915_private *T = ...;
> <+...
> (
> -DRM_INFO(
> +drm_info(&T->drm,
> ...)
> |
> -DRM_NOTE(
> +drm_notice(&T->drm,
> ...)
> |
> -DRM_ERROR(
> +drm_err(&T->drm,
> ...)
> |
> -DRM_WARN(
> +drm_warn(&T->drm,
> ...)
> |
> -DRM_DEBUG_DRIVER(
> +drm_dbg(&T->drm,
> ...)
> |
> -DRM_DEBUG_KMS(
> +drm_dbg_kms(&T->drm,
> ...)
> |
> -DRM_DEBUG_ATOMIC(
> +drm_dbg_atomic(&T->drm,
> ...)
> )
> ...+>
> }
> 
> Cc: Wambui Karuga <wambui.karugax at gmail.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 25 +++++++++++---------
>  1 file changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 6af8d43ceb0c..fe55c7c713f1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2908,6 +2908,7 @@ intel_fb_plane_get_subsampling(int *hsub, int *vsub,
>  static int
>  intel_fb_check_ccs_xy(struct drm_framebuffer *fb, int ccs_plane, int x, int y)
>  {
> +	struct drm_i915_private *i915 = to_i915(fb->dev);
>  	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
>  	int main_plane;
>  	int hsub, vsub;
> @@ -2936,7 +2937,8 @@ intel_fb_check_ccs_xy(struct drm_framebuffer *fb, int ccs_plane, int x, int y)
>  	 * x/y offsets must match between CCS and the main surface.
>  	 */
>  	if (main_x != ccs_x || main_y != ccs_y) {
> -		DRM_DEBUG_KMS("Bad CCS x/y (main %d,%d ccs %d,%d) full (main %d,%d ccs %d,%d)\n",
> +		drm_dbg_kms(&i915->drm,
> +			      "Bad CCS x/y (main %d,%d ccs %d,%d) full (main %d,%d ccs %d,%d)\n",
>  			      main_x, main_y,
>  			      ccs_x, ccs_y,
>  			      intel_fb->normal[main_plane].x,
> @@ -12882,16 +12884,17 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,
>  	return 0;
>  }
>  
> -static void intel_dump_crtc_timings(const struct drm_display_mode *mode)
> +static void intel_dump_crtc_timings(struct drm_i915_private *i915,
> +				    const struct drm_display_mode *mode)
>  {
> -	DRM_DEBUG_KMS("crtc timings: %d %d %d %d %d %d %d %d %d, "
> -		      "type: 0x%x flags: 0x%x\n",
> -		      mode->crtc_clock,
> -		      mode->crtc_hdisplay, mode->crtc_hsync_start,
> -		      mode->crtc_hsync_end, mode->crtc_htotal,
> -		      mode->crtc_vdisplay, mode->crtc_vsync_start,
> -		      mode->crtc_vsync_end, mode->crtc_vtotal,
> -		      mode->type, mode->flags);
> +	drm_dbg_kms(&i915->drm, "crtc timings: %d %d %d %d %d %d %d %d %d, "
> +		    "type: 0x%x flags: 0x%x\n",
> +		    mode->crtc_clock,
> +		    mode->crtc_hdisplay, mode->crtc_hsync_start,
> +		    mode->crtc_hsync_end, mode->crtc_htotal,
> +		    mode->crtc_vdisplay, mode->crtc_vsync_start,
> +		    mode->crtc_vsync_end, mode->crtc_vtotal,
> +		    mode->type, mode->flags);
>  }
>  
>  static inline void
> @@ -13075,7 +13078,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,
>  	drm_mode_debug_printmodeline(&pipe_config->hw.mode);
>  	drm_dbg_kms(&dev_priv->drm, "adjusted mode:\n");
>  	drm_mode_debug_printmodeline(&pipe_config->hw.adjusted_mode);
> -	intel_dump_crtc_timings(&pipe_config->hw.adjusted_mode);
> +	intel_dump_crtc_timings(dev_priv, &pipe_config->hw.adjusted_mode);
>  	drm_dbg_kms(&dev_priv->drm,
>  		    "port clock: %d, pipe src size: %dx%d, pixel rate %d\n",
>  		    pipe_config->port_clock,
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list