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 */

};

猜你喜欢

转载自rogerer.iteye.com/blog/777307
今日推荐