708,7 → 708,8 |
} |
EXPORT_SYMBOL(drm_mode_set_name); |
|
/** drm_mode_hsync - get the hsync of a mode |
/** |
* drm_mode_hsync - get the hsync of a mode |
* @mode: mode |
* |
* Returns: |
917,6 → 918,23 |
} else if (mode1->clock != mode2->clock) |
return false; |
|
return drm_mode_equal_no_clocks(mode1, mode2); |
} |
EXPORT_SYMBOL(drm_mode_equal); |
|
/** |
* drm_mode_equal_no_clocks - test modes for equality |
* @mode1: first mode |
* @mode2: second mode |
* |
* Check to see if @mode1 and @mode2 are equivalent, but |
* don't check the pixel clocks. |
* |
* Returns: |
* True if the modes are equal, false otherwise. |
*/ |
bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) |
{ |
if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) != |
(mode2->flags & DRM_MODE_FLAG_3D_MASK)) |
return false; |
923,7 → 941,7 |
|
return drm_mode_equal_no_clocks_no_stereo(mode1, mode2); |
} |
EXPORT_SYMBOL(drm_mode_equal); |
EXPORT_SYMBOL(drm_mode_equal_no_clocks); |
|
/** |
* drm_mode_equal_no_clocks_no_stereo - test modes for equality |
1056,7 → 1074,7 |
MODE_STATUS(ONE_SIZE), |
MODE_STATUS(NO_REDUCED), |
MODE_STATUS(NO_STEREO), |
MODE_STATUS(UNVERIFIED), |
MODE_STATUS(STALE), |
MODE_STATUS(BAD), |
MODE_STATUS(ERROR), |
}; |
1154,7 → 1172,6 |
/** |
* drm_mode_connector_list_update - update the mode list for the connector |
* @connector: the connector to update |
* @merge_type_bits: whether to merge or overwrite type bits |
* |
* This moves the modes from the @connector probed_modes list |
* to the actual mode list. It compares the probed mode against the current |
1163,34 → 1180,49 |
* This is just a helper functions doesn't validate any modes itself and also |
* doesn't prune any invalid modes. Callers need to do that themselves. |
*/ |
void drm_mode_connector_list_update(struct drm_connector *connector, |
bool merge_type_bits) |
void drm_mode_connector_list_update(struct drm_connector *connector) |
{ |
struct drm_display_mode *mode; |
struct drm_display_mode *pmode, *pt; |
int found_it; |
|
WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); |
|
list_for_each_entry_safe(pmode, pt, &connector->probed_modes, |
head) { |
found_it = 0; |
list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) { |
struct drm_display_mode *mode; |
bool found_it = false; |
|
/* go through current modes checking for the new probed mode */ |
list_for_each_entry(mode, &connector->modes, head) { |
if (drm_mode_equal(pmode, mode)) { |
found_it = 1; |
/* if equal delete the probed mode */ |
mode->status = pmode->status; |
/* Merge type bits together */ |
if (merge_type_bits) |
if (!drm_mode_equal(pmode, mode)) |
continue; |
|
found_it = true; |
|
/* |
* If the old matching mode is stale (ie. left over |
* from a previous probe) just replace it outright. |
* Otherwise just merge the type bits between all |
* equal probed modes. |
* |
* If two probed modes are considered equal, pick the |
* actual timings from the one that's marked as |
* preferred (in case the match isn't 100%). If |
* multiple or zero preferred modes are present, favor |
* the mode added to the probed_modes list first. |
*/ |
if (mode->status == MODE_STALE) { |
drm_mode_copy(mode, pmode); |
} else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && |
(pmode->type & DRM_MODE_TYPE_PREFERRED) != 0) { |
pmode->type |= mode->type; |
drm_mode_copy(mode, pmode); |
} else { |
mode->type |= pmode->type; |
else |
mode->type = pmode->type; |
} |
|
list_del(&pmode->head); |
drm_mode_destroy(connector->dev, pmode); |
break; |
} |
} |
|
if (!found_it) { |
list_move_tail(&pmode->head, &connector->modes); |
1401,13 → 1433,6 |
return NULL; |
|
mode->type |= DRM_MODE_TYPE_USERDEF; |
/* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ |
if (cmd->xres == 1366 && mode->hdisplay == 1368) { |
mode->hdisplay = 1366; |
mode->hsync_start--; |
mode->hsync_end--; |
drm_mode_set_name(mode); |
} |
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); |
return mode; |
} |
1494,10 → 1519,8 |
if (out->status != MODE_OK) |
goto out; |
|
drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V); |
|
ret = 0; |
|
out: |
return ret; |
} |
} |