MI FB API

Version 2.04


1. Overview

As shown below, the FB APIs are divided into several types.


1.1. File Operation Type

This type provides interfaces to operation of SigmaStar FB. By calling the interfaces, you can manipulate the overlay as you do with file operation. These interfaces are standard interfaces provided by Linux, offering such functions as open, close, write, read and lseek, etc. Description of these standard interfaces will not be given here in this document.


1.2. Memory Map Type

This type provides an interfaces to map physical memory to the user's virtual memory space. These interfaces are standard interfaces provided by Linux, offering such functions as mmap and munmap, etc. Description of these standard interfaces will not be given here in this document.


1.3. Memory Control and Status Query Type

This type provides interfaces to set properties like pixel format and color depth. These interfaces are standard interfaces provided by Linux, and are used quite frequently. We will give a brief account of these interfaces in this document.


1.4. Interlayer Effect Control and Status Query Type

The SigmaStar FB can manage multiple graphic overlay. Each layer in the graphic overlay can set attributes including alpha information and display region. These functions are new functions provided by SigmaStar FB, as opposed to Linux framebuffer. In this document, we will concentrate upon these new functions, which are realized by extending the command parameters of the standard Linux Framebuffer ioctl function.

The SigmaStar FB user interface is implemented in the form of ioctl, as illustrated below:

int ioctl(int fd,

unsigned long cmd,

……

);

This function is a Linux standard interface equipped with variable parameters. For SigmaStar FB, however, only three parameters are required. Therefore, the syntax would be:

int ioctl (int fd,

unsigned long cmd,

CMD_DATA_TYPE *cmddata);

Wherein, CMD_DATA_TYPE will vary with the parameter cmd. Detailed descriptions of the three parameters are provided in the table below:

Table 1-1: Parameters of ioctl Function

Parameter Description Input/Output
Fd Framebuffer device file descriptor, which is the return value after calling the open function to open the Framebuffer device. Input
Cmd The main commands (command control word) are as listed below:
FBIOGET_VSCREENINFO: Get screen variable information
FBIOPUT_VSCREENINFO: Set screen variable information
FBIOGET_FSCREENINFO: Get screen fixed information
FBIOPAN_DISPLAY: Set PAN display
FBIOGET_SCREEN_LOCATION: Get overlay display region
FBIOSET_SCREEN_LOCATION: Set overlay display region
FBIOGET_SHOW: Get overlay display status
FBIOSET_SHOW: Set overlay display status
FBIOGET_GLOBAL_ALPHA: Get overlay Alpha attribute
FBIOSET_GLOBAL_ALPHA: Set overlay Alpha attribute
FBIOGET_COLORKEY: Get overlay colorkey attribute
FBIOSET_COLORKEY: Set overlay colorkey attribute
FBIOGET_DISPLAYLAYER_ATTRIBUTES: Get overlay attribute
FBIOSET_DISPLAYLAYER_ATTRIBUTES: Set overlay attribute
FBIOGET_CURSOR_ATTRIBUTE: Get cursor attribute
FBIOSET_CURSOR_ATTRIBUTE: Set cursor attribute
Input
cmddata The foregoing commands correspond respectively to the following data types:
Get or set screen variable information: struct fb_var_screeninfo *
Get screen fixed information: struct fb_fix_screeninfo *
Set PAN display: struct fb_var_screeninfo *
Get or set screen overlay coordinate origin: MI_FB_CursorAttr_t *
Get or set overlay display status: MI_BOOL *
Get or set overlay Alpha: MI_FB_GlobalAlpha_t *
Get or set overlay colorkey: MI_FB_ColorKey_t*
Get or set overlay attribute: MI_FB_DisplayLayerAttr_t*
Get or set cursor graphic layer attribute: MI_FB_CursorAttr_t*
Input/Output

2. STANDARD FUNCTION


2.1. FBIOGET_VSCREENINFO

  • Function

    Get screen variable information

  • Syntax

    int ioctl (int fd,FBIOGET_VSCREENINFO,struct fb_var_screeninfo *var);
    
  • Description

    Use this interface to get screen variable information, including primarily resolution and pixel format. For detailed description of the information, please refer to section “struct fb_var_screeninfo.”

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_VSCREENINFO ioctl number Input
    var Variable information structure pointer Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: fb.h
  • Related Interface

    FBIOPUT_VSCREENINFO


