Check Linux Framebuffer Resolution

本文介绍如何通过sysfs接口调整Android设备的显示分辨率和HDMI输出模式,包括设置分辨率、检查实际分辨率、修复不工作的分辨率以及解决不同显示器的分辨率问题。详细步骤适用于Android和Linux系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


There is some sysfs interface exported to control the display related stuff. The following should work on both Android and Linux.

Contents

 [hide

set display scale

   root@marsboard-picuntu:# cat /sys/devices/platform/rk-fb/graphics/fb0/scale
   xscale=95 yscale=95
   root@marsboard-picuntu:# echo xscale=100 >  /sys/devices/platform/rk-fb/graphics/fb0/scale
   root@marsboard-picuntu:# echo yscale=100 >  /sys/devices/platform/rk-fb/graphics/fb0/scale     
   root@marsboard-picuntu:# cat /sys/devices/platform/rk-fb/graphics/fb0/scale
   xscale=100 yscale=100

set HDMI output mode

you can see supported output modes by the following commands:

   root@marsboard-picuntu:# cat /sys/class/display/HDMI/modes 
   1920x1080p-60
   1920x1080p-50
   1280x720p-60
   1280x720p-50
   720x576p-50
   720x480p-60

check out the current display mode

   root@marsboard-picuntu:# cat /sys/class/display/display0.HDMI/mode
   1280x720p-60

It's 720p@60hz

change the mode to 1080p@60hz

   root@marsboard-picuntu:# echo 1920x1080p-60 > /sys/class/display/display0.HDMI/mode

Checking the actual resolution

On a console type:

   cat /sys/devices/platform/rk-fb/graphics/fb0/disp_info

for a working 1080p setup, the result should be something like:

   win0:enabled
   xvir:960
   xact:1920
   yact:1080
   xdsp:1920
   ydsp:1080
   x_st:192
   y_st:41
   x_scale:1.0
   y_scale:1.0
   format:RGB565
   
   win1:disabled
   xvir:0
   xdsp:320
   ydsp:240
   x_st:10
   y_st:10
   format:ARGB888

That is xact and yact (the virtual resolution seen by Linux) must be the same as xdsp and ydsp (the real resolution been sent to the screen), or else you have a scaled output (x_scale and y_scale not 1.0).

Fix (1) for an not working resolution

If this is the case and you find that xdsp=1280 and ydsp=720, whereas you expected a 1080p display, the solution is in this commit: https://github.com/Galland/3188-SRC-AP6210/commit/130c1ad6bb47f3b2401b6156f205dcb5882255c7


(BTW, notice the 16 bits color: RGB565)

Fix (2) in case solution (1) don't working

With some monitors the EDID information is a little bit different and can cause problems to get the right resolution although the solution (1) is already applied.

F.e. this is the case for the monitor "acer P225HQL".

One solution could be found at miniand forum.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值