mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
wsi/wl: Refactor out code to update current present ID.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no> Reviewed-by: Joshua Ashton <joshua@froggi.es> Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27275>
This commit is contained in:
parent
820859a6ab
commit
1af7f41174
1 changed files with 13 additions and 14 deletions
|
|
@ -1920,6 +1920,17 @@ presentation_handle_sync_output(void *data,
|
|||
{
|
||||
}
|
||||
|
||||
static void
|
||||
wsi_wl_presentation_update_present_id(struct wsi_wl_present_id *id)
|
||||
{
|
||||
/* present_ids.lock already held around dispatch */
|
||||
if (id->present_id > id->chain->present_ids.max_completed)
|
||||
id->chain->present_ids.max_completed = id->present_id;
|
||||
|
||||
wl_list_remove(&id->link);
|
||||
vk_free(id->alloc, id);
|
||||
}
|
||||
|
||||
static void
|
||||
presentation_handle_presented(void *data,
|
||||
struct wp_presentation_feedback *feedback,
|
||||
|
|
@ -1929,14 +1940,8 @@ presentation_handle_presented(void *data,
|
|||
uint32_t flags)
|
||||
{
|
||||
struct wsi_wl_present_id *id = data;
|
||||
|
||||
/* present_ids.lock already held around dispatch */
|
||||
if (id->present_id > id->chain->present_ids.max_completed)
|
||||
id->chain->present_ids.max_completed = id->present_id;
|
||||
|
||||
wsi_wl_presentation_update_present_id(id);
|
||||
wp_presentation_feedback_destroy(feedback);
|
||||
wl_list_remove(&id->link);
|
||||
vk_free(id->alloc, id);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1944,14 +1949,8 @@ presentation_handle_discarded(void *data,
|
|||
struct wp_presentation_feedback *feedback)
|
||||
{
|
||||
struct wsi_wl_present_id *id = data;
|
||||
|
||||
/* present_ids.lock already held around dispatch */
|
||||
if (id->present_id > id->chain->present_ids.max_completed)
|
||||
id->chain->present_ids.max_completed = id->present_id;
|
||||
|
||||
wsi_wl_presentation_update_present_id(id);
|
||||
wp_presentation_feedback_destroy(feedback);
|
||||
wl_list_remove(&id->link);
|
||||
vk_free(id->alloc, id);
|
||||
}
|
||||
|
||||
static const struct wp_presentation_feedback_listener
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue