Commit 4535e53d authored by Matvii Zorin's avatar Matvii Zorin
Browse files

drm_hwcomposer: Fix regression after composition creation cleanup

During rebasing of the local integration branch, one code chunk was not
updated accidentally and the client range was not selected properly which
leads to jank frames appearance.

The issue has been already fixed by the commit 3f89182b
("drm_hwcomposer: Fix client range selection logic").

Issue: #53
Fixes: b3b15166

 ("drm_hwcomposer: Add GetExtraClientRange method")
Suggested-by: Roman Stratiienko's avatarRoman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Matvii Zorin's avatarMatvii Zorin <matvii.zorin@globallogic.com>
parent 67a89d33
......@@ -132,19 +132,20 @@ std::tuple<int, int> Backend::GetExtraClientRange(
if (avail_planes < display->layers().size())
avail_planes--;
size_t extra_client = (layers.size() - client_size) - avail_planes;
int extra_client = int(layers.size() - client_size) - int(avail_planes);
if (extra_client > 0) {
int start = 0;
size_t steps = 0;
if (client_size != 0) {
size_t prepend = std::min((size_t)client_start, extra_client);
size_t append = std::min(layers.size() - (client_start + client_size),
extra_client);
int prepend = std::min(client_start, extra_client);
int append = std::min(int(layers.size()) -
int(client_start + client_size),
extra_client);
start = client_start - (int)prepend;
client_size += extra_client;
steps = 1 + std::min(std::min(append, prepend),
int(layers.size()) - (start + client_size));
int(layers.size()) - int(start + client_size));
} else {
client_size = extra_client;
steps = 1 + layers.size() - extra_client;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment