// //****************************************************************************** // MStar Software // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. // All software, firmware and related documentation herein ("MStar Software") are // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by // law, including, but not limited to, copyright law and international treaties. // Any use, modification, reproduction, retransmission, or republication of all // or part of MStar Software is expressly prohibited, unless prior written // permission has been granted by MStar. // // By accessing, browsing and/or using MStar Software, you acknowledge that you // have read, understood, and agree, to be bound by below terms ("Terms") and to // comply with all applicable laws and regulations: // // 1. MStar shall retain any and all right, ownership and interest to MStar // Software and any modification/derivatives thereof. // No right, ownership, or interest to MStar Software and any // modification/derivatives thereof is transferred to you under Terms. // // 2. You understand that MStar Software might include, incorporate or be // supplied together with third party`s software and the use of MStar // Software may require additional licenses from third parties. // Therefore, you hereby agree it is your sole responsibility to separately // obtain any and all third party right and license necessary for your use of // such third party`s software. // // 3. MStar Software and any modification/derivatives thereof shall be deemed as // MStar`s confidential information and you agree to keep MStar`s // confidential information in strictest confidence and not disclose to any // third party. // // 4. MStar Software is provided on an "AS IS" basis without warranties of any // kind. Any warranties are hereby expressly disclaimed by MStar, including // without limitation, any warranties of merchantability, non-infringement of // intellectual property rights, fitness for a particular purpose, error free // and in conformity with any international standard. You agree to waive any // claim against MStar for any loss, damage, cost or expense that you may // incur related to your use of MStar Software. // In no event shall MStar be liable for any direct, indirect, incidental or // consequential damages, including without limitation, lost of profit or // revenues, lost or damage of data, and unauthorized system use. // You agree that this Section 4 shall still apply without being affected // even if MStar Software has been modified by MStar in accordance with your // request or instruction for your use, except otherwise agreed by both // parties in writing. // // 5. If requested, MStar may from time to time provide technical supports or // services in relation with MStar Software to you for your use of // MStar Software in conjunction with your or your customer`s product // ("Services"). // You understand and agree that, except otherwise agreed by both parties in // writing, Services are provided on an "AS IS" basis and the warranty // disclaimer set forth in Section 4 above shall apply. // // 6. Nothing contained herein shall be construed as by implication, estoppels // or otherwise: // (a) conferring any license or right to use MStar name, trademark, service // mark, symbol or any other identification; // (b) obligating MStar or any of its affiliates to furnish any person, // including without limitation, you and your customers, any assistance // of any kind whatsoever, or any information; or // (c) conferring any license or right under any intellectual property right. // // 7. These terms shall be governed by and construed in accordance with the laws // of Taiwan, R.O.C., excluding its conflict of law rules. // Any and all dispute arising out hereof or related hereto shall be finally // settled by arbitration referred to the Chinese Arbitration Association, // Taipei in accordance with the ROC Arbitration Law and the Arbitration // Rules of the Association by three (3) arbitrators appointed in accordance // with the said Rules. // The place of arbitration shall be in Taipei, Taiwan and the language shall // be English. // The arbitration award shall be final and binding to both parties. // //****************************************************************************** // //////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2009 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 /// @brief Graphics Output Path Driver Interface /// @author MStar Semiconductor Inc. /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _DRV_GOP_H_ #define _DRV_GOP_H_ #ifdef __cplusplus extern "C" { #endif #if defined(MSOS_TYPE_LINUX_KERNEL) #include "autoconf.h" #endif #include "MsCommon.h" #if defined(MSOS_TYPE_LINUX) #include #include #elif defined(MSOS_TYPE_LINUX_KERNEL) #define getpid() pInstance #else #define getpid() 0UL #endif #include "apiGOP.h" #define GETPIDTYPE ptrdiff_t #if (defined ANDROID) && (defined TV_OS) #include #define printf LOGD #ifndef LOGD // android 4.1 rename LOGx to ALOGx #define LOGD ALOGD #endif #endif #ifdef MSOS_TYPE_LINUX #include #include #define APIGOP_ASSERT(_bool, pri) if (!(_bool)) {printf("\nAssert in %s,%d\n", __FUNCTION__, __LINE__); {pri;}; MsOS_DelayTask(100); assert(0);} #else #define APIGOP_ASSERT(_bool, pri) if (!(_bool)) {printf("\nAssert in %s,%d\n", __FUNCTION__, __LINE__); {pri;};}; #endif #if defined(CONFIG_API_GOP) || defined(CONFIG_API_GOP_MODULE) #else #define CONFIG_GOP_POOL_ARRANGE #define CONFIG_GOP_GWIN_MISC #define CONFIG_GOP_2ND_PAL #define CONFIG_GOP_BG #define CONFIG_GOP_FADE #define CONFIG_GOP_YUV_SWAP #define CONFIG_GOP_CONTRAST #define CONFIG_GOP_GOP_VE_CAPTURE #define CONFIG_GOP_SCROLL #define CONFIG_GOP_TEST_PATTERN #define CONFIG_GOP_VE_CAPTURE #endif //------------------------------------------------------------------------------------------------- // Driver Capability //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- // Customize Define //------------------------------------------------------------------------------------------------- #define CUS_SETTING 0UL #define INSTANT_PRIVATE 1UL #if CUS_SETTING #define WINFB_INSHARED 1UL #define POOL_INSHARED 1UL #define CURSOR_SUPPORT 1UL #define MUTEX_LOCK_ENABLE 0UL #define ENABLE_GOP0_RBLK_MIRROR FALSE #ifndef DRV_MAX_GWIN_FB_SUPPORT #define DRV_MAX_GWIN_FB_SUPPORT 0xFFFEUL #endif #define GFLIP_ENABLE FALSE #define BOOTLOGO_PATCH TRUE #define GOP_PIXEL_ALIGN FALSE #define GOP_SW_SCROLL TRUE #define GOP_3D_TYPE_SEL E_DRV_3D_DUP_FULL #define GOP_VSYNC_WAIT_BYSLEEP FALSE #else //mstar default #define WINFB_INSHARED 1UL #define POOL_INSHARED 0UL #define CURSOR_SUPPORT 0UL #define MUTEX_LOCK_ENABLE 0UL #define ENABLE_GOP0_RBLK_MIRROR TRUE #ifndef DRV_MAX_GWIN_FB_SUPPORT #define DRV_MAX_GWIN_FB_SUPPORT 32UL #endif #ifdef CONFIG_GOP_DISABLE_GFLIP #define GFLIP_ENABLE FALSE #else #define GFLIP_ENABLE TRUE #endif #define BOOTLOGO_PATCH FALSE #define GOP_PIXEL_ALIGN FALSE #define GOP_SW_SCROLL FALSE #define GOP_3D_TYPE_SEL E_DRV_3D_DUP_HALF #define GOP_VSYNC_WAIT_BYSLEEP TRUE #endif #ifdef MSOS_TYPE_NOS #define GOP_LOCK_SUPPORT 0UL #define GOP_XC_LOCK_SUPPORT 0UL #define GOP_XC_SEMPHORE_PROTECT 0UL #else #define GOP_LOCK_SUPPORT MUTEX_LOCK_ENABLE #define GOP_XC_LOCK_SUPPORT MUTEX_LOCK_ENABLE #ifdef UTOPIA_V2 //XC #define GOP_XC_SEMPHORE_PROTECT 1UL #else #define GOP_XC_SEMPHORE_PROTECT 0UL #endif #endif #define GOP_XC_LOCK_DEBUG 0UL #ifdef GOP_UTOPIA2K #define GOPDRIVER_BASE KERNEL_MODE #else #define GOPDRIVER_BASE 0UL #endif //------------------------------------------------------------------------------------------------- // Macro and Define //------------------------------------------------------------------------------------------------- #define UNUSED( var ) (void)((var) = (var)) #define MAX_GOP_INFO_COUNT 6 #define INVAILD_GOP_NUM 0xFFUL #define INVALID_GWIN_ID 0xFFUL #define GWIN_OSD_DEFAULT (MS_U8)g_pGOPCtxLocal->pGopChipProperty->TotalGwinNum #define INVALID_POOL_NEXT_FBID 0xFFFFFFFFUL #define FB_FMT_AS_DEFAULT 0xFFFFUL #define INVALID_CLIENT_PID 0x00UL //Invalid PID #define INVALID_GOP_MUX_VAL 0xFFFFUL #define MIU_0 0UL #define MIU_1 1UL #define GOP_STRETCH_WIDTH_UNIT 2UL // 2-pixel #define GOP_STRETCH_TABLE_NUM 50UL #define GOP_VSTRETCH_TABLE_NUM 32UL #define GOP_REG_MAX 128UL #define SHARED_GWIN_MAX_COUNT 32UL #define SHARED_GOP_MAX_COUNT 8UL #define MAX_GOP_SW_SCROLLNUM 16UL #define MAX_MUX_NUMBER_SUPPORT MAX_GOP_MUX #define HAS_BIT(flag, bit) ((flag) & (1<