mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-24 21:59:08 +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. */
|
||||
candidate_planes = 0;
|
||||
liftoff_list_for_each(plane, &device->planes, link) {
|
||||
if (plane->layer == NULL) {
|
||||
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;
|
||||
}
|
||||
if (plane->layer != NULL) {
|
||||
continue;
|
||||
}
|
||||
if ((plane->possible_crtcs & (1 << output->crtc_index)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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