mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-19 10:26:29 +01:00
Don't re-alloc when FB_DAMAGE_CLIPS changes
This is updated at each atomic commit.
This commit is contained in:
parent
9bfe58b7d2
commit
40411f6d3e
3 changed files with 23 additions and 2 deletions
6
alloc.c
6
alloc.c
|
@ -526,8 +526,10 @@ static bool layer_needs_realloc(struct liftoff_layer *layer)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* We should never need a re-alloc when IN_FENCE_FD changes. */
|
||||
if (strcmp(prop->name, "IN_FENCE_FD") == 0) {
|
||||
/* We should never need a re-alloc when IN_FENCE_FD or
|
||||
* FB_DAMAGE_CLIPS changes. */
|
||||
if (strcmp(prop->name, "IN_FENCE_FD") == 0 ||
|
||||
strcmp(prop->name, "FB_DAMAGE_CLIPS") == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ tests = {
|
|||
'unset-alpha-to-opaque',
|
||||
'unset-alpha-to-transparent',
|
||||
'change-in-fence-fd',
|
||||
'change-fb-damage-clips',
|
||||
],
|
||||
'priority': [
|
||||
#'basic',
|
||||
|
|
|
@ -228,6 +228,18 @@ static void run_change_in_fence_fd(struct context *ctx) {
|
|||
assert(liftoff_mock_plane_get_layer(ctx->mock_plane) == ctx->layer);
|
||||
}
|
||||
|
||||
static void run_change_fb_damage_clips(struct context *ctx) {
|
||||
liftoff_layer_set_property(ctx->layer, "FB_DAMAGE_CLIPS", 42);
|
||||
|
||||
first_commit(ctx);
|
||||
assert(liftoff_mock_plane_get_layer(ctx->mock_plane) == ctx->layer);
|
||||
|
||||
liftoff_layer_set_property(ctx->layer, "FB_DAMAGE_CLIPS", 43);
|
||||
|
||||
second_commit(ctx, true);
|
||||
assert(liftoff_mock_plane_get_layer(ctx->mock_plane) == ctx->layer);
|
||||
}
|
||||
|
||||
static const struct test_case tests[] = {
|
||||
{ .name = "same", .run = run_same },
|
||||
{ .name = "change-fb", .run = run_change_fb },
|
||||
|
@ -242,6 +254,7 @@ static const struct test_case tests[] = {
|
|||
{ .name = "unset-alpha-to-opaque", .run = run_unset_alpha_to_opaque },
|
||||
{ .name = "unset-alpha-to-transparent", .run = run_unset_alpha_to_transparent },
|
||||
{ .name = "change-in-fence-fd", .run = run_change_in_fence_fd },
|
||||
{ .name = "change-fb-damage-clips", .run = run_change_fb_damage_clips },
|
||||
};
|
||||
|
||||
static void run(const struct test_case *test) {
|
||||
|
@ -269,6 +282,11 @@ static void run(const struct test_case *test) {
|
|||
strncpy(prop.name, prop_name, sizeof(prop.name) - 1);
|
||||
liftoff_mock_plane_add_property(ctx.mock_plane, &prop);
|
||||
|
||||
prop_name = "FB_DAMAGE_CLIPS";
|
||||
prop = (drmModePropertyRes){0};
|
||||
strncpy(prop.name, prop_name, sizeof(prop.name) - 1);
|
||||
liftoff_mock_plane_add_property(ctx.mock_plane, &prop);
|
||||
|
||||
ctx.drm_fd = liftoff_mock_drm_open();
|
||||
device = liftoff_device_create(ctx.drm_fd);
|
||||
assert(device != NULL);
|
||||
|
|
Loading…
Reference in a new issue