From 662e098b560c6983f5ac320cc5ff7a82ecdc5f8a Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 23 Oct 2010 11:31:29 +0800 Subject: [PATCH] st/egl: Fix native_mode refresh mode. Define the unit to match _EGLMode's. --- src/gallium/state_trackers/egl/common/native_modeset.h | 2 +- src/gallium/state_trackers/egl/drm/modeset.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/egl/common/native_modeset.h b/src/gallium/state_trackers/egl/common/native_modeset.h index dee757b3a88..2598082d687 100644 --- a/src/gallium/state_trackers/egl/common/native_modeset.h +++ b/src/gallium/state_trackers/egl/common/native_modeset.h @@ -39,7 +39,7 @@ struct native_connector { struct native_mode { const char *desc; int width, height; - int refresh_rate; + int refresh_rate; /* HZ * 1000 */ }; /** diff --git a/src/gallium/state_trackers/egl/drm/modeset.c b/src/gallium/state_trackers/egl/drm/modeset.c index 06a60770537..5ed22f7b9d4 100644 --- a/src/gallium/state_trackers/egl/drm/modeset.c +++ b/src/gallium/state_trackers/egl/drm/modeset.c @@ -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)); -- 2.30.2