From patchwork Fri Aug 25 09:07:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9921455 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 0264560349 for ; Fri, 25 Aug 2017 09:07:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9BCF27CF9 for ; Fri, 25 Aug 2017 09:07:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEA4527D29; Fri, 25 Aug 2017 09:07:50 +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 98AF727CF9 for ; Fri, 25 Aug 2017 09:07:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE0486E817; Fri, 25 Aug 2017 09:07:48 +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 E15756E80E; Fri, 25 Aug 2017 09:07:43 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id e67so1947278wmd.0; Fri, 25 Aug 2017 02:07:43 -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=dsIaj6pPUYOo3/SF6NOHivVru9jAW+fG5wkjdXHiIMs=; b=CWSNB8VapqgoF0oSS0z7ODkXglxWfC896cFe7+efPxEk1agJmm2bdwZpyoQR6xQp5y aAqejD/RlNe5jaNaesveFOtZqX0qOK/cPvuctw2AFUclsgsu6/X+uT1H6deUQkQQ2xYr bwcveDEFbCIkRprhp5fU0VJwipbHNuLvmCfLNKkcfgmeKGEsQvQFZDRh5YljW24WpRPQ GkMa+pvT6hnukrq8lIPI8lY0zkqlipqRhFqlUn2IMyX9Vnn+O6kHamZGL4Mgjw5OvlRy tN+dK2nH8sEAjqiuwPyR5z4WNDChX5d13eG0Q//jUuX2yZJLg2NuZf1/51TeUp7knZMd inIA== 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=dsIaj6pPUYOo3/SF6NOHivVru9jAW+fG5wkjdXHiIMs=; b=C/FRTBhKNRqh1doSlbuLkICNL8Mo1aRZ1OQkp0PaEbyNlTBer9ZHpAqZrFce4thXh/ bhlZjSfAZg1OR8abHDesuKtQMvwXxAIf1qgLZ4Rg/0HZCRMTu4UE0wBI82buiu+TWvel gKsi2dgm8JPi/O7GcACyA+YgbHcFunqhW+1AT+PhV7hq4ch0o7sjJp1gMvVcbTQKp6Ga 92s4aK9wilvq7aAP7BMYDE8bX2nI3sS4rtElIOxNgVz7CyhQSNfgwITqNrkns8ttjfWI P4EIxZs9C4TchzfdeG5fwNgtpDd9V9BNsdSjEPACMORrzm4DXQ90kEL/7KwSJ+3J5mjH X8Sg== X-Gm-Message-State: AHYfb5ie6tV554x1eK/Uo6sre3Yc7sPtOmLY5qch19tuGGd5aCGZjKe3 0tzpT/bcs4KqA5BA X-Received: by 10.28.8.209 with SMTP id 200mr1040733wmi.112.1503652062253; Fri, 25 Aug 2017 02:07:42 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 02:07:41 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 04/23] drm/etnaviv: add uapi for perfmon feature Date: Fri, 25 Aug 2017 11:07:03 +0200 Message-Id: <20170825090722.14745-5-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 Sadly we can not read any registers via command stream so we need to extend the drm_etnaviv_gem_submit struct with performance monitor requests. Those requests gets process before or after the actual submitted command stream. The Vivante kernel driver has a special ioctl to read all perfmon registers at once and return it. Changes from v1 -> v2: - use a 16 bit value for signals - fix padding issues Signed-off-by: Christian Gmeiner --- include/uapi/drm/etnaviv_drm.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h index 9e488a083389..25b4498a03fe 100644 --- a/include/uapi/drm/etnaviv_drm.h +++ b/include/uapi/drm/etnaviv_drm.h @@ -150,6 +150,19 @@ struct drm_etnaviv_gem_submit_bo { __u64 presumed; /* in/out, presumed buffer address */ }; +/* performance monitor request (pmr) */ +#define ETNA_PM_PROCESS_PRE 0x0001 +#define ETNA_PM_PROCESS_POST 0x0002 +struct drm_etnaviv_gem_submit_pmr { + __u32 flags; /* in, when to process request (ETNA_PM_PROCESS_x) */ + __u8 domain; /* in, pm domain */ + __u8 pad; + __u16 signal; /* in, pm signal */ + __u32 sequence; /* in, sequence number */ + __u32 read_offset; /* in, offset from read_bo */ + __u32 read_idx; /* in, index of read_bo buffer */ +}; + /* Each cmdstream submit consists of a table of buffers involved, and * one or more cmdstream buffers. This allows for conditional execution * (context-restore), and IB buffers needed for per tile/bin draw cmds. @@ -175,6 +188,9 @@ struct drm_etnaviv_gem_submit { __u64 stream; /* in, ptr to cmdstream */ __u32 flags; /* in, mask of ETNA_SUBMIT_x */ __s32 fence_fd; /* in/out, fence fd (see ETNA_SUBMIT_FENCE_FD_x) */ + __u64 pmrs; /* in, ptr to array of submit_pmr's */ + __u32 nr_pmrs; /* in, number of submit_pmr's */ + __u32 pad; }; /* The normal way to synchronize with the GPU is just to CPU_PREP on @@ -217,14 +233,16 @@ struct drm_etnaviv_gem_wait { struct drm_etnaviv_pm_domain { __u32 pipe; /* in */ __u8 iter; /* in/out, select pm domain at index iter */ - __u8 nr_signals; /* out, how many signals does this domain provide */ + __u8 pad; + __u16 nr_signals; /* out, how many signals does this domain provide */ char name[64]; /* out, name of domain */ }; struct drm_etnaviv_pm_signal { __u32 pipe; /* in */ __u8 domain; /* in, pm domain index */ - __u8 iter; /* in/out, select pm source at index iter */ + __u8 pad; + __u16 iter; /* in/out, select pm source at index iter */ char name[64]; /* out, name of domain */ };