相关疑难解决方法(0)

如何在Android Linux ARM设备上动态更改设备(LCD)参数

我正在尝试使用可加载的内核模块来修改LCD显示参数.以下是内核的编译代码.

void set_fb_video ()
{
    platform_device_unregister(&goldfish_lcd);
    ((atmel_lcdfb_info*)goldfish_lcd.dev.platform_data)->default_monspecs->modedb->xres = 10;
    platform_device_register(&goldfish_lcd);
};

EXPORT_SYMBOL("set_fb_video");
Run Code Online (Sandbox Code Playgroud)

然后我有一个可加载的内核模块lcd_modify.ko

int __init init_module(void)
{
..
..
set_fb_video();
..
..
return;
}
Run Code Online (Sandbox Code Playgroud)

然后使用insmod lcd_modify.ko将模块加载到设备

此时设备挂断了.

题:

  1. 我可以使用可加载的内核模块来修改液晶显示屏吗?
  2. 参数是实时的吗?如果是这样,我做错了什么?
  3. 如果没有,有什么更好的方法可以实时修改lcd参数?

感谢您提前的反馈.

c linux embedded arm embedded-linux

18
推荐指数
0
解决办法
1272
查看次数

GNU/Linux中"绘图"抽象的绝对最低级别是什么?

动机 - 用C(和装配,如果需要)编写程序,为屏幕红色的矩形区域着色.

STRICT要求 - 在文本/控制台模式下使用最小的实用程序和接口运行GNU/Linux .所以没有X(或类似Wayland/Mir),没有非默认(内核提供的POSIX,LSB等)库或接口,除了监视器的设备驱动程序之外没有其他假设.

实际上,我正在寻找的是有关如何编写程序的信息,该程序最终将通过VGA端口发送信号并通过电缆连接到显示器,以便为屏幕的特定部分着色.

抱歉,如果这听起来很粗鲁,但没有"你为什么要这样做?" 或者"你为什么不使用ABC库?" 回答.我试图了解如何编写X服务器的实现或内核帧缓冲(/ dev/fb0)库.可以提供指向C库源的链接.

c c++ linux graphics drawing

6
推荐指数
1
解决办法
708
查看次数

如何通过linux framebuffer在屏幕上显示某些内容?

我发现以下代码旨在在屏幕上绘制正方形。

 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <linux/fb.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>

 int main()
 {
     int fbfd = 0;
     struct fb_var_screeninfo vinfo;
     struct fb_fix_screeninfo finfo;
     long int screensize = 0;
     char *fbp = 0;
     int x = 0, y = 0;
     long int location = 0;

 // Open the file for reading and writing
 fbfd = open("/dev/fb0", O_RDWR);
 if (fbfd == -1) {
     perror("Error: cannot open framebuffer device");
     exit(1);
 }
 printf("The framebuffer device was opened successfully.\n");

 // …
Run Code Online (Sandbox Code Playgroud)

c linux framebuffer

3
推荐指数
1
解决办法
2950
查看次数

标签 统计

c ×3

linux ×3

arm ×1

c++ ×1

drawing ×1

embedded ×1

embedded-linux ×1

framebuffer ×1

graphics ×1