diff options
author | Chia-I Wu <[email protected]> | 2010-02-21 10:11:54 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-02-21 10:22:08 +0800 |
commit | dbaa84515318c3cf1d4be67fc10ca3bd6bc00e0f (patch) | |
tree | fa9d1853e5e02e6b1dd15fc1f879a530783ffb66 /src/gallium/state_trackers | |
parent | 5d4d54574ffb73ecafd44bc533556608f3ab9ffa (diff) |
st/egl: Properly convert vrefresh to refresh rate.
Some kernels have vrefresh = (refresh rate * 1000) while others don't.
Use some heuristics here.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/egl/kms/native_kms.c | 5 |
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)); |