From patchwork Wed Jul 21 17:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87CCAC636C9 for ; Wed, 21 Jul 2021 17:55:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C1AF61248 for ; Wed, 21 Jul 2021 17:55:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C1AF61248 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C02BE6E8E3; Wed, 21 Jul 2021 17:55:39 +0000 (UTC) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85C1F6E8E3 for ; Wed, 21 Jul 2021 17:55:38 +0000 (UTC) Received: by mail-qk1-x733.google.com with SMTP id q190so2897591qkd.2 for ; Wed, 21 Jul 2021 10:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DQx4vJF4nbTnubt+y8ro7ehWlOgw15WaIAgLNO4/XuU=; b=XuZXBkQQry7q5e1MlK1YEWdcRwdoh3d/1GvYWZbcbsQs6tPyKXr4hNgoZXtkGPbM3U zXvHm8bl8b+KlsEEL+b0R/NYYGVmmAs0OxjAwNwOpuiRZPRoU1EeMq20lSoATy8xbXy+ Iz3ZWmjGLZsLbYkqrWyn6HqMsfWL9Bgppv16SO4kpxllj5OvZI3AV+Kx9DaCOM1iPlX9 I9LNMH8fjrtFBTOmsNDl+EK9MGYhMXRBXDcwFFtn1EGhRW8clqtvEL7+6jB/pPFUQktt vnKO0IXpmPkWrH1oi1Uqwv1l7mASh9INKqeURN8XWc3nP7693ML8sWMNAntOLIXhZWVc tmXg== 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=DQx4vJF4nbTnubt+y8ro7ehWlOgw15WaIAgLNO4/XuU=; b=sdmzx8T/hd7GNvGQ1KRIbiQjynGFJHym065sZeI84IksfwfQowOS94EiHY0LCJHiGc BQvnagxLY6P/8vhfPZx9jJq8BRPOPzawOK8BcWM2xxpZ4r1LnPPKviq5/rOGa+blR0y1 vGnCbJYgJT2cwVbR9pb+PDHAfX8xxKGNzYfdbv0zJMuXyzKui4sgTKI2H6WdS/erBXJ1 QVvt9kRYyvolvc85r4JuhYIydpk+LaddXLMfX9KDuUnKe87agXRk5BeZG4AWZYMRap6c Uj91uQC12OuwY7+mb1VRdRxTLARXbjznHJ28kPO45giyh1kLCGwZuWsY9odhgEmRvPaJ lb0w== X-Gm-Message-State: AOAM530kzEs1eDUzyPv2L3HoTtSJrRi+8iWG/Ha42wVzn9q15ip5gWFf J8gQh1WcZeJUHkl4xjITqK95oUTla4Y59A== X-Google-Smtp-Source: ABdhPJzc+Z5xa05OLI8fVMC34IItRiMQ8fyFNJLoHQtSy2KF7wwKN9kpTUbeufcQbt5OgFPTacBHOg== X-Received: by 2002:a37:62d1:: with SMTP id w200mr36074421qkb.11.1626890137604; Wed, 21 Jul 2021 10:55:37 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id z9sm3636608qtn.54.2021.07.21.10.55.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:37 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 01/14] drm/mipi_dbi: Convert pr_debug calls to DRM_DEBUG_DRIVER Date: Wed, 21 Jul 2021 13:55:08 -0400 Message-Id: <20210721175526.22020-2-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Use the drm logging helpers to output these messages to ensure they'll be included by the drm tracefs instance. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-2-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/drm_mipi_dbi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 10b4e59384ae..2f661d7ff774 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -763,9 +763,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *dbi, int dc, int i, ret; u8 *dst; - if (drm_debug_enabled(DRM_UT_DRIVER)) - pr_debug("[drm:%s] dc=%d, max_chunk=%zu, transfers:\n", - __func__, dc, max_chunk); + DRM_DEBUG_DRIVER("dc=%d, max_chunk=%zu, transfers:\n", dc, max_chunk); tr.speed_hz = mipi_dbi_spi_cmd_max_speed(spi, len); spi_message_init_with_transfers(&m, &tr, 1); @@ -887,9 +885,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc, max_chunk = dbi->tx_buf9_len; dst16 = dbi->tx_buf9; - if (drm_debug_enabled(DRM_UT_DRIVER)) - pr_debug("[drm:%s] dc=%d, max_chunk=%zu, transfers:\n", - __func__, dc, max_chunk); + DRM_DEBUG_DRIVER("dc=%d, max_chunk=%zu, transfers:\n", dc, max_chunk); max_chunk = min(max_chunk / 2, len); From patchwork Wed Jul 21 17:55:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F0CFC636C9 for ; Wed, 21 Jul 2021 17:55:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FAAC61029 for ; Wed, 21 Jul 2021 17:55:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FAAC61029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E23A6E97E; Wed, 21 Jul 2021 17:55:44 +0000 (UTC) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1AFA86E97E for ; Wed, 21 Jul 2021 17:55:43 +0000 (UTC) Received: by mail-qv1-xf32.google.com with SMTP id gh6so1354081qvb.3 for ; Wed, 21 Jul 2021 10:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OMkgS3KJ9eUsffAjes/ogVCJh1BrcgeqLuYwbEpCi+w=; b=cVxC30l0K9uLAY34QE0ZUqIfCN6pKQaPf0mlzZNbHcDTJSlt38P2I59BinUO0l+4aZ gSkIv2PuWgZBg9mWmc9J09MH5awTcq7DUai5aivXJE7dO4xnkY61H7MazMEOToL5q6L3 qy4w0FbkwMq6bdb55Jvnq46w9CMHYWJVp2JL+oe4D5GGFMtfH28AvCi41JzwlqUOoZ6f RjziOLBHgRhklOQzJUw1Nuxr5xWNWCLKYWYaDFFLE81zUddJcXFCBcGsruc+qUBmqq0Z 4xiqsojOhlPosRozXv+KEG2ajAeo+nfKToFQGYPpluhi5ny3sDASoyp9fFvmTDPH7jb/ v5BQ== 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=OMkgS3KJ9eUsffAjes/ogVCJh1BrcgeqLuYwbEpCi+w=; b=J6t/zANErwQrJ5K4+3nAzQXJiWiYuICY0VWmXneukEqTPPaZeJoRwDlykFoDDOdP1c 8IeFCoh4NIElGNGkUmZ6CGAgs8aYuZic+2Gl3jWED1SptN2SDs562V6fmNXmEdGz4Z55 upSOd2IDgY0q/XyOshALHqNK+pe1ZXXwWi8y2nudEVq89UPfYw3VgttfgHA2zd4iPl12 DB5NUTTCOAp9C/Cwc1H3tG30MZzyozW1ALffb7DeAMt58Q113+391a+K9J3zbTJS+SJ+ lUsFhe2Vzz5MNkizK6QUXsO/Mf34HjnbjTNm2oo+75mfnelGrdvZWGQKMQikF7TE/N6Z 7jMw== X-Gm-Message-State: AOAM53317wwT2cy4NLmAgmLxPklO0vhVoMZO0s0TPCzg3+LdlM80Td+7 zzyV05LjlDL50ECoukZLHSUy6e66U3Wbbw== X-Google-Smtp-Source: ABdhPJx7URjeVW/I0Hc1Emv4LjeJEdwI6/O3hFdE1arpvwQasXRd3iX/i6qtV2p3SHkWuzQ0JnVSxQ== X-Received: by 2002:a05:6214:dad:: with SMTP id h13mr30570184qvh.26.1626890142102; Wed, 21 Jul 2021 10:55:42 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id r187sm11332988qkb.129.2021.07.21.10.55.41 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:41 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 02/14] drm/sil164: Convert dev_printk to drm_dev_dbg Date: Wed, 21 Jul 2021 13:55:09 -0400 Message-Id: <20210721175526.22020-3-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Use the drm debug helper instead of dev_printk in order to leverage the upcoming tracefs support Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-3-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/i2c/sil164_drv.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i2c/sil164_drv.c b/drivers/gpu/drm/i2c/sil164_drv.c index 741886b54419..b315a789fca2 100644 --- a/drivers/gpu/drm/i2c/sil164_drv.c +++ b/drivers/gpu/drm/i2c/sil164_drv.c @@ -43,11 +43,6 @@ struct sil164_priv { #define to_sil164_priv(x) \ ((struct sil164_priv *)to_encoder_slave(x)->slave_priv) -#define sil164_dbg(client, format, ...) do { \ - if (drm_debug_enabled(DRM_UT_KMS)) \ - dev_printk(KERN_DEBUG, &client->dev, \ - "%s: " format, __func__, ## __VA_ARGS__); \ - } while (0) #define sil164_info(client, format, ...) \ dev_info(&client->dev, format, __VA_ARGS__) #define sil164_err(client, format, ...) \ @@ -359,8 +354,8 @@ sil164_probe(struct i2c_client *client, const struct i2c_device_id *id) int rev = sil164_read(client, SIL164_REVISION); if (vendor != 0x1 || device != 0x6) { - sil164_dbg(client, "Unknown device %x:%x.%x\n", - vendor, device, rev); + drm_dev_dbg(&client->dev, DRM_UT_KMS, + "Unknown device %x:%x.%x\n", vendor, device, rev); return -ENODEV; } @@ -389,7 +384,8 @@ sil164_detect_slave(struct i2c_client *client) }; if (i2c_transfer(adap, &msg, 1) != 1) { - sil164_dbg(adap, "No dual-link slave found."); + drm_dev_dbg(&adap->dev, DRM_UT_KMS, + "No dual-link slave found."); return NULL; } From patchwork Wed Jul 21 17:55:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88A40C12002 for ; Wed, 21 Jul 2021 17:55:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D11D6113C for ; Wed, 21 Jul 2021 17:55:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D11D6113C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DC2D6E98A; Wed, 21 Jul 2021 17:55:48 +0000 (UTC) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1533C6EA20 for ; Wed, 21 Jul 2021 17:55:47 +0000 (UTC) Received: by mail-qv1-xf29.google.com with SMTP id h9so1375203qvs.0 for ; Wed, 21 Jul 2021 10:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EoDFhw4Yf6mVRdX8jKrsmhhWKMjigC0f9LN3iXc51/c=; b=cg7kAhAaynCph+VXjbRGMYkIG2dR1MaRPWuhPEKB64q493qSEp8cdveMLRq1Q0sCxI KpokDyQKkSkzRYK8QbYGv3uBHQ08Ws8KwgmZHxOh0sFmQ5uXo+weKN29q3Fg8ksuTkEW PedUNhtL31a55MK4Bv/34fMWYnmGfTXK1i1j5eKM+Hcat4N9U+ZmbvFX+UQY9H5RJg2z Ts2fsRgQmC5590a4NId2xdFAfSolJQK1zU38uazXRq0ZmGjrkPl/DKscXUY1YdXyxm9z inqGU4bJbLcQfy9RLGaFYuFoQVBwCxZBGLxp+tg3Za0yHS0GKOHUAeK7sl4gz8x7HYFL JhpA== 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=EoDFhw4Yf6mVRdX8jKrsmhhWKMjigC0f9LN3iXc51/c=; b=hYGx3rzAglUsdClY7w//JoAFFmA6nCtZ0ktqh/wNE8qQch6ABZAuG+IQJV+hU9j1rY K6zZEJjGBHPOY+tx+uRdFd+Vu6wdPr0jl7/MBKXlnay0mFfuGX5hO90WkbjYqXN9m9xh 74q/x/7NLj+VsBnfsRErLldYnSoL5DwrTLu2fPmBIDZTp50IiMqIKhRxv1SreO8XP7Bd CUoB88oJdIuwKottHq/4ppz9SdRHlhly3xMJarnS82yHIRSodl1StBKcurC6XIdCLAdr o76yfzdoD+Zj4iJ+/JwRSvjmKMbts3zwiTMjBSf9SCll8eUN9P289zYITK3/cT76DhRk FSOQ== X-Gm-Message-State: AOAM532jYRR1Zf7fTv5Q86M4Ldso3kXKT9D9Ou+wSDSjVT1w/60eiwI4 qFTzzkgE0PE6GcFykkzgYDklaFYbvv/Jrw== X-Google-Smtp-Source: ABdhPJyj8FrqECd0pXbY6TjpkVUf88cbq/zCgT6gW/7hA77lt/WAWvkFBE37PqNFPML9rJEZ4npT4Q== X-Received: by 2002:ad4:4bae:: with SMTP id i14mr37288441qvw.24.1626890146181; Wed, 21 Jul 2021 10:55:46 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id w26sm8803374qki.6.2021.07.21.10.55.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:45 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 03/14] drm/i915/utils: Replace dev_printk with drm helpers Date: Wed, 21 Jul 2021 13:55:10 -0400 Message-Id: <20210721175526.22020-4-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Sean Paul , Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Use drm logging helpers to add support for the upcoming tracefs implementation. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-4-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/i915/i915_utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c index f9e780dee9de..d858c92c6997 100644 --- a/drivers/gpu/drm/i915/i915_utils.c +++ b/drivers/gpu/drm/i915/i915_utils.c @@ -30,10 +30,9 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level, vaf.va = &args; if (is_error) - dev_printk(level, kdev, "%pV", &vaf); + drm_dev_printk(kdev, level, "%pV", &vaf); else - dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); + drm_err(&dev_priv->drm, "%pV", &vaf); va_end(args); From patchwork Wed Jul 21 17:55:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CF2AC12002 for ; Wed, 21 Jul 2021 17:55:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00FA261029 for ; Wed, 21 Jul 2021 17:55:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00FA261029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33DC86EB67; Wed, 21 Jul 2021 17:55:52 +0000 (UTC) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBCFE6EB3C for ; Wed, 21 Jul 2021 17:55:50 +0000 (UTC) Received: by mail-qv1-xf29.google.com with SMTP id ay16so1333010qvb.12 for ; Wed, 21 Jul 2021 10:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0pycXB2ultmLkKc35aeNj2U+LPhWXxWP52T2qDeRhjs=; b=VQnE8G+T99lqj+jpc8gjTrDIq60JvIspB210ozZeqOOMmMWKPswtglKyQ/zpgkH8xf nSzdznQC/pcNlTb+rokrH057TouO69ecT3IdtH4UMAttClC7sNr660xpBHvAE0AIXAjR xGj3wmsOPr3Iy23GWqOeN2yjeLnpugyXQDEs/TM10uBJUuXbqQQRB2MOQhR9gc2S0yZ6 ieMFY38yfiEuI3efFX25D9oEN0kxhojGFGP6MQ7iLMoK2Lp5uxhiFV5GbBvf36oO3sbx e/WRldFNXL8dyuTodbz8ocXxzsjHcGIGW1ADfUiDnv5p6eTBMHtAkv5d8YSKh8Hk86H8 v+YA== 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=0pycXB2ultmLkKc35aeNj2U+LPhWXxWP52T2qDeRhjs=; b=Ym/wpnfVI8ypGdzo8GUPfILA5phH0TVjrKCJlwyCDiX6WYEUa7oozxrmx8D27ebply 1N4Q3b8U4D/jMtNMHbMv+AJnhgxI77dXdH6pN9liPhQTirFk3OExI4/ojPPz6QldBpd7 Ym6kuKEtZLbnDBq7Mi0n6v5Ma3JkpVT/b+0Qr/ib/QIqUBhxj7pUG9m8lTydIjJFZmL+ b8pDz6Ptmb4Ene8v4JsjybW8MELYBD1xKYHU8PyeFmjHb4wC+sD24uNQVW43vI8ddM08 I11dglNVjuOlHfFkYZNLfuW6ZM1Jd8OiInjdgaiidQe0DyJcjXykcdGuH0C9YgECWTdD xqpg== X-Gm-Message-State: AOAM533+faMmJ5Zl6x85TjM0tljaUTFfpmu4q6dPIPFKotObiXEknfCy rKqBMbI1OaxRGucvOR5VdH/DEGcj0cipkQ== X-Google-Smtp-Source: ABdhPJz/2XnWjDEIVkqQXiPb5u4xelAKiOrD8F4Pkyijtn6fTUroFWIgLbFDelftl6codkhebYsC4Q== X-Received: by 2002:ad4:538c:: with SMTP id i12mr37924550qvv.51.1626890149955; Wed, 21 Jul 2021 10:55:49 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id j8sm9492446qti.20.2021.07.21.10.55.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:49 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros Date: Wed, 21 Jul 2021 13:55:11 -0400 Message-Id: <20210721175526.22020-5-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, Sean Paul , linux-arm-msm@vger.kernel.org, Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul The debug messages shouldn't be logged as errors when debug categories are enabled. Use the drm logging helpers to do the right thing Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-5-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h index 323a6bce9e64..c33164d3944a 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h @@ -31,27 +31,15 @@ * DPU_DEBUG - macro for kms/plane/crtc/encoder/connector logs * @fmt: Pointer to format string */ -#define DPU_DEBUG(fmt, ...) \ - do { \ - if (drm_debug_enabled(DRM_UT_KMS)) \ - DRM_DEBUG(fmt, ##__VA_ARGS__); \ - else \ - pr_debug(fmt, ##__VA_ARGS__); \ - } while (0) +#define DPU_DEBUG(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__) /** * DPU_DEBUG_DRIVER - macro for hardware driver logging * @fmt: Pointer to format string */ -#define DPU_DEBUG_DRIVER(fmt, ...) \ - do { \ - if (drm_debug_enabled(DRM_UT_DRIVER)) \ - DRM_ERROR(fmt, ##__VA_ARGS__); \ - else \ - pr_debug(fmt, ##__VA_ARGS__); \ - } while (0) - -#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__) +#define DPU_DEBUG_DRIVER(fmt, ...) DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__) + +#define DPU_ERROR(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__) /** * ktime_compare_safe - compare two ktime structures From patchwork Wed Jul 21 17:55:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93A27C12002 for ; Wed, 21 Jul 2021 17:55:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5777561029 for ; Wed, 21 Jul 2021 17:55:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5777561029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA73B6EB3C; Wed, 21 Jul 2021 17:55:57 +0000 (UTC) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51BC86EB3C for ; Wed, 21 Jul 2021 17:55:55 +0000 (UTC) Received: by mail-qv1-xf33.google.com with SMTP id o9so1350205qvu.5 for ; Wed, 21 Jul 2021 10:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=10zX+wWQODXoUYiEX6WIkatRpliDTXvVrzyJ0vNDwmo=; b=HuN+irXh+kCBSteEi9Z4q5/qRkmGvQCG0mQVsvrvukbke/C0SCxY13/EbQaMbzAwsV DwQ3ZxvQEV6AXvYq+XNQxA93pCfFYIUREn8uOD/L8z/6RhTx9PnAbimtqdeGJZFQeBmT i/0gs90W82EtU0MzV91Us2HXlqkOlPeItYnKg3eItgUXzib39pPDCfwTWOF8oTJaLX5Y KjzEUBLg0o9JIuklPWlbI9rCVPUPW/OssvDmmhbT1/1ThFyZuyBb4L6nuN1PcHsVQPcH TNtnt1IvAOkjt1hoNi1T0h9SEE4/pmywdZ49zYB2eKsH5+710GyAZyU3l5hZyyJIBLgD s34g== 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=10zX+wWQODXoUYiEX6WIkatRpliDTXvVrzyJ0vNDwmo=; b=fc1+HN5XG5VjIMbHXkUpOKERpqsadZwYgxBW7Kv+vcAAdn30g4209hmIXhg3DZvcld pBdGYVQi69M2Tmrav34snh0oeBdPGrr0SFJ1qHrvOV2tJ0i6MRx2ES6KZJCSqIPuilgg 8fpxiCKZD0IJQg8ARfJJCL2ykc0EYrgqWRtSZufBqlX7JYSr1dZsTMULLAnCP+M0r1EL WwkueTdBkvbJYy3DxXZmWwbWJ/f234HH/qKwLDfzuCFniHy0jYFpp35ifq0x9zngParp e+Z610SA68HNwRgGz+fODIEhuVwDX8Xtp3PzoaB2dFDLPZpRAMFmFvdSWTsIg0N6wPVG QNyw== X-Gm-Message-State: AOAM532nT0JBsnNI7pYmiwhg1NGTDfy9cVCHgx9YxeK1dNl7KRui5lVZ oj9F5jFZytmbeeUruIZaPmfoM3lQTtSNZQ== X-Google-Smtp-Source: ABdhPJyVBV+VlLf5zeMR21cLXHKlKy4zszLEFKqHYPZE5iWw3BfFjefH71tv0xlXNvAQq7dqQCFf2A== X-Received: by 2002:ad4:52ea:: with SMTP id p10mr37286736qvu.45.1626890154449; Wed, 21 Jul 2021 10:55:54 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id a11sm5017625qkl.125.2021.07.21.10.55.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:54 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric Date: Wed, 21 Jul 2021 13:55:12 -0400 Message-Id: <20210721175526.22020-6-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul In preparation for tracefs support, rename drm_debug related functions to reflect that it targets the syslog. This will allow us to selectively target syslog and/or tracefs. No functional changes here. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-6-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None Reviewed-by: Abhinav Kumar Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/drm_print.c | 12 ++++++------ include/drm/drm_print.h | 13 +++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 111b932cf2a9..2ff7a6ecc632 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -37,11 +37,11 @@ #include /* - * __drm_debug: Enable debug output. + * __drm_debug_syslog: Enable debug output to system logs * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details. */ -unsigned int __drm_debug; -EXPORT_SYMBOL(__drm_debug); +unsigned int __drm_debug_syslog; +EXPORT_SYMBOL(__drm_debug_syslog); MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" "\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" @@ -52,7 +52,7 @@ MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug cat "\t\tBit 5 (0x20) will enable VBL messages (vblank code)\n" "\t\tBit 7 (0x80) will enable LEASE messages (leasing code)\n" "\t\tBit 8 (0x100) will enable DP messages (displayport code)"); -module_param_named(debug, __drm_debug, int, 0600); +module_param_named(debug, __drm_debug_syslog, int, 0600); void __drm_puts_coredump(struct drm_printer *p, const char *str) { @@ -160,11 +160,11 @@ void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf) } EXPORT_SYMBOL(__drm_printfn_info); -void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf) +void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf) { pr_debug("%s %pV", p->prefix, vaf); } -EXPORT_SYMBOL(__drm_printfn_debug); +EXPORT_SYMBOL(__drm_printfn_debug_syslog); void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf) { diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9b66be54dd16..2ea0ffd9c1ce 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -35,7 +35,7 @@ #include /* Do *not* use outside of drm_print.[ch]! */ -extern unsigned int __drm_debug; +extern unsigned int __drm_debug_syslog; /** * DOC: print @@ -85,7 +85,7 @@ void __drm_puts_coredump(struct drm_printer *p, const char *str); void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf); void __drm_puts_seq_file(struct drm_printer *p, const char *str); void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf); -void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf); +void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf); void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf); __printf(2, 3) @@ -227,7 +227,7 @@ static inline struct drm_printer drm_info_printer(struct device *dev) static inline struct drm_printer drm_debug_printer(const char *prefix) { struct drm_printer p = { - .printfn = __drm_printfn_debug, + .printfn = __drm_printfn_debug_syslog, .prefix = prefix }; return p; @@ -319,9 +319,14 @@ enum drm_debug_category { DRM_UT_DRMRES = 0x200, }; +static inline bool drm_debug_syslog_enabled(enum drm_debug_category category) +{ + return unlikely(__drm_debug_syslog & category); +} + static inline bool drm_debug_enabled(enum drm_debug_category category) { - return unlikely(__drm_debug & category); + return drm_debug_syslog_enabled(category); } /* From patchwork Wed Jul 21 17:55:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C72BC636C9 for ; Wed, 21 Jul 2021 17:56:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15ED160E0C for ; Wed, 21 Jul 2021 17:56:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15ED160E0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 944CD6EB70; Wed, 21 Jul 2021 17:56:00 +0000 (UTC) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by gabe.freedesktop.org (Postfix) with ESMTPS id 598E56EB74 for ; Wed, 21 Jul 2021 17:55:59 +0000 (UTC) Received: by mail-qt1-x831.google.com with SMTP id j7so2458648qtj.6 for ; Wed, 21 Jul 2021 10:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j8lKVNX9q4Fo4fg0uvmmZGsmdf0+oqb3sZHxk/xw0uk=; b=Ff+jBl+uPoZFMSuLK+1AOCIUmwgotdH+8p83S+ozpaHMGmKL7LZQtjhyeAK13iIDoW P1JS+ndquq/AdsAQIopdOTmPgCqgfbL80sdb2H3GxZ2I70ZaxBvctBJ2VVAkNUBNxIbe aRNwNODXMoT42e8N7KnhxgqXJWXNmzFybwwGskRbQHEk0AuHmqB8D4iJgwaIFTout55w ZoPk21LzceQab73g8zs3D0+JgxCMLOJEENn+ImVz9XZdigfpJyqqN7x8usozlvU/2PMs OtCk/mB5k7RqcZBnszhBtACmYehtWTTUeKuhqE5Ac+D1JGXMc/Bffnaf7LZ2KVVA8kJw 2t4A== 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=j8lKVNX9q4Fo4fg0uvmmZGsmdf0+oqb3sZHxk/xw0uk=; b=CmA5oejIUtBINZxCojTTR7ZR1iFhOrxTAtMD/zDth2F/FaSXY4CA575tOdckA8v0IK ZjO44Ol9WDfDG+FcEb6wBDyfaMUHfdzQSxTAHIuxxZisVJ/73aO7r4ISi3sl8qlp2Oww Q7Pt8Tk/7n+lbiqGw6mmaurSWZdTd+xMy2J+4ADPA0CWUAM2TxP+kJwAmpvqbrO2FVjS 592wzvcZu6Fi0A6/CQafaMmQoCpv/PYUAY5RaeysqjNTDxYvIBFEElQWCU+BwoYmZmCS Eixn38KGzUcp9WgR8+s71c4HnoS96csbmEfPHACYfLIPBk7TIh9PWmQKuFSw8P5j/1hS zKMQ== X-Gm-Message-State: AOAM533zwn7r3z0zAjjFbvJaVGjoLGqCT3UciJNN8rcsxJ3X6kHLmlmE q/qDB448MoU7RFa5QBdVbs6tuUw/defPqg== X-Google-Smtp-Source: ABdhPJzWWeUCNVLICcb1swh5GDA1HtVcMPEi7ynJIbXYHmkRp/9V9gt066XUcWRC6Gj1eXwZMIST/g== X-Received: by 2002:ac8:5a12:: with SMTP id n18mr20684605qta.3.1626890158383; Wed, 21 Jul 2021 10:55:58 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id d16sm9183548qtj.69.2021.07.21.10.55.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:55:58 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 06/14] drm/amd: Gate i2c transaction logs on drm_debug_syslog Date: Wed, 21 Jul 2021 13:55:13 -0400 Message-Id: <20210721175526.22020-7-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Pan, Xinhui" , amd-gfx@lists.freedesktop.org, Sean Paul , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Since the logs protected by these checks specifically target syslog, use the new drm_debug_syslog_enabled() call to avoid triggering these prints when only trace is enabled. Acked-by: Christian König Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-7-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c index 5c7d769aee3f..d9ceab332060 100644 --- a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c @@ -233,7 +233,7 @@ static uint32_t smu_v11_0_i2c_transmit(struct i2c_adapter *control, DRM_DEBUG_DRIVER("I2C_Transmit(), address = %x, bytes = %d , data: ", (uint16_t)address, numbytes); - if (drm_debug_enabled(DRM_UT_DRIVER)) { + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) { print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, 16, 1, data, numbytes, false); } @@ -389,7 +389,7 @@ static uint32_t smu_v11_0_i2c_receive(struct i2c_adapter *control, DRM_DEBUG_DRIVER("I2C_Receive(), address = %x, bytes = %d, data :", (uint16_t)address, bytes_received); - if (drm_debug_enabled(DRM_UT_DRIVER)) { + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) { print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, 16, 1, data, bytes_received, false); } From patchwork Wed Jul 21 17:55:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B592FC636C9 for ; Wed, 21 Jul 2021 17:56:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8454E60E0C for ; Wed, 21 Jul 2021 17:56:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8454E60E0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03C886EB9B; Wed, 21 Jul 2021 17:56:05 +0000 (UTC) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D7F56EB9B for ; Wed, 21 Jul 2021 17:56:03 +0000 (UTC) Received: by mail-qk1-x736.google.com with SMTP id c68so2858188qkf.9 for ; Wed, 21 Jul 2021 10:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eJajPBJwhf0xkvC8Oc1cscrVWsD0SBsh6BLFW6m+BMo=; b=Y+nsyUWFzVgiQIYW7sTA3tIlsuW/nl99urrJ3NdUug231lxe3jrgAvDWvFQE7tCbI5 21YruvE83bUgTlRbdEE+z4BWfW1HF2y3MGRFAvJgyD98XbJ0/y/MGXJKX2AsVX8CM53J A9wTDCCvnUCLoXfiWS6x4lrlBxBTs5/Qz4R6QtZAJt6B1+JX0GHfeXKUPRxc6QDKnV1W 9+lWbYPKbPQNMsT8t3kcyKTyQdCHarHowm/W56WlnfNGV7M7c2gO/jLkMNb90PWoveNz irYV2/aA7L4/fKVj+7DU27pqyzPpmKgrjGJqe8EnGxv1mfZ97BAXld31uvSejB38UxWD eHaw== 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=eJajPBJwhf0xkvC8Oc1cscrVWsD0SBsh6BLFW6m+BMo=; b=LqlQXYzcZ2gXkQnl36yHAENXp0O2UUveQAOPc3b/GRC1Z4j8NQlaI+KzfgOY5fe9yv NjCZM8t46q4F30SPt+WaHAT/dTDumErBtarACRwLAXiq8fo9QZELKuD/iwrKibnGwwKS 2bQZNQEaALfKDcT1p1jbBp4LzlGY+6LDsLP3zMAQKM8nv8GmSwjZjJ3MxEseVippsEvQ cWnlf2sH9NNW2d70+axnj6ucvyOGcDFW48BGf+8xq/FqBYmZVsp1IHK38ViEn64oMSbC Wh2aJSuVhxFhLgS9JzJ+PsL9Z742p16O2tj9Co4TVxuxesi+8WP3lkmodToBA6ytWNoY IqvA== X-Gm-Message-State: AOAM530LoMio5u2pAY22sq+aDfoUQtsOFgqODyS9kL9NaueVczLC8+yf ZobcHjAQ46WuN0qIvryPGVMW5IacwxSCNA== X-Google-Smtp-Source: ABdhPJzWRa/fAH7WwN/95bHK8iq5i7MUlrXC1A1uaG0usBMGrf7krfV6gtM2+zieR1s8y8XzyOrCPw== X-Received: by 2002:a37:a647:: with SMTP id p68mr35490185qke.133.1626890162671; Wed, 21 Jul 2021 10:56:02 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id q206sm11670559qka.19.2021.07.21.10.56.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:02 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 07/14] drm/etnaviv: Change buffer dump checks to target syslog Date: Wed, 21 Jul 2021 13:55:14 -0400 Message-Id: <20210721175526.22020-8-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: etnaviv@lists.freedesktop.org, Sean Paul , Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Since the logs protected by these checks specifically target syslog, use the new drm_debug_syslog_enabled() call to avoid triggering these prints when only trace is enabled. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-8-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None Acked-by: Lucas Stach --- drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c index 76d38561c910..7713474800e8 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c @@ -353,7 +353,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, lockdep_assert_held(&gpu->lock); - if (drm_debug_enabled(DRM_UT_DRIVER)) + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) etnaviv_buffer_dump(gpu, buffer, 0, 0x50); link_target = etnaviv_cmdbuf_get_va(cmdbuf, @@ -509,13 +509,13 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, etnaviv_cmdbuf_get_va(buffer, &gpu->mmu_context->cmdbuf_mapping) + buffer->user_size - 4); - if (drm_debug_enabled(DRM_UT_DRIVER)) + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) pr_info("stream link to 0x%08x @ 0x%08x %p\n", return_target, etnaviv_cmdbuf_get_va(cmdbuf, &gpu->mmu_context->cmdbuf_mapping), cmdbuf->vaddr); - if (drm_debug_enabled(DRM_UT_DRIVER)) { + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) { print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4, cmdbuf->vaddr, cmdbuf->size, 0); @@ -534,6 +534,6 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, VIV_FE_LINK_HEADER_PREFETCH(link_dwords), link_target); - if (drm_debug_enabled(DRM_UT_DRIVER)) + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) etnaviv_buffer_dump(gpu, buffer, 0, 0x50); } From patchwork Wed Jul 21 17:55:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13025C12002 for ; Wed, 21 Jul 2021 17:56:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDA9A60E0C for ; Wed, 21 Jul 2021 17:56:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDA9A60E0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F42136EBED; Wed, 21 Jul 2021 17:56:08 +0000 (UTC) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by gabe.freedesktop.org (Postfix) with ESMTPS id AACDD6EBED for ; Wed, 21 Jul 2021 17:56:07 +0000 (UTC) Received: by mail-qt1-x82d.google.com with SMTP id k9so2476316qtx.3 for ; Wed, 21 Jul 2021 10:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GUwvh6F0pQ4ZVFR78iCJytl/tOQMbNgvBCeSAoGO32w=; b=SA4Zrn25cfpJIaL1oes57Z7JCR3eBnrUW+LbmmYg2NoYKgy89T9xfgbzU26RKLeq85 /56pmzOU/P8oZ7k66zL0/6gKhIeI0QYTfOOoLVgK/9JGhAdVi3VvLnNCgKxbNbnNqXcC FRPqIWTf1PlLHiTcakkqVqYqmdHe+kwYxVFAgBdESqvkiu0A9GWBR7u3l53u43iGwGbo NQFEW8EOKuza0N5jXmKEjzmLyr42gzcq8dDjIEn+1U58Ea93QgSI6eYldtPtgMY5zdId FK46NymLFaDajXeqq/p+XcQGzj++BXlSCDOr1KV38bOinIyLVLtYl6r5rtna+1PRMcGH QNgA== 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=GUwvh6F0pQ4ZVFR78iCJytl/tOQMbNgvBCeSAoGO32w=; b=C9PDzBtbcxhvoT58tRt+cQ5LoPyCjAMZEvY0AWJ5YQ0FxnFRwpDLVMsGHLPArG1ghH ZQ4GJDDNwbIL7LUCx6/ZMXrn8+1Hy4ReveVr1qQnwraVp8Ok5uJgBo5RHOiQK79augu/ WiYyUPzUcFd0aqQ2BaA1fiHBeCYZkTEuvtQuIt/NbTaC3GKX/BoP4gai4VY9Oin1CRb5 hliYcZ+AweOxX2hRAN3wuw+L+uWJQ9A70bnXC9MPzBKQDH3/+MW2f3Yxxjv1Q5FYJ4DK 4h5khhYVLbs0t/dLYC7jzDTBhZ2V1Ex0US49vx/dmQkpdF1qHsDpbn19G5Wlh2HcAUc9 G3xg== X-Gm-Message-State: AOAM531YReaJc/NfwMjayNJz4jk+0C5Ehm0hLqac3m6UO4UZOTycfA88 Ss8hO5yHjQDnFbtSKqI8WQmTviemcpk5xQ== X-Google-Smtp-Source: ABdhPJxqL3Z3uzLnVy2E2LxuR435PtjjUG1Jd5JQfh+eyTJXtq/EnC0WqJtxzZimSwr0+IVbfvjjjQ== X-Received: by 2002:ac8:531a:: with SMTP id t26mr32998247qtn.207.1626890166796; Wed, 21 Jul 2021 10:56:06 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id ay31sm1780760qkb.41.2021.07.21.10.56.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:06 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 08/14] drm/nouveau: Change debug checks to specifically target syslog Date: Wed, 21 Jul 2021 13:55:15 -0400 Message-Id: <20210721175526.22020-9-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Sean Paul , Ben Skeggs Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Since the logs protected by these checks specifically target syslog, use the new drm_debug_syslog_enabled() call to avoid triggering these prints when only trace is enabled. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-9-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -Rebased on drm-tip, changes in dispnv50/disp.h were rebased out --- drivers/gpu/drm/nouveau/nouveau_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index ba65f136cf48..2caa5720f451 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -260,11 +260,11 @@ void nouveau_drm_device_remove(struct drm_device *dev); #define NV_INFO(drm,f,a...) NV_PRINTK(info, &(drm)->client, f, ##a) #define NV_DEBUG(drm,f,a...) do { \ - if (drm_debug_enabled(DRM_UT_DRIVER)) \ + if (drm_debug_syslog_enabled(DRM_UT_DRIVER)) \ NV_PRINTK(info, &(drm)->client, f, ##a); \ } while(0) #define NV_ATOMIC(drm,f,a...) do { \ - if (drm_debug_enabled(DRM_UT_ATOMIC)) \ + if (drm_debug_syslog_enabled(DRM_UT_ATOMIC)) \ NV_PRINTK(info, &(drm)->client, f, ##a); \ } while(0) From patchwork Wed Jul 21 17:55:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24134C12002 for ; Wed, 21 Jul 2021 17:56:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0D3C60E0C for ; Wed, 21 Jul 2021 17:56:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0D3C60E0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5068E6EB49; Wed, 21 Jul 2021 17:56:13 +0000 (UTC) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0477B6EBF6 for ; Wed, 21 Jul 2021 17:56:12 +0000 (UTC) Received: by mail-qv1-xf32.google.com with SMTP id h9so1375832qvs.0 for ; Wed, 21 Jul 2021 10:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1ekvo2Bf/cuTyOgoRFGtX8Wm+o3ua6k9s028dsrV8KU=; b=enLwojzsrI/f2htz8/oqYpgAN9oo2G77O0maZJIppOEyH2dTHZULTda1ZLc8V16+iC utlcxxiygZoYh+I07jRvPvCCcmii9ieYppepVhiCZoWHMfrMjYgBCmuBl46l7h9Kl+lS PN6wz0tVA19s7vvG1vHdSFQWy2me2C6fxhwvCX0HjItS5xNbzSwXWGIqnaWibO/y9iDt r8eRkRcgrutnZDanGbvjeUKxzY8+CHLBB9iAatXKazpM0Du6ZLvF2F4Uw7clN0fTCxSz 1rM1pfaS5LUY8SPt5wuVHJgKgmwhJ/i97bYobLiYXx7QbSKrbElqhHm7d/K6vBnIaAaf 99lQ== 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=1ekvo2Bf/cuTyOgoRFGtX8Wm+o3ua6k9s028dsrV8KU=; b=le6dX0axyivVo45q03gYd8HiXjm8foopc4BJeiUOoxwtcfAIHU2IfqYdhrv1seIQtM 9/O4ksBzIiTeQeYYomavTgLa1ZRIAFR1tC4PYXKNtAaAKeBEdrAx/SrelCWZ+vW+KBjB J8Vb5S3DigrbukI9zletyqJIEtgF6kiLmiH8Ezq5n4yP0p5MgcV52QIIs7sI72WNzRW0 0aIKJxMyl7VnEF+1Tvv5LirLNvh52/5cc3zlnDJIV3nqaxLJhJzsvKQo5Ft6kfQVbuK2 Y4zbzfURnJaLA8Oz5jW1u9Y5NaUsAV2mNaoQZHlRdPOhUUsScDpF0OKK+bxfwWyXLANO Tvdw== X-Gm-Message-State: AOAM533DQOQRFd4tMcJ5uRIAixG1fpUHehnMs5OCJXqke7YED/Oi0/Rc yd/YM3fgrs/Qw9Ndk6AskHVgKwy04K6mlg== X-Google-Smtp-Source: ABdhPJwHIl4br1M4W8MzQPTqun+ojKgdRBCA5nraDmk/zsLVnij0gEHlzf1w9uIn3y/04T5Wt5Tf5A== X-Received: by 2002:a05:6214:c63:: with SMTP id t3mr36823429qvj.17.1626890171186; Wed, 21 Jul 2021 10:56:11 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id n20sm11921820qkk.102.2021.07.21.10.56.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:10 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 09/14] drm/i915: Change infoframe debug checks to specify syslog Date: Wed, 21 Jul 2021 13:55:16 -0400 Message-Id: <20210721175526.22020-10-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Sean Paul , Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Since the logs protected by these checks specifically target syslog, use the new drm_debug_syslog_enabled() call to avoid triggering these prints when only trace is enabled. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-10-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/i915/display/intel_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 65ddb6ca16e6..048d7335196b 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7494,7 +7494,7 @@ static void intel_dump_infoframe(struct drm_i915_private *dev_priv, const union hdmi_infoframe *frame) { - if (!drm_debug_enabled(DRM_UT_KMS)) + if (!drm_debug_syslog_enabled(DRM_UT_KMS)) return; hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, frame); @@ -8215,7 +8215,7 @@ pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv, const union hdmi_infoframe *b) { if (fastset) { - if (!drm_debug_enabled(DRM_UT_KMS)) + if (!drm_debug_syslog_enabled(DRM_UT_KMS)) return; drm_dbg_kms(&dev_priv->drm, From patchwork Wed Jul 21 17:55:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F91C12002 for ; Wed, 21 Jul 2021 17:56:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37CC861029 for ; Wed, 21 Jul 2021 17:56:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37CC861029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 841436EC03; Wed, 21 Jul 2021 17:56:17 +0000 (UTC) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by gabe.freedesktop.org (Postfix) with ESMTPS id D094F6EC03 for ; Wed, 21 Jul 2021 17:56:15 +0000 (UTC) Received: by mail-qk1-x72b.google.com with SMTP id z9so2878737qkg.5 for ; Wed, 21 Jul 2021 10:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QcEOQT1kQoqA3mviD8Rd9pRAGego5zppJEfeNqRzIp4=; b=S/oEvj+Jib2aFF5a7uzAbFAEIdIabsTHecFSrbBbGAMDho4Q/U8/jbys9Dl2SpfLvq GYoVI9ztA5heEizubyLQ98D0r/tlj+rYpCcwIiCfo4vdG4Otbrlslz9Ob07GPNtuh5Hx wiNMWYMoBVrz9ZiwI6VOc+PGnpWKYlydHZZnmtPppoHLx7D6NRs8/+lMSXd0MBBkYDp/ gTlGV6Ll9BriNj/Y6N1uFUoRtTvYNmmvpdpibdVX7oynRZ5ZiKv4TiyU77zQ3wTtlxLY vfJm8P7IC948Assydk2W27ULN8rV1ydqB9CQ1jQFHzYWqwoDjNoZXtZvhwz5eypm1zKh qa8Q== 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=QcEOQT1kQoqA3mviD8Rd9pRAGego5zppJEfeNqRzIp4=; b=PnN+CvrSi2ZKi4VdCJYSybP518PkcKdOlLe7hs4hs9S8RIkGjMI4Pr9C2VonCn4s3C hAuQPXFBSWWCwZoNcnggpwWINzegtdJ0o+RU1KHX9zcNZKUyytaRivRDRitMS6ux+Qas 7B4n6TYP0sVcMvD3J21UL1HLowA395+p8CAFNmRMiXwzfGjpu2bkKa5sK5JxU+bqdapw iDBNTQ5ajGpi0NpapmAvITqcNBA1qdBAwCWsZA1NjQd9UnBtFQsnHqp7shXNF1COH3pe XXVX7NRCagWj/tI/MoqD7E9BtIM4pPIq2CsRquFvfCcorCH0uMCAY1QcfKgdL/MK14gh RgSg== X-Gm-Message-State: AOAM531aOQ0k7FCYeT+GLoltjwrTncquSayQ/zPm/4tFIVPAt5AmwGJT DoDOL5dnUlofbYn67jbiGdOEVqcuyn9xdw== X-Google-Smtp-Source: ABdhPJzZ6m++H+LaawkWeY2kU793ys2RMNwErbYX4cgWUn/tDVVYPTtjshAULyRzTZl+YFG20NHsFQ== X-Received: by 2002:a37:a544:: with SMTP id o65mr35707898qke.68.1626890174944; Wed, 21 Jul 2021 10:56:14 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id a5sm3391090qkf.88.2021.07.21.10.56.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:14 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 10/14] drm/print: Add drm_debug_category_printer Date: Wed, 21 Jul 2021 13:55:17 -0400 Message-Id: <20210721175526.22020-11-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This patch adds a new printer which will select the appropriate output for a given debug category. Currently there is only one output target, which is syslog. However in the future we'll have tracefs and it will be useful to print to syslog, tracefs, or both. Drivers just need to create the printer for the appropriate category and the printer will decide where to send the output. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-11-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/drm_print.c | 5 +++++ include/drm/drm_print.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 2ff7a6ecc632..4d984a01b3a3 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -172,6 +172,11 @@ void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf) } EXPORT_SYMBOL(__drm_printfn_err); +void __drm_printfn_noop(struct drm_printer *p, struct va_format *vaf) +{ +} +EXPORT_SYMBOL(__drm_printfn_noop); + /** * drm_puts - print a const string to a &drm_printer stream * @p: the &drm printer diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 2ea0ffd9c1ce..af31beeb82a1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -87,6 +87,7 @@ void __drm_puts_seq_file(struct drm_printer *p, const char *str); void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf); void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf); void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf); +void __drm_printfn_noop(struct drm_printer *p, struct va_format *vaf); __printf(2, 3) void drm_printf(struct drm_printer *p, const char *f, ...); @@ -329,6 +330,33 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) return drm_debug_syslog_enabled(category); } +/** + * drm_debug_category_printer - construct a &drm_printer that outputs to + * pr_debug() if enabled for the given category. + * @category: the DRM_UT_* message category this message belongs to + * @prefix: trace output prefix + * + * RETURNS: + * The &drm_printer object + */ +static inline struct drm_printer +drm_debug_category_printer(enum drm_debug_category category, + const char *prefix) +{ + struct drm_printer p = { + .prefix = prefix + }; + + if (drm_debug_syslog_enabled(category)) { + p.printfn = __drm_printfn_debug_syslog; + } else { + WARN(1, "Debug category %d is inactive.", category); + p.printfn = __drm_printfn_noop; + } + + return p; +} + /* * struct device based logging * From patchwork Wed Jul 21 17:55:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74303C636C9 for ; Wed, 21 Jul 2021 17:56:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39D1D6113C for ; Wed, 21 Jul 2021 17:56:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39D1D6113C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0A106EC20; Wed, 21 Jul 2021 17:56:20 +0000 (UTC) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BE586EC20 for ; Wed, 21 Jul 2021 17:56:19 +0000 (UTC) Received: by mail-qk1-x735.google.com with SMTP id q15so2861138qkm.8 for ; Wed, 21 Jul 2021 10:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s5kCoPIWaEgRDHab51bWpg6a/Dd81e6wqtHD2wi+BP0=; b=ChenSsXdbDl5aTq0sUbNKneDgbSYSdDxayK9i9rCcKZ095PGXsfVPlh2c9G6I6WYuj KsovBQ1GzgxlhkHp6RdhSnlEWusfNFpmLRm5a4MUsTCke1FLaFZMTzt3zsZ8xrWHUiUH HuhG9AotnX3wimxTqax0Jdhp16PxdILEDDVvIrdoDZ0l2pNNgOXIoh7ZzHnoJ83sy5+p FoblAN/LqzKcb0kllRcf9Pg6q5qywtE+ZivyAeJflIToNz3GVaJR05assbYYdptevixT JsP0AqHtn6Zt43k+nNGd4hUy/0oqzdyUdJ7grgYGZ8gn+QGvGX3KJfXNu9i0Nviti/4r //vQ== 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=s5kCoPIWaEgRDHab51bWpg6a/Dd81e6wqtHD2wi+BP0=; b=Xz698UOAMDd6MPqJ5+LvgUw8hBKtpJSIH96LIBwSk5uZckyfaaPVANrpfXzyBIQcmJ rQxY+9I83rohpapUg9Y1C786VA3FYCZeRvetbpCx3LaHmm9cM5PzNdYXSSg2RC45o5Xx OXMNoAsQitJ4k7+BYWy9pM1Eqe3foFRLluPNW7ljAE5nuwF1RqvlzsrpD6eDKG0lI7lz 3r3OWM0UqHOlwgKhzMNwzHgm5C9a9RbTFYzPFiC2fSHeiGtdmOBWIK1ac6m3Q+NIiNMM d3C/yhNWieJnHZwhwpo/hsAcfQWn+SZxmmS+5ciyjN0nnnFq//sgq/J84Hv6LeulZVxF c2GQ== X-Gm-Message-State: AOAM533VeSSccNGjXFZN26GYvC3Thfgg9PyOEQ9L+qYWG0VbNAZXnANY +U6jvwt1zcjxQT60A026KwAiwZFGXTaDpg== X-Google-Smtp-Source: ABdhPJz5cpVzsaV5ztunMqTbe1NPaosx1FiDSV8tkfqz1rNWBgF6WEINhrr8tZTPT3O9OcOvcRLGbA== X-Received: by 2002:a37:66d6:: with SMTP id a205mr4953679qkc.422.1626890178622; Wed, 21 Jul 2021 10:56:18 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id d16sm9183955qtj.69.2021.07.21.10.56.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:18 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 11/14] drm/mst: Convert debug printers to debug category printers Date: Wed, 21 Jul 2021 13:55:18 -0400 Message-Id: <20210721175526.22020-12-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul The printers in dp_mst are meant to be gated on DRM_UT_DP, so use the debug category printer to avoid dumping mst transactions to the wrong place. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-12-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None Reviewed-by: Lyude Paul Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index ad0795afc21c..b1dddecad4c6 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1356,7 +1356,8 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb, } out: if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) { - struct drm_printer p = drm_debug_printer(DBG_PREFIX); + struct drm_printer p = drm_debug_category_printer(DRM_UT_DP, + DBG_PREFIX); drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); } @@ -2873,7 +2874,8 @@ static int process_single_tx_qlock(struct drm_dp_mst_topology_mgr *mgr, ret = drm_dp_send_sideband_msg(mgr, up, chunk, idx); if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) { - struct drm_printer p = drm_debug_printer(DBG_PREFIX); + struct drm_printer p = drm_debug_category_printer(DRM_UT_DP, + DBG_PREFIX); drm_printf(&p, "sideband msg failed to send\n"); drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); @@ -2917,7 +2919,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, list_add_tail(&txmsg->next, &mgr->tx_msg_downq); if (drm_debug_enabled(DRM_UT_DP)) { - struct drm_printer p = drm_debug_printer(DBG_PREFIX); + struct drm_printer p = drm_debug_category_printer(DRM_UT_DP, + DBG_PREFIX); drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); } From patchwork Wed Jul 21 17:55:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C158FC636C9 for ; Wed, 21 Jul 2021 17:56:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86C6A60E0C for ; Wed, 21 Jul 2021 17:56:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86C6A60E0C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8CFA6EC24; Wed, 21 Jul 2021 17:56:24 +0000 (UTC) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CF796EC24 for ; Wed, 21 Jul 2021 17:56:23 +0000 (UTC) Received: by mail-qk1-x734.google.com with SMTP id bm6so2906746qkb.1 for ; Wed, 21 Jul 2021 10:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3aPSv8mU3AbCHcMFdN+dylgnKrMQgvv2xeAE6ndQ/lg=; b=UEKAiKxwuGl5DOU7RytreKynZZtulprGu3JD7GVZtOo8cxtjHOX2hzYUdMNWqN1WWM eecbQaoYNGqioKrOviRkvfWAahOpQtBk4bE1qEFxpij9tLnt/EOUM3SEylZOxcnjxs4t rt5DIiaC9hVuk0fbnzH/jqAfgQ7qpePV5sjisubF8LCNKVNPjMQyX5NWrZ0sKJcIEHug 74dyFPxJDrNR0W884yFkb1WbQsFiSk3X2S+yXZnkOdJCUMvOZUgOOQUECK2I4dGjuZQp WHZC9dOL0IXzKgm9/vU8w0TkhsFQX26TJ28TKCFnV373QnrUFm6EdC9qzfHxpeXPvSHg eN+w== 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=3aPSv8mU3AbCHcMFdN+dylgnKrMQgvv2xeAE6ndQ/lg=; b=Ix+5Yxu+VWyX34vpZfY06vEyZYa0MP50f1x09k2sVzRUSh98C+cttccMESEzYFPBjt FEYkB4qY0qUCd435lfLAyYQRkr0+ppAOgCm0JrMkoyMQww23dKjwScPFbLRIalnSONij O9yrCkt+LJPxWOoWCsBMS0qIMIkx12MUtudTgPJbLRwIIc2azLF/7jB1/P6NpmUpHxyc ZFuC6vz4UdBoofG3JA5xhDpEtLCCkAz5aeGdbBMVtBx+N6+w10AiD1xK5cCzvUnSMe5R RwUczaHLvpE3hMhStrs/jCYCyJ5EJ9Wf5J6v4yfEVwrmMcZxe38YWnpQX3Jw+kvcAgqh Vl+Q== X-Gm-Message-State: AOAM531fQUhizO6oJse6NKYQEZ9u3rfsufUEHHWEBdue7vYX0Zmag//Q zCrAoCb4VmAx7dQ1fpu3rJvhI9hiFcuOKA== X-Google-Smtp-Source: ABdhPJytrLby92pWZXaux2n8Ywej7baHIvSrQti78yqoxO4kXC/jEucxQ9yxi5aOpS5mFrtrro3RzA== X-Received: by 2002:ae9:f201:: with SMTP id m1mr35493084qkg.381.1626890182775; Wed, 21 Jul 2021 10:56:22 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id f15sm7497848qtv.60.2021.07.21.10.56.22 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:22 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 12/14] drm/i915: Use debug category printer for welcome message Date: Wed, 21 Jul 2021 13:55:19 -0400 Message-Id: <20210721175526.22020-13-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Sean Paul , Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul The welcome printer is meant to be gated on DRM_UT_DRIVER, so use the debug category printer to avoid dumping the message in the wrong place. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-13-sean@poorly.run #v5 Changes in v5: -Added to the set Changes in v6: -None --- drivers/gpu/drm/i915/i915_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index c43b698bf0b9..93299af1e853 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -731,7 +731,8 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv) static void i915_welcome_messages(struct drm_i915_private *dev_priv) { if (drm_debug_enabled(DRM_UT_DRIVER)) { - struct drm_printer p = drm_debug_printer("i915 device info:"); + struct drm_printer p = drm_debug_category_printer(DRM_UT_DRIVER, + "i915 device info:"); drm_printf(&p, "pciid=0x%04x rev=0x%02x platform=%s (subplatform=0x%x) gen=%i\n", INTEL_DEVID(dev_priv), From patchwork Wed Jul 21 17:55:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08118C636C9 for ; Wed, 21 Jul 2021 17:56:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2DF561029 for ; Wed, 21 Jul 2021 17:56:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2DF561029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DBD96EC4F; Wed, 21 Jul 2021 17:56:29 +0000 (UTC) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21D296EC5B for ; Wed, 21 Jul 2021 17:56:28 +0000 (UTC) Received: by mail-qk1-x729.google.com with SMTP id m3so2855708qkm.10 for ; Wed, 21 Jul 2021 10:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i4iCyOB72WxlTn6HE/+0gEExmjPFigo8e2AbmHqGhjo=; b=WKT/WJWQtFWFas/T5Lqo24e+VBZ9T/eiQOyxL9dgO2l5qlyvOUqgduacA+dHmd+7P2 Kh0nLDeYcx9EkcMj1IVgBs5yFa2r/7uSRuLr+i/4xszsI7fWFurw/fWArofPToflUDYl bgP3o8JVF3ZRmsI+oL1LblQDhWUlV5rFYdstH1OdrkRmogwg4Ade6AdDGkaztraI4Y2w x83rrlnIKh3C/FuqkveDZA6tkk9fkS0rAfOQHzRXuCoL9xIPKGCNTl1B8ZB5/bVJDNvR A2yBqxu8vaJIpfJ4gzV1GA3rY99H7hlpr44IRlgdKovIT92JAjSYPZxO+15KTyQlxnnP NyJA== 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=i4iCyOB72WxlTn6HE/+0gEExmjPFigo8e2AbmHqGhjo=; b=tWER5LujJ7TGBaLBhLWhC/5i5J5ASpFYlyuwtYW6MxYTQ1PqDxKo8NwyBQKkG7O3hk oiOIb73JWW7uWmdvvQlUbLX5I1B8qzJZ85LTOE2bnZaLyvhQhPreew+tkXi8WKrc8N/U /JHLxLPvdOYfUk2ovTau2tHVJXgFy4kZDgD3Rg70aoKCfiO3UbD0/2wRvBG+UJT6nK4X cqBGrrSyl7s1weDToCVZ49s9RyKqY3V05nH3ZUcRI1GhQpWEIEQmfJnS+6ysA1E5Zn9T EzEy2ZQffXxAGeawT14EdbbCdhL/se46QY+EBdZ9FpH0e0SX0VuJoOze1Dx3uiu58LVD 5rPw== X-Gm-Message-State: AOAM531gBCYAxcbu6K3Gz3RT7VpHRXdqAULrwmf49gEYvkvKn6M/Q15u mAKddWJCuyJKmXbKeXsN7yj+KGXxqmQ+tg== X-Google-Smtp-Source: ABdhPJwhrDAxoYMVgm7Qe3fcosP73WqGWu0xgInEgMwFd+sHNblt+LtXUa1w0wE3OUBJL93p1suk+g== X-Received: by 2002:a37:670e:: with SMTP id b14mr36608807qkc.240.1626890187280; Wed, 21 Jul 2021 10:56:27 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id bl41sm1054767qkb.17.2021.07.21.10.56.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:27 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 13/14] drm/atomic: Use debug category printer for atomic state printer Date: Wed, 21 Jul 2021 13:55:20 -0400 Message-Id: <20210721175526.22020-14-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul The atomic state is printed if the DRM_UT_STATE is active, but it's printed at INFO level. This patch converts it to use the debug category printer so: a- it's consistent with other DRM_UT_STATE logging b- it's properly routed through drm_trace when introduced Signed-off-by: Sean Paul Changes in v6: -Added to the set Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/drm_atomic_uapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 7e48d40600ff..7615ded60195 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1322,7 +1322,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, struct drm_out_fence_state *fence_state; int ret = 0; unsigned int i, j, num_fences; - struct drm_printer p = drm_info_printer(dev->dev); + struct drm_printer p = drm_debug_category_printer(DRM_UT_STATE, "commit_state"); /* disallow for drivers not supporting atomic: */ if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) From patchwork Wed Jul 21 17:55:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12391843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07FAEC636C9 for ; Wed, 21 Jul 2021 17:56:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0BB06113C for ; Wed, 21 Jul 2021 17:56:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BB06113C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63E4A6E991; Wed, 21 Jul 2021 17:56:33 +0000 (UTC) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 991A36E991 for ; Wed, 21 Jul 2021 17:56:32 +0000 (UTC) Received: by mail-qt1-x82e.google.com with SMTP id d15so2430650qte.13 for ; Wed, 21 Jul 2021 10:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CH2kPjmK/HYIHIFGLb86BP+Lyj1IMPrr9Abe3xfbcVc=; b=PfAhfxAWbhF3Qih/yiBiz6VRFB6roXU1H42ZWE0sXg4SlsWfzH42y99iqM6Z1FKY3E n89th2CTipVKay6r5KCOF/42VaaHu3vZlLae201JvvntSC1E7ZfoyujRLaLSl7vsn5iF PI+uKkdNmmAHkrRl23rmypZvaU2SgJItwQHqTVeDE83k4/1wAwlOijRMfM69ahUOc9ql SVjtKLcslSagtxg2xsPoSn6F2+uRp0zaCWSoEjUV+xR7DxZgGqoSSYuXPk3PmjWO7scZ kTIrryu0vJIvZeqx5PR0absr5coUStWI9W2xpKbHR0mRDD4EMT17St9IjcFs7jrnFGUy l/aw== 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=CH2kPjmK/HYIHIFGLb86BP+Lyj1IMPrr9Abe3xfbcVc=; b=FJRo/9CG7iJpCl9Qq2reTpshiBsVxaf8OItbudCV1tQj/CWmK8Od1WWfQWnnX7wMiK PdAjvK4xIx6KNB+NaDGfqnqoKSfxzqozkSY/TM+BD++w4Fg6JdMNqdVljmBihyaqTYNl vZ+htrEQH/dPvHGrzKKEd0ml+IrI2nXTW19WmQITM7EVKcz5LDHPwDcPlBD0pr21ysfU lwJpNdxJ4yPs0XxFn9NbiLlSVZv3y8jygINBo+SdrLgUVegzvKAzK28++rSqvtgZFNOQ CpcOkDlWDPrsm4sJDFMf5dQcjLG8QWSklVYLBNiUOXKfl7SAKR0Ml8Z/P6aY38XulQ4n 0f0w== X-Gm-Message-State: AOAM530ibEwLnCBShEdcz79u1d+Y37n6w4pom+4lg8lMnZ+oezdmFmAB DDyLXiN8tSek/Y68QRXv8Q1dZjnH+sSzNg== X-Google-Smtp-Source: ABdhPJzBZMRT3l18XCw+swJ/gW66HlI1EvzoBwcldy09Gfe1JQ+5e1RwMD4Iz0EEsF6Wc6Z43YLeSA== X-Received: by 2002:a05:622a:50:: with SMTP id y16mr12210546qtw.322.1626890191672; Wed, 21 Jul 2021 10:56:31 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id r4sm9583651qtc.66.2021.07.21.10.56.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 10:56:31 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel.vetter@ffwll.ch Subject: [RESEND PATCH v6 14/14] drm/print: Add tracefs support to the drm logging helpers Date: Wed, 21 Jul 2021 13:55:21 -0400 Message-Id: <20210721175526.22020-15-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210721175526.22020-1-sean@poorly.run> References: <20210721175526.22020-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , kernel test robot , Jonathan Corbet , linux-doc@vger.kernel.org, Steven Rostedt , Chris Wilson , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This patch adds a new module parameter called drm.trace which accepts the same mask as drm.debug. When a debug category is enabled, log messages will be put in a new tracefs instance called drm for consumption. Using the new tracefs instance will allow distros to enable drm logging in production without impacting performance or spamming the system logs. Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Pekka Paalanen Cc: Rob Clark Cc: Steven Rostedt Cc: Thomas Zimmermann Cc: Ville Syrjälä Cc: Chris Wilson Cc: Steven Rostedt Reported-by: kernel test robot # warning reported in v6 Acked-by: Pekka Paalanen Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20191010204823.195540-1-sean@poorly.run #v1 Link: https://lists.freedesktop.org/archives/dri-devel/2019-November/243230.html #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20191212203301.142437-1-sean@poorly.run #v3 Link: https://patchwork.freedesktop.org/patch/msgid/20200114172155.215463-1-sean@poorly.run #v4 Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-14-sean@poorly.run #v5 Link: https://patchwork.freedesktop.org/patch/msgid/20200818210510.49730-15-sean@poorly.run #v6 Changes in v5: -Re-write to use trace_array and the tracefs instance support Changes in v6: -Use the new trace_array_init_printk() to initialize global trace buffers Changes in v6.5: -Fix kernel test robot warning -Add a trace printf in __drm_err Reviewed-by: Rodrigo Siqueira --- Documentation/gpu/drm-uapi.rst | 6 + drivers/gpu/drm/drm_drv.c | 3 + drivers/gpu/drm/drm_print.c | 223 ++++++++++++++++++++++++++++----- include/drm/drm_print.h | 63 ++++++++-- 4 files changed, 255 insertions(+), 40 deletions(-) diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst index 7e51dd40bf6e..ce1ea39fb4b9 100644 --- a/Documentation/gpu/drm-uapi.rst +++ b/Documentation/gpu/drm-uapi.rst @@ -424,6 +424,12 @@ Debugfs Support .. kernel-doc:: drivers/gpu/drm/drm_debugfs.c :export: +DRM Tracing +--------------- + +.. kernel-doc:: drivers/gpu/drm/drm_print.c + :doc: DRM Tracing + Sysfs Support ============= diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 8804ec7d3215..71dc0b161b51 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -1034,12 +1034,15 @@ static void drm_core_exit(void) drm_sysfs_destroy(); idr_destroy(&drm_minors_idr); drm_connector_ida_destroy(); + drm_trace_cleanup(); } static int __init drm_core_init(void) { int ret; + drm_trace_init(); + drm_connector_ida_init(); idr_init(&drm_minors_idr); drm_memcpy_init_early(); diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 4d984a01b3a3..64d9a724c2df 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -43,17 +44,34 @@ unsigned int __drm_debug_syslog; EXPORT_SYMBOL(__drm_debug_syslog); -MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" -"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" -"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" -"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" -"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" -"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" -"\t\tBit 5 (0x20) will enable VBL messages (vblank code)\n" -"\t\tBit 7 (0x80) will enable LEASE messages (leasing code)\n" -"\t\tBit 8 (0x100) will enable DP messages (displayport code)"); +/* + * __drm_debug_trace: Enable debug output in drm tracing instance. + * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details. + */ +unsigned int __drm_debug_trace; +EXPORT_SYMBOL(__drm_debug_trace); + +#define DEBUG_PARM_DESC(dst) \ +"Enable debug output to " dst ", where each bit enables a debug category.\n" \ +"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" \ +"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" \ +"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" \ +"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" \ +"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" \ +"\t\tBit 5 (0x20) will enable VBL messages (vblank code)\n" \ +"\t\tBit 7 (0x80) will enable LEASE messages (leasing code)\n" \ +"\t\tBit 8 (0x100) will enable DP messages (displayport code)" + +MODULE_PARM_DESC(debug, DEBUG_PARM_DESC("syslog")); module_param_named(debug, __drm_debug_syslog, int, 0600); +MODULE_PARM_DESC(trace, DEBUG_PARM_DESC("tracefs")); +module_param_named(trace, __drm_debug_trace, int, 0600); + +#ifdef CONFIG_TRACING +struct trace_array *trace_arr; +#endif + void __drm_puts_coredump(struct drm_printer *p, const char *str) { struct drm_print_iterator *iterator = p->arg; @@ -166,6 +184,20 @@ void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf) } EXPORT_SYMBOL(__drm_printfn_debug_syslog); +void __drm_printfn_trace(struct drm_printer *p, struct va_format *vaf) +{ + drm_trace_printf("%s %pV", p->prefix, vaf); +} +EXPORT_SYMBOL(__drm_printfn_trace); + +void __drm_printfn_debug_syslog_and_trace(struct drm_printer *p, + struct va_format *vaf) +{ + pr_debug("%s %pV", p->prefix, vaf); + drm_trace_printf("%s %pV", p->prefix, vaf); +} +EXPORT_SYMBOL(__drm_printfn_debug_syslog_and_trace); + void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf) { pr_err("*ERROR* %s %pV", p->prefix, vaf); @@ -246,6 +278,14 @@ void drm_dev_printk(const struct device *dev, const char *level, struct va_format vaf; va_list args; + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; + drm_trace_printf("%s%s[" DRM_NAME ":%ps] %pV", + dev ? dev_name(dev) : "",dev ? " " : "", + __builtin_return_address(0), &vaf); + va_end(args); + va_start(args, format); vaf.fmt = format; vaf.va = &args; @@ -267,21 +307,30 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, struct va_format vaf; va_list args; - if (!drm_debug_enabled(category)) - return; + if (drm_debug_syslog_enabled(category)) { + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; + if (dev) + dev_printk(KERN_DEBUG, dev, "[" DRM_NAME ":%ps] %pV", + __builtin_return_address(0), &vaf); + else + printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", + __builtin_return_address(0), &vaf); - if (dev) - dev_printk(KERN_DEBUG, dev, "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - else - printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); + va_end(args); + } - va_end(args); + if (drm_debug_trace_enabled(category)) { + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; + drm_trace_printf("%s%s[" DRM_NAME ":%ps] %pV", + dev ? dev_name(dev) : "", dev ? " " : "", + __builtin_return_address(0), &vaf); + va_end(args); + } } EXPORT_SYMBOL(drm_dev_dbg); @@ -290,17 +339,25 @@ void __drm_dbg(enum drm_debug_category category, const char *format, ...) struct va_format vaf; va_list args; - if (!drm_debug_enabled(category)) - return; + if (drm_debug_syslog_enabled(category)) { + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; + printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", + __builtin_return_address(0), &vaf); - printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); + va_end(args); + } - va_end(args); + if (drm_debug_trace_enabled(category)) { + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; + drm_trace_printf("[" DRM_NAME ":%ps] %pV", + __builtin_return_address(0), &vaf); + va_end(args); + } } EXPORT_SYMBOL(__drm_dbg); @@ -317,6 +374,13 @@ void __drm_err(const char *format, ...) __builtin_return_address(0), &vaf); va_end(args); + + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; + drm_trace_printf("[" DRM_NAME ":%ps] *ERROR* %pV", + __builtin_return_address(0), &vaf); + va_end(args); } EXPORT_SYMBOL(__drm_err); @@ -347,3 +411,104 @@ void drm_print_regset32(struct drm_printer *p, struct debugfs_regset32 *regset) } } EXPORT_SYMBOL(drm_print_regset32); + + +/** + * DOC: DRM Tracing + * + * *tl;dr* DRM tracing is a lightweight alternative to traditional DRM debug + * logging. + * + * While DRM logging is quite convenient when reproducing a specific issue, it + * doesn't help when something goes wrong unexpectedly. There are a couple + * reasons why one does not want to enable DRM logging at all times: + * + * 1. We don't want to overwhelm syslog with drm spam, others have to use it too + * 2. Console logging is slow + * + * DRM tracing aims to solve both these problems. + * + * To use DRM tracing, set the drm.trace module parameter (via cmdline or sysfs) + * to a DRM debug category mask (this is a bitmask of &drm_debug_category + * values): + * :: + * + * eg: echo 0x106 > /sys/module/drm/parameters/trace + * + * Once active, all log messages in the specified categories will be written to + * the DRM trace. Once at capacity, the trace will overwrite old messages with + * new ones. At any point, one can read the trace file to extract the previous N + * DRM messages: + * :: + * + * eg: cat /sys/kernel/tracing/instances/drm/trace + * + * Considerations + * ************** + * The trace is subsystem wide, so if you have multiple devices active, they + * will be adding logs to the same trace. + * + * The contents of the DRM Trace are **not** considered UABI. **DO NOT depend on + * the values of these traces in your userspace.** These traces are intended for + * entertainment purposes only. The contents of these logs carry no warranty, + * expressed or implied. + */ + + +#ifdef CONFIG_TRACING + +/** + * drm_trace_init - initializes the drm trace array + * + * This function fetches (or creates) the drm trace array. This should be called + * once on drm subsystem creation and matched with drm_trace_cleanup(). + */ +void drm_trace_init(void) +{ + int ret; + + trace_arr = trace_array_get_by_name("drm"); + if (!trace_arr) + return; + + ret = trace_array_init_printk(trace_arr); + if (ret) + drm_trace_cleanup(); +} +EXPORT_SYMBOL(drm_trace_init); + +/** + * drm_trace_printf - adds an entry to the drm tracefs instance + * @format: printf format of the message to add to the trace + * + * This function adds a new entry in the drm tracefs instance + */ +void drm_trace_printf(const char *format, ...) +{ + struct va_format vaf; + va_list args; + + va_start(args, format); + vaf.fmt = format; + vaf.va = &args; + trace_array_printk(trace_arr, _THIS_IP_, "%pV", &vaf); + va_end(args); +} + +/** + * drm_trace_cleanup - destroys the drm trace array + * + * This function destroys the drm trace array created with drm_trace_init. This + * should be called once on drm subsystem close and matched with + * drm_trace_init(). + */ +void drm_trace_cleanup(void) +{ + if (trace_arr) { + trace_array_put(trace_arr); + trace_array_destroy(trace_arr); + trace_arr = NULL; + } +} +EXPORT_SYMBOL(drm_trace_cleanup); +#endif \ No newline at end of file diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index af31beeb82a1..4609a2f4a425 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -36,12 +36,13 @@ /* Do *not* use outside of drm_print.[ch]! */ extern unsigned int __drm_debug_syslog; +extern unsigned int __drm_debug_trace; /** * DOC: print * * A simple wrapper for dev_printk(), seq_printf(), etc. Allows same - * debug code to be used for both debugfs and printk logging. + * debug code to be used for debugfs, printk and tracefs logging. * * For example:: * @@ -86,6 +87,9 @@ void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf); void __drm_puts_seq_file(struct drm_printer *p, const char *str); void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf); void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf); +void __drm_printfn_trace(struct drm_printer *p, struct va_format *vaf); +void __drm_printfn_debug_syslog_and_trace(struct drm_printer *p, + struct va_format *vaf); void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf); void __drm_printfn_noop(struct drm_printer *p, struct va_format *vaf); @@ -219,7 +223,8 @@ static inline struct drm_printer drm_info_printer(struct device *dev) } /** - * drm_debug_printer - construct a &drm_printer that outputs to pr_debug() + * drm_debug_printer - construct a &drm_printer that outputs to pr_debug() and + * drm tracefs * @prefix: debug output prefix * * RETURNS: @@ -228,7 +233,7 @@ static inline struct drm_printer drm_info_printer(struct device *dev) static inline struct drm_printer drm_debug_printer(const char *prefix) { struct drm_printer p = { - .printfn = __drm_printfn_debug_syslog, + .printfn = __drm_printfn_debug_syslog_and_trace, .prefix = prefix }; return p; @@ -254,14 +259,14 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * enum drm_debug_category - The DRM debug categories * * Each of the DRM debug logging macros use a specific category, and the logging - * is filtered by the drm.debug module parameter. This enum specifies the values - * for the interface. + * is filtered by the drm.debug and drm.trace module parameters. This enum + * specifies the values for the interface. * * Each DRM_DEBUG_ macro logs to DRM_UT_ category, except * DRM_DEBUG() logs to DRM_UT_CORE. * - * Enabling verbose debug messages is done through the drm.debug parameter, each - * category being enabled by a bit: + * Enabling verbose debug messages is done through the drm.debug and drm.trace + * parameters, each category being enabled by a bit: * * - drm.debug=0x1 will enable CORE messages * - drm.debug=0x2 will enable DRIVER messages @@ -270,10 +275,14 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * - drm.debug=0x1ff will enable all messages * * An interesting feature is that it's possible to enable verbose logging at - * run-time by echoing the debug value in its sysfs node:: + * run-time by echoing the debug category value in its sysfs node:: * + * # For syslog logging: * # echo 0xf > /sys/module/drm/parameters/debug * + * # For tracefs logging: + * # echo 0xf > /sys/module/drm/parameters/trace + * */ enum drm_debug_category { /** @@ -325,14 +334,20 @@ static inline bool drm_debug_syslog_enabled(enum drm_debug_category category) return unlikely(__drm_debug_syslog & category); } +static inline bool drm_debug_trace_enabled(enum drm_debug_category category) +{ + return unlikely(__drm_debug_trace & category); +} + static inline bool drm_debug_enabled(enum drm_debug_category category) { - return drm_debug_syslog_enabled(category); + return drm_debug_syslog_enabled(category) || + drm_debug_trace_enabled(category); } /** * drm_debug_category_printer - construct a &drm_printer that outputs to - * pr_debug() if enabled for the given category. + * pr_debug() and/or the drm tracefs instance if enabled for the given category. * @category: the DRM_UT_* message category this message belongs to * @prefix: trace output prefix * @@ -347,8 +362,13 @@ drm_debug_category_printer(enum drm_debug_category category, .prefix = prefix }; - if (drm_debug_syslog_enabled(category)) { + if (drm_debug_syslog_enabled(category) && + drm_debug_trace_enabled(category)) { + p.printfn = __drm_printfn_debug_syslog_and_trace; + } else if (drm_debug_syslog_enabled(category)) { p.printfn = __drm_printfn_debug_syslog; + } else if (drm_debug_trace_enabled(category)) { + p.printfn = __drm_printfn_trace; } else { WARN(1, "Debug category %d is inactive.", category); p.printfn = __drm_printfn_noop; @@ -357,6 +377,27 @@ drm_debug_category_printer(enum drm_debug_category category, return p; } + +#ifdef CONFIG_TRACING +void drm_trace_init(void); +__printf(1, 2) +void drm_trace_printf(const char *format, ...); +void drm_trace_cleanup(void); +#else +static inline void drm_trace_init(void) +{ +} + +__printf(1, 2) +static inline void drm_trace_printf(const char *format, ...) +{ +} + +static inline void drm_trace_cleanup(void) +{ +} +#endif + /* * struct device based logging *