From patchwork Fri Aug 25 09:07:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9921461 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 4B67B603FA for ; Fri, 25 Aug 2017 09:08:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F97B27F4B for ; Fri, 25 Aug 2017 09:08:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32BE627F82; Fri, 25 Aug 2017 09:08:57 +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 72AF327CF9 for ; Fri, 25 Aug 2017 09:08:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4D426E810; Fri, 25 Aug 2017 09:07:53 +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 1FEE16E810; Fri, 25 Aug 2017 09:07:52 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id e67so1947631wmd.0; Fri, 25 Aug 2017 02:07:52 -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=TwtFoJhjEQZ3u2HJ8OsLdtA6HnfPoFHFf/kzi8e7kjc=; b=UkIyh3eDaN/geJIDB5FuYwTe9hsj9AWXw3hSXhQT1LBOnptLwwuPQr7M8hAWXMBLX/ 5ZwTkH1oT1289QF3tPlM5O3r98DGUmULAa6S2v7rtkAwmxxgDu8l7FGWLMQbINQbgZ5D UPk/1MX5PDltHD1pJpgw9gSZcNvJHFxYmAqtjk35TBuDp7iDTGq727WAEUxgdE4vMiPF o1Q8+hL4BDbtlN/iiY3cHGdC7EC6eLtn1NKJDw8hS5QMaUKiG9/bSJ/ak51s0ZCRGdJz 2aTsxf1+3sdltb9sWNi4VsNietUDmB0cEqdngdEAZW3scbJGGnuBPI66QaQgYxMqQaUX F4pA== 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=TwtFoJhjEQZ3u2HJ8OsLdtA6HnfPoFHFf/kzi8e7kjc=; b=qd9dbqlwqs4Op+7ScGUkl3MAbdFZoOZp4+EgGQk95cTD7z9L5GBJz9bxX/8NnNvJPg iLwjr0P9LQKS/PlxqNJ5dcDYvc2o5+NLHiBtjuHcW3RVD3xe32TClUhd1LSHsTiTFVCt D45++btOTBZG5f3EWjt4O4oVW6EM2qQv1tu7UokGASzxkClGoEesLCUkR6xlMrXYEY3b YYkiPTfD9pBOc1MlgIDHCouA+kqSobTIf3Qwer0+tpSyq5Xt6CVtVjAl8GJz85IWyYMU EclHzgE0fJ1ak01eK5W5txmX9725xVmOxdQHaoV2ToZ5yVmNNZPmcu5HBEzGp5ittt7A rEBA== X-Gm-Message-State: AHYfb5j+eoZZwaxLog8usbnU7EAOu9boaoeoEaqN6IwKvKVOkfoUTOUj BuNEVv3igMH89ghh X-Received: by 10.28.164.2 with SMTP id n2mr795867wme.88.1503652070478; Fri, 25 Aug 2017 02:07:50 -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.07.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 02:07:49 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 09/23] drm/etnaviv: add performance monitor request processing Date: Fri, 25 Aug 2017 11:07:08 +0200 Message-Id: <20170825090722.14745-10-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 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 b8dc5faa6a07..a8518bd4fbf6 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 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__ */