提交 f8b46a05 编写于 作者: A Adam Jackson 提交者: Dave Airlie

drm/edid: Rewrite drm_mode_find_dmt search loop

No functional change, but will make an upcoming change clearer.
Signed-off-by: NAdam Jackson <ajax@redhat.com>
Tested-by: NTakashi Iwai <tiwai@suse.de>
Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 33c7531d
...@@ -499,20 +499,21 @@ static void edid_fixup_preferred(struct drm_connector *connector, ...@@ -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, struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
int hsize, int vsize, int fresh) int hsize, int vsize, int fresh)
{ {
struct drm_display_mode *mode = NULL;
int i; int i;
for (i = 0; i < drm_num_dmt_modes; i++) { for (i = 0; i < drm_num_dmt_modes; i++) {
const struct drm_display_mode *ptr = &drm_dmt_modes[i]; const struct drm_display_mode *ptr = &drm_dmt_modes[i];
if (hsize == ptr->hdisplay && if (hsize != ptr->hdisplay)
vsize == ptr->vdisplay && continue;
fresh == drm_mode_vrefresh(ptr)) { if (vsize != ptr->vdisplay)
/* get the expected default mode */ continue;
mode = drm_mode_duplicate(dev, ptr); if (fresh != drm_mode_vrefresh(ptr))
break; continue;
}
return drm_mode_duplicate(dev, ptr);
} }
return mode;
return NULL;
} }
EXPORT_SYMBOL(drm_mode_find_dmt); EXPORT_SYMBOL(drm_mode_find_dmt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册