45 lines
1.3 KiB
Diff
45 lines
1.3 KiB
Diff
From 78d960bc448598df83d43f6e4881f40b5cbe9a12 Mon Sep 17 00:00:00 2001
|
|
From: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
Date: Wed, 20 Nov 2024 15:58:35 +0800
|
|
Subject: [PATCH] HACK: compositor: Attach buffer earlier for better
|
|
performance
|
|
|
|
Fix:
|
|
c08a6ff8b compositor/renderer: Only attach buffer to renderer in repaint
|
|
|
|
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
---
|
|
libweston/compositor.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/libweston/compositor.c b/libweston/compositor.c
|
|
index e9c499eb..b81a93ae 100644
|
|
--- a/libweston/compositor.c
|
|
+++ b/libweston/compositor.c
|
|
@@ -3351,6 +3351,7 @@ weston_surface_attach(struct weston_surface *surface,
|
|
{
|
|
struct weston_buffer *buffer = state->buffer;
|
|
struct weston_buffer *old_buffer = surface->buffer_ref.buffer;
|
|
+ struct weston_paint_node *pnode;
|
|
|
|
if (!buffer) {
|
|
if (weston_surface_is_mapped(surface)) {
|
|
@@ -3409,6 +3410,14 @@ weston_surface_attach(struct weston_surface *surface,
|
|
weston_buffer_reference(&surface->buffer_ref, buffer,
|
|
BUFFER_MAY_BE_ACCESSED);
|
|
|
|
+ // HACK: Attach buffer earlier for better performance
|
|
+ wl_list_for_each(pnode, &surface->paint_node_list, surface_link) {
|
|
+ assert(pnode->surface == surface);
|
|
+
|
|
+ surface->compositor->renderer->attach(pnode);
|
|
+ break;
|
|
+ }
|
|
+
|
|
return status;
|
|
}
|
|
|
|
--
|
|
2.20.1
|
|
|