Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package weston for openSUSE:Factory checked in at 2026-10-24 22:05:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/weston (Old) and /work/SRC/openSUSE:Factory/.weston.new.2252680 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "weston" Sat Oct 24 22:05:23 2026 rev:41 rq:1392208 version:16.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/weston/weston.changes 2026-07-17 01:45:40.877701174 +0200 +++ /work/SRC/openSUSE:Factory/.weston.new.2252680/weston.changes 2026-10-24 22:07:15.610237116 +0200 @@ -1,0 +2,6 @@ +Sat Oct 24 09:58:07 UTC 2026 - Jan Engelhardt <[email protected]> + +- Update to release 16.0.1 + * Allow running i915 back again on the native drm-backend + +------------------------------------------------------------------- Old: ---- weston-16.0.0.tar.xz weston-16.0.0.tar.xz.sig New: ---- weston-16.0.1.tar.xz weston-16.0.1.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ weston.spec ++++++ --- /var/tmp/diff_new_pack.A6vXiT/_old 2026-10-24 22:07:16.181261148 +0200 +++ /var/tmp/diff_new_pack.A6vXiT/_new 2026-10-24 22:07:16.186261359 +0200 @@ -23,7 +23,7 @@ Name: weston %define lname libweston0 %define major 16 -Version: 16.0.0 +Version: 16.0.1 Release: 0 Summary: Wayland Reference Compositor License: CC-BY-SA-3.0 AND MIT ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.A6vXiT/_old 2026-10-24 22:07:16.258264389 +0200 +++ /var/tmp/diff_new_pack.A6vXiT/_new 2026-10-24 22:07:16.263264600 +0200 @@ -1,5 +1,5 @@ -mtime: 1784230230 -commit: 688702240b64ce9e7c04a6a4fe5af2325bcf127e526942d6a4320ed3e20375b5 +mtime: 1792836012 +commit: 3526a1a99573060699fd962c24d2a696f3189c90ef9c1bd04159f80eae5afb13 url: https://src.opensuse.org/jengelh/weston revision: master ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-10-24 12:00:12.000000000 +0200 @@ -0,0 +1 @@ +.osc ++++++ weston-16.0.0.tar.xz -> weston-16.0.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/frontend/main.c new/weston-16.0.1/frontend/main.c --- old/weston-16.0.0/frontend/main.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/frontend/main.c 2026-10-19 12:07:46.000000000 +0200 @@ -2341,16 +2341,14 @@ } color_format = entry->value; - if ((weston_output_get_supported_color_formats(output) & color_format) == 0) { - weston_log("Error: output '%s' does not support color format %s\n", - output->name, str); - free(str); - return -1; + if ((weston_output_get_supported_color_formats(output) & color_format)) { + weston_log("Setting output '%s' to color %s format\n", + output->name, weston_color_format_to_str(color_format)); + } else { + weston_log("Warning: output '%s' does not support color format %s, " + "falling back to auto\n", output->name, str); } - - weston_log("Setting output '%s' to color %s format\n", - output->name, weston_color_format_to_str(color_format)); - weston_output_set_color_format(output, color_format); + weston_output_set_preferred_color_format(output, color_format); free(str); return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/include/libweston/libweston.h new/weston-16.0.1/include/libweston/libweston.h --- old/weston-16.0.0/include/libweston/libweston.h 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/include/libweston/libweston.h 2026-10-19 12:07:46.000000000 +0200 @@ -339,7 +339,8 @@ WESTON_PAINT_NODE_PLANE_DIRTY = 1 << 3, WESTON_PAINT_NODE_BUFFER_DIRTY = 1 << 4, WESTON_PAINT_NODE_BUFFER_PARAMS_DIRTY = 1 << 5, - WESTON_PAINT_NODE_ALL_DIRTY = (1 << 6) - 1, + WESTON_PAINT_NODE_RATE_DIRTY = 1 << 6, + WESTON_PAINT_NODE_ALL_DIRTY = (1 << 7) - 1, }; @@ -606,6 +607,10 @@ enum weston_vrr_mode vrr_mode; + /** Preferred color_format, should be used if supported by heads. */ + enum weston_color_format preferred_color_format; + + /** Active color_format; AUTO when no heads or preferred unsupported. */ enum weston_color_format color_format; enum weston_output_fb_alpha_encoding fb_alpha_encoding; @@ -1909,6 +1914,9 @@ WESTON_SURFACE_DIRTY_SUBSURFACE_CONFIG = 1 << 5, /** surface added a frame callback */ WESTON_SURFACE_DIRTY_FRAME_CALLBACK = 1 << 6, + /** protocol has changed the way the surface interacts + * with output timings */ + WESTON_SURFACE_DIRTY_RATE = 1 << 7, }; struct weston_surface_state { @@ -1965,6 +1973,9 @@ /* wp_color_representation_surface_v1.set_chroma_location */ struct weston_color_representation color_representation; + /* wp_tearing_control_v1 */ + bool may_tear; + /* wp_fifo_v1 */ bool fifo_barrier; bool fifo_wait; @@ -2130,7 +2141,9 @@ enum weston_hdcp_protection current_protection; enum weston_surface_protection_mode protection_mode; - struct weston_tearing_control *tear_control; + /** tearing_control_v1 */ + struct weston_tearing_control *tearing_control; + bool may_tear; struct weston_color_profile *color_profile; struct weston_color_profile *preferred_color_profile; @@ -2938,8 +2951,11 @@ weston_compositor_disarm_surface_counter_fps(struct weston_compositor *ec); void -weston_output_set_color_format(struct weston_output *output, - enum weston_color_format color_format); +weston_output_set_preferred_color_format(struct weston_output *output, + enum weston_color_format color_format); + +void +weston_output_update_color_format(struct weston_output *output); uint32_t weston_output_get_supported_color_formats(struct weston_output *output); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/drm-gbm.c new/weston-16.0.1/libweston/backend-drm/drm-gbm.c --- old/weston-16.0.0/libweston/backend-drm/drm-gbm.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/drm-gbm.c 2026-10-19 12:07:46.000000000 +0200 @@ -45,6 +45,7 @@ #include "shared/weston-egl-ext.h" #include "linux-dmabuf.h" #include "linux-explicit-synchronization.h" +#include "shared/fd-util.h" #include "shared/xalloc.h" /* When initializing EGL, if the preferred buffer format isn't available @@ -751,12 +752,7 @@ void drm_output_fini_egl(struct drm_output *output) { - struct drm_backend *b = output->backend; - const struct weston_renderer *renderer = b->compositor->renderer; - - /* Destroying the GBM surface will destroy all our GBM buffers, - * regardless of refcount. */ - weston_assert_ptr_null(b->compositor, output->scanout_handle); + const struct weston_renderer *renderer = output->base.compositor->renderer; renderer->gl->output_destroy(&output->base); gbm_surface_destroy(output->gbm_surface); @@ -767,10 +763,7 @@ void drm_output_fini_vulkan(struct drm_output *output) { - struct drm_backend *b = output->backend; - const struct weston_renderer *renderer = b->compositor->renderer; - - weston_assert_ptr_null(b->compositor, output->scanout_handle); + const struct weston_renderer *renderer = output->base.compositor->renderer; for (unsigned int i = 0; i < ARRAY_LENGTH(output->renderbuffer); i++) renderer->destroy_renderbuffer(output->renderbuffer[i]); @@ -821,6 +814,7 @@ struct drm_device *device = output->device; struct linux_dmabuf_memory *dmabuf; struct drm_fb *ret; + int fence_fd; renderer->repaint_output(&output->base, damage, output->renderbuffer[output->current_image]); @@ -840,12 +834,13 @@ return NULL; } - pstate->in_fence_fd = renderer->vulkan->create_fence_fd(&output->base); - if (pstate->in_fence_fd < 1) { + fence_fd = renderer->vulkan->create_fence_fd(&output->base); + if (fence_fd < 0) { weston_log("failed to get fence fd from rendering\n"); drm_fb_unref(ret); return NULL; } + fd_update(&pstate->in_fence_fd, fence_fd); output->current_image = (output->current_image + 1) % ARRAY_LENGTH(output->renderbuffer); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/drm-internal.h new/weston-16.0.1/libweston/backend-drm/drm-internal.h --- old/weston-16.0.0/libweston/backend-drm/drm-internal.h 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/drm-internal.h 2026-10-19 12:07:46.000000000 +0200 @@ -382,6 +382,13 @@ DRM_OUTPUT_PROPOSE_STATE_REUSE = 128, /**< bit indicates reuse prior state with new buffers */ }; +/* Value for drm_output_state::background_color meaning opaque black, which is + * the default CRTC background. Note that the BACKGROUND_COLOR property is + * ARGB16161616, so a value of zero is fully *transparent* black instead, which + * drivers may reject: i915/xe fail the atomic check with "New background not + * completely opaque". */ +#define DRM_BACKGROUND_COLOR_OPAQUE_BLACK ((uint64_t) 0xffff << 48) + /* * Output state holds the dynamic state for one Weston output, i.e. a KMS CRTC, * plus >= 1 each of encoder/connector/plane. Since everything but the planes @@ -402,6 +409,11 @@ struct wl_list plane_list; bool tear; bool planes_enabled; + + /* CRTC prop WDRM_CRTC_BACKGROUND_COLOR, only applied when the CRTC + * supports it. DRM_BACKGROUND_COLOR_OPAQUE_BLACK unless a solid view + * has been lowered into the background region. */ + uint64_t background_color; }; enum drm_colorop_3x1d_lut_blob_quantization { @@ -468,7 +480,6 @@ bool complete; - /* We don't own the fd, so we shouldn't close it */ int in_fence_fd; uint32_t damage_blob_id; /* damage to kernel */ @@ -625,9 +636,6 @@ /* CRTC prop WDRM_CRTC_GAMMA_LUT_SIZE */ uint32_t lut_size; - /* CRTC prop WDRM_CRTC_BACKGROUND_COLOR */ - uint64_t background_color; - /* Union of formats of all compatible writeback connectors */ struct weston_drm_format_array writeback_formats; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/drm.c new/weston-16.0.1/libweston/backend-drm/drm.c --- old/weston-16.0.0/libweston/backend-drm/drm.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/drm.c 2026-10-19 12:07:46.000000000 +0200 @@ -1360,6 +1360,9 @@ return drm_output_apply_mode(output); } +static void +drm_output_reset_planes(struct drm_output *output); + static int drm_output_apply_mode(struct drm_output *output) { @@ -1378,8 +1381,12 @@ fb_size.width = output->base.current_mode->width; fb_size.height = output->base.current_mode->height; - if (!weston_renderer_resize_output(&output->base, &fb_size, NULL)) - return -1; + /* + * Remove all potential drm_fb references to GBM BOs, so that the + * renderer tear-down can destroy the originating GBM/Vulkan + * surface without leaving dangling drm_fb pointers. + */ + drm_output_reset_planes(output); if (b->compositor->renderer->type == WESTON_RENDERER_GL) { drm_output_fini_egl(output); @@ -1395,8 +1402,12 @@ "new mode"); return -1; } + } else { + if (!weston_renderer_resize_output(&output->base, &fb_size, NULL)) + return -1; } + if (device->atomic_modeset) weston_output_update_capture_info(&output->base, WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK, @@ -2557,10 +2568,6 @@ drm_property_get_value(&crtc->props_crtc[WDRM_CRTC_GAMMA_LUT_SIZE], props, 0); - crtc->background_color = - drm_property_get_value(&crtc->props_crtc[WDRM_CRTC_BACKGROUND_COLOR], - props, 0); - /* Add it to the last position of the DRM-backend CRTC list */ wl_list_insert(device->crtc_list.prev, &crtc->link); @@ -2717,33 +2724,42 @@ return 0; } -/** The opposite of drm_output_init_planes(). First of all it removes the planes - * from the plane stacking list. After all it sets the planes of the output as NULL. - */ static void -drm_output_deinit_planes(struct drm_output *output) +drm_output_reset_planes(struct drm_output *output) { struct drm_device *device = output->device; - struct drm_plane_handle *handle, *next_handle; if (output->cursor_handle) { /* Turn off hardware cursor */ drmModeSetCursor(device->kms_device->fd, output->crtc->crtc_id, 0, 0, 0); + drm_plane_reset_state(output->cursor_handle->plane); } + if (output->scanout_handle) + drm_plane_reset_state(output->scanout_handle->plane); +} + +/** The opposite of drm_output_init_planes(). First of all it removes the planes + * from the plane stacking list. After all it sets the planes of the output as NULL. + */ +static void +drm_output_deinit_planes(struct drm_output *output) +{ + struct drm_plane_handle *handle, *next_handle; + + drm_output_reset_planes(output); + /* With universal planes, the planes are allocated at startup, * freed at shutdown, and live on the plane list in between. * We want the planes to continue to exist and be freed up * for other outputs. */ if (output->cursor_handle) { - drm_plane_reset_state(output->cursor_handle->plane); drm_plane_destroy_handle(output->cursor_handle); output->cursor_handle = NULL; } if (output->scanout_handle) { - drm_plane_reset_state(output->scanout_handle->plane); drm_plane_destroy_handle(output->scanout_handle); output->scanout_handle = NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/fb.c new/weston-16.0.1/libweston/backend-drm/fb.c --- old/weston-16.0.0/libweston/backend-drm/fb.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/fb.c 2026-10-19 12:07:46.000000000 +0200 @@ -48,6 +48,8 @@ static void drm_fb_destroy(struct drm_fb *fb) { + weston_assert_int_eq(fb->backend->compositor, fb->refcnt, 0); + /* TODO: do not leak the fb during shutdown. * When we are shutting down, the CRTC may be scanning out our fb. If we * destroy it, the CRTC may turn off. So leak that on purpose. What we @@ -474,20 +476,17 @@ } fb->num_duped_fds++; } - - goto bo_import_skip; - } - - fb->bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_FD_MODIFIER, - &import_mod, GBM_BO_USE_SCANOUT); - if (!fb->bo) { - if (try_view_on_plane_failure_reasons) - *try_view_on_plane_failure_reasons |= - FAILURE_REASONS_GBM_BO_IMPORT_FAILED; - goto err_free; + } else { + fb->bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_FD_MODIFIER, + &import_mod, GBM_BO_USE_SCANOUT); + if (!fb->bo) { + if (try_view_on_plane_failure_reasons) + *try_view_on_plane_failure_reasons |= + FAILURE_REASONS_GBM_BO_IMPORT_FAILED; + goto err_free; + } } -bo_import_skip: fb->width = attributes->width; fb->height = attributes->height; fb->modifier = attributes->modifier; @@ -536,7 +535,7 @@ return fb; err_free: - drm_fb_destroy_dmabuf(fb); + drm_fb_unref(fb); return NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/kms.c new/weston-16.0.1/libweston/backend-drm/kms.c --- old/weston-16.0.0/libweston/backend-drm/kms.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/kms.c 2026-10-19 12:07:46.000000000 +0200 @@ -1863,9 +1863,13 @@ ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_VRR_ENABLED, wdrm_vrr_enabled_from_output(output)); - ret |= crtc_add_prop_zero_ok(req, crtc, + /* Not crtc_add_prop_zero_ok(): opaque black is not zero, so on a + * CRTC without the property that helper would fall through to + * crtc_add_prop() and fail the whole commit. */ + if (drm_crtc_supports_background_color(crtc)) + ret |= crtc_add_prop(req, crtc, WDRM_CRTC_BACKGROUND_COLOR, - crtc->background_color); + state->background_color); /* No need for the DPMS property, since it is implicit in * routing and CRTC activity. */ @@ -2160,8 +2164,11 @@ continue; if (output_state->output->connector_color_format != - wdrm_color_format_from_output(&output_state->output->base)) + wdrm_color_format_from_output(&output_state->output->base)) { weston_assert_true(b->compositor, output_state->output->base.enabled); + output_state->output->connector_color_format = + wdrm_color_format_from_output(&output_state->output->base); + } if (mode == DRM_STATE_APPLY_SYNC) assert(output_state->dpms == WESTON_DPMS_OFF); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/state-helpers.c new/weston-16.0.1/libweston/backend-drm/state-helpers.c --- old/weston-16.0.0/libweston/backend-drm/state-helpers.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/state-helpers.c 2026-10-19 12:07:46.000000000 +0200 @@ -34,6 +34,7 @@ #include "colorops.h" #include "drm-internal.h" +#include "shared/fd-util.h" #include "shared/weston-assert.h" #include "shared/weston-drm-fourcc.h" #include "shared/xalloc.h" @@ -95,7 +96,7 @@ wl_list_remove(&state->link); wl_list_init(&state->link); state->output_state = NULL; - state->in_fence_fd = -1; + fd_update(&state->in_fence_fd, -1); state->zpos = DRM_PLANE_ZPOS_INVALID_PLANE; state->alpha = DRM_PLANE_ALPHA_OPAQUE; drm_color_pipeline_state_unref(state->pipeline_state); @@ -331,6 +332,7 @@ state->output = output; state->dpms = WESTON_DPMS_OFF; state->protection = WESTON_HDCP_DISABLE; + state->background_color = DRM_BACKGROUND_COLOR_OPAQUE_BLACK; wl_list_init(&state->link); wl_list_init(&state->plane_list); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/backend-drm/state-propose.c new/weston-16.0.1/libweston/backend-drm/state-propose.c --- old/weston-16.0.0/libweston/backend-drm/state-propose.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/backend-drm/state-propose.c 2026-10-19 12:07:46.000000000 +0200 @@ -44,6 +44,8 @@ #include "linux-dmabuf.h" #include "presentation-time-server-protocol.h" #include "linux-dmabuf-unstable-v1-server-protocol.h" +#include "weston-trace.h" +#include "shared/fd-util.h" #include "shared/string-helpers.h" #include "shared/weston-assert.h" @@ -178,6 +180,7 @@ struct drm_plane *plane = handle->plane; struct drm_plane_state *state = NULL; enum blend_mode_error err_blend_mode; + int fence_fd = -1; assert(!device->disable_client_buffer_scanout); assert(output == handle->output); @@ -210,7 +213,9 @@ * here to live within the state. */ state->paint_node = pnode; state->fb = drm_fb_ref(fb); - state->in_fence_fd = surface->acquire_fence_fd; + if (surface->acquire_fence_fd >= 0) + fence_fd = dup(surface->acquire_fence_fd); + fd_update(&state->in_fence_fd, fence_fd); drm_color_pipeline_state_unref(state->pipeline_state); state->pipeline_state = NULL; @@ -987,11 +992,12 @@ } static bool -lower_solid_views_to_background_region(struct drm_output *output, +lower_solid_views_to_background_region(struct drm_output_state *state, struct wl_array *visible_pnodes, struct weston_paint_node **last_visible_pnode, pixman_region32_t *background_region) { + struct drm_output *output = state->output; struct drm_device *device = output->device; struct drm_backend *b = device->backend; struct weston_paint_node **visible_pnode; @@ -1089,7 +1095,7 @@ g16 = 0xffff * background_region_color.g; b16 = 0xffff * background_region_color.b; - output->crtc->background_color = + state->background_color = a16 << 48 | r16 << 32 | g16 << 16 | b16; } } @@ -1100,7 +1106,6 @@ error: wl_array_release(&visible_pnodes_new); - output->crtc->background_color = 0; return false; } @@ -1182,6 +1187,7 @@ struct drm_plane_state *pstate; struct drm_plane *plane; struct drm_fb *fb; + int fence_fd = -1; /* we don't care about renderer views */ if (pnode->plane == &output_base->primary_plane) { @@ -1234,7 +1240,9 @@ drm_fb_unref(pstate->fb); pstate->fb = fb; - pstate->in_fence_fd = pnode->surface->acquire_fence_fd; + if (pnode->surface->acquire_fence_fd >= 0) + fence_fd = dup(pnode->surface->acquire_fence_fd); + fd_update(&pstate->in_fence_fd, fence_fd); drm_debug(b, "\t\t[reuse] successfully stole away pnode %s to reused plane\n", pnode->internal_name); /* XXX: When we set non-default color states in DRM, make sure they match */ weston_buffer_reference(&pstate->fb_ref.buffer, @@ -1317,6 +1325,11 @@ state->dpms = WESTON_DPMS_ON; state->planes_enabled = !output_base->disable_planes; + /* Start from the default background. Only PLANES_ONLY lowers solid + * views into it, so without this the colour picked for a previous + * frame would leak into a state that does not paint it. */ + state->background_color = DRM_BACKGROUND_COLOR_OPAQUE_BLACK; + /* Start with the assumption that we're going to do a tearing commit, * if the hardware supports it and we're not compositing with the * renderer. @@ -1440,7 +1453,7 @@ pixman_region32_init(&background_region); if (mode == DRM_OUTPUT_PROPOSE_STATE_PLANES_ONLY && - !lower_solid_views_to_background_region(output, + !lower_solid_views_to_background_region(state, &visible_pnodes, &last_visible_pnode, &background_region)) @@ -1515,10 +1528,7 @@ pnode->try_view_on_plane_failure_reasons |= FAILURE_REASONS_INADEQUATE_CONTENT_PROTECTION; - if (pnode->surface->tear_control) - state->tear &= pnode->surface->tear_control->may_tear; - else - state->tear = 0; + state->tear &= pnode->surface->may_tear; /* Now try to place it on a plane if we can. */ if (!pnode->try_view_on_plane_failure_reasons) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/compositor.c new/weston-16.0.1/libweston/compositor.c --- old/weston-16.0.0/libweston/compositor.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/compositor.c 2026-10-19 12:07:46.000000000 +0200 @@ -405,7 +405,8 @@ pnode->status &= ~(WESTON_PAINT_NODE_VIEW_DIRTY | \ WESTON_PAINT_NODE_OUTPUT_DIRTY | WESTON_PAINT_NODE_BUFFER_DIRTY | - WESTON_PAINT_NODE_BUFFER_PARAMS_DIRTY); + WESTON_PAINT_NODE_BUFFER_PARAMS_DIRTY | + WESTON_PAINT_NODE_RATE_DIRTY); } /* This is for validating a paint node after early update, assign planes, @@ -2924,9 +2925,6 @@ fd_clear(&surface->acquire_fence_fd); - if (surface->tear_control) - surface->tear_control->surface = NULL; - weston_color_profile_unref(surface->color_profile); weston_color_profile_unref(surface->preferred_color_profile); @@ -6855,6 +6853,7 @@ wl_list_insert(output->head_list.prev, &head->output_link); weston_output_compute_protection(output); + weston_output_update_color_format(output); if (output->enabled) { weston_head_add_global(head); @@ -6898,6 +6897,8 @@ if (output->detach_head) output->detach_head(output, head); + weston_output_update_color_format(output); + if (output->enabled) { weston_head_remove_global(head); @@ -7246,6 +7247,8 @@ return; head->supported_color_format_mask = color_format_mask; + if (head->output) + weston_output_update_color_format(head->output); weston_head_set_device_changed(head); } @@ -8543,6 +8546,7 @@ output->enabled = false; output->eotf_mode = WESTON_EOTF_MODE_SDR; output->colorimetry_mode = WESTON_COLORIMETRY_MODE_DEFAULT; + output->preferred_color_format = WESTON_COLOR_FORMAT_AUTO; output->color_format = WESTON_COLOR_FORMAT_AUTO; output->desired_protection = WESTON_HDCP_DISABLE; output->allow_protection = true; @@ -9191,11 +9195,40 @@ return 0; } +/** Update active color_format for output + * + * If the preferred format is supported by the current heads, use it. + * Otherwise fallback to WESTON_COLOR_FORMAT_AUTO. + * + * \ingroup output + * \sa weston_output_set_preferred_color_format + */ +WL_EXPORT void +weston_output_update_color_format(struct weston_output *output) +{ + uint32_t supported = weston_output_get_supported_color_formats(output); + + if (supported & output->preferred_color_format) + output->color_format = output->preferred_color_format; + else + output->color_format = WESTON_COLOR_FORMAT_AUTO; +} + +/** Update preferred color_format for output + * + * It may also update the current active output color_format, and the final + * value depends wether the newest preferred format is supported by current + * heads. + * + * \ingroup output + * \sa weston_output_update_color_format + */ WL_EXPORT void -weston_output_set_color_format(struct weston_output *output, - enum weston_color_format color_format) +weston_output_set_preferred_color_format(struct weston_output *output, + enum weston_color_format color_format) { - output->color_format = color_format; + output->preferred_color_format = color_format; + weston_output_update_color_format(output); } WL_EXPORT uint32_t @@ -9665,15 +9698,37 @@ } static void +tearing_control_base_surface_destroyed(struct wl_listener *listener, void *data) +{ + struct weston_surface *surface = data; + struct weston_compositor *wc = surface->compositor; + struct weston_tearing_control *tc = + wl_container_of(listener, tc, surface_destroy_listener); + + weston_assert_ptr_eq(wc, surface, tc->surface); + + /* Surface destroyed, so tearing control becomes inert */ + tc->surface = NULL; + wl_list_remove(&tc->surface_destroy_listener.link); +} + +static void set_presentation_hint(struct wl_client *client, struct wl_resource *resource, uint32_t hint) { struct weston_tearing_control *tc = wl_resource_get_user_data(resource); struct weston_surface *surf = tc->surface; + /* tearing-control is inert if the surface was destroyed */ + if (!surf) + return; + if (hint == WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC) - surf->tear_control->may_tear = true; + surf->pending.may_tear = true; else - surf->tear_control->may_tear = false; + surf->pending.may_tear = false; + + if (surf->may_tear != surf->pending.may_tear) + surf->pending.status |= WESTON_SURFACE_DIRTY_RATE; } static void @@ -9682,9 +9737,14 @@ struct weston_tearing_control *tc = wl_resource_get_user_data(res); struct weston_surface *surf = tc->surface; - if (surf) - surf->tear_control = NULL; + if (!surf) + return; + surf->tearing_control = NULL; + if (surf->pending.may_tear) { + surf->pending.may_tear = false; + surf->pending.status |= WESTON_SURFACE_DIRTY_RATE; + } wl_resource_destroy(res); } @@ -9706,8 +9766,10 @@ struct weston_tearing_control *tc = wl_resource_get_user_data(res); struct weston_surface *surf = tc->surface; - if (surf) - surf->tear_control = NULL; + if (surf) { + surf->tearing_control = NULL; + wl_list_remove(&tc->surface_destroy_listener.link); + } free(tc); } @@ -9724,7 +9786,7 @@ uint32_t version; surface = wl_resource_get_user_data(surface_resource); - if (surface->tear_control) { + if (surface->tearing_control) { wl_resource_post_error(resource, WP_TEARING_CONTROL_MANAGER_V1_ERROR_TEARING_CONTROL_EXISTS, "Surface already has a tearing controller"); @@ -9741,9 +9803,11 @@ } control = xzalloc(sizeof *control); - control->may_tear = false; control->surface = surface; - surface->tear_control = control; + surface->tearing_control = control; + control->surface_destroy_listener.notify = tearing_control_base_surface_destroyed; + wl_signal_add(&surface->destroy_signal, &control->surface_destroy_listener); + wl_resource_set_implementation(ctl_res, &tearing_interface, control, free_tearing_control); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/libweston-internal.h new/weston-16.0.1/libweston/libweston-internal.h --- old/weston-16.0.0/libweston/libweston-internal.h 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/libweston-internal.h 2026-10-19 12:07:46.000000000 +0200 @@ -250,7 +250,7 @@ struct weston_tearing_control { struct weston_surface *surface; - bool may_tear; + struct wl_listener surface_destroy_listener; }; /** A client tracker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/perfetto/u_perfetto.cc new/weston-16.0.1/libweston/perfetto/u_perfetto.cc --- old/weston-16.0.0/libweston/perfetto/u_perfetto.cc 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/perfetto/u_perfetto.cc 2026-10-19 12:07:46.000000000 +0200 @@ -129,7 +129,7 @@ } void -util_perfetto_trace_full_end(const char *name, uint64_t track_id, clockid_t clock, uint64_t timestamp) +util_perfetto_trace_full_end(uint64_t track_id, clockid_t clock, uint64_t timestamp) { TRACE_EVENT_END(UTIL_PERFETTO_CATEGORY_DEFAULT_STR, perfetto::Track(track_id), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/perfetto/u_perfetto.h new/weston-16.0.1/libweston/perfetto/u_perfetto.h --- old/weston-16.0.0/libweston/perfetto/u_perfetto.h 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/perfetto/u_perfetto.h 2026-10-19 12:07:46.000000000 +0200 @@ -89,7 +89,7 @@ void util_perfetto_trace_full_begin(const char *name, uint64_t track_id, uint64_t id, clockid_t clock, uint64_t timestamp); -void util_perfetto_trace_full_end(const char *name, uint64_t track_id, clockid_t clock, uint64_t timestamp); +void util_perfetto_trace_full_end(uint64_t track_id, clockid_t clock, uint64_t timestamp); void util_perfetto_trace_commit_debug_annots(const char *name, struct weston_debug_annotations *annots); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/surface-state.c new/weston-16.0.1/libweston/surface-state.c --- old/weston-16.0.0/libweston/surface-state.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/surface-state.c 2026-10-19 12:07:46.000000000 +0200 @@ -161,6 +161,8 @@ weston_reset_color_representation(&state->color_representation); + state->may_tear = false; + state->fifo_barrier = false; state->fifo_wait = false; @@ -538,6 +540,11 @@ surface->is_unmapping = false; surface->is_mapping = false; + if (status & WESTON_SURFACE_DIRTY_RATE) { + surface->may_tear = state->may_tear; + weston_surface_dirty_paint_nodes(surface, WESTON_PAINT_NODE_RATE_DIRTY); + } + if (state->fifo_barrier) weston_fifo_surface_set_barrier(surface); state->fifo_barrier = false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/timeline-perfetto.c new/weston-16.0.1/libweston/timeline-perfetto.c --- old/weston-16.0.0/libweston/timeline-perfetto.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/timeline-perfetto.c 2026-10-19 12:07:46.000000000 +0200 @@ -169,33 +169,32 @@ case TLP_CORE_REPAINT_EXIT_LOOP: break; case TLP_CORE_FLUSH_DAMAGE: - WESTON_TRACE_TIMESTAMP_END("Damaged", surface->damage_track_id, CLOCK_MONOTONIC, now_ns); + WESTON_TRACE_TIMESTAMP_END(surface->damage_track_id, CLOCK_MONOTONIC, now_ns); WESTON_TRACE_TIMESTAMP_BEGIN("Clean", surface->damage_track_id, 0, CLOCK_MONOTONIC, now_ns); break; case TLP_CORE_REPAINT_BEGIN: - WESTON_TRACE_TIMESTAMP_END("Scheduled", output->paint_track_id, CLOCK_MONOTONIC, now_ns); + WESTON_TRACE_TIMESTAMP_END(output->paint_track_id, CLOCK_MONOTONIC, now_ns); WESTON_TRACE_TIMESTAMP_BEGIN("Paint", output->paint_track_id, 0, CLOCK_MONOTONIC, now_ns); break; case TLP_CORE_REPAINT_POSTED: - WESTON_TRACE_TIMESTAMP_END("Paint", output->paint_track_id, CLOCK_MONOTONIC, now_ns); + WESTON_TRACE_TIMESTAMP_END(output->paint_track_id, CLOCK_MONOTONIC, now_ns); WESTON_TRACE_TIMESTAMP_BEGIN("Posted", output->presentation_track_id, 0, CLOCK_MONOTONIC, now_ns); break; case TLP_CORE_REPAINT_FINISHED: - WESTON_TRACE_TIMESTAMP_END("Posted", output->presentation_track_id, CLOCK_MONOTONIC, vblank_ns); + WESTON_TRACE_TIMESTAMP_END(output->presentation_track_id, CLOCK_MONOTONIC, vblank_ns); break; case TLP_CORE_REPAINT_REQ: WESTON_TRACE_TIMESTAMP_BEGIN("Scheduled", output->paint_track_id, 0, CLOCK_MONOTONIC, now_ns); break; case TLP_CORE_COMMIT_DAMAGE: - WESTON_TRACE_TIMESTAMP_END("Clean", surface->damage_track_id, CLOCK_MONOTONIC, now_ns); - WESTON_TRACE_TIMESTAMP_END("Damaged", surface->damage_track_id, CLOCK_MONOTONIC, now_ns); + WESTON_TRACE_TIMESTAMP_END(surface->damage_track_id, CLOCK_MONOTONIC, now_ns); WESTON_TRACE_TIMESTAMP_BEGIN("Damaged", surface->damage_track_id, surface->flow.id, CLOCK_MONOTONIC, now_ns); break; case TLP_RENDERER_GPU_BEGIN: WESTON_TRACE_TIMESTAMP_BEGIN("Active", output->gpu_track_id, 0, CLOCK_MONOTONIC, gpu_ns); break; case TLP_RENDERER_GPU_END: - WESTON_TRACE_TIMESTAMP_END("Active", output->gpu_track_id, CLOCK_MONOTONIC, gpu_ns); + WESTON_TRACE_TIMESTAMP_END(output->gpu_track_id, CLOCK_MONOTONIC, gpu_ns); break; case TLP_INPUT_KERNEL_TS: WESTON_TRACE_INSTANT_TIMESTAMP("event ts", ievent->seat->track_id, ievent->flow.id, CLOCK_MONOTONIC, kernel_input_ts); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/libweston/weston-trace.h new/weston-16.0.1/libweston/weston-trace.h --- old/weston-16.0.0/libweston/weston-trace.h 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/libweston/weston-trace.h 2026-10-19 12:07:46.000000000 +0200 @@ -65,11 +65,11 @@ clock, timestamp); \ } while (0) -#define _WESTON_TRACE_TIMESTAMP_END(name, track_id, clock, timestamp) \ +#define _WESTON_TRACE_TIMESTAMP_END(track_id, clock, timestamp) \ do { \ if (unlikely(util_perfetto_is_tracing_enabled())) \ - util_perfetto_trace_full_end(name, track_id, \ - clock, timestamp); \ + util_perfetto_trace_full_end(track_id, clock, \ + timestamp); \ } while (0) #define _WESTON_TRACE_BEGIN_ANNOTATION() \ @@ -225,7 +225,7 @@ #define _WESTON_TRACE_FUNC() #define _WESTON_TRACE_SET_COUNTER(name, value) #define _WESTON_TRACE_TIMESTAMP_BEGIN(name, track_id, flow_id, clock, timestamp) -#define _WESTON_TRACE_TIMESTAMP_END(name, track_id, clock, timestamp) +#define _WESTON_TRACE_TIMESTAMP_END(track_id, clock, timestamp) #define _WESTON_TRACE_INSTANT_TIMESTAMP(name, track_id, id, clock, timestamp) #define _WESTON_TRACE_BEGIN_ANNOTATION() @@ -240,8 +240,8 @@ #define WESTON_TRACE_SET_COUNTER(name, value) _WESTON_TRACE_SET_COUNTER(name, value) #define WESTON_TRACE_TIMESTAMP_BEGIN(name, track_id, flow_id, clock, timestamp) \ _WESTON_TRACE_TIMESTAMP_BEGIN(name, track_id, flow_id, clock, timestamp) -#define WESTON_TRACE_TIMESTAMP_END(name, track_id, clock, timestamp) \ - _WESTON_TRACE_TIMESTAMP_END(name, track_id, clock, timestamp) +#define WESTON_TRACE_TIMESTAMP_END(track_id, clock, timestamp) \ + _WESTON_TRACE_TIMESTAMP_END(track_id, clock, timestamp) #define WESTON_TRACE_INSTANT_TIMESTAMP(name, track_id, id, clock, timestamp) \ _WESTON_TRACE_INSTANT_TIMESTAMP(name, track_id, id, clock, timestamp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/lua-shell/lua-shell.c new/weston-16.0.1/lua-shell/lua-shell.c --- old/weston-16.0.0/lua-shell/lua-shell.c 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/lua-shell/lua-shell.c 2026-10-19 12:07:46.000000000 +0200 @@ -736,6 +736,23 @@ free(shbinding); } +static struct lua_shell_view * +get_main_lua_shell_view(struct weston_view *view) +{ + /** + * shell views are not created for subsurfaces. So walk the parent tree + * to retrieve main to e.g. give focus to. + */ + + if (!view) + return NULL; + + while (view->parent_view) + view = view->parent_view; + + return get_lua_shell_view(view); +} + static void button_binding_cb(struct weston_pointer *pointer, const struct timespec *time, @@ -743,20 +760,16 @@ { struct lua_shell_binding *shbinding = data; struct lua_shell *ls = shbinding->shell; - struct lua_shell_view *shview = NULL; + struct lua_shell_view *shview = get_main_lua_shell_view(pointer->focus); struct lua_shell_seat *shseat = get_lua_shell_seat(pointer->seat); lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shbinding->callback_regid); - if (pointer->focus) { - shview = get_lua_shell_view(pointer->focus); - if (!shview) - return; - + if (shview) lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shview->lua_regid); - } else { + else lua_pushnil(ls->lua); - } + lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shseat->lua_regid); lua_pushnumber(ls->lua, button); lua_shell_call_function(ls, "[button callback]", 3, 0); @@ -792,17 +805,16 @@ { struct lua_shell_binding *shbinding = data; struct lua_shell *ls = shbinding->shell; - struct lua_shell_view *shview = NULL; + struct lua_shell_view *shview = get_main_lua_shell_view(touch->focus); struct lua_shell_seat *shseat = get_lua_shell_seat(touch->seat); lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shbinding->callback_regid); - if (touch->focus) { - shview = get_lua_shell_view(touch->focus); + if (shview) lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shview->lua_regid); - } else { + else lua_pushnil(ls->lua); - } + lua_rawgeti(ls->lua, LUA_REGISTRYINDEX, shseat->lua_regid); lua_shell_call_function(ls, "[touch callback]", 2, 0); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/lua-shell/shell.lua new/weston-16.0.1/lua-shell/shell.lua --- old/weston-16.0.0/lua-shell/shell.lua 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/lua-shell/shell.lua 2026-10-19 12:07:46.000000000 +0200 @@ -326,10 +326,13 @@ if (active_view ~= nil) then active_view:deactivate() + active_view = nil end - focus_view:activate(seat) - active_view = focus_view + if (focus_view ~= nil) then + focus_view:activate(seat) + active_view = focus_view + end end function my_init() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/weston-16.0.0/meson.build new/weston-16.0.1/meson.build --- old/weston-16.0.0/meson.build 2026-07-14 09:34:50.000000000 +0200 +++ new/weston-16.0.1/meson.build 2026-10-19 12:07:46.000000000 +0200 @@ -1,6 +1,6 @@ project('weston', ['c', 'cpp'], - version: '16.0.0', + version: '16.0.1', default_options: [ 'warning_level=3', 'c_std=gnu11', @@ -179,7 +179,7 @@ dep_libdisplay_info = dependency( 'libdisplay-info', - version: ['>= 0.2.0', '< 0.4.0'], + version: ['>= 0.2.0', '< 0.5.0'], fallback: ['display-info', 'di_dep'], default_options: [ 'werror=false',
