[mutter/wayland] wayland: Kill meta_wayland_compositor_is_native



commit dcd628d289cdddb4bc2889392abf473c4e1b5693
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 17 21:13:09 2014 -0500

    wayland: Kill meta_wayland_compositor_is_native
    
    It's unused. Squash the remaining functionality, setting the DRM FD,
    into the main path.

 src/wayland/meta-wayland-private.h |    3 --
 src/wayland/meta-wayland.c         |   46 ++++++-----------------------------
 2 files changed, 8 insertions(+), 41 deletions(-)
---
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index cba6ed3..69de1b8 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -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);
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 16b0156..6b6c1fe 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -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))
-    {
-      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
+#if defined(CLUTTER_WINDOWING_EGL)
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
     {
-      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 ();
@@ -740,12 +716,6 @@ meta_wayland_finalize (void)
 }
 
 gboolean
-meta_wayland_compositor_is_native (MetaWaylandCompositor *compositor)
-{
-  return compositor->native;
-}
-
-gboolean
 meta_wayland_compositor_activate_vt (MetaWaylandCompositor  *compositor,
                                      int                     vt,
                                      GError                **error)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]