Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp492879pxu; Sun, 22 Nov 2020 16:35:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3kLqXnJVpBqeFRHLJtMHgTwqxehz1RYZDA/8t0BTTsaBe+wjk2KASGfdKFW8E4B5qr1J4 X-Received: by 2002:a17:906:7c9:: with SMTP id m9mr41168890ejc.178.1606091741870; Sun, 22 Nov 2020 16:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606091741; cv=none; d=google.com; s=arc-20160816; b=QJQZTNphc6Sx7BON4DCmCWtOY/reeKupUZoxMHkKUVlXym1k4egzam4EGO6Zt2rS/K trRz24cB8DWif78IrcPKgJpQil+A0r7j4Z55xQHRK8+VmsH8TfToWwZF0BqsF4jiHfuz 2xeE8OrJnUv82/MhX13gurVvojtrAEziHcEmwVmHdS8oZHk7fkdRz4c9PrXRHSK/kqoz p6tzBqZJpD+HQGFlZlEV5VgtCka5yoFbYVETRElzBcqgSQBaKpo0Hsf5ygHW/PDWaL1G ZiWNEzFcuIa41sj1/FTgHoDWWk422yLcBMMCVffb5WCjC4ZmacpxYYYBhVrryDz9nTRv XLrw== 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=5dCbZvyPJ9eUu2G59fWkwNpYcrEO/zvwjAoLRWdkXSE=; b=zHvLc40OMYledI0w4OsSbaXViCkzlkrteP2KsEUbG3MpS6J062C53uMxIKW8sRCbZE /NZ6nmh2T8sZMehlLofmfnwIH35keR6kADvXWE/4zsQMcgeWP8yCNBku+CRBQMB7jKaC rdKTfHx4dGsGvzjusqCTvj4aiRSYqww18sY27pX1u8gDglveiTu73JCe4eYFsQLsRQT4 43Tqywzs1meWnA8kMbZWSf8i54Ug00WyMW+Y/Qmnn6ydsiHPCJGncPeWJsvl7sxC4brC i84f4SXhTO2PT/R+TJy3ApH0pw++xLhb2Nxr1ZjtDL9mxmqQW+/gyGFmNpAga/vL8ai7 aRTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T7AH901o; 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 j7si5622509eje.191.2020.11.22.16.35.19; Sun, 22 Nov 2020 16:35:41 -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=T7AH901o; 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 S1727757AbgKWAcE (ORCPT + 99 others); Sun, 22 Nov 2020 19:32:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgKWAb0 (ORCPT ); Sun, 22 Nov 2020 19:31:26 -0500 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E7BC0613CF; Sun, 22 Nov 2020 16:31:24 -0800 (PST) Received: by mail-lf1-x141.google.com with SMTP id t6so5310218lfl.13; Sun, 22 Nov 2020 16:31:24 -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=5dCbZvyPJ9eUu2G59fWkwNpYcrEO/zvwjAoLRWdkXSE=; b=T7AH901oobtMgrudSomm+rl/4jxaf6TmVx6EzcvrY/hlEUm5+uLoBS8hGd0tyZW/hG af3G2Lkd8SFW6raYT+2hWrptLxy/Rg3usmq9TOSPJlLXIaNm0xcQZQsPUEvCeCqnQoQ+ ICMp48bmWUZWtOrTqJ8gMPY7gGTF1OqGLqtac7GSNAqaJAomz77taixpeRUtvaYvynxC z1+YsKqqQ9OZnT6bY1Q0mHplacosTDqgJo+LG2tmkFaiDPZFHgJjx/LKa39T559+oNzV bezM73MXMDmc2SWguMlFLTJyVJMqXGzZ0dFKVxdbX1LdJiRmJOwGlDM1ePePL6TQSKXe eQDg== 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=5dCbZvyPJ9eUu2G59fWkwNpYcrEO/zvwjAoLRWdkXSE=; b=LOf3kbCRFgaloiRLKz8spzoZam0hdSSZGvg43v7N2dtIf/MUtUR4KsAixZJmckADYs iEJqR5LhnqKwNZpzbPsMQNkxXAug7RA60MnZBrlz6mBmt0za5lbLgYbWD+4zq+DVuo93 TVxC6gi96v7BaUFZSQS7/88IkLKj5UG+bmnWoc26RWW7DV4mPIwCu6HCHVZpSEvRz3UE SxHXwRxrYV08o1Atd69f6AfeN+QRJ8AqkO/BfUkdWlqnxPaIFe0CHxqP1ZTabnVI2nFv cV3mvE6gIL1vLZu/P+M4JjiRiWz9dgfmYR8wbJEgzX/sqa7SOVVDL6bUoSo7mfQHfL2Z 80jA== X-Gm-Message-State: AOAM5312zOTeI5CgOEdiGwvBRX20ftlqyCI6ZhMYj+l1MsHofTtK+azi wf71LKO17sqULVOceT7z+OeB0qWaSR8= X-Received: by 2002:a05:6512:6d:: with SMTP id i13mr13447573lfo.491.1606091482844; Sun, 22 Nov 2020 16:31:22 -0800 (PST) Received: from localhost.localdomain (109-252-193-159.dynamic.spd-mgts.ru. [109.252.193.159]) by smtp.gmail.com with ESMTPSA id r27sm1225823lfn.290.2020.11.22.16.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 16:31: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 Subject: [PATCH v10 08/19] drm/tegra: dc: Extend debug stats with total number of events Date: Mon, 23 Nov 2020 03:27:12 +0300 Message-Id: <20201123002723.28463-9-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123002723.28463-1-digetx@gmail.com> References: <20201123002723.28463-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 5c587cfd1bb2..b6676f1fe358 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; } @@ -2310,6 +2315,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++; } @@ -2318,6 +2324,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++; } @@ -2325,6 +2332,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++; } @@ -2332,11 +2340,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 { -- 2.29.2