2.2. FBIOPUT_VSCREENINFO

  • Function

    Set Framebuffer screen resolution and pixel format, etc.

  • Syntax

    int ioctl (int fd,FBIOPUT_VSCREENINFO, struct fb_var_screeninfo *var);
    
  • Description

    Use this interface to set screen resolution and pixel format

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOPUT_VSCREENINFO ioctl number Input
    var Variable information structure pointer Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: fb.h
  • Note

    The actual resolution and offset must be guaranteed to be within the virtual resolution range. Otherwise, system will automatically adjust the actual resolution to keep it within the coverage of the virtual resolution range.

  • Related Interface

    FBIOGET_VSCREENINFO


2.3. FBIOGET_FSCREENINFO

  • Function

    Get Framebuffer fixed information

  • Syntax

    int ioctl (int fd,FBIOGET_FSCREENINFO, struct fb_fix_screeninfo  *fix);
    
  • Description

    Use this interface to get Framebuffer fixed information, including memory start physical address, memory size and line spacing, etc. For detailed description, please refer to the section “”

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_FSCREENINFO ioctl number Input
    fix Fixed information structure pointer Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: fb.h

2.4. FBIOPAN_DISPLAY

  • Function

    Set to display from different offsets in the virtual resolution

  • Syntax

    int ioctl (int fd,FBIOPAN_DISPLAY, struct fb_var_screeninfo  *var);
    
  • Description

    Use this interface to set the display position from different offsets in the virtual resolution; the actual resolution remains unchanged. As shown in the figure below, (xres_virtual, yres_virtual) means the virtual resolution, (xres, yres) the resolution actually shown, and (xoffset, yoffset) the offset used.

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOPAN_DISPLAY ioctl number Input
    var Variable information structure pointer Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: fb.h
  • Note

    The actual resolution and offset must be guaranteed to be within the virtual resolution range. Otherwise, the setting will fail.

    Figure 2-1: Setting the Display Position from Different Offsets in the Virtual Resolution


3. EXTENDED FUNCTION


3.1. FBIOGET_SCREEN_LOCATION

  • Function

    Get overlay screen display region

  • Syntax

    int ioctl (int fd,FBIOGET_SCREEN_LOCATION,MI_FB_Rectangle_t*    pstRectangle);
    
  • Description

    Use this interface to get overlay screen display region

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_SCREEN_LOCATION ioctl number Input
    pstRectangle Pointer to MI_FB_Rectangle_t structure, including (x,y) coordinates, width, and height. It refers to the overlay screen display region. Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_SCREEN_LOCATION


3.2. FBIOSET_SCREEN_LOCATION

  • Function

    Set overlay screen display region

  • Syntax

    int ioctl (int fd,FBIOSET_SCREEN_LOCATION,MI_FB_Rectangle_t* pstRectangle);
    
  • Description

    Use this interface to set overlay screen display region

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_SCREEN_LOCATION ioctl number Input
    pstRectangle Pointer to MI_FB_Rectangle_t structure, including (x,y) coordinates, width, and height. It refers to the overlay screen display region. Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOGET_SCREEN_LOCATION


3.3. FBIOGET_SHOW

  • Function

    Get current overlay display status

  • Syntax

    int ioctl (int fd,FBIOGET_SHOW,MI_BOOL *bShow);
    
  • Description

    Use this interface to get current overlay display status

  • Parameter

    Parameter Name Description Input/Output
    Fd Framebuffer device file descriptor Input
    FBIOGET_SHOW ioctl number Input
    bShow Indicate the current overlay status: *bShow = MS_TRUE: Current overlay is in Show status *bShow = MS_FALSE: Current overlay is in Hidden status Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_SHOW


