Add support for the rotation property

This commit is contained in:
Simon Ser 2020-05-26 11:34:17 +02:00
parent 234dce4f20
commit 95da3ee649
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
3 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -57,6 +57,7 @@ tests = {
],
'prop': [
'alpha',
'rotation',
],
}

View file

@ -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;