From patchwork Fri Aug 25 09:07:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9921475 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 834A660349 for ; Fri, 25 Aug 2017 09:08:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 760A827E01 for ; Fri, 25 Aug 2017 09:08:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B22B27E63; Fri, 25 Aug 2017 09:08:59 +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 2E20827E01 for ; Fri, 25 Aug 2017 09:08:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 626E46E846; Fri, 25 Aug 2017 09:08:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 906756E842; Fri, 25 Aug 2017 09:08:11 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id e67so1948505wmd.0; Fri, 25 Aug 2017 02:08:11 -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=2Rm6d4qX8WojtgSwChFiwREVxGQmpVmUkdIoLm8zoD0=; b=WqfvlrgJGrm3apew+f/956y/yguiuc49ASjWUE40SUgboas3QHHd3Z9OR27vaIu5oM oz/xnwlFZblZ7VW/YrKcnmNreFf+8hYgepEge/ZAc9w0O0PL7Kn32BOiLHVZSiRUwrWk X29dBkkVcvx46RX4nZ0QIuy67UDA9ZIWL+J+YmfyKsy+ZoCTVIZz3wRFBq7wH1xX6ufH ql/oOnyPWp19Hk0qCpP+FWg3lqIBGnMqZmI6KlMhzerafIuk0vCv+vWk7g/Kgq1DnWzJ CERIK0kYNDq7tv7PwwXKi4HRJuKFIQ0xLo6sx82S20z2uDKAigtxstY3B7vikDHfPl7e aw5Q== 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=2Rm6d4qX8WojtgSwChFiwREVxGQmpVmUkdIoLm8zoD0=; b=NAQY9VLYunXL2tyCzwzQF80UszudWyM2QVmyfG1TJx3eDJBFmClvi8xsBIUlY6n+a6 SUnjeahD6WQDAD9IZ2mlmI3PpyUT1wcz35Q5BFgfbUtt0j92Me676S6YRglm9P4joUAK 46I9Xz/98NxWmeMe39G8IJDwGCc+6+8NUayghsPVBHe+w4gRXIoJrnPsaNfGSrCX6ocx XnkB28XbgIrrBcw1+iQArv6M0U82bXLofV5SROZaCAVWy7JYJqVqTgAYwx8QqPaKDsPq muaxfQ1p/DnGWs3szmrR5ESjppnOrJxhlcxFrk0zhPyrJnSj5iBTfXZ1Ek7RfT683PJ7 3ZqA== X-Gm-Message-State: AHYfb5iQk7V9CCGPcbRI4o6whv3mN+wbbnsg+QQEAPDkqaanz4N12ywF CDeUe2bT03IOlRam X-Received: by 10.28.8.209 with SMTP id 200mr1041760wmi.112.1503652090028; Fri, 25 Aug 2017 02:08:10 -0700 (PDT) Received: from localhost.localdomain (93-82-124-36.adsl.highway.telekom.at. [93.82.124.36]) by smtp.gmail.com with ESMTPSA id 52sm5782547wrt.38.2017.08.25.02.08.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 02:08:08 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 21/23] drm/etnaviv: need to disable clock gating when doing profiling Date: Fri, 25 Aug 2017 11:07:20 +0200 Message-Id: <20170825090722.14745-22-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170825090722.14745-1-christian.gmeiner@gmail.com> References: <20170825090722.14745-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 842b6642dcd6..04acc3a64c3c 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1341,6 +1341,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); } @@ -1349,6 +1356,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); @@ -1357,6 +1365,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); }