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

Commit 73f4867

Browse files
committed
Remove primary plane special case
This doesn't work on i915. 8a97169 ("test: introduce liftoff_mock_require_primary_plane") makes sure we catch this in the tests.
1 parent bc0d061 commit 73f4867

3 files changed

Lines changed: 16 additions & 29 deletions

File tree

alloc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ plane_step_init_next(struct alloc_step *step, struct alloc_step *prev,
127127
if (layer != NULL) {
128128
zpos_prop = layer_get_property(layer, "zpos");
129129
}
130-
if (zpos_prop != NULL && plane->type != DRM_PLANE_TYPE_PRIMARY) {
130+
if (zpos_prop != NULL) {
131131
step->last_layer_zpos = zpos_prop->value;
132132
} else {
133133
step->last_layer_zpos = prev->last_layer_zpos;
@@ -212,9 +212,6 @@ has_allocated_layer_over(struct liftoff_output *output, struct alloc_step *step,
212212
if (i >= (ssize_t)step->plane_idx) {
213213
break;
214214
}
215-
if (other_plane->type == DRM_PLANE_TYPE_PRIMARY) {
216-
continue;
217-
}
218215

219216
other_layer = step->alloc[i];
220217
if (other_layer == NULL) {
@@ -253,9 +250,6 @@ has_allocated_plane_under(struct liftoff_output *output,
253250
if (i >= (ssize_t)step->plane_idx) {
254251
break;
255252
}
256-
if (other_plane->type == DRM_PLANE_TYPE_PRIMARY) {
257-
continue;
258-
}
259253
if (step->alloc[i] == NULL) {
260254
continue;
261255
}
@@ -311,7 +305,7 @@ check_layer_plane_compatible(struct alloc_step *step,
311305
}
312306
}
313307

314-
if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
308+
if (layer != layer->output->composition_layer &&
315309
has_composited_layer_over(output, step, layer)) {
316310
liftoff_log(LIFTOFF_DEBUG,
317311
"%s Layer %p -> plane %"PRIu32": "

plane.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,16 @@ liftoff_plane_create(struct liftoff_device *device, uint32_t id)
119119
}
120120

121121
/* During plane allocation, we will use the plane list order to fill
122-
* planes with FBs. Primary planes need to be filled first, then planes
123-
* far from the primary planes, then planes closer and closer to the
124-
* primary plane. */
125-
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
126-
liftoff_list_insert(&device->planes, &plane->link);
127-
} else {
128-
liftoff_list_for_each(cur, &device->planes, link) {
129-
if (cur->type != DRM_PLANE_TYPE_PRIMARY &&
130-
plane->zpos >= cur->zpos) {
131-
liftoff_list_insert(cur->link.prev, &plane->link);
132-
break;
133-
}
122+
* planes with FBs. */
123+
liftoff_list_for_each(cur, &device->planes, link) {
124+
if (plane->zpos >= cur->zpos) {
125+
liftoff_list_insert(cur->link.prev, &plane->link);
126+
break;
134127
}
128+
}
135129

136-
if (plane->link.next == NULL) { /* not inserted */
137-
liftoff_list_insert(device->planes.prev, &plane->link);
138-
}
130+
if (plane->link.next == NULL) { /* not inserted */
131+
liftoff_list_insert(device->planes.prev, &plane->link);
139132
}
140133

141134
return plane;

test/test_alloc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static struct test_case tests[] = {
159159
.height = 1080,
160160
.zpos = 1,
161161
.compat = { PRIMARY_PLANE },
162-
.result = PRIMARY_PLANE,
162+
.result = NULL,
163163
},
164164
{
165165
.width = 100,
@@ -190,7 +190,7 @@ static struct test_case tests[] = {
190190
.height = 1080,
191191
.zpos = 1,
192192
.compat = { PRIMARY_PLANE },
193-
.result = PRIMARY_PLANE,
193+
.result = NULL,
194194
},
195195
{
196196
.width = 100,
@@ -218,7 +218,7 @@ static struct test_case tests[] = {
218218
.height = 1080,
219219
.zpos = 1,
220220
.compat = { PRIMARY_PLANE },
221-
.result = PRIMARY_PLANE,
221+
.result = NULL,
222222
},
223223
{
224224
.width = 100,
@@ -282,7 +282,7 @@ static struct test_case tests[] = {
282282
.height = 1080,
283283
.zpos = 1,
284284
.compat = { PRIMARY_PLANE },
285-
.result = PRIMARY_PLANE,
285+
.result = NULL,
286286
},
287287
{
288288
.width = 100,
@@ -394,7 +394,7 @@ static struct test_case tests[] = {
394394
.height = 1080,
395395
.zpos = 1,
396396
.compat = { PRIMARY_PLANE },
397-
.result = PRIMARY_PLANE,
397+
.result = NULL,
398398
},
399399
{
400400
.width = 100,
@@ -435,7 +435,7 @@ static struct test_case tests[] = {
435435
.height = 1080,
436436
.zpos = 1,
437437
.compat = { PRIMARY_PLANE },
438-
.result = PRIMARY_PLANE,
438+
.result = NULL,
439439
},
440440
{
441441
.width = 100,

0 commit comments

Comments
 (0)