⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drvgop.h

📁 mstar 776 开发的车载dvd
💻 H
📖 第 1 页 / 共 2 页
字号:
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2007 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (¨MStar Confidential Information〃) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
/// @file drvgop.h
/// @version Rev.17 #57337
/// @brief Graphics Output Path
/// @author MStar Semiconductor Inc.
///
/// GOP is used for graphic output to video path.
///
/// Features:
/// 4 GWINs for each GOP
////////////////////////////////////////////////////////////////////////////////

#ifndef MDRV_GOP_H
#define MDRV_GOP_H

#include "sysinfo.h"
#include "board.h"
#include "dataType.h"

#include "drvge.h"

#ifdef DRV_GOP_C
#define INTERFACE
#else
#define INTERFACE extern
#endif

#ifndef GOP_TEST_CODE
#define GOP_TEST_CODE 0
#endif

#define GWIN_ID_INVALID	0xFF

#define GOP_TIMEOUT_CNT     0x100000
///Defination for GWIN Status
/// GWIN Fail
#define GWIN_FAIL         0x00
/// GWIN OK
#define GWIN_OK           0x01
/// GWIN NOT Available
#define GWIN_NO_AVAILABLE 0xFF
/// GWIN Keep init OSD window
#define GWIN_KEEP_INIT_OSDWIN  0

#define GOP_BUF_MIU_RD_TH_H_WORKING     0x55
#define GOP_BUF_MIU_RD_TH_L_WORKING     0x60    //0x70 //0x78
#define GOP_BUF_MIU_RD_TH_H_HIBER     0x40
#define GOP_BUF_MIU_RD_TH_L_HIBER     0x40

#define GOP_SDRAM_BOUNDARY         0x200000
#define GOP_SDRAM_BOUNDARY_MASK    0xFFE00000	// 2MB

#define PANEL_VALID_X0			(100)
#define PANEL_VALID_Y0			(0)
#define PANEL_VALID_MAX_WIDTH		(1200)
#define PANEL_VALID_MAX_HEIGHT	(1200)
#define PANEL_VALID_X1		(PANEL_VALID_X0 + PANEL_VALID_MAX_WIDTH)
#define PANEL_VALID_Y1		(PANEL_VALID_Y0 + PANEL_VALID_MAX_HEIGHT)

#define GOP_PALETTE_ENTRY_NUM   256


//-------------------------------------------------------------------------------------------------
// Macros
//-------------------------------------------------------------------------------------------------
#define BIT_MASK(bits)                  ((1<<bits)-1)

//-------------------------------------------------------------------------------------------------
// Type and Structure Declaration
//-------------------------------------------------------------------------------------------------

/// Define GOP destination displayplane type
// In GOP registers, only can select dst is OP or IP,
// We must set scalar registers for selecting dst is IP0 or IP1
// In this enumerate, The lower two bits are valid for GOP registers.
typedef enum
{
  E_GOP_DST_IP0, // Sanger 070731
  E_GOP_DST_IP1,
  E_GOP_DST_OP0,
  E_GOP_DST_OP1,
  E_GOP_DST_VOP,
  MAX_GOP_DST_SUPPORT
/// (GOP combine with IP0, sub-picture blending should use this path)
//E_GOP_DST_IP0 = 1,
/// (GOP combine with OP, OSD should use this path)
//E_GOP_DST_OP = 2,
//(GOP combine with VOP, only for FPGA debug)
//E_GOP_DST_VOP = 3,
///(GOP combine with IP1, sub-picture blending should use this path)
//E_GOP_DST_IP1 = 5,
}GOPDstType;

/// Define the entry of palette.
typedef union
{
    /// RGB888
    struct
    {
        /// R8
        U8 u8R;
        /// G8
        U8 u8G;
        /// B8
        U8 u8B;
    } RGB;
    /// ARGB6666
#if 0
    struct
    {
        /// B6
        U32 u6B:        6;
        /// G6
        U32 u6G:        6;
        /// R6
        U32 u6R:        6;
        /// A6
        U32 u6A:        6;
        /// Reserved
        U32 reserved:   8;
    } ARGB;
#endif
    // 32-bit direct access.
    U8 u8Data[3];
} GopPaletteEntry;

/// Transparent color format
typedef enum
{
    GOPTRANSCLR_FMT0,	//!< RGB 555
    GOPTRANSCLR_FMT1,	//!< indexd color
    GOPTRANSCLR_MAX,
} GOPTRANSCLRFMT;


/// Scroll direction
typedef enum
{
    GOP_SCROLL_NONE = 0,
    GOP_SCROLL_UP,		//!< bottom to top
    GOP_SCROLL_DOWN,	//!< top to bottom
    GOP_SCROLL_LEFT,	//!< right to left
    GOP_SCROLL_RIGHT,	//!< left to right
    GOP_SCROLL_MAX,
} GOPSCROLLTYPE;

typedef enum
{
	GOP_MIRROR_H,
	GOP_MIRROR_V,
} GOPMIRROR;

