From patchwork Fri Jun 9 10:26:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9777951 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 710B660350 for ; Fri, 9 Jun 2017 10:26:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61662285E8 for ; Fri, 9 Jun 2017 10:26:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 564E828604; Fri, 9 Jun 2017 10:26:56 +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 EC3E6285E8 for ; Fri, 9 Jun 2017 10:26:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF8AE6E5CF; Fri, 9 Jun 2017 10:26:42 +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 D99E26E5CD; Fri, 9 Jun 2017 10:26:40 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id 70so11055793wme.1; Fri, 09 Jun 2017 03:26:40 -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=f3HnneL2hY1KvdutLAWzUlU7bgTetWnaMx0OdUdd/VA=; b=rosgSpYzdoSH/YFdAbtPR/iyp46mjACOl2q6/dIPq+3vGNC8Hg01t3Jj5EiysTWSVy SYsZm5kVXIDIv3wV4IhfKZ0SY77J6NN7QU0jvTVNNHUVld5rE8cQcl6tEZ/+pj3D18Hg sb+1ApM6DQl0/F87vACtAd4PsDmWoKJK4LHRyuC2Zn8jrhZL8K4ncPLjra/TvaEnMKyk AhqEkGqKEtCQgTjcCJXJExvnfplhx9DtqDmaLPQEnDU1qgixEdlBY2c486Lk4xVbbRWq cs4PdXwno39qii/ptVxKaY3YUaF0Tkoz44mo5AAU3cGqwFnk0NJDNOOWRGPU7HOF0yqV srYw== 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=f3HnneL2hY1KvdutLAWzUlU7bgTetWnaMx0OdUdd/VA=; b=krFlRdM/ImjGY1oKbvuhmEYJlHq3NN/RdhDVxXdNxoh7hNP2Pc7/XFhclW8+6ONIW1 zqxnZjQEH22YrzIDti6SbPPGKy4dphZhzjLfhBmrIDjND2+Fgxlr9YGDFaHH4gkcNLzQ BGsKGodEVobL67ORbhSCyyH94ZDMVuzwK9SSyBOv3gAE1/CSJeQPADSzz2cmkM41u6zs F1DT3DeZRuf9exJsndpqZrWahtZlsz7vgmMXa7KOStCu+rCZTF92AG/KGIsHMn1bZdUb wQLAuN5w61w4Vujffg2qOYnlC72kwrdWPR3UlDNpPH346ka2bT/GDCR0L/8N0h9k9ciO Af2Q== X-Gm-Message-State: AODbwcA5wY7YN2NgTSZyoDI/5vK/4xKwXCKxJOy7FAQdezpU2xqtWZUI SQv9uM4ippl7R9HvcVk= X-Received: by 10.28.99.84 with SMTP id x81mr7082893wmb.87.1497003999282; Fri, 09 Jun 2017 03:26:39 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 03:26:38 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 19/21] drm/etnaviv: need to disable clock gating when doing profiling Date: Fri, 9 Jun 2017 12:26:16 +0200 Message-Id: <20170609102618.3195-10-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 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 2e9f031..1e23472 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1329,6 +1329,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); } @@ -1336,6 +1343,7 @@ static void sync_point_perfmon_sample_post(struct etnaviv_gpu *gpu, struct etnaviv_event *event) { unsigned int i; + u32 val; sync_point_perfmon_sample(gpu, event, ETNA_PM_PROCESS_POST); @@ -1344,6 +1352,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); }