aboutsummaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-07 19:24:53 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-07 19:24:53 -0700
commit491ed9e4c27da6b1b5a6a6921039a7bf3a98c290 (patch)
tree60a35aef6cc7c2288c0f481ef5c2d88d498b24c4 /linux-core
parent13d4ea90c09fa834eb6eecaa082780aace78dac7 (diff)
document drm_mode_duplicate and fix vrefresh calculation (off by 1000 error)
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_modes.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux-core/drm_modes.c b/linux-core/drm_modes.c
index eea2e754..1ae43447 100644
--- a/linux-core/drm_modes.c
+++ b/linux-core/drm_modes.c
@@ -75,7 +75,7 @@ int drm_mode_vrefresh(struct drm_display_mode *mode)
if (mode->vrefresh > 0)
refresh = mode->vrefresh;
else if (mode->htotal > 0 && mode->vtotal > 0) {
- refresh = ((mode->clock * 1000) * 1000) / mode->htotal / mode->vtotal;
+ refresh = (mode->clock * 1000) / mode->htotal / mode->vtotal;
if (mode->flags & V_INTERLACE)
refresh *= 2;
if (mode->flags & V_DBLSCAN)
@@ -139,6 +139,13 @@ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)
EXPORT_SYMBOL(drm_mode_set_crtcinfo);
+/**
+ * drm_mode_duplicate - allocate and duplicate an existing mode
+ * @m: mode to duplicate
+ *
+ * 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;