#include "xosd.h"
#include "xenv.h"
Go to the source code of this file.
Please see xosd.h for more details of the driver.
MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ------------------------------------------------------- 1.00a xd 08/18/08 First release 1.02a xd 12/21/10 Removed endian conversion for text bank loading
Definition in file xosd.c.
int XOSD_CfgInitialize | ( | XOSD * | InstancePtr, | |
XOSD_Config * | CfgPtr, | |||
u32 | EffectiveAddr | |||
) |
This function initializes an OSD device.
This function must be called prior to using an OSD device. Initialization of an OSD includes setting up the instance data, and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
CfgPtr | points to the configuration structure associated with the OSD device. | |
EffectiveAddr | is the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used. |
void XOSD_CreateInstruction | ( | XOSD * | InstancePtr, | |
u32 * | InstructionPtr, | |||
u8 | GcIndex, | |||
u16 | ObjType, | |||
u8 | ObjSize, | |||
u16 | XStart, | |||
u16 | YStart, | |||
u16 | XEnd, | |||
u16 | YEnd, | |||
u8 | TextIndex, | |||
u8 | ColorIndex | |||
) |
This function creates an instruction for an OSD.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
InstructionPtr | is a pointer to the instruction buffer to be populated with the instruction to be created. The upper level application is responsible for allocating this instruction buffer. | |
GcIndex | indicates the Graphics Controller that will consume the instruction. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
ObjType | indicates the type of object to draw. Use one of XOSD_INS_OPCODE_... constants defined in xosd_hw.h. | |
ObjSize | indicates line width of boxes and lines and the text scale factor for text boxes. | |
XStart | indicates the horizontal start pixel of the Object. | |
YStart | indicates the vertical start line of the Object. | |
XEnd | indicates the horizontal end pixel of the Object. | |
YEnd | indicates the vertical end line of the Object. | |
TextIndex | indicates the string index. | |
ColorIndex | indicates the color index. |
void XOSD_DisableLayer | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex | |||
) |
This function disables an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). |
void XOSD_EnableLayer | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex | |||
) |
This function enables an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). |
void XOSD_GetBackgroundColor | ( | XOSD * | InstancePtr, | |
u8 * | RedPtr, | |||
u8 * | BluePtr, | |||
u8 * | GreenPtr | |||
) |
This function gets the Background color used by the OSD output.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
RedPtr | will point to the red value used in the background color after this function returns. | |
BluePtr | will point to the blue value used in the background color after this function returns. | |
GreenPtr | will point to the green value used in the background color after this function returns. |
void XOSD_GetLayerAlpha | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u8 * | GlobalAlphaEnblePtr, | |||
u8 * | GlobalAlphaValuePtr | |||
) |
This function gets the Alpha value and mode of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
GlobalAlphaEnblePtr | will point to a flag indicating whether the global Alpha is enabled on a layer after this function returns. Flag 1 indicates that the global Alpha is enabled, 0 indicates that it is not. | |
GlobalAlphaValuePtr | will point to the transparent level after this function returns. 0 for 100% transparent, 255 for 0% transparent (100% opaque). |
void XOSD_GetLayerDimension | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u16 * | XStartPtr, | |||
u16 * | YStartPtr, | |||
u16 * | XSizePtr, | |||
u16 * | YSizePtr | |||
) |
This function gets the start position and size of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
XStartPtr | will point to the Horizontal start pixel value of origin of the layer after this function returns. | |
YStartPtr | will point to the Vertical start line of origin of the layer after this function returns. | |
XSizePtr | will point to the Horizontal Size value of the layer after this function returns. | |
YSizePtr | will point to the Vertical Size value of the layer after this function returns. |
void XOSD_GetLayerPriority | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u8 * | PriorityPtr | |||
) |
This function gets the priority of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
PriorityPtr | will point to the priority used on the layer after this function returns. Use XOSD_LAYER_PRIORITY_... defined in xosd_hw.h to interpret the value. |
void XOSD_GetScreenSize | ( | XOSD * | InstancePtr, | |
u32 * | WidthPtr, | |||
u32 * | HeightPtr | |||
) |
This function gets the screen size of the OSD Output.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
WidthPtr | will point to the width of the OSD output after this function returns. | |
HeightPtr | will point to the height of the OSD output after this function returns. |
void XOSD_GetVersion | ( | XOSD * | InstancePtr, | |
u16 * | Major, | |||
u16 * | Minor, | |||
u16 * | Revision | |||
) |
This function returns the version of an OSD device.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
Major | points to an unsigned 16-bit variable that will be assigned with the major version number after this function returns. Value range is from 0x0 to 0xF. | |
Minor | points to an unsigned 16-bit variable that will be assigned with the minor version number after this function returns. Value range is from 0x00 to 0xFF. | |
Revision | points to an unsigned 16-bit variable that will be assigned with the revision version number after this function returns. Value range is from 0xA to 0xF. |
void XOSD_LoadCharacterSetBank | ( | XOSD * | InstancePtr, | |
u8 | GcIndex, | |||
u8 | BankIndex, | |||
u32 * | CharSetData | |||
) |
This function loads Character Set data (font) into an OSD Graphics Controller Bank.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
GcIndex | indicates which Graphics Controller to work on. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
CharSetData | points to the Character Set data to be loaded. |
void XOSD_LoadColorLUTBank | ( | XOSD * | InstancePtr, | |
u8 | GcIndex, | |||
u8 | BankIndex, | |||
u32 * | ColorData | |||
) |
This function loads color LUT data into an OSD Graphics Controller Bank.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
GcIndex | indicates which Graphics Controller to work on. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
ColorData | points to the color LUT data to be loaded. |
void XOSD_LoadInstructionList | ( | XOSD * | InstancePtr, | |
u8 | GcIndex, | |||
u8 | BankIndex, | |||
u32 * | InstSetPtr, | |||
u32 | InstNum | |||
) |
This function load an instruction list to be used by an Graphic Controller in an OSD device.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
GcIndex | indicates which Graphics Controller to work on. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM. | |
InstSetPtr | is a pointer to the start of the instruction list to load into the OSD device. The last instruction in the list must has XOSD_INS_OPCODE_END type. | |
InstNum | indicates the number of the instructions in the list to load. Valid value range is from 1 to the half of the size of the instruction memory created for the Graphic Controller |
void XOSD_LoadTextBank | ( | XOSD * | InstancePtr, | |
u8 | GcIndex, | |||
u8 | BankIndex, | |||
u32 * | TextData | |||
) |
This function loads Text data into an OSD Graphics Controller Bank.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
GcIndex | indicates which Graphics Controller to work on. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
BankIndex | indicates which GC Bank to be worked on. Valid value range is from 0 to XOSD_GC_BANK_NUM - 1. | |
TextData | points to the Text data to be loaded. |
void XOSD_SetActiveBank | ( | XOSD * | InstancePtr, | |
u8 | GcIndex, | |||
u8 | ColorBankIndex, | |||
u8 | CharBankIndex, | |||
u8 | TextBankIndex, | |||
u8 | InstructionBankIndex | |||
) |
This function chooses active banks for a GC in an OSD device.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
GcIndex | indicates which Graphics Controller to work on. Valid value range is from 0 to (The Number of Layers) - 1. The layer's type must be set to XOSD_LAYER_TYPE_GPU (defined in xosd_hw.h) for this function to work properly. | |
ColorBankIndex | indicates the Color LUT bank to be choose as active. | |
CharBankIndex | indicates the Character Set bank to be choose as active. | |
TextBankIndex | indicates the Text Data bank to be choose as active. | |
InstructionBankIndex | indicates the Instruction bank to be choose as active. |
void XOSD_SetBackgroundColor | ( | XOSD * | InstancePtr, | |
u8 | Red, | |||
u8 | Blue, | |||
u8 | Green | |||
) |
This function sets the Background color used by the OSD output.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
Red | indicates the red value used in the background color. | |
Blue | indicates the blue value used in the background color. | |
Green | indicates the green value used in the background color. |
void XOSD_SetBlankPolarity | ( | XOSD * | InstancePtr, | |
int | VerticalBlankPolarity, | |||
int | HorizontalBlankPolarity | |||
) |
This function chooses the type of Vertical and Horizontal Blank Input Polarities.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
VerticalBlankPolarity | indicates the type of vertical blank input polarity. Use any non-0 value for Active High and 0 for Active Low. | |
HorizontalBlankPolarity | indicates the type of horizontal blank input polarity. Use any non-0 value for Active High and 0 for Active Low. |
void XOSD_SetLayerAlpha | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u8 | GlobalAlphaEnble, | |||
u8 | GlobalAlphaValue | |||
) |
This function sets the Alpha value and mode of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
GlobalAlphaEnble | indicates whether to enable the global Alpha. Use any non-0 value to enable the global Alpha, and 0 to disable it. | |
GlobalAlphaValue | indicates the transparent level. 0 for 100% transparent, 255 for 0% transparent (100% opaque). This argument will be ignored if parameter GlobalAlphaEnble has value 0. |
void XOSD_SetLayerDimension | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u16 | XStart, | |||
u16 | YStart, | |||
u16 | XSize, | |||
u16 | YSize | |||
) |
This function sets the start position and size of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
XStart | indicates the Horizontal start pixel of origin of the layer. | |
YStart | indicates the Vertical start line of origin of the layer. | |
XSize | indicates the Horizontal Size of the layer. | |
YSize | indicates the Vertical Size of the layer. |
void XOSD_SetLayerPriority | ( | XOSD * | InstancePtr, | |
u8 | LayerIndex, | |||
u8 | Priority | |||
) |
This function sets the priority of an OSD layer.
InstancePtr | is a pointer to the OSD device instance to be worked on. | |
LayerIndex | indicates which layer to be worked on. Valid value range is from 0 to (the number of layers implemented in the device - 1). | |
Priority | indicates the priority to be applied on the layer. Use one of XOSD_LAYER_PRIORITY_0 (the lowest priority) through XOSD_LAYER_PRIORITY_7 (the highest priority) defined in xosd_hw.h |
void XOSD_SetScreenSize | ( | XOSD * | InstancePtr, | |
u32 | Width, | |||
u32 | Height | |||
) |