/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*-----------------------------------------------------------------------------
 *
 * $Author: dtvbm11 $
 * $Date  $
 * $RCSfile: feature.h,v $
 * $Revision: #1 $
 *
 *---------------------------------------------------------------------------*/

#ifndef _FEATURE_H
#define _FEATURE_H

#include "vendor.h"

/***************************************************************************
Define IC-related specific feature
****************************************************************************/

/* from config_video.h */

#if defined(CC_MT5391) || defined(CC_MT5387)
	#define SUPPORT_POP 1
	// For 8bit-8bit gamma, please define this in sys_build\customer\model.cfg file.
	#ifdef SUPPORT_8BIT_8BIT_GAMMA
		#define GAMMA_UPSAMPLE 0
	#else
		#define GAMMA_UPSAMPLE 1
	#endif
#else
	#define SUPPORT_POP 1
#endif
	#define SUPPORT_DVI 1
	#define SUPPORT_3DCOMB 1
	#define SUPPORT_TDN 1
	#define SUPPORT_GAMMA 1


/* following feature is enabled/tested in linux env,need to move to drvcust laters*/
#ifndef SUPPORT_ATV_SNOWSCREEN
#ifdef __KERNEL__
#define SUPPORT_ATV_SNOWSCREEN 1
#else
#define SUPPORT_ATV_SNOWSCREEN 1
#endif
#endif

#ifndef SUPPORT_DRAM_DUMP
#ifdef __KERNEL__
#define SUPPORT_DRAM_DUMP 1
#else
#define SUPPORT_DRAM_DUMP 0
#endif
#endif


#ifndef SUPPORT_DOT_TO_DOT_PATTERN
#define SUPPORT_DOT_TO_DOT_PATTERN 0
#else
#define SUPPORT_DOT_TO_DOT_PATTERN 0
#endif
#if defined(CC_MT5395)
#define SUPPORT_SBS_CONVERT 1
#else
#define SUPPORT_SBS_CONVERT 0
#endif

#ifndef SUPPORT_VGA_COLOR_MATRIX
#ifdef __KERNEL__
#define SUPPORT_VGA_COLOR_MATRIX 1
#else
#define SUPPORT_VGA_COLOR_MATRIX 0
#endif
#endif
#ifndef SUPPORT_VIDEO_CUSTOM_PARAM
#ifdef __KERNEL__
#define SUPPORT_VIDEO_CUSTOM_PARAM 1
#else
#define SUPPORT_VIDEO_CUSTOM_PARAM 0
#endif
#endif
#ifndef SUPPORT_SDAL_STYLE_PQ_SETTING
#ifdef __KERNEL__
#define SUPPORT_SDAL_STYLE_PQ_SETTING 1
#else
#define SUPPORT_SDAL_STYLE_PQ_SETTING 0
#endif
#endif

//VFE part
#define TVD_CLAMP_ON_BLANK        1
#define TVD_AUTO_DFT 		  1

//VGA part
//alway let SUPPORT_VGA_USERMODE ==1, feature now control by drvcust_if.h
#define SUPPORT_VGA_USERMODE 1

// PE part
#define SUPPORT_CINEMA_MODE	1
#define SUPPORT_SEAMLESS_MODE 1

//OSTG part
#define SUPPORT_FREERUN_DCLK_BY_STEP
//#define SUPPORT_DDDS_STEP_TRACKING 1

 // PE bypass for testing.
#define BYPASS_PE_MDDI      1
#define BYPASS_PE_NR        1
#define BYPASS_PE_MLC       1

//Scaler Part
#define SUPPORT_EXTMJC_RGBTOYUV_OUTPUT 0

#define SUPPORT_HORIZONTAL_LBOX 1
#define SUPPORT_LUMACHROMA_CHECK 0

#define SUPPORT_MIB_3D_CONVERT_444_TO_422 1

//TVE part
#if (defined(CC_MT5881)||defined(CC_MT5399)||defined(CC_MT5890)|| defined(CC_MT5861))
#define CC_TVE_SUPPORT_VDAC_SOFTWARE_CAL 1  // defualt=0 use the 300R setting
#endif

#ifndef SUPPORT_CEC
#define SUPPORT_CEC 1
#endif

#ifdef CC_SUPPORT_OVERSAMPLE_1440_ENABLE
    #define CC_SUPPORT_OVERSAMPLE_1440 (1) /* porting, disable at first */
    #define CC_OVERSAMPLE_1440_CEN_DROP_PIXEL (0)
#else
    #define CC_SUPPORT_OVERSAMPLE_1440 (0) /* porting, disable at first */
    #define CC_OVERSAMPLE_1440_CEN_DROP_PIXEL (0)
    #define CC_SUPPORT_PRESCALE_DOWN
#endif

#define SUPPORT_VGA_422 (0) // Use YCbCr 422 color space for VGA input source.

// For MHEG5 DecodeOffset Performace Test
// Use old import protection mechanism to speed up import flow
//#ifdef CC_MHEG5_DECODE_OFFSET_PERFORMANCE 
//#define CC_FORCE_OLD_IMPORT     (3)   ==> already use import_sel =0
//#endif

// disable old pscan display mode (up-scaler no-fifo)
// #define CC_DISABLE_OLD_PSCAN_DISPMODE 1  

// Enable mute log when system boot up
#ifndef CC_BOOT_MUTE_LOG
#define CC_BOOT_MUTE_LOG (1)
#endif



#define CC_PSCAN_DISPMODE_DI_SCPIP_DO_HCLIP 1
#if CC_PSCAN_DISPMODE_DI_SCPIP_DO_HCLIP
#define SCPIP_HCLIP_LENGTH 20
#define CC_PSCAN_DISPMODE_SCPIP_DO_HCLIP 0
#else
#define CC_PSCAN_DISPMODE_SCPIP_DO_HCLIP 1
#endif

#ifdef CC_MT5395
//#if !defined(CC_DISABLE_MIRROR_BY_MJC)
//#define CC_MJC_DO_ALL_MIRROR_FLIP
//#endif
#ifdef CC_SCPOS_3DTV_SUPPORT
//#define CC_SCALER_LR_SHIFT_WA
#endif
#endif


#if 0
#define MON_STA(module,item,value) \
    {static UINT32 item;UINT32 tmp;tmp=(value); \
        if(item!=tmp) \
            {LOG(2,"--"#module"--"#item" Change from %d to %d\n",(item),(tmp)); item = tmp;}\
    }
#else
    #define MON_STA(module,item,value)
#endif

#if defined(CC_MT5398)
//#define CC_SUPPORT_4K2K
#endif

#endif  /* End _FEATURE_H */

