Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1494926ybl; Thu, 30 Jan 2020 00:33:55 -0800 (PST) X-Google-Smtp-Source: APXvYqy6h1Ea6eaW/zO/AzAcVrnzwbXWLsySWoFZO5iGmAXnB3z56gB+7G0lA2jzMWrwLfSfDqsy X-Received: by 2002:a9d:784b:: with SMTP id c11mr2629552otm.246.1580373234951; Thu, 30 Jan 2020 00:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580373234; cv=none; d=google.com; s=arc-20160816; b=UKX8hckNAsxSEISiNnCAN1RKAxBgQAK9ohfx5V6E9O1sxbAmrQfSlnzwj8iW4bDyH+ aFBIOmzntvidn9+P5BOMdx2phxsRYNDfxlCCunZC2HpGD+eybvCWNlZB7ybnm6D7ipU/ yeeOyB1682F9eCAOTL5VNKxO8d7Eny9PPXinYNdFVCclc99fnhxkw35GNRiB/MpFlbLL woBkoTMJHgb/I8n6sWn/mXmMw50ULGK2VGaGYP0AeMhFhVkZKusFXNFYp8390f+ena7S R/iN2L1Talu/8tVxt5UXPSLIf9MRUL1ZCbTb9coOFRWMR3JfqZhdh9TukUiB4a189U1J 1STA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=32jvXD3cPexjv7JnSZTYWkfatpOgTafU8/6QQULQx+A=; b=NKmuZI81Xt/HwIzs30lVCCq3RG3oCFr/WWu1yQux4p++Ah6c+9smjg5FDQAs2alYL6 WRpawj29/+3iZhV7Yx3856tr66zwTQWB47BmwUROdT4t5UlbwkqPweK2SmLgYGS9WYxo z5QjWehPjzbXlZoHKSz0nbOg7e3LnumWKI9aZn+ZyexNbL09Ks2ilK1AdmsTtRt1BIzE Y/UP98gPWaWYcY0AC4yLWivzdNVHgkerUlY86uRuS/ThNGrYdpZbn3e96YHu+JozeXKi Cb4HHjuNNXKYU9MQ57aaQj2L+gqUOSHJsYsb6LtQrvfK+d+CiQE1cEA8NHOP574vw1Aq Mlig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XBTKrOZ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w29si3089808oth.313.2020.01.30.00.33.43; Thu, 30 Jan 2020 00:33:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XBTKrOZ3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbgA3Icn (ORCPT + 99 others); Thu, 30 Jan 2020 03:32:43 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38398 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbgA3Icn (ORCPT ); Thu, 30 Jan 2020 03:32:43 -0500 Received: by mail-wm1-f65.google.com with SMTP id a9so3138815wmj.3 for ; Thu, 30 Jan 2020 00:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=32jvXD3cPexjv7JnSZTYWkfatpOgTafU8/6QQULQx+A=; b=XBTKrOZ3+lsyQ0B9uHU5EQoZWWT0yGbb63eZQVB44AjWECJleM0IeLRkv6333At0Pc FILjFOewaZ3lK3MGhVUItG1nwO/MxMj3AWa62bCJbZqziF6tfQpVfcK2fiw1pqJW5E4j Bsmp4jjcLqaY51OaCdfFz2DVozQ+cNO9FWhtjaK0cqWjYzOA3z35c7e0FO9dVK/Uv/ii dKQYjCBQ36MwJ9b3VQvtAwJkKXhxLfS0q+ChuYwcfOPCqi3ZIVPAiBfNyvrZUKDbFT7U nd1mb+sLT/1nMf+lDgQavLqFu0qGW5oWPwo72//BFUDV/t2h1JHdHhfoBT5YCK8vjPzJ lz8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=32jvXD3cPexjv7JnSZTYWkfatpOgTafU8/6QQULQx+A=; b=CSYQ94OknuCCi+iQjBx9v7NuiMbipKieJLU4ipRNzyZzBq1WXLM6F4uknS70Ac8jFm 8h8tu3tArLuEUyByZIGA/15ayLbe+GRl1pN/AmD6Oa796tK1M5Lh3YiM8LDCsoOgqKSh KD7onk4nl3TyDa6ZOe3S3t0TnwEPeI0D+tn9LleBh0/O9vxnCQoxgg9ct1tG68RWeDlW cr1bBHLPqKpO3wA0l6JuAbEDPx5jlWuoFngIwqwR0SbdowmcmoWGinfd6UiYDhPWIEL/ No3pPJGJUqaU7kEzvOFsrLf4VXYTtbK+Lqi1vR1b2ETTwX9OrSHQWqfn21hLyHNBcB2F aWGg== X-Gm-Message-State: APjAAAVXfeAhlMcyjEgR6+snGZzS8rgPOZ6vZkEaT/3X5bEG55eRyH4G ZJ9o1Oo8dH5SEDQ8AXgq5Zg= X-Received: by 2002:a05:600c:2944:: with SMTP id n4mr4103781wmd.22.1580373158828; Thu, 30 Jan 2020 00:32:38 -0800 (PST) Received: from wambui.zuku.co.ke ([197.237.61.225]) by smtp.googlemail.com with ESMTPSA id i11sm6363678wrs.10.2020.01.30.00.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 00:32:38 -0800 (PST) From: Wambui Karuga To: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch Cc: sean@poorly.run, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/12] drm/i915/vlv_dsi_pll: conversion to struct drm_device logging macros. Date: Thu, 30 Jan 2020 11:32:18 +0300 Message-Id: <20200130083229.12889-2-wambui.karugax@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130083229.12889-1-wambui.karugax@gmail.com> References: <20200130083229.12889-1-wambui.karugax@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the printk based logging macros to the new struct drm_device based logging macros in i915/display/vlv_dsi_pll.c using the following coccinelle script that matches based on the existence of a drm_i915_private device: @@ identifier fn, T; @@ fn(...) { ... struct drm_i915_private *T = ...; <+... ( -DRM_INFO( +drm_info(&T->drm, ...) | -DRM_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG( +drm_dbg(&T->drm, ...) | -DRM_DEBUG_KMS( +drm_dbg_kms(&T->drm, ...) | -DRM_DEBUG_DRIVER( +drm_dbg(&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_ERROR( +drm_err(&T->drm, ...) | -DRM_WARN( +drm_warn(&T->drm, ...) | -DRM_DEBUG( +drm_dbg(&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, ...) ) ...+> } Checkpatch warnings were fixed manually. Signed-off-by: Wambui Karuga --- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c index 8a68a86e2dc8..d0a514301575 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c @@ -64,7 +64,7 @@ static int dsi_calc_mnp(struct drm_i915_private *dev_priv, /* target_dsi_clk is expected in kHz */ if (target_dsi_clk < 300000 || target_dsi_clk > 1150000) { - DRM_ERROR("DSI CLK Out of Range\n"); + drm_err(&dev_priv->drm, "DSI CLK Out of Range\n"); return -ECHRNG; } @@ -126,7 +126,7 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder, ret = dsi_calc_mnp(dev_priv, config, dsi_clk); if (ret) { - DRM_DEBUG_KMS("dsi_calc_mnp failed\n"); + drm_dbg_kms(&dev_priv->drm, "dsi_calc_mnp failed\n"); return ret; } @@ -138,8 +138,8 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder, config->dsi_pll.ctrl |= DSI_PLL_VCO_EN; - DRM_DEBUG_KMS("dsi pll div %08x, ctrl %08x\n", - config->dsi_pll.div, config->dsi_pll.ctrl); + drm_dbg_kms(&dev_priv->drm, "dsi pll div %08x, ctrl %08x\n", + config->dsi_pll.div, config->dsi_pll.ctrl); return 0; } @@ -149,7 +149,7 @@ void vlv_dsi_pll_enable(struct intel_encoder *encoder, { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dev_priv->drm, "\n"); vlv_cck_get(dev_priv); @@ -169,12 +169,12 @@ void vlv_dsi_pll_enable(struct intel_encoder *encoder, DSI_PLL_LOCK, 20)) { vlv_cck_put(dev_priv); - DRM_ERROR("DSI PLL lock failed\n"); + drm_err(&dev_priv->drm, "DSI PLL lock failed\n"); return; } vlv_cck_put(dev_priv); - DRM_DEBUG_KMS("DSI PLL locked\n"); + drm_dbg_kms(&dev_priv->drm, "DSI PLL locked\n"); } void vlv_dsi_pll_disable(struct intel_encoder *encoder) @@ -182,7 +182,7 @@ void vlv_dsi_pll_disable(struct intel_encoder *encoder) struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); u32 tmp; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dev_priv->drm, "\n"); vlv_cck_get(dev_priv); @@ -218,12 +218,14 @@ bool bxt_dsi_pll_is_enabled(struct drm_i915_private *dev_priv) val = intel_de_read(dev_priv, BXT_DSI_PLL_CTL); if (IS_GEMINILAKE(dev_priv)) { if (!(val & BXT_DSIA_16X_MASK)) { - DRM_DEBUG_DRIVER("Invalid PLL divider (%08x)\n", val); + drm_dbg(&dev_priv->drm, + "Invalid PLL divider (%08x)\n", val); enabled = false; } } else { if (!(val & BXT_DSIA_16X_MASK) || !(val & BXT_DSIC_16X_MASK)) { - DRM_DEBUG_DRIVER("Invalid PLL divider (%08x)\n", val); + drm_dbg(&dev_priv->drm, + "Invalid PLL divider (%08x)\n", val); enabled = false; } } @@ -236,7 +238,7 @@ void bxt_dsi_pll_disable(struct intel_encoder *encoder) struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); u32 val; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dev_priv->drm, "\n"); val = intel_de_read(dev_priv, BXT_DSI_PLL_ENABLE); val &= ~BXT_DSI_PLL_DO_ENABLE; @@ -248,7 +250,8 @@ void bxt_dsi_pll_disable(struct intel_encoder *encoder) */ if (intel_de_wait_for_clear(dev_priv, BXT_DSI_PLL_ENABLE, BXT_DSI_PLL_LOCKED, 1)) - DRM_ERROR("Timeout waiting for PLL lock deassertion\n"); + drm_err(&dev_priv->drm, + "Timeout waiting for PLL lock deassertion\n"); } u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, @@ -263,7 +266,7 @@ u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, int refclk = IS_CHERRYVIEW(dev_priv) ? 100000 : 25000; int i; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dev_priv->drm, "\n"); vlv_cck_get(dev_priv); pll_ctl = vlv_cck_read(dev_priv, CCK_REG_DSI_PLL_CONTROL); @@ -292,7 +295,7 @@ u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, p--; if (!p) { - DRM_ERROR("wrong P1 divisor\n"); + drm_err(&dev_priv->drm, "wrong P1 divisor\n"); return 0; } @@ -302,7 +305,7 @@ u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, } if (i == ARRAY_SIZE(lfsr_converts)) { - DRM_ERROR("wrong m_seed programmed\n"); + drm_err(&dev_priv->drm, "wrong m_seed programmed\n"); return 0; } @@ -333,7 +336,7 @@ u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, pclk = DIV_ROUND_CLOSEST(dsi_clk * intel_dsi->lane_count, bpp); - DRM_DEBUG_DRIVER("Calculated pclk=%u\n", pclk); + drm_dbg(&dev_priv->drm, "Calculated pclk=%u\n", pclk); return pclk; } @@ -479,10 +482,11 @@ int bxt_dsi_pll_compute(struct intel_encoder *encoder, } if (dsi_ratio < dsi_ratio_min || dsi_ratio > dsi_ratio_max) { - DRM_ERROR("Cant get a suitable ratio from DSI PLL ratios\n"); + drm_err(&dev_priv->drm, + "Cant get a suitable ratio from DSI PLL ratios\n"); return -ECHRNG; } else - DRM_DEBUG_KMS("DSI PLL calculation is Done!!\n"); + drm_dbg_kms(&dev_priv->drm, "DSI PLL calculation is Done!!\n"); /* * Program DSI ratio and Select MIPIC and MIPIA PLL output as 8x @@ -508,7 +512,7 @@ void bxt_dsi_pll_enable(struct intel_encoder *encoder, enum port port; u32 val; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dev_priv->drm, "\n"); /* Configure PLL vales */ intel_de_write(dev_priv, BXT_DSI_PLL_CTL, config->dsi_pll.ctrl); @@ -530,11 +534,12 @@ void bxt_dsi_pll_enable(struct intel_encoder *encoder, /* Timeout and fail if PLL not locked */ if (intel_de_wait_for_set(dev_priv, BXT_DSI_PLL_ENABLE, BXT_DSI_PLL_LOCKED, 1)) { - DRM_ERROR("Timed out waiting for DSI PLL to lock\n"); + drm_err(&dev_priv->drm, + "Timed out waiting for DSI PLL to lock\n"); return; } - DRM_DEBUG_KMS("DSI PLL locked\n"); + drm_dbg_kms(&dev_priv->drm, "DSI PLL locked\n"); } void bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port) -- 2.25.0