mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-25 21:59:11 +01:00
Check compatible CRTCs before disabling planes
Only disable planes we can make use of. Disabling other planes causes same noise and failures if the plane is still being used on another CRTC. One motivation for disabling all planes may be to potentially get more bandwidth to work with. However, we can only increase the avilable bandwidth by disabling previously enabled planes. KMS will refuse to switch a plane's CRTC without completely disabling it first.
This commit is contained in:
parent
bcfca8f602
commit
56e3cb9502
1 changed files with 13 additions and 9 deletions
22
alloc.c
22
alloc.c
|
@ -721,15 +721,19 @@ liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req,
|
||||||
* enabled. */
|
* enabled. */
|
||||||
candidate_planes = 0;
|
candidate_planes = 0;
|
||||||
liftoff_list_for_each(plane, &device->planes, link) {
|
liftoff_list_for_each(plane, &device->planes, link) {
|
||||||
if (plane->layer == NULL) {
|
if (plane->layer != NULL) {
|
||||||
candidate_planes++;
|
continue;
|
||||||
liftoff_log(LIFTOFF_DEBUG,
|
}
|
||||||
"Disabling plane %"PRIu32, plane->id);
|
if ((plane->possible_crtcs & (1 << output->crtc_index)) == 0) {
|
||||||
ret = plane_apply(plane, NULL, req);
|
continue;
|
||||||
assert(ret != -EINVAL);
|
}
|
||||||
if (ret != 0) {
|
|
||||||
return ret;
|
candidate_planes++;
|
||||||
}
|
liftoff_log(LIFTOFF_DEBUG, "Disabling plane %"PRIu32, plane->id);
|
||||||
|
ret = plane_apply(plane, NULL, req);
|
||||||
|
assert(ret != -EINVAL);
|
||||||
|
if (ret != 0) {
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue