diff --git a/test/meson.build b/test/meson.build index 463b358..b3538b8 100644 --- a/test/meson.build +++ b/test/meson.build @@ -46,6 +46,7 @@ tests = { 'composition-3x-partial', 'composition-3x-force', 'zpos-2x-reverse', + 'zpos-3x-zero-fb-id', ], 'dynamic': [ 'same', diff --git a/test/test_alloc.c b/test/test_alloc.c index 1483774..6035029 100644 --- a/test/test_alloc.c +++ b/test/test_alloc.c @@ -538,6 +538,36 @@ static const struct test_case tests[] = { }, }, }, + { + .name = "zpos-3x-zero-fb-id", + .needs_composition = false, + /* Layers at zpos=1 and zpos=2 can be put on a plane. There is + * a layer with zpos=3 but it's not visible because it has a + * zero FB_ID, so it should be ignored. */ + .layers = { + { + .width = 1920, + .height = 1080, + .props = {{ "zpos", 1 }}, + .compat = { PRIMARY_PLANE }, + .result = PRIMARY_PLANE, + }, + { + .width = 200, + .height = 200, + .props = {{ "zpos", 2 }}, + .compat = { OVERLAY_PLANE }, + .result = OVERLAY_PLANE, + }, + { + .width = 100, + .height = 100, + .props = {{ "zpos", 3 }, { "FB_ID", 0 }}, + .compat = { 0 }, + .result = NULL, + }, + }, + }, { .name = "composition-3x", .needs_composition = true,