From 95da3ee649fe42bb147789d5092e95c8f61fab77 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 26 May 2020 11:34:17 +0200 Subject: [PATCH] Add support for the rotation property --- plane.c | 4 ++++ test/meson.build | 1 + test/test_prop.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/plane.c b/plane.c index 2874395..781b741 100644 --- a/plane.c +++ b/plane.c @@ -216,6 +216,10 @@ bool plane_apply(struct liftoff_plane *plane, struct liftoff_layer *layer, layer_prop->value == 0xFFFF) { continue; /* Layer is completely opaque */ } + if (strcmp(layer_prop->name, "rotation") == 0 && + layer_prop->value == DRM_MODE_ROTATE_0) { + continue; /* Layer isn't rotated */ + } *compatible = false; drmModeAtomicSetCursor(req, cursor); return true; diff --git a/test/meson.build b/test/meson.build index 0cab819..7e96bdf 100644 --- a/test/meson.build +++ b/test/meson.build @@ -57,6 +57,7 @@ tests = { ], 'prop': [ 'alpha', + 'rotation', ], } diff --git a/test/test_prop.c b/test/test_prop.c index e9ec486..585b32f 100644 --- a/test/test_prop.c +++ b/test/test_prop.c @@ -55,6 +55,9 @@ int main(int argc, char *argv[]) { if (strcmp(test_name, "alpha") == 0) { require_prop_value = (uint16_t)(0.5 * 0xFFFF); default_value = 0xFFFF; /* opaque */ + } else if (strcmp(test_name, "rotation") == 0) { + require_prop_value = DRM_MODE_ROTATE_180; + default_value = DRM_MODE_ROTATE_0; } else { fprintf(stderr, "no such test: %s\n", test_name); return 1;