summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi/wsi_common.h
diff options
context:
space:
mode:
authorKeith Packard <[email protected]>2017-06-15 21:00:56 -0700
committerKeith Packard <[email protected]>2018-06-23 07:59:00 -0700
commit86c8d93e5a045772b6c1c6ce6a24a5404a37f4cb (patch)
tree05c59079f4b02cd5f4c2965ca0cb82c3711ff7f6 /src/vulkan/wsi/wsi_common.h
parent5581dd5c320c663f82d3ed7e773d34e71175b990 (diff)
vulkan: add VK_EXT_display_control [v10]
This extension provides fences and frame count information to direct display contexts. It uses new kernel ioctls to provide 64-bits of vblank sequence and nanosecond resolution. v2: Remove DRM_CRTC_SEQUENCE_FIRST_PIXEL_OUT flag. This has been removed from the proposed kernel API. Add NULL parameter to drmCrtcQueueSequence ioctl as we don't care what sequence the event was actually queued to. v3: Adapt to pthread clock switch to MONOTONIC v4: Fix scope for wsi_display_mode andwsi_display_connector allocs Suggested-by: Jason Ekstrand <[email protected]> v5: Adopt Jason Ekstrand's coding conventions Declare variables at first use, eliminate extra whitespace between types and names. Wrap lines to 80 columns. Use wsi_rel_to_abs_time helper function to convert relative timeouts to absolute timeouts without causing overflow. Suggested-by: Jason Ekstrand <[email protected]> v6: Change WSI fence wait function to return VkResult instead of bool. This makes the meaning of the return value easier to understand, and allows for the indication of failure. Also change the WSI fence wait function to take only absolute timeouts and not provide an option for a relative timeout. No users wanted relative timeouts, and it's simpler if that option isn't available. Terminate the DPMS property loop once we've found the property. Assert that the fence hasn't already been destroyed in wsi_display_fence_destroy. Rearrange the event handler function order in the file to place routines in an easier to find order. Suggested-by: Jason Ekstrand <[email protected]> v7: Adapt to API changes for surface_get_capabilities v8: Use wsi->alloc in register_display_event so that callers don't have to dig out an allocator for us. v9: Fix a few minor formatting issues Suggested-by: Jason Ekstrand <[email protected]> v10: Use wsi->alloc if none provided in wsi_display_fence_alloc. Now that drivers are expected to pass the allocator argument straight through from the application, we need to check those for NULL everywhere. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.h')
-rw-r--r--src/vulkan/wsi/wsi_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 07d5e8353b0..33e4f849ac9 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -73,6 +73,16 @@ struct wsi_surface_supported_counters {
const void *pNext;
VkSurfaceCounterFlagsEXT supported_surface_counters;
+
+};
+
+struct wsi_fence {
+ VkDevice device;
+ const struct wsi_device *wsi_device;
+ VkDisplayKHR display;
+ const VkAllocationCallbacks *alloc;
+ VkResult (*wait)(struct wsi_fence *fence, uint64_t abs_timeout);
+ void (*destroy)(struct wsi_fence *fence);
};
struct wsi_interface;