/// GWIN Testing color
typedef enum
{
    GOP_TST_R = 0,  ///< R
    GOP_TST_G,  ///< G
    GOP_TST_B,  ///< B
    GOP_TST_MAX,  ///< MAX
} GOP_TST_COLOR;

/// GWIN output color domain
typedef enum
{
    GOPOUT_RGB,     ///< 0: output color RGB
    GOPOUT_YUV,     ///< 1: output color YUV
} GOPOUTPUTCOLOR;

/// GWIN post destination
typedef enum
{
    GOPOUT_OP2,     ///< OP2
    GOPPUT_VOP,     ///< VOP
} GOPOUTPUTDEST;

/// GOP palette entry
typedef struct
{
	U8 u8R;     ///< R
	U8 u8G;     ///< G
	U8 u8B;     ///< B
} GOPPALETTE;

/// DWIN scan mode
typedef enum
{
    GOPDWIN_SCAN_MODE_PROGRESSIVE,  ///< Progressive scan
    GOPDWIN_SCAN_MODE_INTERLACE,  ///< Interlace scan
    GOPDWIN_SCAN_MODE_MAX
} EN_GOP_DWIN_SCAN_TYPE;

/// DWIN source data format
typedef enum
{
    GOPDWIN_DATA_FMT_UV7Y8 = 0,		//!< CrYCb domain
    GOPDWIN_DATA_FMT_UV8Y8,		    //!< CrYCb domain
    GOPDWIN_DATA_FMT_ARGB8888,		//!< RGB domain (CSC bypass)
    GOPDWIN_DATA_FMT_RGB565,		//!< RGB domain (CSC bypass)
    GOPDWIN_DATA_FMT_MAX
} EN_GOP_DWIN_DATA_FMT;

/// DWIN capture data source
typedef enum
{
    GOPDWIN_DATA_SRC_SCALAR,	//!< scaler output
    GOPDWIN_DATA_SRC_EXTRGB,        //!< External, RGB, YUV(pass R2Y)
    GOPDWIN_DATA_SRC_VOP,		//!< DVB VOP (MVOP)
    GOPDWIN_DATA_SRC_MAX
} EN_GOP_DWIN_DATA_SRC;

/// Define palette color format.
typedef enum
{
    /// Palette color format is RGB888.
    E_GOP_PAL_RGB888    = 0,
    /// Palette color format is ARGB6666 (Only I8 format support).
    E_GOP_PAL_ARGB6666  = 1,
    /// Invalid palette color format.
    E_GOP_PAL_INVALID
} GopPalType;

/// Define GWIN color format.
typedef enum
{
    /// Color format RGB555 and Blink.
    E_GOP_COLOR_RGB555_BLINK    =0,
    /// Color format RGB565.
    E_GOP_COLOR_RGB565          =1,
    /// Color format ARGB4444.
    E_GOP_COLOR_ARGB4444        =2,
    /// Color format alpha blink.
    E_GOP_COLOR_ALPHABLINK      =3,
    /// Color format I8 (256-entry palette).
    E_GOP_COLOR_I8              =4,
    /// Color format ARGB8888.
    E_GOP_COLOR_ARGB8888        =5,
    /// Color format I4.
    E_GOP_COLOR_I4              =6,
    /// Color format I2.
    E_GOP_COLOR_I2              =7,
    /// Color format RGB555/YUV422.
    E_GOP_COLOR_RGB555YUV422    =8,
    /// Color format YUV422.
    E_GOP_COLOR_YUV422          =9,
    /// Invalid color format.
    E_GOP_COLOR_INVALID
} GOPColorType;


/// Define GOP transparent color format.
typedef enum
{
    /// Color format RGB555.
    E_GOP_TRSCOLOR_RGB555       =0,
    /// Color format RGB565.
    E_GOP_TRSCOLOR_RGB565       =1,
    /// Color format ARGB4444.
    E_GOP_TRSCOLOR_ARGB4444     =2,
    /// Color format blink.
    E_GOP_TRSCOLOR_BLINK        =3,
    /// Color format I8 (256-entry palette).
    E_GOP_TRSCOLOR_I8           =4,
    /// Color format ARGB8888.
    E_GOP_TRSCOLOR_ARGB8888     =5,
    /// Color format alpha blink.
    E_GOP_TRSCOLOR_ALPHABLINK   =6,
    /// Invalid color format.
    E_GOP_TRSCOLOR_INVALID
} GOPTRSColorType;

/// Define  GWin Transparent Color Entry
typedef union
{
    /// ARGB8888
    struct
    {
        /// B8
        U8 uARGB8888_B;
        /// G8
        U8 uARGB8888_G;
        /// R8
        U8 uARGB8888_R;
        /// A8 Reserved
        U8 uARGB8888_reserved;
    } ARGB8888;
#if 0
    /// ARGB4444
    struct
    {
        /// B4
        U32 uARGB4444_B:        4;
        /// G4
        U32 uARGB4444_G:        4;
        /// R4

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -