From patchwork Wed Nov 4 16:49:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 318023 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=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 4D813C5517A for ; Wed, 4 Nov 2020 16:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9027206E3 for ; Wed, 4 Nov 2020 16:51:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mBIZ+z3A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731682AbgKDQvU (ORCPT ); Wed, 4 Nov 2020 11:51:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731672AbgKDQuZ (ORCPT ); Wed, 4 Nov 2020 11:50:25 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19333C061A4A; Wed, 4 Nov 2020 08:50:25 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id v19so18770590lji.5; Wed, 04 Nov 2020 08:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FzRtX226Ns3ZKp6+Uq+Yk4+eY0Se/Xl5BO5wShlYK5k=; b=mBIZ+z3AGHgKtZ8J0vw9IDOhiu7RO9dSUfhU5Ry+UE6oJPHtmQ0YVWeqHZD76IqkL7 ypyi3Zq0fJlKo3yjvQDvFGVgwFk+U627MS9pRZpqSUtXaPAkWhKEAnoQRCCpyR1ajPvC W/IGXmP83sYT4lDitUYngD5jggJixP57F59tqHcaQp2LLfN/+vDl6Mvs2TSUpzi0yEff EeuGljdKmdVbfri/BpyvPaXD8EnvdxbRttck52x+lEAwyUNHyx4KtbI/iU41+NAMBn3V 6/lkliV/1dhMjSBBrUGNnsLkSlRWTq8g3kGc3gwpfFpdicOlDL65vIbwR968x6tg5xRD CKLw== 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=FzRtX226Ns3ZKp6+Uq+Yk4+eY0Se/Xl5BO5wShlYK5k=; b=jKZMGdQWYEukoiuYSniGEWg060ogI04OKyCr45UV15MvC0K3tO9BkDmbZDOJ1CKHO6 /ulrKi6UVUWye2x5GcP0mzkpUsrZxKbIM0UNNG3qiUwgMscb3lGSDL86CFAl5QTRpwEe zksi5Knb1PKvtnwdjtF0715w15jiat5JTMs/i9BF5ZkCK4uzwFtasBg37G0CVWUFieun ol2SEkWkxm7rER9aM6rBdUc8XkIV3WxWjLknhwo85mZuPBQieImWX8imgqKAjp1zyXQg E9xNt9/o7BTx/LvXn0YY4oEmL1RzlAlAgida6Nmy4vlA7HyZYIO12JqNroc2K0LSkPJG cNnw== X-Gm-Message-State: AOAM5324vzJNY2gWB81kr2UIxyRB0Vdf5nAyMzf0my1HXX5ODopoinUo w7W/8NTRJYo3DJYh1kbjtLs= X-Google-Smtp-Source: ABdhPJyOC59Ix41fXQXTZLbW5qdZVtfibNUJwBFUtazB1+xbtSOxZJ+Kkaq92Z0z1qs3gUWWqjYq5A== X-Received: by 2002:a2e:b4ba:: with SMTP id q26mr11711603ljm.121.1604508623388; Wed, 04 Nov 2020 08:50:23 -0800 (PST) Received: from localhost.localdomain (109-252-192-83.dynamic.spd-mgts.ru. [109.252.192.83]) by smtp.gmail.com with ESMTPSA id m2sm454587lfo.25.2020.11.04.08.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 08:50:22 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen , Viresh Kumar , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v7 44/47] drm/tegra: dc: Extend debug stats with total number of events Date: Wed, 4 Nov 2020 19:49:20 +0300 Message-Id: <20201104164923.21238-45-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201104164923.21238-1-digetx@gmail.com> References: <20201104164923.21238-1-digetx@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It's useful to know the total number of underflow events and currently the debug stats are getting reset each time CRTC is being disabled. Let's account the overall number of events that doesn't get a reset. Tested-by: Peter Geis Tested-by: Nicolas Chauvet Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 10 ++++++++++ drivers/gpu/drm/tegra/dc.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 14168f792977..fd7c8828652d 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1539,6 +1539,11 @@ static int tegra_dc_show_stats(struct seq_file *s, void *data) seq_printf(s, "underflow: %lu\n", dc->stats.underflow); seq_printf(s, "overflow: %lu\n", dc->stats.overflow); + seq_printf(s, "frames total: %lu\n", dc->stats.frames_total); + seq_printf(s, "vblank total: %lu\n", dc->stats.vblank_total); + seq_printf(s, "underflow total: %lu\n", dc->stats.underflow_total); + seq_printf(s, "overflow total: %lu\n", dc->stats.overflow_total); + return 0; } @@ -2308,6 +2313,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): frame end\n", __func__); */ + dc->stats.frames_total++; dc->stats.frames++; } @@ -2316,6 +2322,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) dev_dbg(dc->dev, "%s(): vertical blank\n", __func__); */ drm_crtc_handle_vblank(&dc->base); + dc->stats.vblank_total++; dc->stats.vblank++; } @@ -2323,6 +2330,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): underflow\n", __func__); */ + dc->stats.underflow_total++; dc->stats.underflow++; } @@ -2330,11 +2338,13 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): overflow\n", __func__); */ + dc->stats.overflow_total++; dc->stats.overflow++; } if (status & HEAD_UF_INT) { dev_dbg_ratelimited(dc->dev, "%s(): head underflow\n", __func__); + dc->stats.underflow_total++; dc->stats.underflow++; } diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 0d7bdf66a1ec..ba4ed35139fb 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -48,6 +48,11 @@ struct tegra_dc_stats { unsigned long vblank; unsigned long underflow; unsigned long overflow; + + unsigned long frames_total; + unsigned long vblank_total; + unsigned long underflow_total; + unsigned long overflow_total; }; struct tegra_windowgroup_soc {