[Mesa-dev] [PATCH mesa 21/21] radv: Add VK_GOOGLE_display_timing extension to radv driver

Keith Packard keithp at keithp.com
Thu Mar 8 07:25:19 UTC 2018


This adds support for the VK_GOOGLE_display timing extension.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 src/amd/vulkan/radv_extensions.py |  1 +
 src/amd/vulkan/radv_wsi.c         | 33 ++++++++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index e7bbf12fb69..f2bd8500307 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -100,6 +100,7 @@ EXTENSIONS = [
     Extension('VK_AMD_rasterization_order',               1, 'device->rad_info.chip_class >= VI && device->rad_info.max_se >= 2'),
     Extension('VK_AMD_shader_info',                       1, True),
     Extension('VK_MESA_query_timestamp',                  1, True),
+    Extension('VK_GOOGLE_display_timing',                 1, True),
 ]
 
 class VkVersion:
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index 20484177135..b5e75e98176 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -248,7 +248,6 @@ VkResult radv_QueuePresentKHR(
 					pPresentInfo);
 }
 
-
 VkResult radv_GetDeviceGroupPresentCapabilitiesKHR(
     VkDevice                                    device,
     VkDeviceGroupPresentCapabilitiesKHR*        pCapabilities)
@@ -270,3 +269,35 @@ VkResult radv_GetDeviceGroupSurfacePresentModesKHR(
 
    return VK_SUCCESS;
 }
+
+/* VK_GOOGLE_display_timing */
+VkResult
+radv_GetRefreshCycleDurationGOOGLE(
+	VkDevice                      _device,
+	VkSwapchainKHR                swapchain,
+	VkRefreshCycleDurationGOOGLE  *pDisplayTimingProperties)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	struct radv_physical_device *pdevice = device->physical_device;
+
+	return wsi_common_get_refresh_cycle_duration(&pdevice->wsi_device,
+						     _device,
+						     swapchain,
+						     pDisplayTimingProperties);
+}
+
+VkResult
+radv_GetPastPresentationTimingGOOGLE(VkDevice                            _device,
+				     VkSwapchainKHR                      swapchain,
+				     uint32_t                            *pPresentationTimingCount,
+				     VkPastPresentationTimingGOOGLE      *pPresentationTimings)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	struct radv_physical_device *pdevice = device->physical_device;
+
+	return wsi_common_get_past_presentation_timing(&pdevice->wsi_device,
+						       _device,
+						       swapchain,
+						       pPresentationTimingCount,
+						       pPresentationTimings);
+}
-- 
2.16.2



More information about the mesa-dev mailing list