From: Adam Jackson <ajax@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/7] drm/edid: Rewrite drm_mode_find_dmt search loop
Date: Thu, 12 Apr 2012 17:35:55 -0400 [thread overview]
Message-ID: <1334266560-27813-3-git-send-email-ajax@redhat.com> (raw)
In-Reply-To: <1334266560-27813-1-git-send-email-ajax@redhat.com>
No functional change, but will make an upcoming change clearer.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
drivers/gpu/drm/drm_edid.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 79a3637..0a23ee5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -499,20 +499,21 @@ static void edid_fixup_preferred(struct drm_connector *connector,
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
int hsize, int vsize, int fresh)
{
- struct drm_display_mode *mode = NULL;
int i;
for (i = 0; i < drm_num_dmt_modes; i++) {
const struct drm_display_mode *ptr = &drm_dmt_modes[i];
- if (hsize == ptr->hdisplay &&
- vsize == ptr->vdisplay &&
- fresh == drm_mode_vrefresh(ptr)) {
- /* get the expected default mode */
- mode = drm_mode_duplicate(dev, ptr);
- break;
- }
+ if (hsize != ptr->hdisplay)
+ continue;
+ if (vsize != ptr->vdisplay)
+ continue;
+ if (fresh != drm_mode_vrefresh(ptr))
+ continue;
+
+ return drm_mode_duplicate(dev, ptr);
}
- return mode;
+
+ return NULL;
}
EXPORT_SYMBOL(drm_mode_find_dmt);
--
1.7.7.6
next prev parent reply other threads:[~2012-04-12 21:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 21:35 [PATCH 0/7] drm/edid: Add the reduced-blanking modes to the DMT list Adam Jackson
2012-04-12 21:35 ` [PATCH 1/7] drm/edid: Document drm_mode_find_dmt Adam Jackson
2012-04-12 21:35 ` Adam Jackson [this message]
2012-04-12 21:35 ` [PATCH 3/7] drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes Adam Jackson
2012-04-12 21:35 ` [PATCH 4/7] drm/edid: s/drm_gtf_modes_for_range/drm_dmt_modes_for_range/ Adam Jackson
2012-04-12 21:35 ` [PATCH 5/7] drm/edid: Armor drm_dmt_modes_for_range for reduced blanking modes Adam Jackson
2012-04-13 19:22 ` Adam Jackson
2012-04-12 21:35 ` [PATCH 6/7] drm/edid: Add the reduced blanking DMT modes to the DMT list Adam Jackson
2012-04-12 21:36 ` [PATCH 7/7] drm/edid: Fix some comment typos in the DMT mode list Adam Jackson
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=1334266560-27813-3-git-send-email-ajax@redhat.com \
--to=ajax@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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