From patchwork Fri Jun 9 10:21:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 9777913 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 215EE6034B for ; Fri, 9 Jun 2017 10:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D00285DD for ; Fri, 9 Jun 2017 10:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06B54285E7; Fri, 9 Jun 2017 10:21:47 +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 A8D31285DD for ; Fri, 9 Jun 2017 10:21:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 172E26E5AE; Fri, 9 Jun 2017 10:21:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD3656E5AB; Fri, 9 Jun 2017 10:21:41 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id v104so5922500wrb.0; Fri, 09 Jun 2017 03:21:41 -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=K3d/31+Xa8pifPQfVwGXozkIOzycF7X8PDAqIbBA/Dw=; b=HEIsGKIk3NTTturETqYr3APZT+OvDpLmdK4N8aZoEgiUNI+Fj07/Dbz6iw1fyKgbNT EdzyI++A+wvxbu7RJd1N9rGTdUAB9IQs+XsrbueSL4umN3sM204BLB7haO0BE1l2m+uI 9dNr4bwMJfkYOgi2mwJkSHHKuNQuJmxerc7bfETZAkIybdKZ/x5KfGBS5XaNnBojYUAD 214NYlJF+2SXxNeDvDgYTwAmYdfcYXuFEZt+lUcaV7NikQ05QyVLJ0ISKriR+VlzzKBx H8/Ido+iCLhnFIwdu/J04ODUTfWTEcnAPLKH8gmSbr+3k+HzlKlfvBGJci0uil+NGDoz dZJg== 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=K3d/31+Xa8pifPQfVwGXozkIOzycF7X8PDAqIbBA/Dw=; b=dfZB2JVe9Bad5hvllWM7WvyRNP9PrVrXYFUS/hwGRhcjTzD8wHsYIqTZWcMd9L9Ab6 +iu0TeHrg4jQwESdxXtwiRhB9n8qkffT1/uglafEI8pjWb75n1Uu8E9HuIC28aZ5V7Fn QVthWCR6yt3y7R5gNYTz9aJMxzHxozIccCFoYK8yGqqxumiGi+57TCafAa5RZV05bBoH 5PBeL8Dehfx1YGhtII8IgQFNgqVC9Kb73z3+WVBIY5HO0zjUFU/tBWSPAa6j/5ZpJo4y LvIC9lHtvgM8PLCIok9P81L9uBO/nMRBcDAlLfPehZ6rcR2hAxJj8gMMXBhzn8TnvdFV Y3eA== X-Gm-Message-State: AODbwcAXtQqvaLPxjBO9jXzxa91FG/tQ/ifBWWoPnvlzNi62641cAck3 ViXDf+mqeyunKJ5UCn8= X-Received: by 10.223.160.172 with SMTP id m41mr13031485wrm.176.1497003700296; Fri, 09 Jun 2017 03:21:40 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 03:21:39 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/21] drm/etnaviv: add uapi for perfmon feature Date: Fri, 9 Jun 2017 12:21:16 +0200 Message-Id: <20170609102123.2417-3-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 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 and/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. There is no connection between a specifc command stream and the read perf values. 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 9e488a0..b67a7dd 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 signal; /* in, pm signal */ + __u16 pad[3]; + __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