3.4. FBIOSET_SHOW

  • Function

    Show or hide the overlay

  • Syntax

    int ioctl (int fd,FBIOSET_SHOW,MI_BOOL *bShow);
    
  • Description

    Use this interface to set the overlay display status: show or hide

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_SHOW ioctl number Input
    bShow Display status of the overlay: *bShow = MS_TRUE: Show the current overlay *bShow = MS_FALSE: Hide the current overlay Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOGET_SHOW


3.5. FBIOGET_GLOBAL_ALPHA

  • Function

    Get overlay Alpha setting

  • Syntax

    int ioctl (int fd,FBIOGET_GLOBAL_ALPHA,MI_FB_GlobalAlpha_t  *pstAlpha);
    
  • Description

    Use this interface to get current overlay Alpha setting

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_GLOBAL_ALPHA ioctl number Input
    pstAlpha Pointer to MI_FB_GlobalAlpha_t structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_GLOBAL_ALPHA


3.6. FBIOSET_GLOBAL_ALPHA

  • Function

    Set overlay Alpha

  • Syntax

    int ioctl (int fd,FBIOSET_GLOBAL_ALPHA, MI_FB_GlobalAlpha_t *pstAlpha);
    
  • Description

    Use this interface to set current overlay Alpha function

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_GLOBAL_ALPHA ioctl number Input
    pstAlpha Pointer to MI_FB_GlobalAlpha_t structure Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOGET_GLOBAL_ALPHA


3.7. FBIOGET_COLORKEY

  • Function

    Get overlay colorkey

  • Syntax

    int ioctl (int fd,FBIOGET_COLORKEY,MI_FB_ColorKey_t* pstColorKey);
    
  • Description

    Use this interface to get overlay colorkey

  • Parameter

    Parameter Name Description Input/Output
    Fd Framebuffer device file descriptor Input
    FBIOGET_COLORKEY ioctl number Input
    pstColorKey Pointer to MI_FB_ColorKey_t structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_COLORKEY


3.8. FBIOSET_COLORKEY

  • Function

    Set the overlay colorkey

  • Syntax

    int ioctl (int fd,FBIOSET_COLORKEY,MI_FB_ColorKey_t* pstColorKey);
    
  • Description

    Use this interface to set current overlay colorkey function

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_COLORKEY ioctl number Input
    pstColorKey Pointer to MI_FB_ColorKey_t structure Input
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOGET_COLORKEY


3.9. FBIOSET_DISPLAYLAYER_ATTRIBUTES

  • Function

    Set graphic layer information

  • Syntax

    int ioctl (int fd,FBIOSET_DISPLAYLAYER_ATTRIBUTES,
    
    MI_FB_DisplayLayerAttr_t* pstLayerInfo);
    
  • Description

    This interface is used to set graphic layer information, including screen display position, canvas resolution, memory resolution, screen display resolution, and capability of pre-multiplication of the graphic layer. For more details, see description with respect to MI_FB_DisplayLayerAttr_t.

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_DISPLAYLAYER_ATTRIBUTES ioctl number Input
    pstLayerInfo Pointer to MI_FB_DisplayLayerAttr_t structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_DISPLAYLAYER_ATTRIBUTES


3.10. FBIOGET_DISPLAYLAYER_ATTRIBUTES

  • Function

    Get graphic layer information

  • Syntax

    int ioctl (int fd,
    
    FBIOGET_DISPLAYLAYER_ATTRIBUTES,
    
    MI_FB_DisplayLayerAttr_t * pstLayerInfo);
    
  • Description

    Used to get graphic layer information, including screen display position, memory resolution, screen display resolution, and capability of pre-multiplication of the graphic layer.

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_DISPLAYLAYER_ATTRIBUTES ioctl number Input
    pstLayerInfo Pointer to graphic layer information structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOGET_DISPLAYLAYER_ATTRIBUTES



4.1. FBIOGET_CURSOR_ATTRIBUTE

  • Function

    Get cursor graphic layer information

  • Syntax

    int ioctl (int fd,
    
    FBIOGET_CURSOR_ATTRIBUTE,
    
    MI_FB_CursorAttr_t *pstCursorAttr)
    
  • Description

    Get cursor graphic layer information, including hotspot, position, Alpha, Colorkey, and visibility.

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOGET_CURSOR_ATTRIBUTE ioctl number Input
    pstCursorAttr Pointer to MI_FB_CursorAttr_t structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

    FBIOSET_CURSOR_ATTRIBUTE


