aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-09-04 22:57:09 +0200
committeremersion <contact@emersion.fr>2018-09-04 22:57:09 +0200
commit5b13b8a12c55b3216b1b92a20474efc856be5d7b (patch)
tree05d9c6efd55949a3cc1f08c06bf3377d4117b568 /backend/drm
parentfb94f03b4388dd50bf908a1a0ab3d3eeccb8b1ad (diff)
backend/drm: consider continue not using resources
Fixes #1230
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 4681f85a..c97afac6 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -247,13 +247,19 @@ static bool match_obj_(struct match_state *st, size_t skips, size_t score, size_
* Attempt to use the current solution first, to try and avoid
* recalculating everything
*/
-
if (st->orig[i] != UNMATCHED && !is_taken(i, st->res, st->orig[i])) {
st->res[i] = st->orig[i];
if (match_obj_(st, skips, score + 1, replaced, i + 1)) {
return true;
}
}
+ if (st->orig[i] == UNMATCHED) {
+ st->res[i] = UNMATCHED;
+ match_obj_(st, skips, score, replaced, i + 1);
+ if (st->exit_early) {
+ return true;
+ }
+ }
if (st->orig[i] != UNMATCHED) {
++replaced;