Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
Remove primary plane special case
Browse files Browse the repository at this point in the history
This doesn't work on i915. 8a97169 ("test: introduce
liftoff_mock_require_primary_plane") makes sure we catch this in
the tests.
  • Loading branch information
emersion committed Aug 18, 2021
1 parent bc0d061 commit 73f4867
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
10 changes: 2 additions & 8 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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": "
Expand Down
23 changes: 8 additions & 15 deletions plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions test/test_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down Expand Up @@ -190,7 +190,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down Expand Up @@ -218,7 +218,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down Expand Up @@ -282,7 +282,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down Expand Up @@ -394,7 +394,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down Expand Up @@ -435,7 +435,7 @@ static struct test_case tests[] = {
.height = 1080,
.zpos = 1,
.compat = { PRIMARY_PLANE },
.result = PRIMARY_PLANE,
.result = NULL,
},
{
.width = 100,
Expand Down

0 comments on commit 73f4867

Please sign in to comment.