[PATCH weston 2/3] compositor: pass the backend config struct to the backends init function

Giulio Camuffo giuliocamuffo at gmail.com
Sat Oct 17 09:24:14 PDT 2015


Add new configuration argument to the backend_init() function, which
will replace the current argc, argv, and config arguments.
After each backend is converted individually the unused parameters
will be removed.
---
 src/compositor-drm.c      | 3 ++-
 src/compositor-fbdev.c    | 3 ++-
 src/compositor-headless.c | 3 ++-
 src/compositor-rdp.c      | 3 ++-
 src/compositor-rpi.c      | 3 ++-
 src/compositor-wayland.c  | 3 ++-
 src/compositor-x11.c      | 3 ++-
 src/compositor.h          | 3 ++-
 src/main.c                | 5 +++--
 9 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 36c3b3e..41f9a82 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -3238,7 +3238,8 @@ err_base:
 
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	struct drm_backend *b;
 	struct drm_parameters param = { 0, };
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 7465df6..57c54c2 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -904,7 +904,8 @@ out_compositor:
 
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	struct fbdev_backend *b;
 	/* TODO: Ideally, available frame buffers should be enumerated using
diff --git a/src/compositor-headless.c b/src/compositor-headless.c
index dba21a6..ba0d8d7 100644
--- a/src/compositor-headless.c
+++ b/src/compositor-headless.c
@@ -260,7 +260,8 @@ err_free:
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor,
 	     int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	int width = 1024, height = 640;
 	char *display_name = NULL;
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 7272f41..1098f01 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -1269,7 +1269,8 @@ err_free_strings:
 
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
-	     struct weston_config *wconfig)
+	     struct weston_config *wconfig,
+	     struct weston_backend_config *config_base)
 {
 	struct rdp_backend *b;
 	struct rdp_backend_config config;
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index 83c01b4..4d7ea7b 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -555,7 +555,8 @@ out_compositor:
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor,
 	     int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	const char *transform = "normal";
 	struct rpi_backend *b;
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 7b11ae4..a819867 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -2056,7 +2056,8 @@ wayland_backend_destroy(struct wayland_backend *b)
 
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	struct wayland_backend *b;
 	struct wayland_output *output;
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 9a23996..ccb7867 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -1701,7 +1701,8 @@ err_free:
 
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
-	     struct weston_config *config)
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base)
 {
 	struct x11_backend *b;
 	int fullscreen = 0;
diff --git a/src/compositor.h b/src/compositor.h
index 172de6f..6bb6222 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -1599,7 +1599,8 @@ noop_renderer_init(struct weston_compositor *ec);
 int
 backend_init(struct weston_compositor *c,
 	     int *argc, char *argv[],
-	     struct weston_config *config);
+	     struct weston_config *config,
+	     struct weston_backend_config *config_base);
 int
 module_init(struct weston_compositor *compositor,
 	    int *argc, char *argv[]);
diff --git a/src/main.c b/src/main.c
index 1591018..11ade46 100644
--- a/src/main.c
+++ b/src/main.c
@@ -638,7 +638,8 @@ int main(int argc, char *argv[])
 	struct wl_event_loop *loop;
 	int (*backend_init)(struct weston_compositor *c,
 			    int *argc, char *argv[],
-			    struct weston_config *config);
+			    struct weston_config *config,
+			    struct weston_backend_config *config_base);
 	int i, fd;
 	char *backend = NULL;
 	char *shell = NULL;
@@ -737,7 +738,7 @@ int main(int argc, char *argv[])
 	if (weston_compositor_init_config(ec, config) < 0)
 		goto out;
 
-	if (backend_init(ec, &argc, argv, config) < 0) {
+	if (backend_init(ec, &argc, argv, config, NULL) < 0) {
 		weston_log("fatal: failed to create compositor backend\n");
 		goto out;
 	}
-- 
2.6.1



More information about the wayland-devel mailing list