mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
drm/i915: Allow fuzzy matching in intel_compare_link_m_n
This prevents a unnecessary modeset on a dell XPS 13 (2016). N is always a power of 2, which means that for fuzzy matching we should compare for inequality on the n values, then do fuzzy matching on the m values. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Tested-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/568D0E93.304@linux.intel.com
This commit is contained in:
parent
d93c037246
commit
31d10b5701
1 changed files with 8 additions and 5 deletions
|
@ -12577,19 +12577,22 @@ intel_compare_m_n(unsigned int m, unsigned int n,
|
|||
|
||||
BUILD_BUG_ON(DATA_LINK_M_N_MASK > INT_MAX);
|
||||
|
||||
if (m > m2) {
|
||||
while (m > m2) {
|
||||
if (n > n2) {
|
||||
while (n > n2) {
|
||||
m2 <<= 1;
|
||||
n2 <<= 1;
|
||||
}
|
||||
} else if (m < m2) {
|
||||
while (m < m2) {
|
||||
} else if (n < n2) {
|
||||
while (n < n2) {
|
||||
m <<= 1;
|
||||
n <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return m == m2 && n == n2;
|
||||
if (n != n2)
|
||||
return false;
|
||||
|
||||
return intel_fuzzy_clock_check(m, m2);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
Loading…
Reference in a new issue