From patchwork Tue Sep 12 15:11:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9949421 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 DA8516024A for ; Tue, 12 Sep 2017 15:13:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2E5286EF for ; Tue, 12 Sep 2017 15:13:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C222B28F9C; Tue, 12 Sep 2017 15:13:46 +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 5C88D286EF for ; Tue, 12 Sep 2017 15:13:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 640E16E671; Tue, 12 Sep 2017 15:13:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE5146E036; Tue, 12 Sep 2017 15:13:38 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id n64so6407272wrb.2; Tue, 12 Sep 2017 08:13:38 -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=8VGD1ZZTX3BFjC8KlKqSeiC/2FilYCwnJU5dBQJ55ck=; b=pHHrrAX6jPUfDVikD98ABOFEzE7Q8pldDNzYceRgho+U6GYuxtM4bpunbgiq9o6C75 fTBYqGKkqmk+HkoikYK4J1daw+8zp+XAnNX9+RE2leZoXwEm0u1EDtJiDA14gaBWU6il jdaifgopFcaLhZ1ydFtc1FpfkXVMNY+tH2LvLu9jt2C9OpOwujxCPknOzmgjWE7C++7t gKUvArnLf7ppFgVljKVMCSOeHbApFz3vVFfjkuEyycjY6P3v13ttmcF3uurv9bUb4GBF mReO5cKc5Mlh4SoEOvFF0RIwRCP5U8zAGgnfc01boMOPY7q0pJXqfVN20qdnTbBsHRaP SrKQ== 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=8VGD1ZZTX3BFjC8KlKqSeiC/2FilYCwnJU5dBQJ55ck=; b=Tb9T84Kh/kXD/jVakjncSVT/7f06qbuhIe/i6tSIxSRfcdlMxMobVdN01jaUc02RJt edMf7ET4MvSkJru0ri0a3dac5Q3ZNAlX27z4qU2ujeecySz/fHZxl/Fzeb2m1NFBBOE2 YFX6r7jj5UYLnWoQP4G7eVxNy/QBtV4gkYLtbZCc9+l9PuMQDYnizVVH5Th5nVnzQ97Z MBmYzg7LTynbkN8R5iOLBajW6iz81n7Cpw1EaVpTHtsmxVmL3ZJNCkN0KwHg2+WU/ZIy YXrOdamvSnae7GzFEXZ9s2qZgjFJsyahBpKj0NLfl9MI0UxyRhXZOm3PAp0YItYkMXtT cGXQ== X-Gm-Message-State: AHPjjUhRqrOjxDD1KquhzJNIMndNLBaMeuxFfVA/stjjqAwY261WdbQz n8SHqSiid6KWquaQ X-Google-Smtp-Source: AOwi7QCN6rorRAeyyj87x/3Ayno8YgzYG187WHr93DRQQ2H2lKf/p4rPbxqakZGbvmdIvFxm3IsG3g== X-Received: by 10.223.135.66 with SMTP id 2mr12274660wrz.208.1505229217076; Tue, 12 Sep 2017 08:13:37 -0700 (PDT) Received: from localhost.localdomain (91-115-35-97.adsl.highway.telekom.at. [91.115.35.97]) by smtp.gmail.com with ESMTPSA id 110sm6593819wra.39.2017.09.12.08.13.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Sep 2017 08:13:35 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V4 13/23] drm/etnaviv: add HI perf domain Date: Tue, 12 Sep 2017 17:11:45 +0200 Message-Id: <20170912151155.4603-14-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170912151155.4603-1-christian.gmeiner@gmail.com> References: <20170912151155.4603-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 41e12f2a1dbd..212e1cee61fa 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,