Skip to content

Commit f71efe6

Browse files
committed
vc4_hdmi_phy: Fix offset calculation
The original firmware code worked with float and did offset = ((vco_freq / fref * 2) * (1 << 22)); offset >>= 2; In this code it's all integer so doing the integer divide before the shift loses lots of precision This fixes the issue of 1080p59.94 mode having 59.64 fps Signed-off-by: popcornmix <popcornmix@gmail.com>
1 parent c2b4e8e commit f71efe6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/gpu/drm/vc4/vc4_hdmi_phy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ static u32 phy_get_rm_offset(unsigned long long vco_freq)
192192

193193
/* RM offset is stored as 9.22 format */
194194
offset = vco_freq * 2;
195-
do_div(offset, fref);
196195
offset = offset << 22;
196+
do_div(offset, fref);
197197
offset >>= 2;
198198

199199
return offset;

0 commit comments

Comments
 (0)