4.2. FBIOSET_CURSOR_ATTRIBUTE

  • Function

    Set cursor graphic layer information

  • Syntax

    int ioctl (int fd,
    
    FBIOSET_CURSOR_ATTRIBUTE,
    
    MI_FB_CursorAttr_t *pstCursorAttr)
    
  • Description

    Set cursor graphic layer information, including hotspot, position, Alpha, Colorkey, and visibility

  • Parameter

    Parameter Name Description Input/Output
    fd Framebuffer device file descriptor Input
    FBIOSET_CURSOR_ATTRIBUTE ioctl number Input
    pstCursorAttr Pointer to MI_FB_CursorAttr_t structure Output
  • Return Value

    • 0: Successful.

    • -1: Failed.

  • Requirement

    • Header file: mstarFb.h
  • Related Interface

FBIOGET_CURSOR_ATTRIBUTE


5. ERROR CODE

The following table lists all error codes that may appear when the return value of the various functions is smaller than 0. These error codes originate from the standard Linux error code definitions. For details, please refer to the Linux Kernel source code errno_base.h. To check the error message, print the Linux standard error code errno or use strerror(errno).

Table 5-1: Error Code

Error Code Macro Definition Description
1 EPERM Invalid operation
12 ENOMEM No memory
14 EFAULT Invalid parameter pointer address
22 EINVAL Invalid parameter

6. FB DATA TYPE


6.1. Standard Data Type

6.1.1. struct fb_bitfield

  • Description

    Bit field information for setting pixel format

  • Definition

    struct fb_bitfield
    
    {
    
        u32 offset; /* beginning of bitfield */
    
        u32 length; /* length of bitfield */
    
        u32 msb_right; /* != 0: Most significant bit is right */
    
    };
    
  • Member

    Member Description Supportability
    offset Color component start bit Supported
    length Length of the bit occupied by the color component Supported
    msb_right Whether the bit on the right is the most significant bit. Only 0 is supported. That is, the leftmost bit is the most significant bit.

6.1.2. struct fb_var_screeninfo

  • Description

    Variable screen information

  • Definition

    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, except 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 */
    };
    
  • Member

    Member Description Supportability
    xres Visible screen width (number of pixels) Supported
    yres Visible screen height (number of pixels) Supported
    xres_virtual Virtual screen width (image width in memory). When the value is smaller than xres, xres will be modified to be equal to that value. Supported
    yres_virtual Virtual screen height (image height in memory). When the value is smaller than yres, yres will be modified to be equal to that value. If used in combination with xres_virtual, this parameter can pan image quickly in horizontal or vertical direction. Supported
    xoffset Number of offset pixels in x direction Supported, default is 0
    yoffset Number of offset pixels in y direction Supported, default is 0
    bits_per_pixel Number of bits occupied by each pixel Supported
    grayscale Grayscale Not supported, default is 0 (color)
    red Red bit field information in the color component Supported
    green Green bit field information in the color component Supported
    blue Blue bit field information in the color component Supported
    transp Alpha bit field information in the color component Supported
    nonstd Indicates whether standard pixel format is used Not supported, default is 0 (standard pixel format supported)
    Member Description Supportability
    activate Set the time of activation Not supported, default is FB_ACTIVATE_NOW (activated immediately)
    height Screen height, unit is mm Not supported, default is -1
    width Screen width, unit is mm Not supported, default is -1
    accel_flags Acceleration flag Not supported, default is -1
    pixclock Time required to show a pixel, unit is ns Not supported, default is -1
    left_margin Represent the left blanking signal, the right blanking signal, and the horizontal synchronization duration. The sum of these values is equal to the horizontal retrace time in unit of dot clock. Not supported, default is 64
    right_margin
    hsync_len
    upper_margin Represent the upper blanking signal, the lower blanking signal, and the vertical synchronization duration. The sum of these values is equal to the vertical retrace time in unit of dot clock. Not supported, default is -1
    lower_margin
    vsync_len
    sync Signal synchronization method Not supported, default is -1
    vmode Scan mode Not supported, default is -1
    rotate Angle of rotation clockwise Not supported, default is 0 (no rotation)
  • Note

    The default resolution of the HD device graphics layer is 1280x720; the default resolution of the SD device graphics layer is 720x576, and the cursor layer default resolution is 128x128. The pixel format is ARGB1555.

  • Related Data Type and Interface

    struct fb_bitfield

    FBIOGET_VSCREENINFO

    FBIOPUT_VSCREENINFO

