Framebuffer programming 1 (data structure)

Source: Internet
Author: User

The most important and frequently used data structures in framebuffer programming are as follows:

Struct fb_bitfield;

Struct fb_fix_screeninfo;

Struct fb_var_screeninfo;

In the friendly source code, there are other data structures such:

Struct fb_cmap;

Struct fb_con2fbmap;

Struct fb_vblank;

Struct fb_copyarea;

Struct fb_image;

Struct fbcurpos;

Struct fb_cursor;

If you use these basic data structures, go to the source code to find the content in the header file of FB. H on the platform.

Now we will focus on the following important data structures:

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 _**/
_ 2010xpanstep;/* zero if no hardware panning */
_ 2010ypanstep;/* zero if no hardware panning */
_ 2010ywrapstep;/* 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;/* Indicate to driver which */
/* Specific chip/card we have */
_ 2010reserved [3];/* reserved for future compatibility */
};

Struct fb_var_screeninfo {
_ U32 xres;/* visible resolution */
_ U32 yres;
_ U32 xres_virtual;/* virtual resolution */
_ U32 yres_virtual;
_ U32 xoffset;/* offset from virtual to visible */
_ U32 yoffset;/* Resolution */

_ U32 bits_per_pixel;/* Guess what */
_ U32 grayscale ;/*! = 0 graylevels instead of colors */

Struct fb_bitfield red;/* bitfield in FB MEm if true color ,*/
Struct fb_bitfield green;/* else only length is significant */
Struct fb_bitfield blue;
Struct fb_bitfield Transp;/* Transparency */

_ U32 nonstd ;/*! = 0 non standard pixel format */

_ U32 activate;/* See fb_activate _**/

_ U32 height;/* Height of picture in mm */
_ U32 width;/* width of picture in mm */

_ U32 accel_flags;/* (obsolete) See fb_info.flags */

/* Timing: All values in pixclocks, blocks t pixclock (of course )*/
_ U32 pixclock;/* pixel clock in PS (Pico seconds )*/
_ U32 left_margin;/* time from sync to picture */
_ U32 right_margin;/* time from picture to sync */
_ U32 upper_margin;/* time from sync to picture */
_ U32 lower_margin;
_ U32 hsync_len;/* length of horizontal sync */
_ U32 vsync_len;/* length of vertical sync */
_ U32 sync;/* See fb_sync _**/
_ U32 vmode;/* See fb_vmode _**/
_ U32 rotate;/* angle we rotate counter clockwise */
_ U32 reserved [5];/* 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 */
};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.