/* Just allocate a new mode, copy the existing mode into it, and return a pointer to it. Used to create new instances of established modes.  */
struct drm_display_mode* drm_mode_duplicate(struct drm_device *dev, struct drm_display_mode *mode)
/* Just allocate a new mode, copy the existing mode into it, and return a pointer to it. Used to create new instances of established modes.  */
struct drm_display_mode* drm_mode_duplicate(struct drm_device *dev, struct drm_display_mode *mode)
{
	struct drm_display_mode *nmode;
	int new_id;
	nmode = drm_mode_create(dev);
	if (!nmode)
		return NULL;
	new_id = nmode->base.id;
	*nmode = *mode;
	nmode->base.id = new_id;
	INIT_LIST_HEAD(&nmode->head);
	return nmode;
}