6.1.3. struct fb_fix_screeninfo

  • Description

    Fixed screen information

  • Definition

    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; /* Indicate to driver which specific chip/card we have */
    u16 reserved[3];    /* Reserved for future compatibility */
    };
    
  • Member

    Member Description Supportability
    id Device driver name Supported
    smem_start Memory start physical address Supported
    smem_len Memory size Supported
    type Graphics card type Fixed to FB_TYPE_PACKED_PIXELS(pixel values closely packed)
    type_aux Auxiliary type Not supported. Undefined graphics card type under FB_TYPE_PACKED_PIXELS.
    visual Color mode Not supported, default is FB_VISUAL_TRUECOLOR (true color)
    xpanstep Support horizontal PAN display or not:
    0: Not supported
    ǂ 0: Supported. The value in this case is used to indicate the pixel value per step in the horizontal direction
    Fixed to 1
    ypanstep Support vertical PAN display or not:
    0: Not supported
    ǂ 0: Supported. The value in this case is used to indicate the pixel value per step in the vertical direction
    Fixed to 1
    ywrapstep Smilar to ypanstep, except that when it is displayed to the bottom, it can be returned to the beginning of the video memory for display. Not supported, default is 0
    line_length Number of bytes per line Supported
    mmio_start Memory map I/O start address Not supported, default is 0
    mmio_len Memory map I/O length Not supported, default is 0
    accel Indicate the hardware acceleration device supported Not supported, default is FB_ACCEL_NONE (no acceleration)
    reserved Reserved Not supported, default is 0
  • Related Data Type and Interface

    FBIOGET_FSCREENINFO


6.2. Extended Data Type

6.2.1. MI_FB_ColorFmt_e

  • Description

    Collection of pixel formats supported by SigmaStar FB

  • Definition

    typedef enum
    
    {
    
        E_MI_FB_COLOR_FMT_RGB565 = 1,
    
        E_MI_FB_COLOR_FMT_ARGB4444 =2,
    
        E_MI_FB_COLOR_FMT_ARGB8888 =5,
    
        E_MI_FB_COLOR_FMT_ARGB1555 =6,
    
        E_MI_FB_COLOR_FMT_YUV422 =9,
    
        /// Invalid color format.
    
        E_MI_FB_COLOR_FMT_INVALID = 12,
    
    }MI_FB_ColorFmt_e;
    
  • Member

    Member Description
    E_MI_FB_COLOR_FMT_RGB565 RGB565 format
    E_MI_FB_COLOR_FMT_ARGB4444 ARGB444 format
    E_MI_FB_COLOR_FMT_ARGB8888 ARGB8888 format
    E_MI_FB_COLOR_FMT_ARGB1555 ARGB1555 format
    E_MI_FB_COLOR_FMT_YUV422 YUV422 format
    E_MI_FB_COLOR_FMT_INVALID Invalid pixel format
  • Related Data Type and Interface

    MI_FB_DisplayLayerAttr_t

    MI_FB_CursorAttr_t

