Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2c6918f
wayland/surface: Put buffer reference on heap
Sunderland93 Aug 18, 2025
0f28967
drm-buffer/gbm: Support both surface and standalone buffers
Sunderland93 Aug 18, 2025
efae29f
window/x11: Use G_DECLARE_DERIVABLE_TYPE()
Sunderland93 Aug 18, 2025
fae6a93
surface-actor-x11: Move window related unredirect logic to MetaWindowX11
Sunderland93 Aug 18, 2025
469ddbb
clutter/actor: Add semi-private API to check for transitions
Sunderland93 Aug 18, 2025
c6a98b3
wayland: Make MetaWaylandBufferRef reference counted
Sunderland93 Aug 18, 2025
09066db
wayland/buffer-ref: Add helpers for use count tracking
Sunderland93 Aug 18, 2025
b9839b6
cogl/onscreen: Add API to scanout a buffer directly
Sunderland93 Aug 18, 2025
6f5cddb
clutter/view: Make it possible to assign a temporary direct scanout
Sunderland93 Aug 18, 2025
d054eb2
renderer/native: Add API to get primary GPU
Sunderland93 Aug 18, 2025
ba9706c
onscreen/native: Add API to check whether buffer is scanout compatible
Sunderland93 Aug 19, 2025
d65bb64
wayland/dma-buf: Don't advertise modifier support by default
Sunderland93 Aug 19, 2025
3236dd2
wayland/dma-buf: Handle getting dma-buf from detached buffer handle
Sunderland93 Aug 19, 2025
d8481e0
wayland: Add API to acquire a CoglScanout from a surface
Sunderland93 Aug 19, 2025
f0de49a
util: Move MetaLater to its own file
Sunderland93 Aug 19, 2025
6056fb6
display: Initialize MetaCompositor in two steps
Sunderland93 Aug 20, 2025
58ffc4e
later: Make MetaCompositor the owner of the MetaLaters state
Sunderland93 Aug 20, 2025
f48bc60
later: Listen to MetaCompositor signal instead of clutter
Sunderland93 Aug 20, 2025
88e6bda
compositor: Add support for direct scanout of Wayland surfaces
Sunderland93 Aug 20, 2025
bfd97cb
debian: update symbols for libmuffin0
Sunderland93 Aug 21, 2025
3b066b3
Fix build
Sunderland93 Sep 20, 2025
d895b01
Fix build
Sunderland93 Sep 20, 2025
3c9b5c7
wayland/dma-buf: Handle failing to import scanout DMA buffer
Sunderland93 Sep 28, 2025
05b81e6
Use custom page flip function when retrying failed flips
Sunderland93 Feb 2, 2026
4863480
backends: force enable modifiers on tagged devices
Sunderland93 Feb 15, 2026
76854a0
add missing systemd-dev dependency
Sunderland93 Feb 15, 2026
bbfa8ec
compositor/native: fix parent class
Sunderland93 Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions clutter/clutter/clutter-actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -20020,6 +20020,23 @@ clutter_actor_get_transition (ClutterActor *self,
return clos->transition;
}

/**
* clutter_actor_has_transitions: (skip)
*/
gboolean
clutter_actor_has_transitions (ClutterActor *self)
{
const ClutterAnimationInfo *info;

g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);

info = _clutter_actor_get_animation_info_or_defaults (self);
if (info->transitions == NULL)
return FALSE;

return g_hash_table_size (info->transitions) > 0;
}

