Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp559134pxf; Thu, 11 Mar 2021 09:25:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI24bfNnZtwDkA1tWKqgFdqCvld86pk1yU+BdG8dtUgVCzmQAVxortPSNHt3jIIqO9GC+U X-Received: by 2002:a17:906:1408:: with SMTP id p8mr4038461ejc.89.1615483531760; Thu, 11 Mar 2021 09:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615483531; cv=none; d=google.com; s=arc-20160816; b=aHYW4LcHBRj7tUiIJhnuQQY8nSumsouCGn4TiD6PgOTpWbA6wnPtbc9xplIDNhFUOj LAsFTRlOL8qDmbyG6kyS3yG0q1f8TFDFXYPsxT9gzvEtloTGpUlBPw1l8SWVBqYmeZaK 7PWTIZzf4ZbOTXWRqQKrFmB86oIXw11ko7kr5ca5pqHGxdScYQe9gT6NXGbVOCYuW13s pmUbqJ57jAd6T8CRRkHR/zc534GGKRfp/UTGHVnuRNHTfu0+G6p13b+SVXc+bJWB1AIH Vn7GL6WPaJNivWsM9j5l5LVpwZjOB5f71K9CVg45Vw2Q30v5R7eufPsRK25I13M7ZtC0 lQGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RHqyaVV9xNkvF/r79ZHMYRyngwcH1Np8oMRkBFJWWS4=; b=P8V89ZA+i2TrGcEnJRvfOfXaU8wPb7bFrIVzBeiw/fmX+4JXpRJlxvHdLERYH2UA/G J0MZW3ywj1ssrDHgIM6PVTh3VpC1sIilh0Bgh3q3W5lvUOOoipDzuK0xdgkNNvNMZwmI 9+20UBIIHt5uQA9PamAsE9kkss+gNOBSNMJ2bE8HZtem3AwUeMJymeza1GnA8B3iIRpD nPxMknkYI1+Du6FiJM7eBv9cBiQJwkeM8lGb/YoIaZyD+BlN5cosi7OVda/ezRfSFt82 bOno8+8qMg4VZ7r8uy9pXEfbjPkhVoOat3zDFnfhSxIyMIAm0sx6QeCrcNANtOD3IvCE kvnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jOzvebEp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s28si2134904ejm.721.2021.03.11.09.25.08; Thu, 11 Mar 2021 09:25:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jOzvebEp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbhCKRYO (ORCPT + 99 others); Thu, 11 Mar 2021 12:24:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbhCKRXw (ORCPT ); Thu, 11 Mar 2021 12:23:52 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCC9C061760; Thu, 11 Mar 2021 09:23:52 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id e7so41103982lft.2; Thu, 11 Mar 2021 09:23:52 -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=RHqyaVV9xNkvF/r79ZHMYRyngwcH1Np8oMRkBFJWWS4=; b=jOzvebEprjH+UNDtQ0eiaWAJpepmixIx4HivkVVMR8DVeATpb0aWVeaHhz3g81NF7J m07wO70GxtCYfBv9BhJ5YbjCgqmj3Kf1JgUYLLjm8Ox3DKLn3y1tFDSXKQvsJMD/iwab 7ia08BpOn9HvG5UgJ25e5xryGGMBgxjuJwtaKP9Q8FRLhDWKwQJXvIRuDfB4cjDBlK7e m2YOj2ItToskDt3QLmK2rmM1jcFtOsFmk4MKGgDa2tgg+iBYufZk552MzllFaXINMkn0 /WAS5i0Z9Xv96ZiW+i9uLVffX/pT2BTiwH9LiMSDRVIXdxBpQEZCoz9BLv/EaYqPCPzN 7ivA== 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=RHqyaVV9xNkvF/r79ZHMYRyngwcH1Np8oMRkBFJWWS4=; b=U8jtD7t4ISMf+Uh3UolA9D3PAnVV9kQPpARYBy1oNhaoCD9oZNy2JuLYVjoT+rrL+9 9pcER6416e2VOW4W52o24zOAU68MpaBSMMVc+kng45Xs7y1V1S898OmlyMQ3DjaCNqrm FmjKsCCVrMClU/0cXgEo3U8EfYdjKYrujxEP6iIZhVikEuFpCJC4sFctaoz2OMZzRxaE pQprSPKl7aNfmGQf40nyR4+AT1nM8WxKMsDgGpH0ajg24lmVaA4ng/wvv4GBc2tMrnx9 UHTOdbI1iCGsoMkprYM+r+WXVCOcrgYtFYoROxe/1pxYFi/Wa5YSWEeH+a6AEhdjJVor vAdA== X-Gm-Message-State: AOAM532IZz4NvQxd6JdmkCnZhXGUtvSedkTGD8UHvfy2VR98iY6NFydl d4UNXiggPPsiH+DOju/SnSo= X-Received: by 2002:a19:d61a:: with SMTP id n26mr2774558lfg.383.1615483430986; Thu, 11 Mar 2021 09:23:50 -0800 (PST) Received: from localhost.localdomain (109-252-193-52.dynamic.spd-mgts.ru. [109.252.193.52]) by smtp.gmail.com with ESMTPSA id p5sm1180088ljj.26.2021.03.11.09.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 09:23:50 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Matt Merhar , Peter Geis , Nicolas Chauvet , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v15 2/2] drm/tegra: dc: Extend debug stats with total number of events Date: Thu, 11 Mar 2021 20:22:55 +0300 Message-Id: <20210311172255.25213-3-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210311172255.25213-1-digetx@gmail.com> References: <20210311172255.25213-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 49fa488cf930..ecac28e814ec 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; } @@ -2313,6 +2318,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++; } @@ -2321,6 +2327,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++; } @@ -2328,6 +2335,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++; } @@ -2335,11 +2343,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 69d4cca2e58c..ad8d51a55a00 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 { -- 2.29.2