]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display: use struct drm_device based logging
authorJani Nikula <jani.nikula@intel.com>
Fri, 20 Mar 2020 14:36:36 +0000 (16:36 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 25 Mar 2020 17:47:41 +0000 (19:47 +0200)
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@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@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ffdbda0a0fe18354867b3f8c7a83f59f0963711d.1584714939.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display.c

index a67e6a91052c4d91ce710afc2c0a7eb2a4873d9f..7d20c060b56c3207cbf44f80074990d8d5af6999 100644 (file)
@@ -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,