6.2.2. MI_FB_DisplayLayerAttrMaskbit_e

  • Description

    Indicate which members in the MI_FB_DisplayLayerAttr_t structure have been updated

  • Definition

    typedef enum
    
    {
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_DISP_POS = 0x1,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_DISP_SIZE = 0x2,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_BUFFER_SIZE = 0x4,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_SCREEN_SIZE = 0x8,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_PREMUL = 0x10,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_COLOR_FMB = 0x20
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_OUTPUT_COLORSPACE = 0x40,
    
        E_MI_FB_DISPLAYLAYER_ATTR_MASK_DST_DISP = 0x80,
    
    } MI_FB_DisplayLayerAttrMaskbit_e;
    
  • Member

    Member Description
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_DISP_POS Overlay position changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_DISP_SIZE Width or height of overlay screen display region changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_BUFFER_SIZE Display resolution changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_SCREEN_SIZE Screen resolution changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_PREMUL Pre-multiplication attribute changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_COLOR_FMB FB color format attribute changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_OUTPUT_COLORSPACE Overlay output color space changed
    E_MI_FB_DISPLAYLAYER_ATTR_MASK_DST_DISP Overlay output to display chain target module changed
  • Related Data Type and Interface

    MI_FB_DisplayLayerAttr_t

6.2.3. MI_FB_GlobalAlpha_t

  • Description

    Alpha information structure

  • Definition

    typedef struct MI_FB_GlobalAlpha_s
    
    {
    
        MI_BOOL bAlphaEnable; /* alpha enable flag */
    
        MI_BOOL bAlphaChannel; /* alpha channel enable flag */
    
        MI_BOOL bAlphaInvert;   /* alpha invert flag */
    
        MI_U8 u8Alpha0; /* alpha0 value */
    
        MI_U8 u8Alpha1; /* alpha1 value */
    
        MI_U8 u8GlobalAlpha; /* global alpha value */ MI_U8 u8Reserved;
    
    } MI_FB_GlobalAlpha_t;
    
  • Member

    Member Description
    bAlphaEnable Alpha overlay enable, default is 1
    bAlphaChannel Alpha channel enable, default is 0
    bAlphaInvert Alpha invert flag, used to that 0 is opaque in argb1555 format.
    u8Alpha0 Alpha0 value. Range: 0~255, default is 255. In RGB1:5:5:5 format, when the most significant bit is 0, this value will be chosen as the Alpha overlay value.
    u8Alpha1 Alpha1 value. Range: 0~255, default is 255. In RGB1:5:5:5 format, when the most significant bit is 1, this value will be chosen as the Alpha overlay value.
    u8GlobalAlpha Global Alpha value. Range: 0~255, default is 255. Works when Alpha channel is enabled.
    u8Reserved Reserved
  • Note

    Alpha0 just for cursor, alpha0 is 0 for UI.

    Alpha overlay is implemented only when Alpha overlay function is enabled. Otherwise, the upper layer overlay will replace the lower layer overlay.

    The formula for Alpha overlay value calculation can be divided into the following cases:

    • When Alpha channel is enabled, global Alpha will be included in the overlay.

      • If global Alpha and pixel Alpha overlay are not supported, the Alpha overlay value is calculated as: u8GlobalAlpha

      • If global Alpha and pixel Alpha overlay are supported, the Alpha overlay value is calculated as: u8GlobalAlpha * pixel

    • When Alpha channel is not enabled, the Alpha overlay value is equal to the pixel Alpha value, that is: pixel

  • Related Data Type and Interface

    FBIOGET_GLOBAL_ALPHA

    FBIOSET_GLOBAL_ALPHA

6.2.4. MI_FB_ColorKey_t

  • Description

    Colorkey information structure for setting colorkey attribute

  • Definition

    typedef struct MI_FB_ColorKey_s
    
    {
    
        MI_BOOL bKeyEnable;
    
        MI_U8 u8Red;
    
        MI_U8 u8Green;
    
        MI_U8 u8Blue;
    
    } MI_FB_ColorKey_t
    
  • Member

    Member Description
    bKeyEnable Colorkey enable.
    TRUE: Enable
    FALSE: Not enable
    u8Red Colorkey R component value
    u8Green Colorkey G component value
    u8Blue Colorkey B component value
  • Related Data Type and Interface

    FBIOGET_COLORKEY

    FBIOSET_COLORKEY

