From patchwork Thu Oct 19 06:15:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 10016031 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 A7A6E60215 for ; Thu, 19 Oct 2017 06:15:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A8B128C7C for ; Thu, 19 Oct 2017 06:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CC1D28C7B; Thu, 19 Oct 2017 06:15:58 +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 9434C28C7B for ; Thu, 19 Oct 2017 06:15:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 285816E9EE; Thu, 19 Oct 2017 06:15:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1B036E9E1; Thu, 19 Oct 2017 06:15:54 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id u138so13675049wmu.5; Wed, 18 Oct 2017 23:15:54 -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; bh=cZLPuqGqV7FmcOnfeqbCa98IwRYE6NjVglaKoSQppuU=; b=cWwYLHzZ5X5L3QVZ9rqy2Kjzn8IV+vmURrIzJ1sZgn/fWGoSo0nO9hCDqBdILfdeSL CURRqmBShZTqRsugtUEC8uJyH4fQGRNWMHyL4Zzc0WyqjAArrmT9Krb0c0HL7Xpuw4Yi xDsteZs6EtT5Eep0FrzU5GliG46ncnkoScad0aukSWu8rYpOj1oGV10be6sjuG8xRDGF xxntA+b74HjTGhbYGuoLscVbhCSABWdv8/ku5Y75KFGxk7py0NvX3HuKZaz+c5L0E/HX t7tCgC9M7WCqwE08wWftHtvZa1nIRvExE5S+CQUmjngs3c9qzMibLqhsPN4odZdgbofj lfKA== 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; bh=cZLPuqGqV7FmcOnfeqbCa98IwRYE6NjVglaKoSQppuU=; b=TtDyBDb3b7o31fC54E/VUHY2oyShxbAWDP4fmk7gNiCdUjERkWQAslxUl6uNzCiZ2r 9P6H6TTobsgE0MNFjzwg7RRCJnAXtin/Xlezhrr2HkRL/vPd5EO0z0duYfJJsqYh/E8R oNIY7ZlIQ0pRyT54vCBJ5vizzZfKtJWj8u1b5ZN9N3Ra6XKoUIPWsD0SfIHnxWuumSKR VZOBIVN5ImrBbG2HTFfSgvjNbz76BJ8MdfU6YO1VzASsZ4GAbZQkEEvmpQmz2oSHSt7i 6qbnLELJLYF8S7kiXlZBAzWVKN9h8nIr4OnBnfS4SaTTJR7yArEzGU/4ZwMpWn8VzZ+1 L//w== X-Gm-Message-State: AMCzsaWuOwdyuk2D4ntRX5VHmd4AUBmS9kdxaxyp01J6yeScvIzL8JIN RL5Q9QG/gquxQAzzx8WLEKgJ3Q== X-Google-Smtp-Source: ABhQp+QAlL+ESTqOk27PxfZ/Y7o2rfe97m6RHT10xvIUspvNQer/EiIusbMYTviSUrBjlauJMLKqkA== X-Received: by 10.28.56.198 with SMTP id f189mr677393wma.16.1508393753257; Wed, 18 Oct 2017 23:15:53 -0700 (PDT) Received: from localhost.localdomain (193-83-18-195.adsl.highway.telekom.at. [193.83.18.195]) by smtp.gmail.com with ESMTPSA id e77sm1241629wmi.16.2017.10.18.23.15.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2017 23:15:52 -0700 (PDT) From: Christian Gmeiner To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] etnaviv: sync uapi header Date: Thu, 19 Oct 2017 08:15:45 +0200 Message-Id: <20171019061547.11676-1-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.13.6 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 Import the etnaviv header changes from kernel commit 05916bed1 (drm-next) The drm_etnaviv_gem_submit structure was extended to include performance monitor requests. Also two new ioctls got added to be able to readout performance monitor domains and their signals. Signed-off-by: Christian Gmeiner --- etnaviv/etnaviv_drm.h | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/etnaviv/etnaviv_drm.h b/etnaviv/etnaviv_drm.h index 76f6f78a..110cc73b 100644 --- a/etnaviv/etnaviv_drm.h +++ b/etnaviv/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 @@ -210,6 +226,27 @@ struct drm_etnaviv_gem_wait { struct drm_etnaviv_timespec timeout; /* in */ }; +/* + * Performance Monitor (PM): + */ + +struct drm_etnaviv_pm_domain { + __u32 pipe; /* in */ + __u8 iter; /* in/out, select pm domain at index iter */ + __u8 id; /* out, id of domain */ + __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 pad; + __u16 iter; /* in/out, select pm source at index iter */ + __u16 id; /* out, id of signal */ + char name[64]; /* out, name of domain */ +}; + #define DRM_ETNAVIV_GET_PARAM 0x00 /* placeholder: #define DRM_ETNAVIV_SET_PARAM 0x01 @@ -222,7 +259,9 @@ struct drm_etnaviv_gem_wait { #define DRM_ETNAVIV_WAIT_FENCE 0x07 #define DRM_ETNAVIV_GEM_USERPTR 0x08 #define DRM_ETNAVIV_GEM_WAIT 0x09 -#define DRM_ETNAVIV_NUM_IOCTLS 0x0a +#define DRM_ETNAVIV_PM_QUERY_DOM 0x0a +#define DRM_ETNAVIV_PM_QUERY_SIG 0x0b +#define DRM_ETNAVIV_NUM_IOCTLS 0x0c #define DRM_IOCTL_ETNAVIV_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param) #define DRM_IOCTL_ETNAVIV_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new) @@ -233,6 +272,8 @@ struct drm_etnaviv_gem_wait { #define DRM_IOCTL_ETNAVIV_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence) #define DRM_IOCTL_ETNAVIV_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr) #define DRM_IOCTL_ETNAVIV_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait) +#define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain) +#define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal) #if defined(__cplusplus) }