Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4452745pxb; Tue, 10 Nov 2020 17:23:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwW15yAK9deeFuTXdadKwAaQHSA6k7QPXztL9FAuaMCVhfeVL7qzaYXMaeOwvWAHYlvQww8 X-Received: by 2002:a17:906:c836:: with SMTP id dd22mr22198560ejb.552.1605057788521; Tue, 10 Nov 2020 17:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605057788; cv=none; d=google.com; s=arc-20160816; b=WE+ZHU+n8xc6SCuLjTVuG7AFVo/9CekYRvwUV77X+FhOb/bCLxVv7Ac7KZxf/YViNS alWT5kGiGs37wAVgXwUM9//gCkTKxhKiOmuvnFIC58lvz3wkTTBS1Cvxhl9HREzriR/R +FM/5djq1YCLXiP1nSJdIPeXsaQGPQC9/s7PeSCKUNfK73B1x/aF/gLjVwj2jLU7JXhX 6EhpxWGYnT85OFJ1eNkOdwzgie6FuZN3RDokNWH3FKP1j6e6QxUSLLCPyhFM/W4DmjtN L09UW+CYVVtY3t1VBvTfarEt4V5qFDcjgdAFTrODuH4PJNOHQrAJav39Ft9UWObIjhK3 jGzA== 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=1e/VYWgZxHoyycezlGx0+zNMTf+Ar1q2pDE3AU+q2B4=; b=jQOt2aC98wZcleIU7TmXsDFcllv4kRppvvgRBVNRnP4Vrb+0Tsfzp/+QIa7MreSZ0e G7lI3BRiUsm+pg/53a2zDR+mAYFqgmnCBsvvbHxMJ0cSkkqapgqJ4gJ7b5JP/VqNotg0 S9l+kJWMicjBjVa2JtC5WKMG4NxM1xue/JKUo4+Pu4OztcC0G6OY1dYgkrHfRVekhrTG fpiJtYJcFzWajypH3xYoAGoFIYd2MDhV1jf1tayBa4ajBwDvsNP6Kg+rExbkxmJr2jGf VI/8jEsgL8l8SNG+0lZC0lj2oA8H150DuA+tHRZjx54ymxVNDVh9NTlT7IPRiY/yEDxn IofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ntx7ZeFj; 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 dm25si322290edb.238.2020.11.10.17.22.39; Tue, 10 Nov 2020 17:23:08 -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=Ntx7ZeFj; 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 S1732608AbgKKBRW (ORCPT + 99 others); Tue, 10 Nov 2020 20:17:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732586AbgKKBPg (ORCPT ); Tue, 10 Nov 2020 20:15:36 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C1AC0613D1; Tue, 10 Nov 2020 17:15:36 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id s8so708276wrw.10; Tue, 10 Nov 2020 17:15:36 -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=1e/VYWgZxHoyycezlGx0+zNMTf+Ar1q2pDE3AU+q2B4=; b=Ntx7ZeFjnTLoZ7J8oLjNcCFDoPBW4C5PNkct/9BX0yPgUHnj1t705oKvKLsOLkqYzW CK67X5JEuIk+DIDAlUjSfCVfq8mtpGNXEfe7hK2tLBD8kBwCRr86GMPqxlQBoVX6/Wat UekFb/FL5BFeVLuEE5QylQmc27TAjgFF8roBBGCVnMEQIA+CVv5IfJq9AVaT+BQaUZYT Gd9cN+/jJGxf5QB7BHEfps/Q4Je+7yzw0U0dzjE3C2v/IpUDpcFOdBCekq+97nl2kdf1 J4cv2MOo4FLbMlPfNX2FF+ywKahFTCkBtEgDATLeOb28PBj9npnNj2qno6RmvCyHH02i zp5w== 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=1e/VYWgZxHoyycezlGx0+zNMTf+Ar1q2pDE3AU+q2B4=; b=UpX3keQ7hicyeIpU7pNm2OKD/LEv+owCtF0u2ZC6Uk4JnPPZqXCUt9w0c6fEfDJRfQ W1tIor1YIMs4tEpuE1R9z8j/6r10t0WA4VKNZizLIzdDqYuQCpt3Mg9h8hMunbD26CHV zKXU2OvsO8DgE4yJ2CAij/adgDhciU1vwU3n/1MupR/TSsSeSwPkYmvaki40eA+emq5A JIkQqT53DVJnKnvtqz7t4p+8Pg35O723byNGGghd+Zi/awMkWQ577PKDquuOPjEg2aVb QmFQtwFFbtw0r85NvKEP8OOF36LYK5dNvYWaoSIgMMKkcjWMQ2RiPKdKfqdOkyK05BEq nJkA== X-Gm-Message-State: AOAM533ppdTAKJ9Q0sAIoGxNJ1sv4uj7NvA7qOI1vfrSXL7hEU+rCrQA 8NRE9Lu2SjlfN/9JErY1Vqk= X-Received: by 2002:adf:f4c9:: with SMTP id h9mr25752756wrp.332.1605057334852; Tue, 10 Nov 2020 17:15:34 -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 g131sm564329wma.35.2020.11.10.17.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 17:15:34 -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 v8 15/26] drm/tegra: dc: Extend debug stats with total number of events Date: Wed, 11 Nov 2020 04:14:45 +0300 Message-Id: <20201111011456.7875-16-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201111011456.7875-1-digetx@gmail.com> References: <20201111011456.7875-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 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 { -- 2.29.2