6.2.5. MI_FB_Rectangle_t

  • Description

    MI_FB_Rectangle_t structure for describing overlay display region

  • Definition

    typedef struct MI_FB_Rectangle_s
    
    {
    
        MI_U32 u32Xpos;
    
        MI_U32 u32Ypos;
    
        MI_U32 u32Width;
    
        MI_U32 u32Height;
    
    }MI_FB_Rectangle_t;
    
  • Member

    Member Description
    u32Xpos Upper left corner x coordinate
    u32Ypos Upper left corner y coordinate
    u32Width Width
    u32Height Height
  • Related Data Type and Interface

    FBIOGET_SCREEN_LOCATION

    FBIOSET_SCREEN_LOCATION

6.2.6. MI_FB_DisplayLayerAttr_t

  • Description

    MI_FB_DisplayLayerAttr_t structure for describing the overlay attribute information

  • Definition

    typedef struct MI_FB_DisplayLayerAttr_s
    
    {
    
        MI_U32 u32Xpos; /**the x pos of orign point in screen*/
    
        MI_U32 u32YPos; /**the y pos of orign point in screen*/
    
        MI_U32 u32dstWidth; /**display buffer dest with in screen*/
    
        MI_U32 u32dstHeight; /**display buffer dest hight in screen*/
    
        MI_U32 u32DisplayWidth; /**the width of display buf in fb */
    
        MI_U32 u32DisplayHeight; /**the height of display buf in fb. */
    
        MI_U32 u32ScreenWidth; /**the width of screen */
    
        MI_U32 u32ScreenHeight; /** the height of screen */
    
        MI_BOOL bPreMul; /**the data drawed in buffer whether is premultiply
        alpha or not*/
    
        MI_FB_ColorFmt_e eFbColorFmt; /**the color format of framebuffer*/
    
        MI_FB_OutputColorSpace_e eFbOutputColorSpace; /**output color space*/
    
        MI_FB_DstDisplayplane_e eFbDestDisplayPlane; /**destination
        displayplane*/
    
        MI_U32 u32SetAttrMask; /** display attribute modify mask*/
    
    }MI_FB_DisplayLayerAttr_t;
    
  • Member

    Member Description
    u32Xpos The x-axis origin of the graphics layer on the screen
    u32YPos The y-axis origin of the graphics layer on the screen
    u32dstWidth The display width of the graphics layer on the screen
    u32dstHeight The display height of the graphics layer on the screen
    u32DisplayWidth Width of memory resolution
    u32DisplayHeight Height of memory resolution
    u32ScreenWidth Width of screen display resolution
    u32ScreenHeight Height of screen display resolution
    bPreMul Whether the data in FB is pre-multiplied
    eFbColorFmt FB pixel format
    u32SetAttrMask Parameter modification mask bit when setting graphics layer information
    eFbOutputColorSpace Set the overlay output color space
    eFbDestDisplayPlane Set the overlay output to display chain target module. Default is E_MI_FB_DST_OP0.
  • Related Data Type and Interface

    MI_FB_DisplayLayerAttrMaskbit_e

    MI_FB_ColorFmt_e

    MI_FB_DstDisplayplane_e

    MI_FB_OutputColorSpace_e

6.2.7. MI_FB_OutputColorSpace_e

  • Description

    FB overlay output color space

  • Definition

    typedef enum
    
    {
    
        E_MI_FB_OUTPUT_RGB = 0,
    
        E_MI_FB_OUTPUT_YUV = 1
    
    }MI_FB_OutputColorSpace_e
    
  • Member

    Member Description
    E_MI_FB_OUTPUT_RGB RGB Color Space
    E_MI_FB_OUTPUT_YUV YUV Color Space
  • Related Data Type and Interface

    MI_FB_DisplayLayerAttr_t

6.2.8. MI_FB_DstDisplayplane_e

  • Description

    FB overlay output to display chain target module. By configuring different Display chains, you can select the image adjustment process that the overlay participates in.

  • Definition

    typedef enum
    
    {
    
        E_MI_FB_DST_OP0 = 0,
    
        E_MI_FB_DST_OP1 = 1,
    
        E_MI_FB_DST_INVALID
    
    }MI_FB_DstDisplayplane_e
    
  • Member

    Member Description
    E_MI_FB_DST_OP0 OP path
    E_MI_FB_DST_OP1 OP1 path
    E_MI_FB_DST_INVALID MIXER2OP1
  • Note

    This interface is only valid for Ikayaki series chips.

  • Related Data Type and Interface

    MI_FB_DisplayLayerAttr_t

