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
12
alloc.c
12
alloc.c
|
@ -721,17 +721,21 @@ 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) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((plane->possible_crtcs & (1 << output->crtc_index)) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
candidate_planes++;
|
candidate_planes++;
|
||||||
liftoff_log(LIFTOFF_DEBUG,
|
liftoff_log(LIFTOFF_DEBUG, "Disabling plane %"PRIu32, plane->id);
|
||||||
"Disabling plane %"PRIu32, plane->id);
|
|
||||||
ret = plane_apply(plane, NULL, req);
|
ret = plane_apply(plane, NULL, req);
|
||||||
assert(ret != -EINVAL);
|
assert(ret != -EINVAL);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
result.req = req;
|
result.req = req;
|
||||||
result.flags = flags;
|
result.flags = flags;
|
||||||
|
|
Loading…
Reference in a new issue