summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2019-06-04 14:37:51 +0000
committerNeil Armstrong <narmstrong@baylibre.com>2019-06-04 14:52:30 +0000
commit9cf798da27ba1f902f53c3d1e7140922711ca4b2 (patch)
treeaff73892ece6d330d0c5379d425e17c2c989b113
parenta9ed46acc12d7e7bb0cdaf5b53ff175156589dc9 (diff)
drm_hwcomposer: recalculate vrefresh from clock + resolution
For DMT modes and HDMI modes with 1000/1001 variations, the kernel reports the vrefresh in integer, rounded up, thus 59.94Hz or 23.97Hz are reported as 60Hz and 24Hz to userspace. To solve this, recalculate the vrefresh from clock + resolution. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
-rw-r--r--drmmode.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/drmmode.cpp b/drmmode.cpp
index 5f2e7c2..c3ab385 100644
--- a/drmmode.cpp
+++ b/drmmode.cpp
@@ -122,8 +122,8 @@ uint32_t DrmMode::v_scan() const {
}
float DrmMode::v_refresh() const {
- return v_refresh_ ? v_refresh_ * 1.0f
- : clock_ / (float)(v_total_ * h_total_) * 1000.0f;
+ // Always recalculate refresh to report correct float rate
+ return clock_ / (float)(v_total_ * h_total_) * 1000.0f;
}
uint32_t DrmMode::flags() const {