summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2016-04-01 16:40:38 -0700
committerBryce Harrington <bryce@osg.samsung.com>2016-04-06 12:20:57 -0700
commitcd2c4f0ccd866a905444dc90828830a6c27dd07d (patch)
tree52c4fa945d21d8c5f8ea1c23cfc557257365e41a
parentd677d1c303daadbd621624c4af6042aa92cf8d99 (diff)
drm: Drop use of drm_config config wrapperlibweston-backend-config
With the use_current_mode moved into the main config class, this small wrapper is redundant. Dropping it helps make the drm backend config initialization more consistent with the other backends.
-rw-r--r--src/main.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/src/main.c b/src/main.c
index b5baa0e3..50740df0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -688,12 +688,6 @@ load_backend_new(struct weston_compositor *compositor, const char *backend,
}
-// TODO: Why is there a wrapper around the drm config base object?
-struct drm_config {
- struct weston_drm_backend_config base;
- bool use_current_mode;
-};
-
static enum weston_drm_backend_output_mode
drm_configure_output(struct weston_compositor *c,
bool use_current_mode,
@@ -740,39 +734,38 @@ static int
load_drm_backend(struct weston_compositor *c, const char *backend,
int *argc, char **argv, struct weston_config *wc)
{
- struct drm_config *config;
+ struct weston_drm_backend_config *config;
struct weston_config_section *section;
int ret = 0;
- config = zalloc(sizeof (struct drm_config));
+ config = zalloc(sizeof (struct weston_drm_backend_config));
if (!config)
return -1;
const struct weston_option options[] = {
- { WESTON_OPTION_INTEGER, "connector", 0, &config->base.connector },
- { WESTON_OPTION_STRING, "seat", 0, &config->base.seat_id },
- { WESTON_OPTION_INTEGER, "tty", 0, &config->base.tty },
- { WESTON_OPTION_BOOLEAN, "current-mode", 0,
- &config->use_current_mode },
- { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config->base.use_pixman },
+ { WESTON_OPTION_INTEGER, "connector", 0, &config->connector },
+ { WESTON_OPTION_STRING, "seat", 0, &config->seat_id },
+ { WESTON_OPTION_INTEGER, "tty", 0, &config->tty },
+ { WESTON_OPTION_BOOLEAN, "current-mode", 0, &config->use_current_mode },
+ { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config->use_pixman },
};
parse_options(options, ARRAY_LENGTH(options), argc, argv);
section = weston_config_get_section(wc, "core", NULL, NULL);
weston_config_section_get_string(section,
- "gbm-format", &config->base.gbm_format,
+ "gbm-format", &config->gbm_format,
NULL);
- config->base.base.struct_version = 1;
- config->base.base.struct_size = sizeof(struct weston_drm_backend_config);
- config->base.configure_output = drm_configure_output;
+ config->base.struct_version = 1;
+ config->base.struct_size = sizeof(struct weston_drm_backend_config);
+ config->configure_output = drm_configure_output;
ret = load_backend_new(c, backend,
- (struct weston_backend_config *)(&config->base));
+ (struct weston_backend_config *)config);
- free(config->base.gbm_format);
- free(config->base.seat_id);
+ free(config->gbm_format);
+ free(config->seat_id);
free(config);
return ret;