We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4054 - [patch] Raspberry Pi refresh rate detection
Summary: [patch] Raspberry Pi refresh rate detection
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: don't know
Hardware: ARM Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-18 22:22 UTC by Viacheslav Slavinsky
Modified: 2018-02-07 23:05 UTC (History)
0 users

See Also:


Attachments
Report correct refresh rate on Raspberry Pi (1.27 KB, patch)
2018-01-18 22:22 UTC, Viacheslav Slavinsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Viacheslav Slavinsky 2018-01-18 22:22:40 UTC
Created attachment 3147 [details]
Report correct refresh rate on Raspberry Pi

SDL_rpivideo driver has 60 frames per second hardcoded in it, this is a problem for games that need to keep pace using VSYNC. I believe that I have found a solution to this. It is based on code in tvservice.c in rpi userland:

https://github.com/raspberrypi/userland/blob/a1b89e91f393c7134b4cdc36431f863bb3333163/host_applications/linux/apps/tvservice/tvservice.c#L433

Attached is a patch that reports display refresh rate on Raspberry Pi or falls back to report 60 if it can't. I do not know when it may fail though.
Comment 1 Sam Lantinga 2018-02-07 23:05:19 UTC
Added, thanks!
https://hg.libsdl.org/SDL/rev/c7946b873fe8