backend/drm: drop SKIP in match_connectors_with_crtcs()

It's unused.
This commit is contained in:
Simon Ser 2024-08-21 22:18:23 +02:00
parent 5f3b99bbed
commit 5432108846
2 changed files with 7 additions and 15 deletions

View File

@ -133,7 +133,7 @@ struct match_state {
* *
* Returns whether we've set a new best element with this solution. * Returns whether we've set a new best element with this solution.
*/ */
static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips, static bool match_connectors_with_crtcs_(struct match_state *st,
size_t score, size_t replaced, size_t crtc_index) { size_t score, size_t replaced, size_t crtc_index) {
// Finished // Finished
if (crtc_index >= st->num_crtcs) { if (crtc_index >= st->num_crtcs) {
@ -143,7 +143,7 @@ static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips,
st->replaced = replaced; st->replaced = replaced;
memcpy(st->best, st->res, sizeof(st->best[0]) * st->num_crtcs); memcpy(st->best, st->res, sizeof(st->best[0]) * st->num_crtcs);
st->exit_early = (st->score == st->num_crtcs - skips st->exit_early = (st->score == st->num_crtcs
|| st->score == st->num_conns) || st->score == st->num_conns)
&& st->replaced == 0; && st->replaced == 0;
@ -153,11 +153,6 @@ static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips,
} }
} }
if (st->orig[crtc_index] == SKIP) {
st->res[crtc_index] = SKIP;
return match_connectors_with_crtcs_(st, skips + 1, score, replaced, crtc_index + 1);
}
bool has_best = false; bool has_best = false;
/* /*
@ -167,7 +162,7 @@ static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips,
if (st->orig[crtc_index] != UNMATCHED && !is_taken(crtc_index, st->res, st->orig[crtc_index])) { if (st->orig[crtc_index] != UNMATCHED && !is_taken(crtc_index, st->res, st->orig[crtc_index])) {
st->res[crtc_index] = st->orig[crtc_index]; st->res[crtc_index] = st->orig[crtc_index];
size_t crtc_score = st->conns[st->res[crtc_index]] != 0 ? 1 : 0; size_t crtc_score = st->conns[st->res[crtc_index]] != 0 ? 1 : 0;
if (match_connectors_with_crtcs_(st, skips, score + crtc_score, replaced, crtc_index + 1)) { if (match_connectors_with_crtcs_(st, score + crtc_score, replaced, crtc_index + 1)) {
has_best = true; has_best = true;
} }
} }
@ -197,7 +192,7 @@ static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips,
st->res[crtc_index] = candidate; st->res[crtc_index] = candidate;
size_t crtc_score = st->conns[candidate] != 0 ? 1 : 0; size_t crtc_score = st->conns[candidate] != 0 ? 1 : 0;
if (match_connectors_with_crtcs_(st, skips, score + crtc_score, replaced, crtc_index + 1)) { if (match_connectors_with_crtcs_(st, score + crtc_score, replaced, crtc_index + 1)) {
has_best = true; has_best = true;
} }
@ -208,7 +203,7 @@ static bool match_connectors_with_crtcs_(struct match_state *st, size_t skips,
// Maybe this CRTC can't be matched // Maybe this CRTC can't be matched
st->res[crtc_index] = UNMATCHED; st->res[crtc_index] = UNMATCHED;
if (match_connectors_with_crtcs_(st, skips, score, replaced, crtc_index + 1)) { if (match_connectors_with_crtcs_(st, score, replaced, crtc_index + 1)) {
has_best = true; has_best = true;
} }
@ -236,7 +231,7 @@ void match_connectors_with_crtcs(size_t num_conns,
.exit_early = false, .exit_early = false,
}; };
match_connectors_with_crtcs_(&st, 0, 0, 0, 0); match_connectors_with_crtcs_(&st, 0, 0, 0);
} }
void generate_cvt_mode(drmModeModeInfo *mode, int hdisplay, int vdisplay, void generate_cvt_mode(drmModeModeInfo *mode, int hdisplay, int vdisplay,

View File

@ -19,10 +19,7 @@ void generate_cvt_mode(drmModeModeInfo *mode, int hdisplay, int vdisplay,
float vrefresh); float vrefresh);
// Part of match_connectors_with_crtcs // Part of match_connectors_with_crtcs
enum { #define UNMATCHED ((uint32_t)-1)
UNMATCHED = (uint32_t)-1,
SKIP = (uint32_t)-2,
};
/** /**
* Tries to match DRM connectors with DRM CRTCs. * Tries to match DRM connectors with DRM CRTCs.