Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5009149ybl; Tue, 14 Jan 2020 01:53:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzEbqiHbZ4ScYmmUOC/urICSYz4Eu2aizyAqEIC713y9caI7AH93iJNZuuOWdYsoFY3UwTY X-Received: by 2002:a05:6830:1f95:: with SMTP id v21mr16866369otr.325.1578995615781; Tue, 14 Jan 2020 01:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578995615; cv=none; d=google.com; s=arc-20160816; b=xgsTiXm8uZ8DbJ65KWGuPDD42g0oSW078ngIJ7/8TES2CZEn5xqpgDcHgfwh1rVcW4 S9ZPq4pMbaN7FBADFzEACHGMHZQrtauPsUgWwyYPPBd3nypjcsPtoylhiH2Oxhup8jri jyUTqhGmBbBhl+YVyLL5ZCKG3nxrhHc+UCF3oaQjMzkBKaLv+kqxn2IDSdc85uirKrSC CPyRwfYnyXDkdOE2vaywWudrWS88OidHNufXwaxfhr5P+q1kQDVX6k0gtXeCtYFkc8BM zXa/VoZIOslQK1L59u7QpvTjf6nnu8j0uP1RYh0XUep8usdql6RHBt2eJ4Ecw8kNjKUo FmuA== 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=q6RanNdUoczCExPmVTmgRD9iBfpF1gCk763s4qX8JSY=; b=cpyXcQFrSjsQUOOYdiq2C9v3QkCwVehFR1uPlAGiFW+T0NFL468PxA0/Q2az+I6nKk /+tstuDSX0jAuDBh0l9TrEbpgIot4NEJzF5rKzaT640dsGiiG7o7lpHeukIO9jK+6PjU IzmDwhovVptmcaf/gX3mZnLXHASJqrr+jnAIB/e7TEe4n1AtSyD3qfl9kFIwQSoBuS9V +S38y3a3CWa6Nr35lbbfeA8I2Z0FywISoegBwVgpaA0ngy1BGtAUk2sdYMIG4iU7RWgE /a+zId3T8mJ9mPH9EccpF3nmxDkZdSy2B0wYn4DFyq7xrA+P33SuB3AEyZ3uRotJbAqf wP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PDK4+Znj; 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 d22si8785648oti.316.2020.01.14.01.53.24; Tue, 14 Jan 2020 01:53:35 -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=PDK4+Znj; 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 S1729268AbgANJwL (ORCPT + 99 others); Tue, 14 Jan 2020 04:52:11 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53883 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbgANJwL (ORCPT ); Tue, 14 Jan 2020 04:52:11 -0500 Received: by mail-wm1-f66.google.com with SMTP id m24so12964522wmc.3 for ; Tue, 14 Jan 2020 01:52:09 -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=q6RanNdUoczCExPmVTmgRD9iBfpF1gCk763s4qX8JSY=; b=PDK4+Znj3pDpGScOLb1jD7Y+GaEdkIlqrSBrgCHVt11xjztSfFj/Gnf69dHZrZIObD TDil1nTHkIP5Qf1oxy+FJJJtQUA6VsAYfDXHs0Ce9gfxFZNWdZ95Htsx/pBOmHbnXcw4 +D86kt+FYYGmwpih7Udj34mguk2k943d5fpgI4kHK3cDDK6/HlIJ8X4H/6ss7OtvCHwF GPWi/wwzT1Gy0UoHRYEddbcCgvMysVUSR7xykVTaks8ERO+1hpv75X27pDJ+vX1zmSeL zHFFwNXA4Hjy2sE3B/23xbBKCiyiXLC4fcY4Z5MpCtLNh8epREuyHLFpGjftzEbGR0l9 qvBA== 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=q6RanNdUoczCExPmVTmgRD9iBfpF1gCk763s4qX8JSY=; b=ATQyasQDo2uIG2FNzFuUFv6A4FsMgqYkwIKWfkIdeDgKcnSGYFjHG813n/dHl5loei fKL90QLQISBnwFxx6dy+xZyp6Vc6UxjwTZvaldZjXft3jNRMnb3M/A3RSdQIBmI2uav9 m+mZbviHJqppV+QMa6SQ1Ra58/QkAtvLWpbwL9fkVzq1hLnPML3L2qfovuumRXZe4aKK 0ZHTIQMc5iGPaomcC5xtk5PC4cLV04sMNnxp/8D5kUID1RMvhCGqmon1jd0ncJ+6SJhS LHTpqs8ShRQEO85dPwDVuTv+fa9w0nEQsyhzgahFm7PXOBWEX86LDHfyGEWU8TSb/KfF e1pQ== X-Gm-Message-State: APjAAAU76D7p/JBRd74zBis+1CqhnMZs55M0wcXTzNx0rrRL12QPM2zO q/FM2ntmal4VliH/6e0IwZU= X-Received: by 2002:a1c:a9c6:: with SMTP id s189mr26335879wme.151.1578995528477; Tue, 14 Jan 2020 01:52:08 -0800 (PST) Received: from localhost.localdomain ([154.70.37.104]) by smtp.googlemail.com with ESMTPSA id y20sm17454881wmi.25.2020.01.14.01.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 01:52:08 -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 4/5] drm/i915/bw: convert to new drm_device based logging macros. Date: Tue, 14 Jan 2020 12:51:06 +0300 Message-Id: <20200114095107.21197-5-wambui.karugax@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114095107.21197-1-wambui.karugax@gmail.com> References: <20200114095107.21197-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 This replaces the printk based logging macros with the struct drm_based macros in i915/display/intel_bw.c This transformation was achieved by using the following coccinelle script that matches based on the existence of a struct drm_i915_private device in the functions: @rule1@ 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, ...) ) ...+> } @rule2@ 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, ...) ) ...+> } Resulting checkpatch warnings were addressed manually. Signed-off-by: Wambui Karuga --- drivers/gpu/drm/i915/display/intel_bw.c | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index b228671d5a5d..9c40ad52dd73 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -132,9 +132,10 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv, if (ret) return ret; - DRM_DEBUG_KMS("QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n", - i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras, - sp->t_rcd, sp->t_rc); + drm_dbg_kms(&dev_priv->drm, + "QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n", + i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras, + sp->t_rcd, sp->t_rc); } return 0; @@ -187,7 +188,8 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel ret = icl_get_qgv_points(dev_priv, &qi); if (ret) { - DRM_DEBUG_KMS("Failed to get memory subsystem information, ignoring bandwidth limits"); + drm_dbg_kms(&dev_priv->drm, + "Failed to get memory subsystem information, ignoring bandwidth limits"); return ret; } num_channels = qi.num_channels; @@ -228,8 +230,9 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel bi->deratedbw[j] = min(maxdebw, bw * 9 / 10); /* 90% */ - DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n", - i, j, bi->num_planes, bi->deratedbw[j]); + drm_dbg_kms(&dev_priv->drm, + "BW%d / QGV %d: num_planes=%d deratedbw=%u\n", + i, j, bi->num_planes, bi->deratedbw[j]); } if (bi->num_planes == 1) @@ -424,10 +427,11 @@ int intel_bw_atomic_check(struct intel_atomic_state *state) bw_state->data_rate[crtc->pipe] = new_data_rate; bw_state->num_active_planes[crtc->pipe] = new_active_planes; - DRM_DEBUG_KMS("pipe %c data rate %u num active planes %u\n", - pipe_name(crtc->pipe), - bw_state->data_rate[crtc->pipe], - bw_state->num_active_planes[crtc->pipe]); + drm_dbg_kms(&dev_priv->drm, + "pipe %c data rate %u num active planes %u\n", + pipe_name(crtc->pipe), + bw_state->data_rate[crtc->pipe], + bw_state->num_active_planes[crtc->pipe]); } if (!bw_state) @@ -441,8 +445,9 @@ int intel_bw_atomic_check(struct intel_atomic_state *state) data_rate = DIV_ROUND_UP(data_rate, 1000); if (data_rate > max_data_rate) { - DRM_DEBUG_KMS("Bandwidth %u MB/s exceeds max available %d MB/s (%d active planes)\n", - data_rate, max_data_rate, num_active_planes); + drm_dbg_kms(&dev_priv->drm, + "Bandwidth %u MB/s exceeds max available %d MB/s (%d active planes)\n", + data_rate, max_data_rate, num_active_planes); return -EINVAL; } -- 2.24.1