compositor: Use weston_head transform for output default

If the output only has a single weston_head attached to it, take its
declared transform as the default transform.

With the previous patches, this allows a device declaring the KMS 'panel
orientation' property (e.g. through DeviceTree) to autoconfigure to the
correct display rotation when running Weston.

Signed-off-by: Daniel Stone <daniels@collabora.com>
dev
Daniel Stone 5 years ago
parent 72e7a1ed48
commit 1c0507b12a
  1. 9
      compositor/main.c

@ -1700,6 +1700,7 @@ drm_backend_output_configure(struct weston_output *output,
const struct weston_drm_output_api *api; const struct weston_drm_output_api *api;
enum weston_drm_backend_output_mode mode = enum weston_drm_backend_output_mode mode =
WESTON_DRM_BACKEND_OUTPUT_PREFERRED; WESTON_DRM_BACKEND_OUTPUT_PREFERRED;
uint32_t transform = WL_OUTPUT_TRANSFORM_NORMAL;
char *s; char *s;
char *modeline = NULL; char *modeline = NULL;
char *gbm_format = NULL; char *gbm_format = NULL;
@ -1731,9 +1732,13 @@ drm_backend_output_configure(struct weston_output *output,
} }
free(modeline); free(modeline);
if (count_remaining_heads(output, NULL) == 1) {
struct weston_head *head = weston_output_get_first_head(output);
transform = weston_head_get_transform(head);
}
wet_output_set_scale(output, section, 1, 0); wet_output_set_scale(output, section, 1, 0);
if (wet_output_set_transform(output, section, if (wet_output_set_transform(output, section, transform,
WL_OUTPUT_TRANSFORM_NORMAL,
UINT32_MAX) < 0) { UINT32_MAX) < 0) {
return -1; return -1;
} }

Loading…
Cancel
Save