invalid argument error when setting yres_virtual in fb_var_screeninfo

后端 未结 2 645
遇见更好的自我
遇见更好的自我 2021-01-13 16:41

I\'m trying to make an application for linux that writes directly to the framebuffer /dev/fb0. In order to make it double buffered I try to make the virtual screen be double

2条回答
  •  粉色の甜心
    2021-01-13 17:38

    To save anyone a headache in the future, there is a way to properly double buffer using low level graphics on linux (such as /dev/fb0). However per this thread: https://forum.odroid.com/viewtopic.php?f=55&t=8741 it is not possible to truly double buffer the framebuffer by creating a virtual framebuffer of double the size of the original one (I've read that the raspberry PI might be an exception to this rule because it is backed by a different driver).

    The right way to double buffer using low level graphics on linux is to go through libdrm (or /dev/dri/card0). There is a really nice example that I followed myself here: https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-vsync.c. It wasn't very hard to convert my /dev/fb0 code to /dev/dri/card0 code.

    Anyways I hope I've helped someone out here who might come across this in the future.

提交回复
热议问题