From patchwork Fri Jun 9 10:26:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9777941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66E1560350 for ; Fri, 9 Jun 2017 10:26:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56E8D285E8 for ; Fri, 9 Jun 2017 10:26:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BC9028604; Fri, 9 Jun 2017 10:26:38 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 0CCBC285E8 for ; Fri, 9 Jun 2017 10:26:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B13176E5AD; Fri, 9 Jun 2017 10:26:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC8186E5A5; Fri, 9 Jun 2017 10:26:29 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id x3so11071665wme.0; Fri, 09 Jun 2017 03:26:29 -0700 (PDT) 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; bh=ucv76sPA1t0LvlnjuEVjudQMkHPL7OfCXJD5BMoLd6g=; b=nik8/QlzShqAXeXHnm+XikrZmkR9rmsDcoP1c6AtkTG9gydN8cmGs63YpVcRDjb6iq fGvequx6oGqU4G+524ygxKZauPQE3bJ7o0Wdu592Fyo8NM4011aRXzeNIvaxaNlVlpMv gzMwHgJWI2wW2x7ls7iKB5e4msc3PisD08wh0UadK7i5Dgu5uOde8udIzSPcutkm0LIn ZYllb109rI3o0Q4qoVbD0/xGRU36vaxT7SQHjT17wUJiVC979i33elaBoNGXsKLlAdIT N1x3BVa2+qeujg81nYItRF+s9Wc3Mj4/1unHCGS/0yddTyCfXmAMjuKTO/VibEhxjrKm /4GQ== 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; bh=ucv76sPA1t0LvlnjuEVjudQMkHPL7OfCXJD5BMoLd6g=; b=aKj5Cj59D6KGcSqbT+geJBOUv0lYM8NChGEbiPiW5wc70ABeGP6uCmLDSuFyC58FgS DVMI3BJQj9jU+Ds2VnW9DEgBZrGILOlmJTxiMXrGbJiVxa7d91HODT0HzhAdn/+j7jEW l7hWq8q/hAN1zrjIrZvazbUY5SpR2Dw20NRyDJtmnhPheP+LoDCYbGhFwKbp7EP3zqut 7UZqBPe7/gn4j5tVMwSBBrIkDcwnMQSZlWNYwF73/W7GeVkZVX0M2RJvvb2dVV5IZFgu omPQQyLRI0oZxK23eQW6pDVqOuIizLZhecT1xxQOZ62uMGpEeEt5BmK8K5w1S40q23QB IloQ== X-Gm-Message-State: AODbwcBljUUsHMyYp7D393dXpdTNG98IOiHPi3H0VtvkSUVm19kPwRia 5AqhmMODAp1BCHcykUU= X-Received: by 10.28.155.65 with SMTP id d62mr7321516wme.78.1497003988116; Fri, 09 Jun 2017 03:26:28 -0700 (PDT) Received: from localhost.localdomain (213-147-162-44.nat.highway.bob.at. [213.147.162.44]) by smtp.gmail.com with ESMTPSA id s95sm879945wrc.13.2017.06.09.03.26.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 03:26:27 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 12/21] drm/etnaviv: add PE perf domain Date: Fri, 9 Jun 2017 12:26:09 +0200 Message-Id: <20170609102618.3195-3-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609102618.3195-1-christian.gmeiner@gmail.com> References: <20170609102618.3195-1-christian.gmeiner@gmail.com> Cc: linux+etnaviv@armlinux.org.uk, etnaviv@lists.freedesktop.org, cphealy@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We need to iterate over all pixel pipelines to get overall value. Signed-off-by: Christian Gmeiner --- drivers/gpu/drm/etnaviv/etnaviv_perfmon.c | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c index 9079ffc..3bda13c 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c @@ -57,6 +57,25 @@ static u32 perf_reg_read(struct etnaviv_gpu *gpu, return gpu_read(gpu, domain->profile_read); } +static u32 pipe_reg_read(struct etnaviv_gpu *gpu, + const struct etnaviv_pm_domain *domain, + const struct etnaviv_pm_signal *signal) +{ + u32 clock = gpu_read(gpu, VIVS_HI_CLOCK_CONTROL); + u32 value = 0; + unsigned i; + + for (i = 0; i < gpu->identity.pixel_pipes; i++) { + clock &= ~(VIVS_HI_CLOCK_CONTROL_DEBUG_PIXEL_PIPE__MASK); + clock |= VIVS_HI_CLOCK_CONTROL_DEBUG_PIXEL_PIPE(i); + gpu_write(gpu, VIVS_HI_CLOCK_CONTROL, clock); + gpu_write(gpu, domain->profile_config, signal->data); + value += gpu_read(gpu, domain->profile_read); + } + + return value; +} + static const struct etnaviv_pm_domain doms[] = { { .name = "HI", @@ -90,6 +109,39 @@ static const struct etnaviv_pm_domain doms[] = { &perf_reg_read } } + }, + { + .name = "PE", + .profile_read = VIVS_MC_PROFILE_PE_READ, + .profile_config = VIVS_MC_PROFILE_CONFIG0, + .nr_signals = 5, + .signal = (const struct etnaviv_pm_signal[]) { + { + "PIXEL_COUNT_KILLED_BY_COLOR_PIPE", + VIVS_MC_PROFILE_CONFIG0_PE_PIXEL_COUNT_KILLED_BY_COLOR_PIPE, + &pipe_reg_read + }, + { + "PIXEL_COUNT_KILLED_BY_DEPTH_PIPE", + VIVS_MC_PROFILE_CONFIG0_PE_PIXEL_COUNT_KILLED_BY_DEPTH_PIPE, + &pipe_reg_read + }, + { + "PIXEL_COUNT_DRAWN_BY_COLOR_PIPE", + VIVS_MC_PROFILE_CONFIG0_PE_PIXEL_COUNT_DRAWN_BY_COLOR_PIPE, + &pipe_reg_read + }, + { + "PIXEL_COUNT_DRAWN_BY_DEPTH_PIPE", + VIVS_MC_PROFILE_CONFIG0_PE_PIXEL_COUNT_DRAWN_BY_DEPTH_PIPE, + &pipe_reg_read + }, + { + "PIXELS_RENDERED_2D", + VIVS_MC_PROFILE_CONFIG0_PE_PIXELS_RENDERED_2D, + &pipe_reg_read + } + } } };