summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2016-03-30 18:59:18 -0700
committerBryce Harrington <bryce@osg.samsung.com>2016-04-06 12:20:44 -0700
commite2abf90c49733a7c15b4af49c02531da95f6a94c (patch)
tree246f140084746c6dbb68bf450e5da6ba95a03ef9
parent2c19bd9e3b0802da6c9380f28897955e239df864 (diff)
drm: Code and comments reformatting for consistency with other backend configs
-rw-r--r--src/compositor-drm.c10
-rw-r--r--src/compositor-drm.h43
-rw-r--r--src/main.c6
3 files changed, 38 insertions, 21 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index f039c008..691d132d 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -46,13 +46,13 @@
#include <gbm.h>
#include <libudev.h>
-#include "shared/helpers.h"
-#include "shared/timespec-util.h"
-#include "libbacklight.h"
#include "compositor.h"
#include "compositor-drm.h"
+#include "shared/helpers.h"
+#include "shared/timespec-util.h"
#include "gl-renderer.h"
#include "pixman-renderer.h"
+#include "libbacklight.h"
#include "libinput-seat.h"
#include "launcher-util.h"
#include "vaapi-recorder.h"
@@ -3224,7 +3224,8 @@ err_compositor:
}
WL_EXPORT int
-backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
+backend_init(struct weston_compositor *compositor,
+ int *argc, char *argv[],
struct weston_config *wc,
struct weston_backend_config *config_base)
{
@@ -3241,5 +3242,6 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
b = drm_backend_create(compositor, config);
if (b == NULL)
return -1;
+
return 0;
}
diff --git a/src/compositor-drm.h b/src/compositor-drm.h
index 423378a4..3b54ca55 100644
--- a/src/compositor-drm.h
+++ b/src/compositor-drm.h
@@ -25,8 +25,8 @@
* SOFTWARE.
*/
-#ifndef WESTON_COMPOSITOR_DRM_H
-#define WESTON_COMPOSITOR_DRM_H
+#ifndef _WESTON_COMPOSITOR_DRM_H
+#define _WESTON_COMPOSITOR_DRM_H
#ifdef __cplusplus
extern "C" {
@@ -73,30 +73,43 @@ struct weston_drm_backend_output_config {
struct weston_drm_backend_config {
struct weston_backend_config base;
- /** The connector id of the output to be initialized. A value of 0 will
- * enable all available outputs. */
+ /** The connector id of the output to be initialized.
+ *
+ * A value of 0 will enable all available outputs.
+ */
int connector;
+
/** The tty to be used. Set to 0 to use the current tty. */
int tty;
- /** If true the pixman renderer will be used instead of the OpenGL ES
- * renderer. */
+
+ /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */
bool use_pixman;
- /** The seat to be used for input and output. If NULL the default "seat0"
- * will be used.
- * The backend will take ownership of the seat_id pointer and will free
- * it on backend destruction. */
+
+ /** The seat to be used for input and output.
+ *
+ * If NULL the default "seat0" will be used. The backend will
+ * take ownership of the seat_id pointer and will free it on
+ * backend destruction.
+ */
char *seat_id;
- /** The pixel format of the framebuffer to be used. Valid values are:
+
+ /** The pixel format of the framebuffer to be used.
+ *
+ * Valid values are:
* - NULL - The default format ("xrgb8888") will be used;
* - "xrgb8888";
* - "rgb565"
* - "xrgb2101010"
* The backend will take ownership of the format pointer and will free
- * it on backend destruction. */
+ * it on backend destruction.
+ */
char *gbm_format;
- /** Callback used to configure the outputs. This function will be called
- * by the backend when a new DRM output needs to be configured. */
+ /** Callback used to configure the outputs.
+ *
+ * This function will be called by the backend when a new DRM
+ * output needs to be configured.
+ */
enum weston_drm_backend_output_mode
(*configure_output)(struct weston_compositor *compositor,
struct weston_drm_backend_config *backend_config,
@@ -108,4 +121,4 @@ struct weston_drm_backend_config {
}
#endif
-#endif
+#endif /* _WESTON_COMPOSITOR_DRM_H */
diff --git a/src/main.c b/src/main.c
index 55a991c3..5985391e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -675,6 +675,7 @@ 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;
@@ -731,7 +732,7 @@ load_drm_backend(struct weston_compositor *c, const char *backend,
struct weston_config_section *section;
int ret = 0;
- config = zalloc(sizeof *config);
+ config = zalloc(sizeof (struct drm_config));
if (!config)
return -1;
@@ -755,7 +756,8 @@ load_drm_backend(struct weston_compositor *c, const char *backend,
config->base.base.struct_size = sizeof(struct weston_drm_backend_config);
config->base.configure_output = drm_configure_output;
- if (load_backend_new(c, backend, &config->base.base) < 0) {
+ if (load_backend_new(c, backend,
+ (struct weston_backend_config *)(&config->base)) < 0) {
ret = -1;
free(config->base.gbm_format);
free(config->base.seat_id);