st/egl: Fix native_mode refresh mode.
authorChia-I Wu <olv@lunarg.com>
Sat, 23 Oct 2010 03:31:29 +0000 (11:31 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 23 Oct 2010 03:32:06 +0000 (11:32 +0800)
Define the unit to match _EGLMode's.

src/gallium/state_trackers/egl/common/native_modeset.h
src/gallium/state_trackers/egl/drm/modeset.c

index dee757b3a88c1d0c1c2ecdd60c6687da58900f78..2598082d68773c8f6adae90152e6232fefed3fc7 100644 (file)
@@ -39,7 +39,7 @@ struct native_connector {
 struct native_mode {
    const char *desc;
    int width, height;
-   int refresh_rate;
+   int refresh_rate; /* HZ * 1000 */
 };
 
 /**
index 06a607705375c351f94fcf97ea6b021c34cbfd11..5ed22f7b9d45864dec0e52d2d4dd6bce59c70fb8 100644 (file)
@@ -469,8 +469,8 @@ drm_display_get_modes(struct native_display *ndpy,
       drmmode->base.height = drmmode->mode.vdisplay;
       drmmode->base.refresh_rate = drmmode->mode.vrefresh;
       /* not all kernels have vrefresh = refresh_rate * 1000 */
-      if (drmmode->base.refresh_rate > 1000)
-         drmmode->base.refresh_rate = (drmmode->base.refresh_rate + 500) / 1000;
+      if (drmmode->base.refresh_rate < 1000)
+         drmmode->base.refresh_rate *= 1000;
    }
 
    nmodes_return = MALLOC(count * sizeof(*nmodes_return));