mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-24 23:00:11 +01:00
drm: make mode comparison more betterer.
This compares the clocks after converting to fb pico timings so we get the same answer if the X and fb modes are the same.
This commit is contained in:
parent
3ed17803d8
commit
40229b6ad5
1 changed files with 9 additions and 2 deletions
|
|
@ -276,8 +276,15 @@ EXPORT_SYMBOL(drm_mode_duplicate);
|
|||
*/
|
||||
bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2)
|
||||
{
|
||||
if (mode1->clock == mode2->clock &&
|
||||
mode1->hdisplay == mode2->hdisplay &&
|
||||
/* do clock check convert to PICOS so fb modes get matched
|
||||
* the same */
|
||||
if (mode1->clock && mode2->clock) {
|
||||
if (KHZ2PICOS(mode1->clock) != KHZ2PICOS(mode2->clock))
|
||||
return false;
|
||||
} else if (mode1->clock != mode2->clock)
|
||||
return false;
|
||||
|
||||
if (mode1->hdisplay == mode2->hdisplay &&
|
||||
mode1->hsync_start == mode2->hsync_start &&
|
||||
mode1->hsync_end == mode2->hsync_end &&
|
||||
mode1->htotal == mode2->htotal &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue