mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
backend/drm: drop SKIP in match_connectors_with_crtcs()
It's unused.
This commit is contained in:
parent
5f3b99bbed
commit
5432108846
@ -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,
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user