How to save fbset setting?

流过昼夜 提交于 2019-12-11 12:06:59

问题


I am working on a embedded Linux project using Qt, when the Qt program runs, it does not sit on the middle of the 7" LCD,so I used "fbset -move -step" to move it,then it is ok.

But when the board is switched off and on again, the setting is lost, the Qt program still not sit on the middle of the LCD. I checked the etc/fb.modes, and I also modified it, but the problem still remains. Can anyone help me?


回答1:


Very lucky this time, I solved the question by myself. After "fbset -move -step", I printed the current setting using "fbset" command, and then I write these setting into the /etc/fb.modes. If you want to use this setting every bootup, you should add one line in /etc/rc.local: fbset mymode (the name you set in the fb.modes).




回答2:


You can output the current settings by running fbset with no arguments other than -s/--show or -fb:

# fbset

mode "1024x768-60"
    # D: 65.003 MHz, H: 48.365 kHz, V: 60.006 Hz
    geometry 1024 768 1024 768 16
    timings 15384 160 24 29 3 136 6
    hsync high
    vsync high
    rgba 5/11,6/5,5/0,0/0
endmode

And you can write that into a file:

fbset >>/etc/local.fb.modes

Edit to rename the mode, add any comments you want; you can then use your new file with the -db argument:

fbset -db /etc/local.fb.modes --all "1024x768-60"

You can put that command into your /etc/rc.local to take effect every boot.




回答3:


Tip: if setting mode in /etc/rc.local fails with:

systemctl status rc-local.service -l
"open /dev/fb0: No such file or directory"

Then simply run "fbset" 1st before setting mode:

/etc/rc.local
fbset
fbset -g 800 600 800 600 32

Had this problem in VMWare..



来源:https://stackoverflow.com/questions/38194864/how-to-save-fbset-setting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!