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;
|
MetaXWaylandManager xwayland_manager;
|
||||||
|
|
||||||
MetaLauncher *launcher;
|
MetaLauncher *launcher;
|
||||||
gboolean native;
|
|
||||||
|
|
||||||
MetaWaylandSeat *seat;
|
MetaWaylandSeat *seat;
|
||||||
};
|
};
|
||||||
@ -106,8 +105,6 @@ void meta_wayland_compositor_set_input_focus (MetaWaylandComp
|
|||||||
gboolean meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
gboolean meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||||
const ClutterEvent *event);
|
const ClutterEvent *event);
|
||||||
|
|
||||||
gboolean meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor);
|
|
||||||
|
|
||||||
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);
|
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);
|
||||||
void meta_wayland_buffer_ref (MetaWaylandBuffer *buffer);
|
void meta_wayland_buffer_ref (MetaWaylandBuffer *buffer);
|
||||||
void meta_wayland_buffer_unref (MetaWaylandBuffer *buffer);
|
void meta_wayland_buffer_unref (MetaWaylandBuffer *buffer);
|
||||||
|
@ -600,30 +600,11 @@ meta_wayland_log_func (const char *fmt,
|
|||||||
g_free (str);
|
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
|
void
|
||||||
meta_wayland_init (void)
|
meta_wayland_init (void)
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
|
MetaWaylandCompositor *compositor = &_meta_wayland_compositor;
|
||||||
MetaMonitorManager *monitors;
|
MetaMonitorManager *monitors;
|
||||||
int drm_fd;
|
|
||||||
|
|
||||||
memset (compositor, 0, sizeof (MetaWaylandCompositor));
|
memset (compositor, 0, sizeof (MetaWaylandCompositor));
|
||||||
|
|
||||||
@ -668,21 +649,16 @@ meta_wayland_init (void)
|
|||||||
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
||||||
g_error ("Failed to initialize Clutter");
|
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;
|
ClutterBackend *backend = clutter_get_default_backend ();
|
||||||
if (!meta_launcher_set_drm_fd (compositor->launcher, drm_fd, &error))
|
CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
|
||||||
{
|
CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (cogl_context));
|
||||||
g_error ("Failed to set DRM fd to weston-launch and become DRM master: %s", error->message);
|
int drm_fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
|
||||||
g_error_free (error);
|
meta_launcher_set_drm_fd (compositor->launcher, drm_fd, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
compositor->native = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
compositor->native = FALSE;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
meta_monitor_manager_initialize ();
|
meta_monitor_manager_initialize ();
|
||||||
monitors = meta_monitor_manager_get ();
|
monitors = meta_monitor_manager_get ();
|
||||||
@ -739,12 +715,6 @@ meta_wayland_finalize (void)
|
|||||||
meta_launcher_free (compositor->launcher);
|
meta_launcher_free (compositor->launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor)
|
|
||||||
{
|
|
||||||
return compositor->native;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_wayland_compositor_activate_vt (MetaWaylandCompositor *compositor,
|
meta_wayland_compositor_activate_vt (MetaWaylandCompositor *compositor,
|
||||||
int vt,
|
int vt,
|
||||||
|
Loading…
Reference in New Issue
Block a user