summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-02-07 15:31:22 +0100
committerAdam Jackson <ajax@redhat.com>2017-02-23 14:27:16 -0500
commitabf3bc68db579eb524c2eb5786daa5a00957a2f8 (patch)
tree2370958712538aa9cccb013bebe0bc0d83f92b28
parentfd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df (diff)
xwayland: CRTC should support all rotations
If the Wayland compositor sets a rotation on the output, Xwayland translates the transformation as an xrandr rotation for the given output. However, if the rotation is not supported by the CRTC, this is not a valid setup and xrandr queries will fail. Pretend we support all rotations and reflections so that the configuration remains a valid xrandr setup. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit afeace27d3818274b75d59375771dc964d2f56bb)
-rw-r--r--hw/xwayland/xwayland-output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 150b67a4d..a4bc185da 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -31,6 +31,12 @@
#include <randrstr.h>
#define DEFAULT_DPI 96
+#define ALL_ROTATIONS (RR_Rotate_0 | \
+ RR_Rotate_90 | \
+ RR_Rotate_180 | \
+ RR_Rotate_270 | \
+ RR_Reflect_X | \
+ RR_Reflect_Y)
static Rotation
wl_transform_to_xrandr(enum wl_output_transform transform)
@@ -270,6 +276,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
ErrorF("Failed creating RandR CRTC\n");
goto err;
}
+ RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS);
xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name,
strlen(name), xwl_output);
@@ -321,7 +328,7 @@ xwl_output_remove(struct xwl_output *xwl_output)
static Bool
xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations)
{
- *rotations = 0;
+ *rotations = ALL_ROTATIONS;
return TRUE;
}