/**
* clutter_actor_save_easing_state:
* @self: a #ClutterActor
Expand Down
8 changes: 8 additions & 0 deletions clutter/clutter/clutter-muffin.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void clutter_stage_thaw_updates (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_update_resource_scales (ClutterStage *stage);

CLUTTER_EXPORT
void clutter_stage_view_assign_next_scanout (ClutterStageView *stage_view,
CoglScanout *scanout);

CLUTTER_EXPORT
gboolean clutter_actor_has_damage (ClutterActor *actor);

Expand All @@ -83,6 +87,10 @@ void clutter_stage_get_device_coords (ClutterStage *stage,
ClutterInputDevice *device,
ClutterEventSequence *sequence,
graphene_point_t *coords);

CLUTTER_EXPORT
gboolean clutter_actor_has_transitions (ClutterActor *actor);

#undef __CLUTTER_H_INSIDE__

#endif /* __CLUTTER_MUFFIN_H__ */
3 changes: 2 additions & 1 deletion clutter/clutter/clutter-stage-view-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ const cairo_region_t * clutter_stage_view_peek_redraw_clip (ClutterStageView *vi

cairo_region_t * clutter_stage_view_take_redraw_clip (ClutterStageView *view);


void clutter_stage_view_transform_rect_to_onscreen (ClutterStageView *view,
const cairo_rectangle_int_t *src_rect,
int dst_width,
int dst_height,
cairo_rectangle_int_t *dst_rect);

CoglScanout * clutter_stage_view_take_scanout (ClutterStageView *view);

#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */
23 changes: 23 additions & 0 deletions clutter/clutter/clutter-stage-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "clutter/clutter-damage-history.h"
#include "clutter/clutter-private.h"
#include "clutter/clutter-muffin.h"
#include "cogl/cogl.h"

enum
{
Expand Down Expand Up @@ -64,6 +66,8 @@ typedef struct _ClutterStageViewPrivate
CoglOffscreen *framebuffer;
} shadow;

CoglScanout *next_scanout;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not checked or freed in dispose()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next_scanout does not need to be released in clutter_stage_view_dispose() because ClutterStageView does not own it at disposal time. By the time dispose() runs, next_scanout is guaranteed to be either NULL or no longer owned by the stage view.


gboolean has_redraw_clip;
cairo_region_t *redraw_clip;

Expand Down Expand Up @@ -923,6 +927,25 @@ clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *vie
cogl_matrix_init_identity (matrix);
}

void
clutter_stage_view_assign_next_scanout (ClutterStageView *view,
CoglScanout *scanout)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);

g_set_object (&priv->next_scanout, scanout);
}

CoglScanout *
clutter_stage_view_take_scanout (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);

return g_steal_pointer (&priv->next_scanout);
}

static void
clutter_stage_view_get_property (GObject *object,
guint prop_id,
Expand Down
28 changes: 27 additions & 1 deletion clutter/clutter/cogl/clutter-stage-cogl.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,20 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
return res;
}

static void
clutter_stage_cogl_scanout_view (ClutterStageCogl *stage_cogl,
ClutterStageView *view,
CoglScanout *scanout)
{
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
CoglOnscreen *onscreen;

g_return_if_fail (cogl_is_onscreen (framebuffer));

onscreen = COGL_ONSCREEN (framebuffer);
cogl_onscreen_direct_scanout (onscreen, scanout);
}

static void
clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
{
Expand Down Expand Up @@ -820,11 +834,23 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
for (l = _clutter_stage_window_get_views (stage_window); l; l = l->next)
{
ClutterStageView *view = l->data;
g_autoptr (CoglScanout) scanout = NULL;

if (!clutter_stage_view_has_redraw_clip (view))
continue;

swap_event |= clutter_stage_cogl_redraw_view (stage_window, view);
scanout = clutter_stage_view_take_scanout (view);
if (scanout)
{
clutter_stage_cogl_scanout_view (stage_cogl,
view,
scanout);
swap_event = TRUE;
}
else
{
swap_event |= clutter_stage_cogl_redraw_view (stage_window, view);
}
}

if (has_redraw_clip)
Expand Down
21 changes: 21 additions & 0 deletions cogl/cogl/cogl-onscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,27 @@ cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen)
return winsys->onscreen_get_buffer_age (onscreen);
}

