天嵌 ARM开发社区

 找回密码
 注册
查看: 1731|回复: 4

关于TQ2440的framebuffer驱动应用的问题,希望高手能解答,在线等啊!

[复制链接]
lang1437 发表于 2011-3-26 18:08:39 | 显示全部楼层 |阅读模式
这是我的程序,我要改变虚拟分辨率的大小,总是不能成功,希望大侠吗给我解释下,是我内核编译的不支持还是硬件不支持呢!?
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/fb.h>
#include <errno.h>


int main ()
{
        int fp=0;
        struct fb_var_screeninfo vinfo;
        struct fb_fix_screeninfo finfo;
        fp = open ("/dev/fb0",O_RDWR);
       
        if (fp < 0)
        {
                printf("Error : Can not open framebuffer device\n");
                exit(1);
        }
       
        if (ioctl(fp,FBIOGET_FSCREENINFO,&finfo))
        {
                printf("Error reading fixed information\n");
                exit(2);
        }
       
        if (ioctl(fp,FBIOGET_VSCREENINFO,&vinfo))
        {
                printf("Error reading variable information\n");
                exit(3);
        }
       
        printf("The mem is :%d\n",finfo.smem_len);
        printf("The line_length is :%d\n",finfo.line_length);
        printf("The xres is :%d\n",vinfo.xres);
        printf("The yres is :%d\n",vinfo.yres);
        printf("bits_per_pixel is :%d\n",vinfo.bits_per_pixel);
        printf("The xoffset is :%d\n",vinfo.xoffset);
        printf("The yoffset is :%d\n",vinfo.yoffset);
       
        //修改偏移地址
        vinfo.xoffset=100;
        vinfo.yoffset=100;
       
        if (ioctl(fp,FBIOPUT_VSCREENINFO,&vinfo))
        {
                printf("Error reading variable information\n");
                exit(3);
        }
        //重新读取修改的值
        if (ioctl(fp,FBIOGET_VSCREENINFO,&vinfo))
        {
                printf("Error reading variable information\n");
                exit(3);
        }
       
        printf("The mem is :%d\n",finfo.smem_len);
        printf("The line_length is :%d\n",finfo.line_length);
        printf("The xres is :%d\n",vinfo.xres);
        printf("The yres is :%d\n",vinfo.yres);
        printf("bits_per_pixel is :%d\n",vinfo.bits_per_pixel);
        printf("The xoffset is :%d\n",vinfo.xoffset);
        printf("The yoffset is :%d\n",vinfo.yoffset);
        close (fp);
        return 0;
}
 楼主| lang1437 发表于 2011-3-26 18:47:47 | 显示全部楼层
大家帮帮忙啊。。。。哎。。。。
 楼主| lang1437 发表于 2011-3-28 07:11:20 | 显示全部楼层
有人没啊 哎。。。
shufexiu 发表于 2011-3-28 09:32:02 | 显示全部楼层
你直接去修改xres数值就是了
 楼主| lang1437 发表于 2011-3-28 16:20:49 | 显示全部楼层
4# shufexiu


xres是物理屏的大小,改完烧写内核不能正常运行

莫非是我改错地方了。。。您能说具体点吗 改哪啊?!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-9-28 05:31 , Processed in 1.022396 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表