6.2.9. MI_FB_CursorAttrMaskbit_e

  • Description

    Describe which attributes in the MI_FB_CursorAttr_t structure has been updated

  • Definition

    typedef enum
    
    {
    
        E_MI_FB_CURSOR_ATTR_MASK_ICON = 0x1,
    
        E_MI_FB_CURSOR_ATTR_MASK_POS = 0x2,
    
        E_MI_FB_CURSOR_ATTR_MASK_ALPHA = 0x4,
    
        E_MI_FB_CURSOR_ATTR_SHOW = 0x8,
    
        E_MI_FB_CURSOR_ATTR_HIDE = 0x10,
    
        E_MI_FB_CURSOR_ATTR_MASK = 0x1F
    
    } MI_FB_CursorAttrMaskbit_e;
    
  • Member

    Member Description
    E_MI_FB_CURSOR_ATTR_MASK_ICON Cursor icon changed
    E_MI_FB_CURSOR_ATTR_MASK_POS Cursor position changed
    E_MI_FB_CURSOR_ATTR_MASK_ALPHA Alpha changed
    E_MI_FB_CURSOR_ATTR_SHOW Show cursor
    E_MI_FB_CURSOR_ATTR_MASK_HIDE Hide cursor
    E_MI_FB_CURSOR_ATTR_MASK Indicate all cursor attributes that can be configured
  • Related Data Type and Interface

    MI_FB_CursorAttr_t

6.2.10. MI_FB_CursorImage_t

  • Description

    MI_FB_CursorImage_t structure for describing cursor icon data information

  • Definition

    typedef struct MI_FB_CursorImage_s
    
    {
    
        MI_U32 u32Width; /**width, unit pixel*/
    
        MI_U32 u32Height; /**Height, unit pixel*/
    
        MI_U32 u32Pitch; /**Pitch, unit pixel*/
    
        MI_FB_ColorFmt_e eColorFmt; /**Color format*/
    
        const char* data;
    
    }MI_FB_CursorImage_t;
    
  • Member

    Member Description
    u32Width Icon width
    u32Height Icon height
    u32Pitch Pitch
    eColorFmt Icon data pixel format
    data Icon data
  • Note

    The maximum value of icon width and height is 128

  • Related Data Type and Interface

    MI_FB_CursorAttr_t

    MI_FB_ColorFmt_e

6.2.11. MI_FB_CursorAttr_t

  • Description

    MI_FB_CursorAttr_t structure for describing cursor icon information

  • Definition

    typedef struct MI_FB_CursorAttr_s
    
    {
    
        MI_U32 u32XPos;
    
        MI_U32 u32YPos;
    
        MI_U32 u32HotSpotX;
    
        MI_U32 u32HotSpotY;
    
        MI_FB_GlobalAlpha_t stAlpha;
    
        MI_FB_ColorKey_t stColorKey;
    
        MI_BOOL bShown;
    
        MI_FB_CursorImage_t stCursorImageInfo;
    
        MS_U16 u16CursorAttrMask;
    
    }MI_FB_CursorAttr_t;
    
  • Member

    Member Description
    u32XPos X coordinate of cursor position
    u32YPos Y coordinate of cursor position
    u32HotSpotX X coordinate of cursor hotspot
    u32HotSpotY Y coordinate of cursor hotspot
    stAlpha Cursor graphics layer alpha information of MI_FB_GlobalAlpha_t structure
    stColorKey Cursor graphics layer colorkey information of MI_FB_ColorKey_t structure
    bShown Cursor visibility. TRUE means visible, and FALSE means invisible.
    MI_FB_CursorImage_t Icon data information
    u16CursorAttrMask Set the cursor graphics layer parameter modification mask bit
  • Related Data Type and Interface

    MI_FB_CursorAttrMaskbit_e

    MI_FB_CursorImage_t