Commit 171fdd89 authored by Adam Jackson's avatar Adam Jackson Committed by Dave Airlie

drm/modes: Fix interlaced mode names

Height in frame size, not field size, and trailed with an 'i'.  Matches
the X server behaviour.
Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 7a374350
...@@ -1013,10 +1013,10 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev, ...@@ -1013,10 +1013,10 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
if (mode->vsync_end > mode->vtotal) if (mode->vsync_end > mode->vtotal)
mode->vtotal = mode->vsync_end + 1; mode->vtotal = mode->vsync_end + 1;
drm_mode_set_name(mode);
drm_mode_do_interlace_quirk(mode, pt); drm_mode_do_interlace_quirk(mode, pt);
drm_mode_set_name(mode);
if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) { if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE; pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE;
} }
......
...@@ -258,8 +258,10 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, ...@@ -258,8 +258,10 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
drm_mode->clock -= drm_mode->clock % CVT_CLOCK_STEP; drm_mode->clock -= drm_mode->clock % CVT_CLOCK_STEP;
/* 18/16. Find actual vertical frame frequency */ /* 18/16. Find actual vertical frame frequency */
/* ignore - just set the mode flag for interlaced */ /* ignore - just set the mode flag for interlaced */
if (interlaced) if (interlaced) {
drm_mode->vtotal *= 2; drm_mode->vtotal *= 2;
drm_mode->flags |= DRM_MODE_FLAG_INTERLACE;
}
/* Fill the mode line name */ /* Fill the mode line name */
drm_mode_set_name(drm_mode); drm_mode_set_name(drm_mode);
if (reduced) if (reduced)
...@@ -268,8 +270,6 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, ...@@ -268,8 +270,6 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
else else
drm_mode->flags |= (DRM_MODE_FLAG_PVSYNC | drm_mode->flags |= (DRM_MODE_FLAG_PVSYNC |
DRM_MODE_FLAG_NHSYNC); DRM_MODE_FLAG_NHSYNC);
if (interlaced)
drm_mode->flags |= DRM_MODE_FLAG_INTERLACE;
return drm_mode; return drm_mode;
} }
...@@ -446,14 +446,14 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay, ...@@ -446,14 +446,14 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
drm_mode->clock = pixel_freq; drm_mode->clock = pixel_freq;
drm_mode_set_name(drm_mode);
drm_mode->flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC;
if (interlaced) { if (interlaced) {
drm_mode->vtotal *= 2; drm_mode->vtotal *= 2;
drm_mode->flags |= DRM_MODE_FLAG_INTERLACE; drm_mode->flags |= DRM_MODE_FLAG_INTERLACE;
} }
drm_mode_set_name(drm_mode);
drm_mode->flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC;
return drm_mode; return drm_mode;
} }
EXPORT_SYMBOL(drm_gtf_mode_complex); EXPORT_SYMBOL(drm_gtf_mode_complex);
...@@ -509,8 +509,11 @@ EXPORT_SYMBOL(drm_gtf_mode); ...@@ -509,8 +509,11 @@ EXPORT_SYMBOL(drm_gtf_mode);
*/ */
void drm_mode_set_name(struct drm_display_mode *mode) void drm_mode_set_name(struct drm_display_mode *mode)
{ {
snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d", mode->hdisplay, bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
mode->vdisplay);
snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s",
mode->hdisplay, mode->vdisplay,
interlaced ? "i" : "");
} }
EXPORT_SYMBOL(drm_mode_set_name); EXPORT_SYMBOL(drm_mode_set_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment