Verified Commit a5066e00 authored by Oliver Smith's avatar Oliver Smith Committed by Quentin Glidic

compositor-fbdev: Instead of less than 1 Hz use default refresh rate

I ran Weston on a Nexus 4 mobile phone, with a native GNU/Linux userland,
and the latest Android kernel for that device from LineageOS [1].

calculate_refresh_rate() returned 1 (mHz), which gets rounded to 0 Hz later
and results in nothing being drawn to the screen.

This patch makes sure, that there is at least a refresh rate of 1 Hz, because
it returns the default refresh rate of 60 Hz otherwise.

[1]: Oliver Smith's avatarOliver Smith <>
Reviewed-by: Quentin Glidic's avatarQuentin Glidic <>
parent 47bbdc72
......@@ -253,7 +253,8 @@ calculate_refresh_rate(struct fb_var_screeninfo *vinfo)
if (refresh_rate > 200000)
refresh_rate = 200000; /* cap at 200 Hz */
return refresh_rate;
if (refresh_rate >= 1000) /* at least 1 Hz */
return refresh_rate;
return 60 * 1000; /* default to 60 Hz */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment