From patchwork Fri Jun 9 10:26:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9777939 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 354FE60350 for ; Fri, 9 Jun 2017 10:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2597A285E8 for ; Fri, 9 Jun 2017 10:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A84028604; Fri, 9 Jun 2017 10:26:36 +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 D0FCA285E8 for ; Fri, 9 Jun 2017 10:26:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 914466E5AC; 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-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A91F6E59E; Fri, 9 Jun 2017 10:26:28 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id e23so5925968wre.3; Fri, 09 Jun 2017 03:26:28 -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=SZ27B2KErgAjQzgVUAQ7Yx4OFG708mLpMWf+7MYuSeM=; b=Sktgq2MKFTXhZN/YowsXb99HVR5eAGIWrgXqe1uduRHFYKQoTU7gsUTKUU4eME9e7/ BXWf5qw7RI29qDR8rnfRHNhrHkpqmSQckUKk39VMPXSkvzeVbxX3z6Nnx5JuAw88D+3Y /DjLjcAQZRyQ8AyHTkNjtd3ym04T8mRPbNmUTfbJz1+697Q2o/1+s89o62EUR9oPo2r9 LIhVGJGeQdb7s63H3FkhZ6Fgut+qw3XogLcUtK03ESUeCStqv1zafPQXo0PHnC5D85Gv 1jLqlpTBaBSsaTz3gdXLucHegWmfxIyxCnWnG4fBQNsA82M6SzxuezuSy2okdcGjRYHK 4rUA== 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=SZ27B2KErgAjQzgVUAQ7Yx4OFG708mLpMWf+7MYuSeM=; b=p1aIOoIOii3p53tbD0fJV7FJOJPBvWm7J2OP9ny0EuxyxPirgFB0sTlfyDLTHEZdTC TCc9PqnWKHFMUMC43roahtGR1djrmI1qmAPq1nvws+z7/VLnSmVFMjwyBUx2H+YBLVR6 BAM/9vUAN3jmLfytE+raOqD10Xyq7Z4zKk0tyvlSpsg0BoJOFbPNUTD1l9rJ5JC63VVv g1bUPVlH1QLxItB4e7S/ZE1oSeTUcp2kgiPoqVr0RgX5VEEdIcJc79L3A9LVIRZkgr3o 0d4/pNwekPk5I9Ail8CGzfxk7PlSzqXl/QOC5/t+SgZNqb6rvq0ikhkK5DKFb/8WEgtO 2brw== X-Gm-Message-State: AODbwcCCR/YpLaNQ98RfhvsKgryBWsowU+Fh+kgoLar+Dx1w86hzCb5G G+euJ/7eJlxC4lxAQao= X-Received: by 10.223.144.134 with SMTP id i6mr20083458wri.92.1497003986630; Fri, 09 Jun 2017 03:26:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 03:26:25 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/21] drm/etnaviv: add HI perf domain Date: Fri, 9 Jun 2017 12:26:08 +0200 Message-Id: <20170609102618.3195-2-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 Signed-off-by: Christian Gmeiner --- drivers/gpu/drm/etnaviv/etnaviv_perfmon.c | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c index a8518bd..9079ffc 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c @@ -17,6 +17,7 @@ #include "etnaviv_gpu.h" #include "etnaviv_perfmon.h" +#include "state_hi.xml.h" struct etnaviv_pm_domain; @@ -31,11 +32,65 @@ struct etnaviv_pm_signal { struct etnaviv_pm_domain { char name[64]; + + /* profile register */ + u32 profile_read; + u32 profile_config; + u8 nr_signals; const struct etnaviv_pm_signal *signal; }; +static u32 simple_reg_read(struct etnaviv_gpu *gpu, + const struct etnaviv_pm_domain *domain, + const struct etnaviv_pm_signal *signal) +{ + return gpu_read(gpu, signal->data); +} + +static u32 perf_reg_read(struct etnaviv_gpu *gpu, + const struct etnaviv_pm_domain *domain, + const struct etnaviv_pm_signal *signal) +{ + gpu_write(gpu, domain->profile_config, signal->data); + + return gpu_read(gpu, domain->profile_read); +} + static const struct etnaviv_pm_domain doms[] = { + { + .name = "HI", + .profile_read = VIVS_MC_PROFILE_HI_READ, + .profile_config = VIVS_MC_PROFILE_CONFIG2, + .nr_signals = 5, + .signal = (const struct etnaviv_pm_signal[]) { + { + "TOTAL_CYCLES", + VIVS_HI_PROFILE_TOTAL_CYCLES, + &simple_reg_read + }, + { + "IDLE_CYCLES", + VIVS_HI_PROFILE_IDLE_CYCLES, + &simple_reg_read + }, + { + "AXI_CYCLES_READ_REQUEST_STALLED", + VIVS_MC_PROFILE_CONFIG2_HI_AXI_CYCLES_READ_REQUEST_STALLED, + &perf_reg_read + }, + { + "AXI_CYCLES_WRITE_REQUEST_STALLED", + VIVS_MC_PROFILE_CONFIG2_HI_AXI_CYCLES_WRITE_REQUEST_STALLED, + &perf_reg_read + }, + { + "AXI_CYCLES_WRITE_DATA_STALLED", + VIVS_MC_PROFILE_CONFIG2_HI_AXI_CYCLES_WRITE_DATA_STALLED, + &perf_reg_read + } + } + } }; int etnaviv_pm_query_dom(struct etnaviv_gpu *gpu,