struct drm_display_mode *mode);
extern void drm_mode_config_init(struct drm_device *dev);
extern void drm_mode_config_cleanup(struct drm_device *dev);
+extern void drm_mode_set_name(struct drm_display_mode *mode);
extern void drm_disable_unused_functions(struct drm_device *dev);
extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
else
vsize = (hsize * 9) / 16;
- snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d", hsize, vsize);
+ drm_mode_set_name(mode);
return mode;
}
pt->vsync_pulse_width_lo);
mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo);
- snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d", mode->hdisplay,
- mode->vdisplay);
+ drm_mode_set_name(mode);
if (pt->interlaced)
mode->flags |= V_INTERLACE;
}
EXPORT_SYMBOL(drm_mode_debug_printmodeline);
+void drm_mode_set_name(struct drm_display_mode *mode)
+{
+ snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d", mode->hdisplay,
+ mode->vdisplay);
+}
+EXPORT_SYMBOL(drm_mode_set_name);
+
void drm_mode_list_concat(struct list_head *head, struct list_head *new)
{
mode->vtotal = ((vtot & 0xffff0000) >> 16) + 1;
mode->vsync_start = (vsync & 0xffff) + 1;
mode->vsync_end = ((vsync & 0xffff0000) >> 16) + 1;
- /* FIXME: pull name generation into a common routine */
- snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d", mode->hdisplay,
- mode->vdisplay);
+
+ drm_mode_set_name(mode);
drm_mode_set_crtcinfo(mode, 0);
return mode;