From patchwork Sun Sep 24 13:15:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9967985 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 078BB602D8 for ; Sun, 24 Sep 2017 13:16:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBB5828C24 for ; Sun, 24 Sep 2017 13:16:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E09E328C28; Sun, 24 Sep 2017 13:16:05 +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 90B9E28C24 for ; Sun, 24 Sep 2017 13:16:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB2FB6E158; Sun, 24 Sep 2017 13:16:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 516D36E152; Sun, 24 Sep 2017 13:16:01 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id b9so2999537wra.0; Sun, 24 Sep 2017 06:16:01 -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=DBcZQwKBD5pdqHFi83YRV4qJ4AT3KKS01IlIKYR9faQ=; b=K1R74TsyMvI/MajiL61HY7eOVFqxvvXXg/tjhjSbqE1BjNYyzWh6DQyAAWLRLSzrfs W2Usm6VyRMmO19iHe/P3rKBHNzorLCi3vL5T9FTbNyD12ih6K7zEUV6zFCNPcY8J4CeJ 60EO/D9cf1FZ6JXRpS59N3u5o/IkSTP65fN4LOWbb8L8Mo7lQHxx8X141M5/aA1a83Yc IBHgRQdHZVr0zqrot5C6jys1jiipMp/j0e2vgmiiEosnlKcW2qHfHPfyZpIKIAFRa/kg D7E2wmGKGtwgA4leBFhc050GZpcATB3oAbUeTzyO/OrlgAqQAEEMfam9NGq/BTNgCSwb 5h6w== 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=DBcZQwKBD5pdqHFi83YRV4qJ4AT3KKS01IlIKYR9faQ=; b=J1u5iP/ZFqFJNG90EZDKONynzmfZXKUGoY/3F0DWmXx2f5rCZesRGg144SDZDkvIeQ jXntUIEl+zWLWMdcYb13Hr2xgadcREzxYYnTrCsQ44hmfNuhm54ypOsyFq1GWZ/qgLRt fNOCMWdqSXjk00LfNvZk3A8+qeksrXjJ7TZsrVhkQveiLIDiICqmgFSrD9SXiaepX8qC 0S/nBY1zkh7vGpz7/PZx21TE5/lymyu4S56GmvZZJEByy+6k2NLl4rx4k2eKj6SjkcbK igwCeODjY3oUL1rBDc15UIIMOi5mfJLM0K5foTDmW8eojYtVLkZqcJa+KvnkImcpcmD0 CXTQ== X-Gm-Message-State: AHPjjUiN/GghMz1Sj3XAr/loMzaTLbx+qkCJ/mkRKRa307Vf+p6Ei6C5 Osjoi1R+jCZRO4J2W2oizs5urw== X-Google-Smtp-Source: AOwi7QCWz7n3bFobp7kyipimNHgQR0eznx1GmGlB1gO25I/yegsoB20NBmYNgf6zTAZiozEak//PXA== X-Received: by 10.223.179.200 with SMTP id x8mr3746931wrd.274.1506258959595; Sun, 24 Sep 2017 06:15:59 -0700 (PDT) Received: from localhost.localdomain (194-166-231-209.adsl.highway.telekom.at. [194.166.231.209]) by smtp.gmail.com with ESMTPSA id z51sm5748304wrz.80.2017.09.24.06.15.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Sep 2017 06:15:58 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH V5 04/25] drm/etnaviv: add uapi for perfmon feature Date: Sun, 24 Sep 2017 15:15:22 +0200 Message-Id: <20170924131543.4066-5-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170924131543.4066-1-christian.gmeiner@gmail.com> References: <20170924131543.4066-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 | 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