vulkan: Add EXT_direct_mode_display [v2]
authorKeith Packard <keithp@keithp.com>
Fri, 9 Feb 2018 15:38:32 +0000 (07:38 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 19 Jun 2018 21:17:46 +0000 (14:17 -0700)
Add support for the EXT_direct_mode_display extension. This just
provides the vkReleaseDisplayEXT function.

v2:
Adopt Jason Ekstrand's coding conventions

Declare variables at first use, eliminate extra whitespace
between types and names. Wrap lines to 80 columns.

Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/vulkan/wsi/wsi_common_display.c
src/vulkan/wsi/wsi_common_display.h

index fd2a4ad9930a8256f59f2e97103865ace62e1c06..d9569981ab540413d341afd2b53be56e21f5f0b0 100644 (file)
@@ -1475,3 +1475,21 @@ wsi_display_finish_wsi(struct wsi_device *wsi_device,
       vk_free(alloc, wsi);
    }
 }
+
+/*
+ * Implement vkReleaseDisplay
+ */
+VkResult
+wsi_release_display(VkPhysicalDevice            physical_device,
+                    struct wsi_device           *wsi_device,
+                    VkDisplayKHR                display)
+{
+   struct wsi_display *wsi =
+      (struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
+
+   if (wsi->fd >= 0) {
+      close(wsi->fd);
+      wsi->fd = -1;
+   }
+   return VK_SUCCESS;
+}
index 9ca1fa6be868de35a3193b816d654b0fcb46bcc2..f1e53484bac15202b9c069864ccea1f95b7ba852 100644 (file)
@@ -82,4 +82,9 @@ wsi_create_display_surface(VkInstance instance,
                            const VkDisplaySurfaceCreateInfoKHR *pCreateInfo,
                            VkSurfaceKHR *pSurface);
 
+VkResult
+wsi_release_display(VkPhysicalDevice            physical_device,
+                    struct wsi_device           *wsi_device,
+                    VkDisplayKHR                display);
+
 #endif