summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-02-21 10:11:54 +0800
committerChia-I Wu <[email protected]>2010-02-21 10:22:08 +0800
commitdbaa84515318c3cf1d4be67fc10ca3bd6bc00e0f (patch)
treefa9d1853e5e02e6b1dd15fc1f879a530783ffb66
parent5d4d54574ffb73ecafd44bc533556608f3ab9ffa (diff)
st/egl: Properly convert vrefresh to refresh rate.
Some kernels have vrefresh = (refresh rate * 1000) while others don't. Use some heuristics here.
-rw-r--r--src/gallium/state_trackers/egl/kms/native_kms.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c
index 91cefc538d1..ee6ab2e60b8 100644
--- a/src/gallium/state_trackers/egl/kms/native_kms.c
+++ b/src/gallium/state_trackers/egl/kms/native_kms.c
@@ -499,7 +499,10 @@ kms_display_get_modes(struct native_display *ndpy,
kmode->base.desc = kmode->mode.name;
kmode->base.width = kmode->mode.hdisplay;
kmode->base.height = kmode->mode.vdisplay;
- kmode->base.refresh_rate = kmode->mode.vrefresh / 1000;
+ kmode->base.refresh_rate = kmode->mode.vrefresh;
+ /* not all kernels have vrefresh = refresh_rate * 1000 */
+ if (kmode->base.refresh_rate > 1000)
+ kmode->base.refresh_rate = (kmode->base.refresh_rate + 500) / 1000;
}
nmodes_return = malloc(count * sizeof(*nmodes_return));