/* 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: 2015/11/10 $
 * $RCSfile: mt53xx_vdp.h,v $
 * $Revision: #1 $
 *
 *---------------------------------------------------------------------------*/

/** @file vdp-mt53xx.h
 *  Define VDP interface.
 */

#ifndef VDP_MT53XX_H
#define VDP_MT53XX_H


#include <x_typedef.h>
#ifdef __KERNEL__
#include "vdp_if.h"
#else
#define VDP_MAX_REGION_WIDTH 10000
#define VDP_MAX_REGION_HEIGHT 10000

// Video plane argument
typedef enum
{
    VDP_ARG_BLENDING = 0,           ///< blending
    VDP_ARG_BRIGHTNESS,             ///< brightness
    VDP_ARG_CONTRAST,               ///< contrast
    VDP_ARG_HUE,                    ///< hue
    VDP_ARG_SATURATION,             ///< saturation
    VDP_ARG_CTI,                    		// < CTI
    VDP_ARG_LTI,                    			// < LTI    
    VDP_ARG_SHARPNESS_ON_OFF,       ///< sharpness switch
    VDP_ARG_SHARPNESS,              ///< sharpness
    VDP_ARG_NR,                     ///< 2D noise reduction
    VDP_ARG_COLOR_SUPPRESS,         ///< obsolete
    VDP_ARG_DEINT_FILM,             ///< cinema mode
    VDP_ARG_DEINT_DEINT,            ///< normal mode
    VDP_ARG_DEINT_EDGE,             ///< edge mode
    VDP_ARG_ADAPTIVE_LUMA,          ///< adaptive luma
    VDP_ARG_SCE,                    ///< second color enhance
    VDP_ARG_R_GAIN,                 ///< R-gain
    VDP_ARG_G_GAIN,                 ///< G-gain
    VDP_ARG_B_GAIN,                 ///< B-gain
    //mtk01140 20081016 range redirection for basic control
    VDP_ARG_R_OFFSET_BEFORE_GAIN,   ///< R-offset1
    VDP_ARG_G_OFFSET_BEFORE_GAIN,   ///< G-offset1
    VDP_ARG_B_OFFSET_BEFORE_GAIN,   ///< B-offset1
    VDP_ARG_R_OFFSET,               ///< R-offset
    VDP_ARG_G_OFFSET,               ///< G-offset
    VDP_ARG_B_OFFSET,               ///< B-offset
    VDP_ARG_GAMMA,                  ///< Gamma
    VDP_ARG_WHITE_PEAK_LMT,         ///< white peak limit
    VDP_ARG_BACK_LIGHT_LVL,         ///< back light level
    VDP_ARG_ADAPTIVE_BACK_LIGHT,    ///< adaptive back light
    VDP_ARG_3D_NR,                  ///< 3D noise reduction
    VDP_ARG_SOFT_BWS,               ///< SoftBWS
    VDP_ARG_DEMO,                   ///< Demo mode
    VDP_ARG_CDS,
    // New UI
    VDP_ARG_DI_FILM_MODE,
    VDP_ARG_DI_MA,
    VDP_ARG_DI_EDGE_PRESERVE,
    VDP_ARG_MJC_MODE,       
    VDP_ARG_MJC_EFFECT,
    VDP_ARG_MJC_DEMO,
    VDP_ARG_XVYCC,
    VDP_ARG_WCG,
    VDP_ARG_GAME_MODE,
    VDP_ARG_BLUE_STRETCH,
    VDP_ARG_MPEG_NR,
    VDP_ARG_NS                      ///< total color items
} VDP_ARG_TYPE;

typedef struct
{
    UINT32 u4X;
    UINT32 u4Y;
    UINT32 u4Width;
    UINT32 u4Height;
} VDP_REGION_T;
#endif

typedef struct
{
    UINT32 u4Top;
    UINT32 u4Bottom;
    UINT32 u4Left;
    UINT32 u4Right;
} VDP_OVERSCAN_REGION_T;

#define VDP_IOCTL_ENABLE            0
#define VDP_IOCTL_SET_MODE          1
#define VDP_IOCTL_SET_OUTREGION     2
#define VDP_IOCTL_SET_SRCREGION     3
#define VDP_IOCTL_SET_INPUT         4
#define VDP_IOCTL_SET_MASTER        5
#define VDP_IOCTL_INIT              6


typedef struct
{
    UCHAR           ucVdpId;

    UCHAR           ucMode;

	UCHAR           ucOutFullRegion;
	VDP_REGION_T    rOutRegion;

	UCHAR           ucSrcFullRegion;
	VDP_REGION_T    rSrcRegion;

	UCHAR           ucEsId;
	UCHAR           ucPort;
} VDP_IOCTL_T;


#endif  // VDP_MT53XX_H

