Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6afeb75
wayland/surface: Put buffer reference on heap
Sunderland93 Aug 18, 2025
f0cc9a8
drm-buffer/gbm: Support both surface and standalone buffers
Sunderland93 Aug 18, 2025
61f7704
window/x11: Use G_DECLARE_DERIVABLE_TYPE()
Sunderland93 Aug 18, 2025
e12d68a
surface-actor-x11: Move window related unredirect logic to MetaWindowX11
Sunderland93 Aug 18, 2025
526c32a
clutter/actor: Add semi-private API to check for transitions
Sunderland93 Aug 18, 2025
227dcc9
wayland: Make MetaWaylandBufferRef reference counted
Sunderland93 Aug 18, 2025
10e552b
wayland/buffer-ref: Add helpers for use count tracking
Sunderland93 Aug 18, 2025
2860c83
cogl/onscreen: Add API to scanout a buffer directly
Sunderland93 Aug 18, 2025
7bbc18b
clutter/view: Make it possible to assign a temporary direct scanout
Sunderland93 Aug 18, 2025
2f387ba
renderer/native: Add API to get primary GPU
Sunderland93 Aug 18, 2025
49fe73a
onscreen/native: Add API to check whether buffer is scanout compatible
Sunderland93 Aug 19, 2025
aad8643
wayland/dma-buf: Don't advertise modifier support by default
Sunderland93 Aug 19, 2025
fed926d
wayland/dma-buf: Handle getting dma-buf from detached buffer handle
Sunderland93 Aug 19, 2025
a537e38
wayland: Add API to acquire a CoglScanout from a surface
Sunderland93 Aug 19, 2025
fcd14d3
util: Move MetaLater to its own file
Sunderland93 Aug 19, 2025
742bea3
display: Initialize MetaCompositor in two steps
Sunderland93 Aug 20, 2025
3986a44
later: Make MetaCompositor the owner of the MetaLaters state
Sunderland93 Aug 20, 2025
cc0a694
later: Listen to MetaCompositor signal instead of clutter
Sunderland93 Aug 20, 2025
65d3479
compositor: Add support for direct scanout of Wayland surfaces
Sunderland93 Aug 20, 2025
8366b30
debian: update symbols for libmuffin0
Sunderland93 Aug 21, 2025
0c337c1
Fix build
Sunderland93 Sep 20, 2025
01bd91b
Fix build
Sunderland93 Sep 20, 2025
0267671
wayland/dma-buf: Handle failing to import scanout DMA buffer
Sunderland93 Sep 28, 2025
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__ */
2 changes: 2 additions & 0 deletions clutter/clutter/clutter-stage-view-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ const cairo_region_t * clutter_stage_view_peek_redraw_clip (ClutterStageView *vi

cairo_region_t * clutter_stage_view_take_redraw_clip (ClutterStageView *view);

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 @@ -24,6 +24,8 @@
#include <math.h>

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

enum
{
Expand Down Expand Up @@ -52,6 +54,8 @@ typedef struct _ClutterStageViewPrivate
CoglOffscreen *shadowfb;
CoglPipeline *shadowfb_pipeline;

CoglScanout *next_scanout;

gboolean has_redraw_clip;
cairo_region_t *redraw_clip;

Expand Down Expand Up @@ -407,6 +411,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 @@ -989,6 +989,20 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
}
}

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 @@ -1016,11 +1030,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 @@ -117,6 +118,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
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 @@ -1771,6 +1773,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 @@ -1905,6 +1908,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 @@ -2681,8 +2685,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
Loading
Loading