]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/dsi: use struct drm_device based logging
authorJani Nikula <jani.nikula@intel.com>
Fri, 20 Mar 2020 14:36:32 +0000 (16:36 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 25 Mar 2020 17:47:10 +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,
...)
)
...+>
}

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/436b6dde60dcba235085c8bb216c841267519fa6.1584714939.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/icl_dsi.c
drivers/gpu/drm/i915/display/intel_dsi_vbt.c
drivers/gpu/drm/i915/display/vlv_dsi.c

index d452037b1ac91715af383853acdeba800f8a5e1a..5a83df2fd72306048c2c50a0d5a6671b1de37775 100644 (file)
@@ -186,16 +186,19 @@ static int dsi_send_pkt_hdr(struct intel_dsi_host *host,
 static int dsi_send_pkt_payld(struct intel_dsi_host *host,
                              struct mipi_dsi_packet pkt)
 {
+       struct intel_dsi *intel_dsi = host->intel_dsi;
+       struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
+
        /* payload queue can accept *256 bytes*, check limit */
        if (pkt.payload_length > MAX_PLOAD_CREDIT * 4) {
-               DRM_ERROR("payload size exceeds max queue limit\n");
+               drm_err(&i915->drm, "payload size exceeds max queue limit\n");
                return -1;
        }
 
        /* load data into command payload queue */
        if (!add_payld_to_queue(host, pkt.payload,
                                pkt.payload_length)) {
-               DRM_ERROR("adding payload to queue failed\n");
+               drm_err(&i915->drm, "adding payload to queue failed\n");
                return -1;
        }
 
@@ -1513,6 +1516,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,
                                    struct intel_crtc_state *pipe_config,
                                    struct drm_connector_state *conn_state)
 {
+       struct drm_i915_private *i915 = to_i915(encoder->base.dev);
        struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
                                                   base);
        struct intel_connector *intel_connector = intel_dsi->attached_connector;
@@ -1542,7 +1546,7 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,
        pipe_config->clock_set = true;
 
        if (gen11_dsi_dsc_compute_config(encoder, pipe_config))
-               DRM_DEBUG_KMS("Attempting to use DSC failed\n");
+               drm_dbg_kms(&i915->drm, "Attempting to use DSC failed\n");
 
        pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5;
 
index 574dcfec9577e81389ec28c4b9942a41f40f6b90..3c9c05478a03d10bf7bd33395c5e1277b436a285 100644 (file)
@@ -453,8 +453,7 @@ static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
 
 static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 {
-       struct drm_device *drm_dev = intel_dsi->base.base.dev;
-       struct device *dev = &drm_dev->pdev->dev;
+       struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
        struct i2c_adapter *adapter;
        struct i2c_msg msg;
        int ret;
@@ -471,7 +470,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 
        adapter = i2c_get_adapter(intel_dsi->i2c_bus_num);
        if (!adapter) {
-               DRM_DEV_ERROR(dev, "Cannot find a valid i2c bus for xfer\n");
+               drm_err(&i915->drm, "Cannot find a valid i2c bus for xfer\n");
                goto err_bus;
        }
 
@@ -489,9 +488,9 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
 
        ret = i2c_transfer(adapter, &msg, 1);
        if (ret < 0)
-               DRM_DEV_ERROR(dev,
-                             "Failed to xfer payload of size (%u) to reg (%u)\n",
-                             payload_size, reg_offset);
+               drm_err(&i915->drm,
+                       "Failed to xfer payload of size (%u) to reg (%u)\n",
+                       payload_size, reg_offset);
 
        kfree(payload_data);
 err_alloc:
index f4c362dc6e15f809a7553a9746a450d971bf6a7a..456909ee37a7bbfe1d2e8af8c7ff7e24feb15d1a 100644 (file)
@@ -875,10 +875,11 @@ static void intel_dsi_disable(struct intel_encoder *encoder,
                              const struct intel_crtc_state *old_crtc_state,
                              const struct drm_connector_state *old_conn_state)
 {
+       struct drm_i915_private *i915 = to_i915(encoder->base.dev);
        struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
        enum port port;
 
-       DRM_DEBUG_KMS("\n");
+       drm_dbg_kms(&i915->drm, "\n");
 
        intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_OFF);
        intel_panel_disable_backlight(old_conn_state);