[PATCH weston 08/21] compositor-drm: set all properties in create_output_for_connector
Pekka Paalanen
ppaalanen at gmail.com
Fri Sep 22 14:31:16 UTC 2017
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Move the remaining scattered setup of the fixed properties into
create_output_for_connector(). All these are already known and they
cannot change.
This helps future refactoring.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
libweston/compositor-drm.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index ee3e76dd..19509907 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -3122,9 +3122,6 @@ drm_output_set_mode(struct weston_output *base,
output->base.native_mode = output->base.current_mode;
output->base.native_scale = output->base.current_scale;
- output->base.mm_width = output->connector->mmWidth;
- output->base.mm_height = output->connector->mmHeight;
-
return 0;
}
@@ -3188,12 +3185,6 @@ drm_output_enable(struct weston_output *base)
output->base.gamma_size = output->original_crtc->gamma_size;
output->base.set_gamma = drm_output_set_gamma;
- output->base.subpixel = drm_subpixel_to_wayland(output->connector->subpixel);
-
- if (output->connector->connector_type == DRM_MODE_CONNECTOR_LVDS ||
- output->connector->connector_type == DRM_MODE_CONNECTOR_eDP)
- output->base.connection_internal = true;
-
weston_plane_init(&output->cursor_plane, b->compositor,
INT32_MIN, INT32_MIN);
weston_plane_init(&output->scanout_plane, b->compositor, 0, 0);
@@ -3393,6 +3384,15 @@ create_output_for_connector(struct drm_backend *b,
output->base.make = (char *)make;
output->base.model = (char *)model;
output->base.serial_number = (char *)serial_number;
+ output->base.subpixel = drm_subpixel_to_wayland(output->connector->subpixel);
+
+ if (output->connector->connector_type == DRM_MODE_CONNECTOR_LVDS ||
+ output->connector->connector_type == DRM_MODE_CONNECTOR_eDP)
+ output->base.connection_internal = true;
+
+ output->base.mm_width = output->connector->mmWidth;
+ output->base.mm_height = output->connector->mmHeight;
+
drmModeFreeObjectProperties(props);
for (i = 0; i < output->connector->count_modes; i++) {
--
2.13.5
More information about the wayland-devel
mailing list