aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch')
-rw-r--r--meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch67
1 files changed, 0 insertions, 67 deletions
diff --git a/meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch b/meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch
deleted file mode 100644
index 25785ffb..00000000
--- a/meta-amdfalconx86/recipes-graphics/vulkan/vulkan-loader-layers/0009-vulkaninfo.c-fix-segfault-when-DISPLAY-is-not-set.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From b73227e97086116e596206b22ce0356bfc9b0a2c Mon Sep 17 00:00:00 2001
-From: Awais Belal <awais_belal@mentor.com>
-Date: Fri, 11 Nov 2016 14:48:54 +0500
-Subject: [PATCH] vulkaninfo.c: fix segfault when DISPLAY is not set
-
-Both xlib and xcb interfaces expect the DISPLAY environment
-variable to be set before creation of a window and the
-display creation mechanism would segfault if that is
-not the case and won't provide the user with details on
-what has to be done to correct the problem.
-We now handle such scenarios and exit cleanly after
-providing the user with some details.
-
-Signed-off-by: Awais Belal <awais_belal@mentor.com>
----
- demos/vulkaninfo.c | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
-index 324720c..da0a7c3 100644
---- a/demos/vulkaninfo.c
-+++ b/demos/vulkaninfo.c
-@@ -900,6 +900,9 @@ static void app_create_xlib_window(struct app_instance *inst) {
- long visualMask = VisualScreenMask;
- int numberOfVisuals;
-
-+ if (inst->xlib_display == NULL)
-+ return;
-+
- XVisualInfo vInfoTemplate={};
- vInfoTemplate.screen = DefaultScreen(inst->xlib_display);
- XVisualInfo *visualInfo = XGetVisualInfo(inst->xlib_display, visualMask,
-@@ -1488,6 +1491,12 @@ int main(int argc, char **argv) {
- app_destroy_win32_window(&inst);
- }
- #endif
-+#if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR)
-+ if (getenv("DISPLAY") == NULL) {
-+ printf("'DISPLAY' environment variable not set... Exiting!\n");
-+ goto out;
-+ }
-+#endif
- //--XCB--
- #ifdef VK_USE_PLATFORM_XCB_KHR
- if (has_extension(VK_KHR_XCB_SURFACE_EXTENSION_NAME,
-@@ -1508,6 +1517,10 @@ int main(int argc, char **argv) {
- if (has_extension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME,
- inst.global_extension_count, inst.global_extensions)) {
- app_create_xlib_window(&inst);
-+ if (inst.xlib_display == NULL) {
-+ printf("'DISPLAY' variable not set correctly. Exiting!\n'");
-+ goto out;
-+ }
- for (i = 0; i < gpu_count; i++) {
- app_create_xlib_surface(&inst);
- printf("GPU id : %u (%s)\n", i, gpus[i].props.deviceName);
-@@ -1528,6 +1541,7 @@ int main(int argc, char **argv) {
- printf("\n\n");
- }
-
-+out:
- for (i = 0; i < gpu_count; i++)
- app_gpu_destroy(&gpus[i]);
-
---
-1.9.1
-