-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update patches for 24.0 and bump to 24.0-rc2
- Loading branch information
1 parent
572755c
commit 2d306cd
Showing
28 changed files
with
319 additions
and
161 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
From 60a5e81909b35028bc2c74b4c394dde64f706b03 Mon Sep 17 00:00:00 2001 | ||
From 34e1eb1878c1efa9da4a756acf46c646b10c0199 Mon Sep 17 00:00:00 2001 | ||
From: Derek Foreman <[email protected]> | ||
Date: Wed, 20 Sep 2023 10:40:33 -0500 | ||
Subject: [PATCH 2/5] vulkan/wsi/wayland: refactor wayland dispatch code | ||
Subject: [PATCH 1/5] vulkan/wsi/wayland: refactor wayland dispatch code | ||
|
||
We currently have two similar but different bits of code to dispatch | ||
wayland event queues. Pull out as much common code as possible. | ||
|
||
Signed-off-by: Derek Foreman <[email protected]> | ||
--- | ||
src/vulkan/wsi/wsi_common_wayland.c | 399 +++++++++++++++------------- | ||
1 file changed, 208 insertions(+), 191 deletions(-) | ||
src/vulkan/wsi/wsi_common_wayland.c | 405 ++++++++++++++-------------- | ||
1 file changed, 210 insertions(+), 195 deletions(-) | ||
|
||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c | ||
index 94b9217cbdf..9d410cf8fe1 100644 | ||
index a11cbd21adb..e80ac56cfe8 100644 | ||
--- a/src/vulkan/wsi/wsi_common_wayland.c | ||
+++ b/src/vulkan/wsi/wsi_common_wayland.c | ||
@@ -96,6 +96,11 @@ struct wsi_wl_display { | ||
|
@@ -212,7 +212,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
wsi_wl_display_finish(display); | ||
return result; | ||
} | ||
@@ -1675,19 +1816,15 @@ wsi_wl_swapchain_wait_for_present(struct wsi_swapchain *wsi_chain, | ||
@@ -1672,19 +1813,15 @@ wsi_wl_swapchain_wait_for_present(struct wsi_swapchain *wsi_chain, | ||
uint64_t timeout) | ||
{ | ||
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; | ||
|
@@ -239,7 +239,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
|
||
/* Need to observe that the swapchain semaphore has been unsignalled, | ||
* as this is guaranteed when a present is complete. */ | ||
@@ -1703,141 +1840,45 @@ wsi_wl_swapchain_wait_for_present(struct wsi_swapchain *wsi_chain, | ||
@@ -1700,141 +1837,45 @@ wsi_wl_swapchain_wait_for_present(struct wsi_swapchain *wsi_chain, | ||
return VK_SUCCESS; | ||
} | ||
|
||
|
@@ -406,7 +406,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
} | ||
|
||
static VkResult | ||
@@ -1847,19 +1888,18 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
@@ -1844,19 +1885,18 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
{ | ||
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; | ||
struct wsi_wl_surface *wsi_wl_surface = chain->wsi_wl_surface; | ||
|
@@ -435,7 +435,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
if (ret < 0) | ||
return VK_ERROR_OUT_OF_DATE_KHR; | ||
|
||
@@ -1873,46 +1913,26 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
@@ -1870,46 +1910,26 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
} | ||
} | ||
|
||
|
@@ -498,7 +498,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
} | ||
} | ||
|
||
@@ -1933,9 +1953,10 @@ presentation_handle_presented(void *data, | ||
@@ -1930,9 +1950,10 @@ presentation_handle_presented(void *data, | ||
{ | ||
struct wsi_wl_present_id *id = data; | ||
|
||
|
@@ -510,7 +510,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
|
||
wp_presentation_feedback_destroy(feedback); | ||
wl_list_remove(&id->link); | ||
@@ -1948,9 +1969,10 @@ presentation_handle_discarded(void *data, | ||
@@ -1945,9 +1966,10 @@ presentation_handle_discarded(void *data, | ||
{ | ||
struct wsi_wl_present_id *id = data; | ||
|
||
|
@@ -522,7 +522,7 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
|
||
wp_presentation_feedback_destroy(feedback); | ||
wl_list_remove(&id->link); | ||
@@ -2198,8 +2220,6 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
@@ -2195,8 +2217,6 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
chain->wsi_wl_surface->chain = NULL; | ||
|
||
if (chain->present_ids.wp_presentation) { | ||
|
@@ -531,23 +531,32 @@ index 94b9217cbdf..9d410cf8fe1 100644 | |
/* In VK_EXT_swapchain_maintenance1 there is no requirement to wait for all present IDs to be complete. | ||
* Waiting for the swapchain fence is enough. | ||
* Just clean up anything user did not wait for. */ | ||
@@ -2211,7 +2231,6 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
@@ -2208,12 +2228,11 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
} | ||
|
||
wl_proxy_wrapper_destroy(chain->present_ids.wp_presentation); | ||
- pthread_cond_destroy(&chain->present_ids.list_advanced); | ||
pthread_mutex_destroy(&chain->present_ids.lock); | ||
} | ||
|
||
@@ -2372,18 +2391,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
chain->num_drm_modifiers = num_drm_modifiers; | ||
chain->drm_modifiers = drm_modifiers; | ||
- if (chain->present_ids.queue) | ||
- wl_event_queue_destroy(chain->present_ids.queue); | ||
+ if (chain->queue) | ||
+ wl_event_queue_destroy(chain->queue); | ||
|
||
vk_free(pAllocator, (void *)chain->drm_modifiers); | ||
|
||
@@ -2386,20 +2405,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
chain->drm_modifiers = drm_modifiers_copy; | ||
} | ||
|
||
+ chain->queue = wl_display_create_queue(chain->wsi_wl_surface->display->wl_display); | ||
+ | ||
if (chain->wsi_wl_surface->display->wp_presentation_notwrapped) { | ||
- if (!wsi_init_pthread_cond_monotonic(&chain->present_ids.list_advanced)) | ||
- goto fail; | ||
- if (!wsi_init_pthread_cond_monotonic(&chain->present_ids.list_advanced)) { | ||
- result = VK_ERROR_OUT_OF_HOST_MEMORY; | ||
- goto fail_free_wl_chain; | ||
- } | ||
pthread_mutex_init(&chain->present_ids.lock, NULL); | ||
|
||
wl_list_init(&chain->present_ids.outstanding_list); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 71111b7e67088b2c32db73565f79a3840a2d69e5 Mon Sep 17 00:00:00 2001 | ||
From d65354a4b06d573b34a5485b9207d3492c48ff27 Mon Sep 17 00:00:00 2001 | ||
From: Derek Foreman <[email protected]> | ||
Date: Fri, 10 Nov 2023 07:25:35 -0600 | ||
Subject: [PATCH 3/5] vulkan/wsi/wayland: Use commit_timing/commit_queue | ||
Subject: [PATCH 2/5] vulkan/wsi/wayland: Use commit_timing/commit_queue | ||
protocol for FIFO | ||
|
||
The commit_timing protocol allows us to set a presentation timestamp, | ||
|
@@ -15,8 +15,8 @@ Signed-off-by: Derek Foreman <[email protected]> | |
--- | ||
src/egl/wayland/wayland-drm/meson.build | 2 + | ||
src/vulkan/wsi/meson.build | 2 + | ||
src/vulkan/wsi/wsi_common_wayland.c | 138 +++++++++++++++++++++--- | ||
3 files changed, 130 insertions(+), 12 deletions(-) | ||
src/vulkan/wsi/wsi_common_wayland.c | 139 +++++++++++++++++++++--- | ||
3 files changed, 130 insertions(+), 13 deletions(-) | ||
|
||
diff --git a/src/egl/wayland/wayland-drm/meson.build b/src/egl/wayland/wayland-drm/meson.build | ||
index ac822acec67..8b6044f09e5 100644 | ||
|
@@ -32,7 +32,7 @@ index ac822acec67..8b6044f09e5 100644 | |
'presentation-time': 'stable/presentation-time/presentation-time.xml', | ||
'tearing-control-v1': 'staging/tearing-control/tearing-control-v1.xml', | ||
diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build | ||
index 9d0db011767..83ad71f06fa 100644 | ||
index c8206eac996..48ea09b99aa 100644 | ||
--- a/src/vulkan/wsi/meson.build | ||
+++ b/src/vulkan/wsi/meson.build | ||
@@ -31,6 +31,8 @@ endif | ||
|
@@ -45,7 +45,7 @@ index 9d0db011767..83ad71f06fa 100644 | |
files_vulkan_wsi += wp_files['presentation-time'] | ||
files_vulkan_wsi += wp_files['tearing-control-v1'] | ||
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c | ||
index 9d410cf8fe1..86de6ca190c 100644 | ||
index e80ac56cfe8..28f8f3b5e8f 100644 | ||
--- a/src/vulkan/wsi/wsi_common_wayland.c | ||
+++ b/src/vulkan/wsi/wsi_common_wayland.c | ||
@@ -41,6 +41,8 @@ | ||
|
@@ -128,7 +128,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
if (display->tearing_control_manager) | ||
wp_tearing_control_manager_v1_destroy(display->tearing_control_manager); | ||
if (display->wl_display_wrapper) | ||
@@ -1922,6 +1945,16 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
@@ -1919,6 +1942,16 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, | ||
else | ||
time_left = end_time - now; | ||
|
||
|
@@ -145,7 +145,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
ret = wsi_wl_display_dispatch_queue_with_timeout(wsi_wl_surface->display, | ||
wsi_wl_surface->display->queue, | ||
time_left); | ||
@@ -1952,10 +1985,16 @@ presentation_handle_presented(void *data, | ||
@@ -1949,10 +1982,16 @@ presentation_handle_presented(void *data, | ||
uint32_t flags) | ||
{ | ||
struct wsi_wl_present_id *id = data; | ||
|
@@ -162,7 +162,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
pthread_mutex_unlock(&id->chain->present_ids.lock); | ||
|
||
wp_presentation_feedback_destroy(feedback); | ||
@@ -1991,8 +2030,10 @@ frame_handle_done(void *data, struct wl_callback *callback, uint32_t serial) | ||
@@ -1988,8 +2027,10 @@ frame_handle_done(void *data, struct wl_callback *callback, uint32_t serial) | ||
{ | ||
struct wsi_wl_swapchain *chain = data; | ||
|
||
|
@@ -174,7 +174,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
|
||
wl_callback_destroy(callback); | ||
} | ||
@@ -2001,6 +2042,46 @@ static const struct wl_callback_listener frame_listener = { | ||
@@ -1998,6 +2039,46 @@ static const struct wl_callback_listener frame_listener = { | ||
frame_handle_done, | ||
}; | ||
|
||
|
@@ -221,15 +221,15 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
static VkResult | ||
wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
uint32_t image_index, | ||
@@ -2009,6 +2090,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
@@ -2006,6 +2087,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
{ | ||
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; | ||
struct wsi_wl_surface *wsi_wl_surface = chain->wsi_wl_surface; | ||
+ bool mode_fifo = chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR; | ||
|
||
if (chain->buffer_type == WSI_WL_BUFFER_SHM_MEMCPY) { | ||
struct wsi_wl_image *image = &chain->images[image_index]; | ||
@@ -2018,7 +2100,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
@@ -2015,7 +2097,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
|
||
/* For EXT_swapchain_maintenance1. We might have transitioned from FIFO to MAILBOX. | ||
* In this case we need to let the FIFO request complete, before presenting MAILBOX. */ | ||
|
@@ -238,7 +238,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
int ret = wl_display_dispatch_queue(wsi_wl_surface->display->wl_display, | ||
wsi_wl_surface->display->queue); | ||
if (ret < 0) | ||
@@ -2041,16 +2123,19 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
@@ -2038,16 +2120,19 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
wl_surface_damage(wsi_wl_surface->surface, 0, 0, INT32_MAX, INT32_MAX); | ||
} | ||
|
||
|
@@ -266,7 +266,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
struct wsi_wl_present_id *id = | ||
vk_zalloc(chain->wsi_wl_surface->display->wsi_wl->alloc, sizeof(*id), sizeof(uintptr_t), | ||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); | ||
@@ -2069,6 +2154,10 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
@@ -2066,6 +2151,10 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, | ||
} | ||
|
||
chain->images[image_index].busy = true; | ||
|
@@ -277,28 +277,30 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
wl_surface_commit(wsi_wl_surface->surface); | ||
wl_display_flush(wsi_wl_surface->display->wl_display); | ||
|
||
@@ -2184,6 +2273,7 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain, | ||
@@ -2181,6 +2270,7 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain, | ||
goto fail_image; | ||
|
||
wl_buffer_add_listener(image->buffer, &buffer_listener, image); | ||
+ image->chain = chain; | ||
|
||
return VK_SUCCESS; | ||
|
||
@@ -2234,6 +2324,12 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
pthread_mutex_destroy(&chain->present_ids.lock); | ||
} | ||
@@ -2234,8 +2324,13 @@ wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain, | ||
if (chain->queue) | ||
wl_event_queue_destroy(chain->queue); | ||
|
||
- vk_free(pAllocator, (void *)chain->drm_modifiers); | ||
+ if (chain->commit_queue) | ||
+ wp_commit_queue_v1_destroy(chain->commit_queue); | ||
+ | ||
+ if (chain->commit_timer) | ||
+ wp_commit_timer_v1_destroy(chain->commit_timer); | ||
+ | ||
|
||
+ vk_free(pAllocator, (void *)chain->drm_modifiers); | ||
wsi_swapchain_finish(&chain->base); | ||
} | ||
|
||
@@ -2288,6 +2384,15 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
@@ -2291,6 +2386,15 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
wp_tearing_control_v1_destroy(old_chain->tearing_control); | ||
old_chain->tearing_control = NULL; | ||
} | ||
|
@@ -314,7 +316,7 @@ index 9d410cf8fe1..86de6ca190c 100644 | |
} | ||
|
||
/* Take ownership of the wsi_wl_surface */ | ||
@@ -2403,7 +2508,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
@@ -2417,7 +2521,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, | ||
chain->queue); | ||
} | ||
|
||
|
Oops, something went wrong.