95 lines
3.1 KiB
Diff
95 lines
3.1 KiB
Diff
From 99e9854c5fab7114b26c272088d9202548da55bf Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
|
|
Date: Fri, 19 Jun 2020 18:14:35 +0200
|
|
Subject: [PATCH xserver 3/4] xwayland: Always use xwl_present_free_event for
|
|
freeing Present events
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Minor cleanup, and will make the next change simpler. No functional
|
|
change intended.
|
|
|
|
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
(cherry picked from commit 1beffba699e2cc3f23039d2177c025bc127966de)
|
|
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
---
|
|
hw/xwayland/xwayland-present.c | 27 ++++++++++++---------------
|
|
1 file changed, 12 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
|
|
index 5ba7dce08..492e4a876 100644
|
|
--- a/hw/xwayland/xwayland-present.c
|
|
+++ b/hw/xwayland/xwayland-present.c
|
|
@@ -111,6 +111,13 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
|
|
}
|
|
}
|
|
|
|
+static void
|
|
+xwl_present_free_event(struct xwl_present_event *event)
|
|
+{
|
|
+ xorg_list_del(&event->list);
|
|
+ free(event);
|
|
+}
|
|
+
|
|
void
|
|
xwl_present_cleanup(WindowPtr window)
|
|
{
|
|
@@ -128,17 +135,15 @@ xwl_present_cleanup(WindowPtr window)
|
|
}
|
|
|
|
/* Clear remaining events */
|
|
- xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) {
|
|
- xorg_list_del(&event->list);
|
|
- free(event);
|
|
- }
|
|
+ xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list)
|
|
+ xwl_present_free_event(event);
|
|
|
|
/* Clear remaining buffer releases and inform Present about free ressources */
|
|
event = xwl_present_window->sync_flip;
|
|
xwl_present_window->sync_flip = NULL;
|
|
if (event) {
|
|
if (event->buffer_released) {
|
|
- free(event);
|
|
+ xwl_present_free_event(event);
|
|
} else {
|
|
event->pending = FALSE;
|
|
event->abort = TRUE;
|
|
@@ -160,13 +165,6 @@ xwl_present_cleanup(WindowPtr window)
|
|
free(xwl_present_window);
|
|
}
|
|
|
|
-static void
|
|
-xwl_present_free_event(struct xwl_present_event *event)
|
|
-{
|
|
- xorg_list_del(&event->list);
|
|
- free(event);
|
|
-}
|
|
-
|
|
static void
|
|
xwl_present_buffer_release(void *data, struct wl_buffer *buffer)
|
|
{
|
|
@@ -216,7 +214,7 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window)
|
|
/* If the buffer was already released, clean up now */
|
|
present_wnmd_event_notify(xwl_present_window->window, event->event_id,
|
|
xwl_present_window->ust, msc);
|
|
- free(event);
|
|
+ xwl_present_free_event(event);
|
|
} else {
|
|
xorg_list_add(&event->list, &xwl_present_window->release_queue);
|
|
}
|
|
@@ -392,8 +390,7 @@ xwl_present_abort_vblank(WindowPtr present_window,
|
|
|
|
xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) {
|
|
if (event->event_id == event_id) {
|
|
- xorg_list_del(&event->list);
|
|
- free(event);
|
|
+ xwl_present_free_event(event);
|
|
return;
|
|
}
|
|
}
|
|
--
|
|
2.26.2
|
|
|