anholt / vc4-gpu-tools

Userland tools for debugging and testing the VC4 kernel driver.
15 stars 5 forks source link

[Request] An utility to query for available physical video modes and run-time video mode setting #2

Closed vanfanel closed 6 years ago

vanfanel commented 6 years ago

Hi there, Eric

I have been using VC4 by default lately, as it's stable and in a good shape for me (I don't use X and server, so I don't know/care how it behaves there, but there are a couple of small things that I think we're missing. One is the ability to query available video modes at runtime. On the vendor libs, we had the tvservice tool that allowed that and also setting physical video modes, but we don't have such a thing on the VC4 side of things. I know it's a general KMS/DRM thing, not VC4 specific, but anyhow... Is there an utility or are you planning such an utility? I know coding something that simply iterates the resources and ends up calling drmModeSetCRTC() would be easy to to, but then it would en up scan-outing a new buffer and I guess we wouln't get a new TTY with the new video mode, which tvservice does. What do you think?

PD: My main concern in this is the use of PAL-like video modes for C64, Amiga or ZX-Spectrum emulation, which are commonplace in Raspbian systems and shouldn't be running on ~60Hz video modes if we want to keep the perfect smooth scrolls we get with PAL-like modes.

anholt commented 6 years ago

You can use the xrandr extension (and the xrandr command line tool) in X11 to list modes and set custom video modes. On the command line, you can use modetest to list modes, and setting modes is up to whatever application you're using for display.