From: Kenneth Graunke <kenneth@whitecape.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Allow fuzzy matching in intel_compare_link_m_n
Date: Wed, 06 Jan 2016 05:00:27 -0800 [thread overview]
Message-ID: <2485368.OfNUyHZSap@eiger> (raw)
In-Reply-To: <568D0E93.304@linux.intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 1203 bytes --]
On Wednesday, January 6, 2016 1:54:43 PM PST Maarten Lankhorst wrote:
> 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:
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
> --
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/
intel_display.c
> index 7afbdc45a278..aa4f1e69b92e 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12638,19 +12638,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
>
>
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-01-06 13:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 12:54 [PATCH] drm/i915: Allow fuzzy matching in intel_compare_link_m_n Maarten Lankhorst
2016-01-06 13:00 ` Kenneth Graunke [this message]
2016-01-06 13:17 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2485368.OfNUyHZSap@eiger \
--to=kenneth@whitecape.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox