`

FrameBuffer的重要数据结构

阅读更多

include/linux/fb.h中的一些重要的数据结构

struct fb_fix_screeninfo {

   char id[16]; /* identification string eg "TT Builtin" */

   unsigned long smem_start; /* Start of frame buffer mem */
/* (physical address) */

   __u32 smem_len; /* Length of frame buffer mem */

   __u32 type; /* see FB_TYPE_* */

   __u32 type_aux; /* Interleave for interleaved Planes */
  
   __u32 visual; /* see FB_VISUAL_* */ 

   __u16 xpanstep; /* zero if no hardware panning */

   __u16 ypanstep; /* zero if no hardware panning */

   __u16 ywrapstep; /* zero if no hardware ywrap */

   __u32 line_length; /* length of a line in bytes */

   unsigned long mmio_start; /* Start of Memory Mapped I/O */
/* (physical address) */

   __u32 mmio_len; /* Length of Memory Mapped I/O */

   __u32 accel; /* Type of acceleration available */

   __u16 reserved[3]; /* Reserved for future compatibility */

};


struct fb_bitfield {

  __u32 offset; /* beginning of bitfield */

  __u32 length; /* length of bitfield */

  __u32 msb_right; /* != 0 : Most significant bit is */ 
/* right */ 

};


struct fb_info {

  char modename[40]; /* default video mode */

  kdev_t node;

  int flags;
  int open; /* Has this been open already ? */

#define FBINFO_FLAG_MODULE 1 /* Low-level driver is a module */

  struct fb_var_screeninfo var; /* Current var */

  struct fb_fix_screeninfo fix; /* Current fix */

  struct fb_monspecs monspecs; /* Current Monitor specs */

  struct fb_cmap cmap; /* Current cmap */

  struct fb_ops *fbops;

  char *screen_base; /* Virtual address */

  struct display *disp; /* initial display variable */

  struct vc_data *display_fg; /* Console visible on this display */

  char fontname[40]; /* default font name */

  devfs_handle_t devfs_handle; /* Devfs handle for new name */

  devfs_handle_t devfs_lhandle; /* Devfs handle for compat. symlink */

  int (*changevar)(int); /* tell console var has changed */

  int (*switch_con)(int, struct fb_info*);

  /* tell fb to switch consoles */

  int (*updatevar)(int, struct fb_info*);
  /* tell fb to update the vars */

  void (*blank)(int, struct fb_info*); /* tell fb to (un)blank the screen */
  /* arg = 0: unblank */
  /* arg > 0: VESA level (arg-1) */

  void *pseudo_palette; /* Fake palette of 16 colors and 
  the cursor's color for non
  palette mode */
  /* From here on everything is device dependent */

  void *par; 

};


struct fbgen_hwswitch {

  void (*detect)(void);

  int (*encode_fix)(struct fb_fix_screeninfo *fix, const void *par,
  struct fb_info_gen *info);

  int (*decode_var)(const struct fb_var_screeninfo *var, void *par,
 struct fb_info_gen *info);

  int (*encode_var)(struct fb_var_screeninfo *var, const void *par,
struct fb_info_gen *info);

  void (*get_par)(void *par, struct fb_info_gen *info);

  void (*set_par)(const void *par, struct fb_info_gen *info);

  int (*getcolreg)(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp, struct fb_info *info);

  int (*setcolreg)(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp, struct fb_info *info);

  int (*pan_display)(const struct fb_var_screeninfo *var,
struct fb_info_gen *info);

  int (*blank)(int blank_mode, struct fb_info_gen *info);

  void (*set_disp)(const void *par, struct display *disp,
struct fb_info_gen *info);

};


struct fb_info_gen {

  struct fb_info info;

  /* Entries for a generic frame buffer device */
  /* Yes, this starts looking like C++ */
  u_int parsize;

  struct fbgen_hwswitch *fbhw;

  /* From here on everything is device dependent */

};

 

  • 大小: 37.6 KB
分享到:
评论

相关推荐

    framebuffer驱动全篇

    在Linux内核中,Framebuffer设备模型提供了一系列特定的函数和数据结构,以支持显卡驱动的编写。开发Framebuffer驱动时,开发者应参考内核源码中的`Documentation/fb`目录下的文档,如`00-INDEX`、`framebuffer.txt`...

    framebuffer.pdf

    #### 三、framebuffer设备的数据结构 framebuffer设备的核心数据结构包括: - **`struct fb_var_screeninfo`**:用于描述图形卡的特性,通常由用户设置。 - **`struct fb_fix_screeninfo`**:定义图形卡的硬件特性...

    framebuffer BMP图像显示

    综上所述,操作framebuffer显示BMP图像涉及到了对BMP文件格式的理解、framebuffer设备的访问、内存映射、像素数据的解析和转换等多个步骤。这是一个涉及到硬件、操作系统和图像处理的综合实践,对于开发嵌入式系统的...

    嵌入式framebuffer编程实例

    通过以上介绍,我们可以看到,Framebuffer编程涉及硬件、内核驱动以及用户空间的交互,对于理解和开发嵌入式系统的图形界面至关重要。这个实例资源提供了一个实践平台,可以帮助开发者深入了解和掌握Framebuffer的...

    arm平台framebuffer 显示png图片

    PNG图片的数据存储采用了块结构,包含头部信息、图像信息、压缩数据等部分。解析PNG图片时,我们需要理解这些块的作用,例如IDAT(图像数据块)用于存储经过压缩的像素数据,IHDR(图像头数据块)包含图像的宽度、...

    MSM FrameBuffer Study

    这些操作需要参考头文件,其中定义了各种ioctl命令和相关的数据结构。 6. 多帧缓冲支持 在MSM平台上,可能同时存在多个帧缓冲设备,这允许系统支持多窗口、多任务或者同时驱动多个显示设备。每个帧缓冲都可以独立...

    framebuffer的原理

    其中,`struct fb_info`是核心的数据结构,它包含了关于framebuffer设备的所有信息,如屏幕尺寸、颜色深度、行缓冲区大小等。`fb_var_screeninfo`和`fb_fix_screeninfo`分别用于存储可变和固定的屏幕信息。 当一个...

    Linux设备驱动之Framebuffer分析

    通过理解并正确使用关键的数据结构和接口,开发人员可以轻松地为不同的显示设备编写驱动程序。此外,内核提供的默认实现大大降低了开发难度,使得Framebuffer驱动成为一个高效且易于维护的选择。

    arm平台framebuffer,bmp图像显示

    在编程时,我们需要根据解析出的BMP图像尺寸调整Framebuffer的视窗大小,然后逐行将BMP的像素数据写入Framebuffer的对应位置。由于Framebuffer的像素格式可能与BMP不同,因此在写入数据前,可能需要进行色彩转换。...

    基于linux2.6.30.4 framebuffer移植LCD驱动到FL2440开发板

    驱动移植相关及应用程序接口相关重要数据结构分析 **4.1 驱动移植步骤** - **分析目标硬件**:了解 LCD 显示屏的具体规格和技术参数。 - **配置 LCD 控制器**:设置 S3C2440 LCD 控制器的寄存器,以适应目标 LCD ...

    了解LCD驱动(FrameBuffer)的实例开发

    了解LCD硬件结构和工作原理,熟悉LCD控制器的内部组成,掌握TFT屏幕的时序分析,以及熟练运用Linux FrameBuffer接口,是进行LCD驱动开发的重要基础。通过理论与实践相结合的方式,可以有效地开发出适用于特定LCD屏幕...

    framebuffer驱动全篇.pdf

    在Linux系统中,Framebuffer设备通过一系列特定的函数和数据结构来实现。为了更好地理解这些内容,我们可以通过以下几个方面来探讨: 1. **重要文件介绍** - **00-INDEX**: 提供了一个整体的框架,介绍了...

    STM32-LCD Framebuffer应用开发

    在"源码&文档&图片"目录中,你可能找到相关的示例代码、详细文档和参考图片,这些都是学习和实践STM32-LCD Framebuffer开发的重要资源。通过阅读文档,你可以了解如何配置STM32的LCD控制器和Framebuffer;查看源码,...

    LCD FrameBuffer设备驱动总结

    FrameBuffer(帧缓冲)是操作系统用来管理显示输出的重要组件。对于LCD显示器而言,帧缓冲驱动的核心功能在于: 1. **初始化硬件**:配置LCD控制器,设置分辨率、颜色深度等参数。 2. **数据传输**:将图像数据写入...

    framebuffer驱动全篇.doc

    **帧缓冲**是一种用于存储图像数据的数据结构,它为图形输出提供了一种统一的接口。通过帧缓冲,应用程序可以通过简单的API访问和修改图像数据,而无需关心底层硬件的具体细节。Linux系统中的帧缓冲驱动模型提供了...

    linux2.6.30.4_framebuffer移植LCD驱动

    这些接口包括 LCD 驱动接口函数的调用及其必要包含头文件和数据结构等。 6、显示图片应用程序: 显示图片应用程序是指在 LCD 上显示一幅自定义图片的应用程序。这个应用程序需要使用 LCD 驱动接口函数来控制 LCD ...

    你了解过linux framebuffer 驱动?.docx

    Framebuffer驱动的核心数据结构是`struct fb_info`,它包含了各种与Framebuffer相关的变量和结构体。其中,`fb_var_screeninfo`和`fb_fix_screeninfo`分别存储了可变参数(如分辨率)和固定参数(如屏幕大小),`fb_...

    S3C2440上LCD驱动(FrameBuffer)实例开发讲解.doc

    在开发过程中,理解S3C2440的硬件特性、LCD控制器的工作原理以及Linux内核的FrameBuffer机制至关重要。通过实践,可以逐步掌握如何编写和优化LCD驱动,以适应不同类型的LCD屏幕,并实现高效稳定的显示效果。

    关于linux的fb_framebuffer设备驱动.pdf

    查看 `<linux/fb.h>` 就知道有多少 ioctl 应用以及相关数据结构。 Framebuffer 设备驱动程序提供了许多有用的功能,例如: * 获取设备的一些不变信息,如设备名,屏幕的组织(平面,象素,...) 对应内存区的长度和...

Global site tag (gtag.js) - Google Analytics