From patchwork Sat Jul 22 09:53:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9858043 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 C2595600F5 for ; Sat, 22 Jul 2017 09:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB2A285ED for ; Sat, 22 Jul 2017 09:55:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1C7D285F5; Sat, 22 Jul 2017 09:55:16 +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 4AA6E285ED for ; Sat, 22 Jul 2017 09:55:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 090296E1B9; Sat, 22 Jul 2017 09:55:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D580F6E1B2; Sat, 22 Jul 2017 09:55:10 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id y67so12969263wrb.3; Sat, 22 Jul 2017 02:55:10 -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=kXJfv4qvIkX0w+hbsdhqKTq1yG4h22usJnmDYmHXmf8=; b=omMgWryrbUNHUZgzh3wJC+Wpxbd3iR4mzSlYgTI6XiaPdTE6pLF9QfQ0MU8OlRn9sK veAIiM+Uv7CjZXYVeqoRRmzu98xTA+bB8bCd8DyM9F+NlWmJMnWijoViYF7p3UmxmHSP rfI8z0jxspHZdNy44Qq0BmCMYn3h64f1Fz4X2LR4/irDDHfMRcZuix3I5QwsV9lPmhGM VZOsBYetuk7t9oEQJGq/HMX3zRbJPe763W2Bf2ZJeXn5zmlEng16IRo1y4Qwc/Zl2F6P a89J2mT+WqmJXgK7j2Pcp8ZNSS4+/Eq64ct6bm+egC5lrtsN1OnQtLIsQkQxl2yaCf3R dJsQ== 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=kXJfv4qvIkX0w+hbsdhqKTq1yG4h22usJnmDYmHXmf8=; b=WoYK8llluSo0Hi5z2YTCJNJa4/rL8N6kmNR+yj5GK2JyPNw31iyBF64OofVXzM3ny7 K38lmU3QkjiNcLlPMnyuGd2xbT+WG/xQps41S8IEziphNeUCsj7As9XZHdTJYZi1mJLh 0Yc9BIiEC5vvIOBHf7f+pEy/norWtLW35+6mKTqYE0hJg9DyKz4+DYJ/cOGvvF64CwAq WiJo05t2czIUUsXa2aEGaGLtd1F3aKOuHSFDaQ/QU2KEnjLcMTRn5Dzv0Pv8s0yYKW7P PMjyiZ0uT3ToJV4wHzK2M2aSQBxNIKtVUs9f9QAz/G0vqTr9eGcknsTRV/Ow/7FNzrPA 6+vA== X-Gm-Message-State: AIVw111YQF+yq7e++HVOcLCcVrAw4BPwyhu51xSJI1/SnGsXD8lC/vAd q7O5FHXY9a6naSgI X-Received: by 10.223.163.16 with SMTP id c16mr12783269wrb.173.1500717309265; Sat, 22 Jul 2017 02:55:09 -0700 (PDT) Received: from cp720.fritz.box (91-114-193-248.adsl.highway.telekom.at. [91.114.193.248]) by smtp.gmail.com with ESMTPSA id z192sm2544673wmz.44.2017.07.22.02.55.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Jul 2017 02:55:08 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V2 04/23] drm/etnaviv: add uapi for perfmon feature Date: Sat, 22 Jul 2017 11:53:04 +0200 Message-Id: <20170722095323.9964-5-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170722095323.9964-1-christian.gmeiner@gmail.com> References: <20170722095323.9964-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. Signed-off-by: Christian Gmeiner --- include/uapi/drm/etnaviv_drm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h index c065c8308bbd..110cc73bf549 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