mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
wayland: Kill meta_wayland_compositor_is_native
It's unused. Squash the remaining functionality, setting the DRM FD, into the main path.
This commit is contained in:
parent
6038877c4c
commit
dcd628d289
@ -87,7 +87,6 @@ struct _MetaWaylandCompositor
|
||||
MetaXWaylandManager xwayland_manager;
|
||||
|
||||
MetaLauncher *launcher;
|
||||
gboolean native;
|
||||
|
||||
MetaWaylandSeat *seat;
|
||||
};
|
||||
@ -106,8 +105,6 @@ void meta_wayland_compositor_set_input_focus (MetaWaylandComp
|
||||
gboolean meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||
const ClutterEvent *event);
|
||||
|
||||
gboolean meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor);
|
||||
|
||||
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);
|
||||
void meta_wayland_buffer_ref (MetaWaylandBuffer *buffer);
|
||||
void meta_wayland_buffer_unref (MetaWaylandBuffer *buffer);
|
||||
|
@ -600,30 +600,11 @@ meta_wayland_log_func (const char *fmt,
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
are_we_native (int *out_drm_fd)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
|
||||
CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (cogl_context));
|
||||
|
||||
if (cogl_renderer_get_winsys_id (cogl_renderer) == COGL_WINSYS_ID_EGL_KMS)
|
||||
{
|
||||
*out_drm_fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_init (void)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
|
||||
MetaMonitorManager *monitors;
|
||||
int drm_fd;
|
||||
|
||||
memset (compositor, 0, sizeof (MetaWaylandCompositor));
|
||||
|
||||
@ -668,21 +649,16 @@ meta_wayland_init (void)
|
||||
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
||||
g_error ("Failed to initialize Clutter");
|
||||
|
||||
if (are_we_native (&drm_fd))
|
||||
#if defined(CLUTTER_WINDOWING_EGL)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
|
||||
{
|
||||
GError *error = NULL;
|
||||
if (!meta_launcher_set_drm_fd (compositor->launcher, drm_fd, &error))
|
||||
{
|
||||
g_error ("Failed to set DRM fd to weston-launch and become DRM master: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
compositor->native = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
compositor->native = FALSE;
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
|
||||
CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (cogl_context));
|
||||
int drm_fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
|
||||
meta_launcher_set_drm_fd (compositor->launcher, drm_fd, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
meta_monitor_manager_initialize ();
|
||||
monitors = meta_monitor_manager_get ();
|
||||
@ -739,12 +715,6 @@ meta_wayland_finalize (void)
|
||||
meta_launcher_free (compositor->launcher);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
return compositor->native;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_compositor_activate_vt (MetaWaylandCompositor *compositor,
|
||||
int vt,
|
||||
|
Loading…
Reference in New Issue
Block a user