From patchwork Sat Jul 22 09:53:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9858079 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 760D1600F5 for ; Sat, 22 Jul 2017 09:56:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F8E1285ED for ; Sat, 22 Jul 2017 09:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5479C285F5; Sat, 22 Jul 2017 09:56:51 +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 EAE24285ED for ; Sat, 22 Jul 2017 09:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66F2A6E1D2; Sat, 22 Jul 2017 09:55:42 +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 B34AF6E940; Sat, 22 Jul 2017 09:55:35 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id p12so5779365wrc.5; Sat, 22 Jul 2017 02:55:35 -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=P/JGG5H3EcBE3VCBuwGCbqXTik66BvlDcdkRbdEWk1I=; b=i1h+3/R7vrz3iH0Ng6ItGt9JqNBx3JmSDtEpsaOx9+9Wmc0c8KDq3NVa2oo/dzUTn3 1xCUp+JgOk7Ov3MQsNVRkJXKmfUElcFKu696sn2RQrOih4jD60uJ4Z0iGngKZfH3Loju HzC3Hkplrw531SSi8BsRW7P7NKUH+hYHbasllZCC5CX1NIplTNDDc7GsVQHmzr4wiO2j FEfPC0tgPENXz7jpaKS/UbaH96v64XgLP5yfMg2/bkZJEuu2y8e4xDssfKsRbun6JTgD Cn733xgC0Qvke0h19Xq95ZoOYbecxoNEMhuosaePNmSXTqc04aF3f6teX/tY8edcFBWd VtSQ== 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=P/JGG5H3EcBE3VCBuwGCbqXTik66BvlDcdkRbdEWk1I=; b=IguyMzh4WqfPT4jlnYWU15yrm8aSKX7VkJqvpQkRDMr2SF624oDMIeVBJwIJpNWB9a +BMZ7Q51EUNlen5rTgMBIrizWLz5rw8YZ62LA7QDABi1Xwg9I9QxV/+bqiSVsMaXPW1v Pxx0bSPSl5GSXgpAC1STCwbGay0jdUbtur0yz4RdNgf7GcW3VqMaqrJmT5bvcw/wdJGY miUHSorKK7/aASLIDoY4uB1B4rBQCd31cuvL2hgNvXnlU0n02dvJqxYmckj0/RWOlBiy BzgD4sz9KnLGC6KbGxTdw2LcI+SvKiuEurF0MsxEsIZcnbJ0L6pQPPIrJ0R2E0YEAZbh R/RA== X-Gm-Message-State: AIVw112XgmytkRdHoEl/wPalbtgTcpUHRl9wOYBjFoY8OwSzMSqpIKfd JD7t+ti3/a2Ilw9A X-Received: by 10.223.180.88 with SMTP id v24mr11633190wrd.29.1500717334112; Sat, 22 Jul 2017 02:55:34 -0700 (PDT) Received: from cp720.fritz.box (91-114-193-248.adsl.highway.telekom.at. [91.114.193.248]) by smtp.gmail.com with ESMTPSA id z192sm2544673wmz.44.2017.07.22.02.55.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Jul 2017 02:55:33 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V2 21/23] drm/etnaviv: need to disable clock gating when doing profiling Date: Sat, 22 Jul 2017 11:53:21 +0200 Message-Id: <20170722095323.9964-22-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170722095323.9964-1-christian.gmeiner@gmail.com> References: <20170722095323.9964-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 As done by Vivante kernel driver. Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index c176781788ac..5964ee36d93b 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1335,6 +1335,13 @@ static void sync_point_perfmon_sample(struct etnaviv_gpu *gpu, static void sync_point_perfmon_sample_pre(struct etnaviv_gpu *gpu, struct etnaviv_event *event) { + u32 val; + + /* disable clock gating */ + val = gpu_read(gpu, VIVS_PM_POWER_CONTROLS); + val &= ~VIVS_PM_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING; + gpu_write(gpu, VIVS_PM_POWER_CONTROLS, val); + sync_point_perfmon_sample(gpu, event, ETNA_PM_PROCESS_PRE); } @@ -1343,6 +1350,7 @@ static void sync_point_perfmon_sample_post(struct etnaviv_gpu *gpu, { const struct etnaviv_cmdbuf *cmdbuf = event->cmdbuf; unsigned int i; + u32 val; sync_point_perfmon_sample(gpu, event, ETNA_PM_PROCESS_POST); @@ -1351,6 +1359,11 @@ static void sync_point_perfmon_sample_post(struct etnaviv_gpu *gpu, *pmr->bo_vma = pmr->sequence; } + + /* enable clock gating */ + val = gpu_read(gpu, VIVS_PM_POWER_CONTROLS); + val |= VIVS_PM_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING; + gpu_write(gpu, VIVS_PM_POWER_CONTROLS, val); }