From patchwork Fri May 24 18:16:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10962771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0F841395 for ; Mon, 27 May 2019 12:04:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D25B828B4A for ; Mon, 27 May 2019 12:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C729128B59; Mon, 27 May 2019 12:04:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BA7428B4A for ; Mon, 27 May 2019 12:04:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 636D889B48; Mon, 27 May 2019 12:03:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF6696E13D for ; Fri, 24 May 2019 18:17:39 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id w1so9505248ljw.0 for ; Fri, 24 May 2019 11:17:39 -0700 (PDT) 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=WOTPz5lNju8Uwf51eJBHGL7FhyMKmYNlaIjFWCSiGME=; b=nD/2ALPDj+YIdESxps/x7nEJxGrHzCDljLBPObn3aHPQhctPgAAK7UCJEooDS4YSSC rQFL0bG12SSgWT4cahTYahqEUHg5t15L158mamSkB2ba2kQA1IgwVt5O6szlXealxbGN P9qD5pyKqtDmyUVq20NCdkkO3FvxuUJtfBSkAYs7gM/X37cGybf1IbSYs3NXf3B9phWG sZrBZxNxZzk0Q2UPXASOb2VSWLwQNLBvQkG/zvNZWECDAKtKWgs6+QQox1yHmqv1yrMC W0VlWKObJVtqBb42vAhL2cV8UuB16Ez8QOoKp/9000Pq3pW6Enm67M/bt42y2aZpOI+L I4hA== X-Gm-Message-State: APjAAAUKQooAjVyo7ewuZHBTs28d7qm7h9Aqx7QlI5/dhZ39emhmkhGT VayK8O8SAzC0ODwz75omMXs= X-Google-Smtp-Source: APXvYqy6t/I6JgVTAG71Jqtfllh/WzeZ3qSfINCsL566Fz5VwbQfcnbzSJCKnRiWwKYjFlFFkY6rRQ== X-Received: by 2002:a2e:2c17:: with SMTP id s23mr768905ljs.214.1558721858446; Fri, 24 May 2019 11:17:38 -0700 (PDT) Received: from localhost.localdomain ([94.29.35.141]) by smtp.gmail.com with ESMTPSA id h10sm810376ljm.9.2019.05.24.11.17.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 11:17:37 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding Subject: [PATCH v2 2/3] drm/tegra: dc: Extend debug stats with total number of events Date: Fri, 24 May 2019 21:16:26 +0300 Message-Id: <20190524181627.16490-3-digetx@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190524181627.16490-1-digetx@gmail.com> References: <20190524181627.16490-1-digetx@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 27 May 2019 12:03:54 +0000 X-Mailman-Original-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=WOTPz5lNju8Uwf51eJBHGL7FhyMKmYNlaIjFWCSiGME=; b=s2ZFjGlJcmB539B/LGdP4E0zY4XNlHT0ngjGl9uhJWqjDfzwF+gU+3VB7odWc+2nvM oxqBS5Ypscym2U7Es/IkT6Om0kGInRYq3nJIxx45XMClBzFwTRx9OESoAKn6SaFRmRci eTHX2pF2bzjVp8HVrFEIfclrHSsY7VT54qTez+aWoMgdnPr2yYUQY/da+bsuXh/CeB2r kmESwe03Al0CVQKfVGEaR137jaAELYf4VlJiQfYnwaCn/smQAVdrU/vNt7+XS/6s2xh2 R136Jmbv5Z6Qc17wYcKRj4LzIrD77RCtWdKbPcTspu60gTDogFbVOb8hvYDzT5cKL9At BuGg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP I found useful to know the total number of underflow events while was working on adding support for memory bandwidth management. Currently the debug stats are getting reset after disabling CRTC, let's account the overall number of events that doesn't get reset. 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 3e13948dcdcd..e537c0d4bfdd 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1477,6 +1477,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; } @@ -1940,6 +1945,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++; } @@ -1948,6 +1954,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++; } @@ -1955,6 +1962,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++; } @@ -1962,11 +1970,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 1256dfb6b2f5..ab25157c948e 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -41,6 +41,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 {