backend/drm: Allow interlaced modes whose resolution is unique

This partially reverts the filtering-out of interlaced modes, but we
still remove those whose resolution matches a progressive mode (at
least until wlr-randr and arandr can be taught to distinguish them).
This commit is contained in:
Nick Hollinghurst 2023-10-04 17:46:32 +01:00 committed by David Turner
parent f36f856cdb
commit e6858621ab

View file

@ -1612,7 +1612,20 @@ static bool connect_drm_connector(struct wlr_drm_connector *wlr_conn,
bool found_current_mode = false;
for (int i = 0; i < drm_conn->count_modes; ++i) {
if (drm_conn->modes[i].flags & DRM_MODE_FLAG_INTERLACE) {
continue;
// Filter out any interlaced mode with the same resolution
// as a progressive mode (because wlr-randr and arandr
// can't currently distinguish them).
int j;
for (j = 0; j < drm_conn->count_modes; ++j) {
if (!(drm_conn->modes[j].flags & DRM_MODE_FLAG_INTERLACE) &&
drm_conn->modes[j].hdisplay == drm_conn->modes[i].hdisplay &&
drm_conn->modes[j].vdisplay == drm_conn->modes[i].vdisplay) {
break;
}
}
if (j < drm_conn->count_modes) {
continue;
}
}
struct wlr_drm_mode *mode = drm_mode_create(&drm_conn->modes[i]);