All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: mesa-dev@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 16/21] vulkan: Define new VK_MESA_query_timestamp extension
Date: Tue, 13 Feb 2018 16:31:29 -0800	[thread overview]
Message-ID: <20180214003134.1552-17-keithp@keithp.com> (raw)
In-Reply-To: <20180214003134.1552-1-keithp@keithp.com>

This extension adds a single function to query the current GPU
timestamp, just like glGetInteger64v(GL_TIMESTAMP, &timestamp). This
function is needed to complete the implementation of
GOOGLE_display_timing, which needs to be able to coorelate GPU and CPU
timestamps.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 include/vulkan/vulkan.h                         |  6 ++++++
 src/Makefile.am                                 |  1 +
 src/vulkan/meson.build                          |  1 +
 src/vulkan/registry/vk_mesa_query_timestamp.xml | 22 ++++++++++++++++++++++
 4 files changed, 30 insertions(+)
 create mode 100644 src/vulkan/registry/vk_mesa_query_timestamp.xml

diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h
index d3e2e246cf3..5523eb7586f 100644
--- a/include/vulkan/vulkan.h
+++ b/include/vulkan/vulkan.h
@@ -7025,6 +7025,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT(
     VkMemoryHostPointerPropertiesEXT*           pMemoryHostPointerProperties);
 #endif
 
+typedef VkResult (VKAPI_PTR *PFN_vkQueryCurrentTimestampMESA)(VkDevice device, uint64_t *timestamp);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkQueryCurrentTimestampMESA(
+    VkDevice                                    _device,
+    uint64_t                                    *timestamp);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 014ffaf3e29..74ff305d7c6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,6 +68,7 @@ endif
 
 EXTRA_DIST += vulkan/registry/vk.xml
 EXTRA_DIST += vulkan/registry/vk_android_native_buffer.xml
+EXTRA_DIST += vulkan/registry/vk_mesa_query_timestamp.xml
 
 if HAVE_AMD_DRIVERS
 SUBDIRS += amd
diff --git a/src/vulkan/meson.build b/src/vulkan/meson.build
index 3908005b8a0..6ab0966b7c5 100644
--- a/src/vulkan/meson.build
+++ b/src/vulkan/meson.build
@@ -20,6 +20,7 @@
 
 vk_api_xml = files('registry/vk.xml')
 vk_android_native_buffer_xml = files('registry/vk_android_native_buffer.xml')
+vk_mesa_query_timestamp_xml = files('registry/vk_mesa_query_timestamp.xml')
 
 inc_vulkan_util = include_directories('util')
 inc_vulkan_wsi = include_directories('wsi')
diff --git a/src/vulkan/registry/vk_mesa_query_timestamp.xml b/src/vulkan/registry/vk_mesa_query_timestamp.xml
new file mode 100644
index 00000000000..7fd4d974872
--- /dev/null
+++ b/src/vulkan/registry/vk_mesa_query_timestamp.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+    <commands>
+        <command>
+            <proto><type>VkResult</type> <name>vkQueryCurrentTimestampMESA</name></proto>
+            <param><type>VkDevice</type> <name>device</name></param>
+            <param><type>uint64_t</type>* <name>pTimestamp</name></param>
+        </command>
+    </commands>
+    <extensions>
+        <extension name="VK_MESA_query_timestamp" number="200"
+		   type="device" author="MESA"
+		   contact="Keith Packard @keithp"
+		   supported="vulkan">
+            <require>
+                <enum value="1"                                         name="VK_MESA_QUERY_TIMESTAMP_SPEC_VERSION"/>
+                <enum value="&quot;VK_MESA_query_timestamp&quot;"       name="VK_MESA_QUERY_TIMESTAMP_NAME"/>
+                <command name="vkQueryCurrentTimestampMESA"/>
+            </require>
+        </extension>
+    </extensions>
+</registry>
-- 
2.15.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

  parent reply	other threads:[~2018-02-14  0:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  0:31 [PATCH 0/21] Add KHR_display through GOOGLE_display_timing [v2] Keith Packard
2018-02-14  0:31 ` [PATCH 01/21] vulkan: Add KHR_display extension using DRM Keith Packard
2018-02-24  0:43   ` Jason Ekstrand
2018-02-24  9:43     ` Daniel Stone
2018-03-07 20:28       ` [Mesa-dev] " Keith Packard
2018-03-07 20:15     ` Keith Packard
2018-02-14  0:31 ` [PATCH 02/21] anv: Add KHR_display extension to anv Keith Packard
2018-02-14  0:31 ` [PATCH 03/21] radv: Add KHR_display extension to radv Keith Packard
2018-02-14  0:31 ` [PATCH 04/21] vulkan: Add EXT_direct_mode_display Keith Packard
2018-02-14  0:31 ` [PATCH 05/21] anv: Add EXT_direct_mode_display to anv driver Keith Packard
2018-02-14  0:31 ` [PATCH 06/21] radv: Add EXT_direct_mode_display to radv driver Keith Packard
2018-02-14  0:31 ` [PATCH 07/21] vulkan: Add EXT_acquire_xlib_display Keith Packard
2018-02-14 12:13   ` [Mesa-dev] " Eric Engestrom
2018-02-15 20:26     ` Keith Packard
2018-02-14  0:31 ` [PATCH 08/21] anv: Add EXT_acquire_xlib_display to anv driver Keith Packard
2018-02-14  0:31 ` [PATCH 09/21] radv: Add EXT_acquire_xlib_display to radv driver Keith Packard
2018-02-14  0:31 ` [PATCH 10/21] vulkan: Add VK_EXT_display_surface_counter [v3] Keith Packard
2018-02-14  0:31 ` [PATCH 11/21] anv: Add VK_EXT_display_surface_counter to anv driver [v4] Keith Packard
2018-02-14  0:31 ` [PATCH 12/21] radv: Add VK_EXT_display_surface_counter to radv driver Keith Packard
2018-02-14  0:31 ` [PATCH 13/21] vulkan: add VK_EXT_display_control [v3] Keith Packard
2018-02-14  0:31 ` [PATCH 14/21] anv: add VK_EXT_display_control to anv driver Keith Packard
2018-02-14  0:31 ` [PATCH 15/21] radv: add VK_EXT_display_control to radv driver Keith Packard
2018-02-14  0:31 ` Keith Packard [this message]
2018-02-14  0:31 ` [PATCH 17/21] anv: Add new VK_MESA_query_timestamp extension to anv driver Keith Packard
2018-02-14  0:31 ` [PATCH 18/21] radv: Add new VK_MESA_query_timestamp extension to radv driver Keith Packard
2018-02-14  0:31 ` [PATCH 19/21] vulkan: Add VK_GOOGLE_display_timing extension (x11 and display backends) Keith Packard
2018-02-14  0:31 ` [PATCH 20/21] anv: Add VK_GOOGLE_display_timing extension to anv driver Keith Packard
2018-02-14  0:31 ` [PATCH 21/21] radv: Add VK_GOOGLE_display_timing extension to radv driver Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180214003134.1552-17-keithp@keithp.com \
    --to=keithp@keithp.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mesa-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.