gpt4 book ai didi

rotation - 嵌入式linux framebuffer旋转

转载 作者:行者123 更新时间:2023-12-04 15:34:15 55 4
gpt4 key购买 nike

我必须将 LCD 屏幕集成到我的嵌入式 linux (ARM9) 系统中。 LCD 是纵向 320x480,我需要以横向 480x320 运行屏幕。
使用 LCD 配置寄存器我可以在硬件中旋转它,以便 (x,y)(0,0) 旋转 90 度。
我的问题开始了,屏幕的宽边从 480 像素缩小到 320,并且图片的长边超出了屏幕。这应该通过更改帧缓冲区尺寸 AFAIK 来解决,但我尝试了几种方法来做到这一点,但尚未成功。
使用 fbset,以下是纵向设置:

mode "480x320-55"
# D: 9.091 MHz, H: 18.182 kHz, V: 55.096 Hz
geometry 480 320 480 320 16
timings 110000 4 4 4 4 12 2
rgba 5/0,6/5,5/11,0/0
endmode

发送命令:
fbset --geometry 480 320 480 320 16

结果是:
mode "480x320-55"
# D: 9.091 MHz, H: 18.182 kHz, V: 55.096 Hz
geometry 480 320 480 320 16
timings 110000 4 4 4 4 12 2
rgba 5/0,6/5,5/11,0/0
endmode

这使得画面出现了几次并重叠,但屏幕宽度仍然太窄。

我试图为虚拟 xres 和 yres 提供双倍的屏幕尺寸,但没有改变。
fbset --geometry 480 320 960 640 16

我也尝试使用我在网上找到的 fb 旋转功能“saFbdevRotation.c”,它使用 FB IOCTL,但事件屏幕尺寸仍然不正确。

旋转 90 度,见输出
$> ./fb_rotate -r 90
## Before rotation
### Fix Screen Info:
Line Length - 640
Physical Address = 81a00000
Buffer Length = 1048576

### Var Screen Info:
Xres - 320
Yres - 480
Xres Virtual - 320
Yres Virtual - 480
Bits Per Pixel - 16
Pixel Clk - 110000
Rotation - 0
## after rotation
### Fix Screen Info:
Line Length - 960
Physical Address = 81a00000
Buffer Length = 1048576

### Var Screen Info:
Xres - 480
Yres - 320
Xres Virtual - 480
Yres Virtual - 320
Bits Per Pixel - 16
Pixel Clk - 110000
Rotation - 90

我还可以补充一点,系统的可用内存非常有限,这会导致 fb 不分配新缓冲区吗?但是 dmesg 中没有错误。

将感谢您的建议。

最佳答案

I can also add that the system is very limited with free memory, can this cause the fb to NOT allocate a new buffer? However there were no errors in dmesg.



通常,分配视频缓冲区的标准方法是在启动时预先分配一个大的视频缓冲区(基于您支持的最大视频分辨率),将 men= 参数传递给内核,以便内核不会占用它最初。

然后稍后,视频驱动程序可以做
void *ioremap(unsigned long phys_addr, unsigned long size)

这将为驱动程序直接操作帧缓冲区创建一个 mmap 区域。

你可以通过做 cat /proc/iomen 来检查它

因此,视频驱动程序内存是预先分配的,与linux内核系统内存(如kmalloc()或get_free_pages()或vmalloc())不同,排除了您的担忧。

关于rotation - 嵌入式linux framebuffer旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14271795/

55 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com