mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-26 21:59:18 +01:00
Disable all planes before building the mapping
This commit is contained in:
parent
c5601aef5d
commit
1ca4a03224
1 changed files with 12 additions and 9 deletions
21
display.c
21
display.c
|
@ -227,7 +227,8 @@ bool hwc_display_apply(struct hwc_display *display, drmModeAtomicReq *req)
|
|||
struct hwc_layer *layer;
|
||||
struct hwc_plane *plane;
|
||||
|
||||
/* TODO: incremental updates keeping old configuration if possible */
|
||||
/* Unset all existing plane and layer mappings.
|
||||
TODO: incremental updates keeping old configuration if possible */
|
||||
for (i = 0; i < display->planes_len; i++) {
|
||||
plane = &display->planes[i];
|
||||
if (plane->layer != NULL) {
|
||||
|
@ -236,6 +237,16 @@ bool hwc_display_apply(struct hwc_display *display, drmModeAtomicReq *req)
|
|||
}
|
||||
}
|
||||
|
||||
/* Disable all planes. Do it before building mappings to make sure not
|
||||
to hit bandwidth limits because too many planes are enabled. */
|
||||
for (i = 0; i < display->planes_len; i++) {
|
||||
plane = &display->planes[i];
|
||||
if (plane->layer == NULL) {
|
||||
fprintf(stderr, "Disabling plane %d\n", plane->id);
|
||||
plane_apply(plane, NULL, req);
|
||||
}
|
||||
}
|
||||
|
||||
hwc_list_for_each(output, &display->outputs, link) {
|
||||
hwc_list_for_each(layer, &output->layers, link) {
|
||||
if (!layer_choose_plane(layer, req)) {
|
||||
|
@ -246,13 +257,5 @@ bool hwc_display_apply(struct hwc_display *display, drmModeAtomicReq *req)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < display->planes_len; i++) {
|
||||
plane = &display->planes[i];
|
||||
if (plane->layer == NULL) {
|
||||
fprintf(stderr, "Disabling plane %d\n", plane->id);
|
||||
plane_apply(plane, NULL, req);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue