diff --git a/alloc.c b/alloc.c index 353b5ea..e9f0a19 100644 --- a/alloc.c +++ b/alloc.c @@ -127,7 +127,7 @@ plane_step_init_next(struct alloc_step *step, struct alloc_step *prev, if (layer != NULL) { zpos_prop = layer_get_property(layer, "zpos"); } - if (zpos_prop != NULL && plane->type != DRM_PLANE_TYPE_PRIMARY) { + if (zpos_prop != NULL) { step->last_layer_zpos = zpos_prop->value; } else { step->last_layer_zpos = prev->last_layer_zpos; @@ -212,9 +212,6 @@ has_allocated_layer_over(struct liftoff_output *output, struct alloc_step *step, if (i >= (ssize_t)step->plane_idx) { break; } - if (other_plane->type == DRM_PLANE_TYPE_PRIMARY) { - continue; - } other_layer = step->alloc[i]; if (other_layer == NULL) { @@ -253,9 +250,6 @@ has_allocated_plane_under(struct liftoff_output *output, if (i >= (ssize_t)step->plane_idx) { break; } - if (other_plane->type == DRM_PLANE_TYPE_PRIMARY) { - continue; - } if (step->alloc[i] == NULL) { continue; } @@ -311,7 +305,7 @@ check_layer_plane_compatible(struct alloc_step *step, } } - if (plane->type != DRM_PLANE_TYPE_PRIMARY && + if (layer != layer->output->composition_layer && has_composited_layer_over(output, step, layer)) { liftoff_log(LIFTOFF_DEBUG, "%s Layer %p -> plane %"PRIu32": " diff --git a/plane.c b/plane.c index 1e1835a..4b19e79 100644 --- a/plane.c +++ b/plane.c @@ -119,23 +119,16 @@ liftoff_plane_create(struct liftoff_device *device, uint32_t id) } /* During plane allocation, we will use the plane list order to fill - * planes with FBs. Primary planes need to be filled first, then planes - * far from the primary planes, then planes closer and closer to the - * primary plane. */ - if (plane->type == DRM_PLANE_TYPE_PRIMARY) { - liftoff_list_insert(&device->planes, &plane->link); - } else { - liftoff_list_for_each(cur, &device->planes, link) { - if (cur->type != DRM_PLANE_TYPE_PRIMARY && - plane->zpos >= cur->zpos) { - liftoff_list_insert(cur->link.prev, &plane->link); - break; - } + * planes with FBs. */ + liftoff_list_for_each(cur, &device->planes, link) { + if (plane->zpos >= cur->zpos) { + liftoff_list_insert(cur->link.prev, &plane->link); + break; } + } - if (plane->link.next == NULL) { /* not inserted */ - liftoff_list_insert(device->planes.prev, &plane->link); - } + if (plane->link.next == NULL) { /* not inserted */ + liftoff_list_insert(device->planes.prev, &plane->link); } return plane; diff --git a/test/test_alloc.c b/test/test_alloc.c index f1571ce..1eeec40 100644 --- a/test/test_alloc.c +++ b/test/test_alloc.c @@ -159,7 +159,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100, @@ -190,7 +190,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100, @@ -218,7 +218,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100, @@ -282,7 +282,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100, @@ -394,7 +394,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100, @@ -435,7 +435,7 @@ static struct test_case tests[] = { .height = 1080, .zpos = 1, .compat = { PRIMARY_PLANE }, - .result = PRIMARY_PLANE, + .result = NULL, }, { .width = 100,