From patchwork Fri Jun 9 10:21: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: 9777925 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 BDAA9603B4 for ; Fri, 9 Jun 2017 10:22:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE168285DD for ; Fri, 9 Jun 2017 10:22:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3259285E7; Fri, 9 Jun 2017 10:22:08 +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 504C4285DD for ; Fri, 9 Jun 2017 10:22:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 110496E5A9; Fri, 9 Jun 2017 10:21:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 748286E5BC; Fri, 9 Jun 2017 10:21:51 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id d17so6195110wme.3; Fri, 09 Jun 2017 03:21:51 -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=2quJv3jVylOzgX9mLnYGhs5n3KQdWqtZZzs5YQlX0qs=; b=NUwNNLqNDUb22LoLTkrrHGp5GoXOpEzNkyEWxGp++G/sEHvC3H8iWpHGxlAPrRByDb EmVy7ydJw5vbOiUnoFJjtshgcyOtOztUXNrepD/sBExQAui9f13pjtV8gMBPQ3xt7ytt lxVfr8+ky6g2/Kl6EC7prKQySlpKMM6+P7UAePby6jKhheJF316tCjkeQNA/o/8TzNH5 zat+tmx+CLCtVFxacOSYuWesbll2GdDGYdSTP/ucSMPIsaFi0Pn8TIqGjZi+Medish5L nXNR84ZfIQAgrje+MW3CTTM933CZWgmZOStN0QQNDIEwtg6GWFzBLOOW4TkBQ7Oq5weB HQVQ== 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=2quJv3jVylOzgX9mLnYGhs5n3KQdWqtZZzs5YQlX0qs=; b=K3YCQrdEDpaeHOLGw7PL9UMJw5NjxAOwJwx7gVvLqV+uVR2GJ07Yg3sAu5zaFSBXEl CRdA3RVyhoGuqDHa/c/TCiYwVH3Z/s4FwSclWsaksFJlrNDkC1ntgN1tLrM0hEo2qBmo zmegJU7irrzZ/UfhUoPs1jVEFa/aAyEtR1yGpgXjJfPpuwbi6ZDMzikR2TXsGKtZzJY6 FO3uywMq5T1Sr8ErK/Fm/yUzuluVapOqAqpnWll4B1eobN4vtvefKcDTidOx+YG85OMb xbos4NfOvQa+8N5VUqnVRDv9EA8DdkufT9lB1/Zs+fNsj3zKliYAsnFXJw0BUqIYq2Gw iSww== X-Gm-Message-State: AODbwcAHtsj33jkkAJfJZ9GhxFEQ2F7773ujXIkqaj9RxbzFMUbchFSG y1TRfdNwIlVmwe7Lg/c= X-Received: by 10.28.175.84 with SMTP id y81mr7182063wme.25.1497003709924; Fri, 09 Jun 2017 03:21:49 -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 w52sm806952wrc.33.2017.06.09.03.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 03:21:49 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 07/21] drm/etnaviv: add performance monitor request processing Date: Fri, 9 Jun 2017 12:21:21 +0200 Message-Id: <20170609102123.2417-8-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170609102123.2417-1-christian.gmeiner@gmail.com> References: <20170609102123.2417-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 The signal gets sampled and stored in a bo at defined bo. 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 b8dc5fa..a8518bd 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; @@ -94,3 +95,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 f20b69c..f9c8d7e 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__ */