void
cogl_onscreen_direct_scanout (CoglOnscreen *onscreen,
CoglScanout *scanout)
{
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
const CoglWinsysVtable *winsys;
CoglFrameInfo *info;

g_return_if_fail (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
g_return_if_fail (_cogl_winsys_has_feature (COGL_WINSYS_FEATURE_SYNC_AND_COMPLETE_EVENT));

info = _cogl_frame_info_new ();
info->frame_counter = onscreen->frame_counter;
g_queue_push_tail (&onscreen->pending_frame_infos, info);

winsys = _cogl_framebuffer_get_winsys (framebuffer);
winsys->onscreen_direct_scanout (onscreen, scanout);

onscreen->frame_counter++;
}

#ifdef COGL_HAS_X11_SUPPORT
uint32_t
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
Expand Down
9 changes: 9 additions & 0 deletions cogl/cogl/cogl-onscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ G_BEGIN_DECLS
typedef struct _CoglOnscreen CoglOnscreen;
#define COGL_ONSCREEN(X) ((CoglOnscreen *)(X))

typedef struct _CoglScanout CoglScanout;

/**
* cogl_onscreen_get_gtype:
*
Expand Down Expand Up @@ -284,6 +286,13 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
const int *rectangles,
int n_rectangles);

/**
* cogl_onscreen_direct_scanout: (skip)
*/
COGL_EXPORT void
cogl_onscreen_direct_scanout (CoglOnscreen *onscreen,
CoglScanout *scanout);

/**
* cogl_onscreen_swap_region:
* @onscreen: A #CoglOnscreen framebuffer
Expand Down
27 changes: 27 additions & 0 deletions cogl/cogl/cogl-scanout.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2019 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cogl-config.h"

#include "cogl-scanout.h"

G_DEFINE_INTERFACE (CoglScanout, cogl_scanout, G_TYPE_OBJECT)

static void
cogl_scanout_default_init (CoglScanoutInterface *iface)
{
}
35 changes: 35 additions & 0 deletions cogl/cogl/cogl-scanout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2019 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef COGL_SCANOUT_H
#define COGL_SCANOUT_H

#include "cogl/cogl-types.h"

#include <glib-object.h>

#define COGL_TYPE_SCANOUT (cogl_scanout_get_type ())
COGL_EXPORT
G_DECLARE_INTERFACE (CoglScanout, cogl_scanout,
COGL, SCANOUT, GObject)

struct _CoglScanoutInterface
{
GTypeInterface parent_iface;
};

#endif /* COGL_SCANOUT_H */
1 change: 1 addition & 0 deletions cogl/cogl/cogl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
#include <cogl/cogl-fence.h>
#include <cogl/cogl-glib-source.h>
#include <cogl/cogl-trace.h>
#include <cogl/cogl-scanout.h>
/* XXX: This will definitly go away once all the Clutter winsys
* code has been migrated down into Cogl! */
#include <cogl/deprecated/cogl-clutter.h>
Expand Down
2 changes: 2 additions & 0 deletions cogl/cogl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ cogl_nonintrospected_headers = [
'cogl-version.h',
'cogl-gtype-private.h',
'cogl-glib-source.h',
'cogl-scanout.h',
]

cogl_nodist_headers = [
Expand Down Expand Up @@ -347,6 +348,7 @@ cogl_sources = [
'cogl-closure-list.c',
'cogl-fence.c',
'cogl-fence-private.h',
'cogl-scanout.c',
'deprecated/cogl-material-compat.c',
'deprecated/cogl-program.c',
'deprecated/cogl-program-private.h',
Expand Down
5 changes: 5 additions & 0 deletions cogl/cogl/winsys/cogl-winsys-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "cogl-renderer.h"
#include "cogl-onscreen.h"
#include "cogl-scanout.h"

#ifdef COGL_HAS_XLIB_SUPPORT
#include "cogl-texture-pixmap-x11-private.h"
Expand Down Expand Up @@ -116,6 +117,10 @@ typedef struct _CoglWinsysVtable
const int *rectangles,
int n_rectangles);

void
(*onscreen_direct_scanout) (CoglOnscreen *onscreen,
CoglScanout *scanout);

void
(*onscreen_set_visibility) (CoglOnscreen *onscreen,
gboolean visibility);
Expand Down
1 change: 1 addition & 0 deletions data/61-muffin.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DRIVER=="tegra-host1x", SUBSYSTEM=="platform", TAG+="muffin-device-requires-kms-modifiers"
6 changes: 6 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ configure_file(
install_dir: schemadir
)

if have_libgudev
install_data(['61-muffin.rules'],
install_dir: join_paths(udev_dir, 'rules.d'),
)
endif

1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Build-Depends:
libxt-dev,
meson (>= 1.0.0),
pkg-config (>= 0.22),
systemd-dev [linux-any],
udev [linux-any],
wayland-protocols (>= 1.23) [linux-any],
xauth <!nocheck>,
Expand Down
1 change: 1 addition & 0 deletions debian/libmuffin0.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
usr/lib/*/libmuffin.so.*
usr/lib/*/muffin/*.so.*
usr/lib/udev/rules.d/61-muffin.rules
usr/libexec/muffin-restart-helper
6 changes: 4 additions & 2 deletions debian/libmuffin0.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ libmuffin-clutter-0.so.0 libmuffin0 #MINVER#
clutter_actor_has_mapped_clones@Base 5.3.0
clutter_actor_has_overlaps@Base 5.3.0
clutter_actor_has_pointer@Base 5.3.0
clutter_actor_has_transitions@Base 6.4.1
clutter_actor_hide@Base 5.3.0
clutter_actor_inhibit_culling@Base 5.3.0
clutter_actor_insert_child_above@Base 5.3.0
Expand Down Expand Up @@ -1159,6 +1160,7 @@ libmuffin-clutter-0.so.0 libmuffin0 #MINVER#
clutter_stage_state_get_type@Base 5.3.0
clutter_stage_thaw_updates@Base 5.3.0
clutter_stage_update_resource_scales@Base 5.3.0
clutter_stage_view_assign_next_scanout@Base 6.4.1
clutter_stage_view_cogl_get_type@Base 5.3.0
clutter_stage_view_get_framebuffer@Base 5.3.0
clutter_stage_view_get_layout@Base 5.3.0
Expand Down Expand Up @@ -1780,6 +1782,7 @@ libmuffin-cogl-0.so.0 libmuffin0 #MINVER#
cogl_onscreen_add_dirty_callback@Base 5.3.0
cogl_onscreen_add_frame_callback@Base 5.3.0
cogl_onscreen_add_resize_callback@Base 5.3.0
cogl_onscreen_direct_scanout@Base 6.4.1
cogl_onscreen_dirty_closure_get_gtype@Base 5.3.0
cogl_onscreen_get_buffer_age@Base 5.3.0
cogl_onscreen_get_frame_counter@Base 5.3.0
Expand Down Expand Up @@ -1914,6 +1917,7 @@ libmuffin-cogl-0.so.0 libmuffin0 #MINVER#
cogl_renderer_set_custom_winsys@Base 5.3.0
cogl_renderer_set_driver@Base 5.3.0
cogl_renderer_set_winsys_id@Base 5.3.0
cogl_scanout_get_type@Base 6.4.1
cogl_set_backface_culling_enabled@Base 5.3.0
cogl_set_depth_test_enabled@Base 5.3.0
cogl_set_tracing_disabled_on_thread@Base 5.3.0
Expand Down Expand Up @@ -2697,8 +2701,6 @@ libmuffin.so.0 libmuffin0 #MINVER#
meta_window_move_resize_frame@Base 5.3.0
meta_window_move_to_monitor@Base 5.3.0
meta_window_raise@Base 5.3.0
meta_window_requested_bypass_compositor@Base 5.3.0
meta_window_requested_dont_bypass_compositor@Base 5.3.0
meta_window_set_compositor_private@Base 5.3.0
meta_window_set_demands_attention@Base 5.3.0
meta_window_set_icon_geometry@Base 5.3.0
Expand Down
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ have_libgudev = get_option('udev')
if have_libgudev
libudev_dep = dependency('libudev', version: udev_req)
gudev_dep = dependency('gudev-1.0', version: gudev_req)
udev_dep = dependency('udev')
udev_dir = get_option('udev_dir')
if udev_dir == ''
udev_dir = udev_dep.get_variable('udevdir')
endif
endif

have_native_backend = get_option('native_backend')
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
description: 'Enable udev support when using the X11 backend'
)

option('udev_dir',
type: 'string',
value: '',
description: 'Absolute path of the udev base directory'
)

option('libwacom',
type: 'boolean',
value: true,
Expand Down Expand Up @@ -150,7 +156,7 @@
option('xwayland_grab_default_access_rules',
type: 'string',
value: 'gnome-boxes,remote-viewer,virt-viewer,virt-manager,vinagre,vncviewer,Xephyr',
description: 'Comma delimited list of applications ressources or class allowed to issue X11 grabs in Xwayland'

Check failure on line 159 in meson_options.txt

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22.3-amd64, Mint 22, true) / Mint 22

ressources ==> resources
)

option('xwayland_initfd',
Expand Down
Loading
Loading