From patchwork Tue Sep 12 15:11:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9949411 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 0D8236024A for ; Tue, 12 Sep 2017 15:13:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0001E286EF for ; Tue, 12 Sep 2017 15:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8F5628F9C; Tue, 12 Sep 2017 15:13:21 +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 A776F286EF for ; Tue, 12 Sep 2017 15:13:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B54B6E674; Tue, 12 Sep 2017 15:13:14 +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 6371A6E673; Tue, 12 Sep 2017 15:13:12 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id r136so121174wmf.3; Tue, 12 Sep 2017 08:13:12 -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=DDxQfoG6P4kS7xj1PsLJ4JzXWckumVmi8b96PRD2ojk=; b=tfCast3RtxU3iuXoG6suU0PsD97bzyxz9GIB2N1qXRAPvFIW4xJ3dt63bvWmsJ8B87 FC4XAlCKlhL3Ok6qhU4sR2yHAYL7ohlH1gYIuEz3OOclwYHoNuafPNE1oY4gxu2erkGc VVOiV5f8auGA/RGPhv6FUD8eLhG7Ylrm+s7RzSMyRN5kWIz9If4G+jiGlMSszblilstZ poAueiGZffuw/6oiYeOIB8Z1zDJ2RAgwcay5+mXM+dD7DireZvI0rx1JSU8qdsY2rYBE 59e0ZDeasoND39tLhFKKrZMNPjsxEcuWF9eeRvsiRM2loGX4+w9S0DS+bppn+BEFBrx0 VxhQ== 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=DDxQfoG6P4kS7xj1PsLJ4JzXWckumVmi8b96PRD2ojk=; b=g2+Q7XXoUA+YFPjZzL3NYuOPL0aU/BldEmZbNLA5ekXP+eIlfAvGXVrq37MtPBzmzE q1o1VXka6Zq+SrAoFtUwKSVVTmNPlV0j6QP2RDAyxungavO6N5K5zkHtI0mIjifmNWYZ KbgUkZH4G0VON1FOVbcMy6kSWLZrrULVwO84lVNTTpuOVGOq9H2FpPFximEwhd7MBOCe u9TJZ18WzPw7jaqGTqmYAZbliXlBMw5ql+KOkPiO9hIMTb+Mg2YdGE4O72KOyVY0Pvlf vyAxy/RlC15EdeKskpbUOG9o60FtNyb/t2D1QHoUyJ9Lauc1+DdJQTot4o+y1bQoTFww rOrA== X-Gm-Message-State: AHPjjUhuNP9CzX6NjoI8Dv7KC5qFy2vj2XrQnsnotuX/Kb8P5RDzmgoN c7SVIMAGKA1+f7m6 X-Google-Smtp-Source: AOwi7QAYFOopkrGp9t4D2vqDJ00BQ7W+2T5W5T0uz3CgXa+5w09n8Fmg9o5d78YZbHQCsJmxga/SyQ== X-Received: by 10.28.59.133 with SMTP id i127mr128518wma.154.1505229190536; Tue, 12 Sep 2017 08:13:10 -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.12.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Sep 2017 08:13:09 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V4 09/23] drm/etnaviv: add performance monitor request processing Date: Tue, 12 Sep 2017 17:11:41 +0200 Message-Id: <20170912151155.4603-10-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 | 16 ++++++++++++++++ drivers/gpu/drm/etnaviv/etnaviv_perfmon.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c index 3ecedeed87bd..41e12f2a1dbd 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c @@ -16,6 +16,7 @@ */ #include "etnaviv_gpu.h" +#include "etnaviv_perfmon.h" struct etnaviv_pm_domain; @@ -98,3 +99,18 @@ int etnaviv_pm_req_validate(const struct drm_etnaviv_gem_submit_pmr *r) return 0; } + +void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, + const struct etnaviv_perfmon_request *pmr) +{ + const struct etnaviv_pm_domain *dom; + const struct etnaviv_pm_signal *sig; + u32 *bo = pmr->bo_vma; + u32 val; + + dom = &doms[pmr->domain]; + sig = &dom->signal[pmr->signal]; + val = sig->sample(gpu, dom, sig); + + *(bo + pmr->offset) = val; +} diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.h b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.h index f20b69c942fc..f9c8d7ec8a9b 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.h +++ b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.h @@ -42,4 +42,7 @@ int etnaviv_pm_query_sig(struct etnaviv_gpu *gpu, int etnaviv_pm_req_validate(const struct drm_etnaviv_gem_submit_pmr *r); +void etnaviv_perfmon_process(struct etnaviv_gpu *gpu, + const struct etnaviv_perfmon_request *pmr); + #endif /* __ETNAVIV_PERFMON_H__ */