/* 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: brianpc.huang $
 * $Date: 2015/05/29 $
 * $RCSfile: gfx_drvif.h,v $
 * $Revision: #1 $
 *
 *---------------------------------------------------------------------------*/

/** @file gfx_drvif.h
 *  gfx driver internal public interfaces
 *  
 */
#ifndef __GFX_DRVIF_H__
#define __GFX_DRVIF_H__
#include "gfx_common_if.h"

extern void gaussian_elimination(double A[][8], double X[], double B[]);
extern void derive_inverse_transform(float src_x[], float src_y[],
        float dst_x[], float dst_y[], float inv_matrix[][3]);
extern unsigned int fnum_converter(float in);

extern void _VGFX_Init(void);

extern void _VGFX_SetWb(UINT32 u4BaseAddr, UINT32 u4ColrMode, UINT32 u4GlAr,
        UINT32 u4Pitch);
extern void _VGFX_SetTexture(UINT32 u4StartX, UINT32 u4StartY, UINT32 u4EndX,
        UINT32 u4EndY);

extern void _VGFX_SetBb(UINT32 u4StartX, UINT32 u4StartY, UINT32 u4Width,
        UINT32 u4Height);

extern void _VGFX_SetImgage(UINT32 u4BaseAddr, UINT32 u4ColrMode,
        UINT32 u4GlAr, UINT32 u4Pitch);

extern void _VGFX_SetMatrixCoef(VGFX_MATRIX_T* pt_matrix);

extern void _VGFX_SetMatrixCoef_Emu(UINT32 u4MatrixA, UINT32 u4MatrixB,
        UINT32 u4MatrixC, UINT32 u4MatrixD, UINT32 u4MatrixE, UINT32 u4MatrixF,
        UINT32 u4MatrixG, UINT32 u4MatrixH, UINT32 u4MatrixI);

extern void _VGFX_SetCoef4Tap(VGFX_COEFF_4_TAP* u4Coef4Tap);

extern void _VGFX_Scaler_Emu(VG_PARAM_SET_T *vgParam);

extern void _VGFX_SetAlcom(UINT32 u4AlcomEn);

extern void _VGFX_Scaler(VGFX_PARAM_SET_T *vgParam);

extern void _VGFX_SetQualityEnv(UINT32 u4WbExpMode, UINT32 u4ImgExpMode,
        UINT32 u4AntiAliasEn, UINT32 u4FilterEn, UINT32 u4AlMode);

extern void _VGFX_SetPostWrEnv(UINT32 u4PostWriteThreshold,
        UINT32 fgWdleEnable, UINT32 fgWBRndEn);

extern void _VGFX_SetWriteArgbOrder(UINT32 u4Aorder, UINT32 u4Rorder,
        UINT32 u4Gorder, UINT32 u4Border);

extern void _VGFX_SetAlphaEdgeRGB0(UINT32 u4AlEdgeRGB0,
        UINT32 u4AlEdgeThresHold);
extern void _VGFX_SetFilterType(UINT32 u4FilterType);

extern void _VGFX_SetReflect(UINT32 u4RefEn, UINT32 u4RefOnly,
        UINT32 u4TextTureHeight, UINT32 u4RefRatioInit, UINT32 u4RatioLineStep,
        UINT32 u4RefAAEn);

extern void _VGFX_SetTextureArgbOrder(UINT32 u4Aorder, UINT32 u4Rorder,
        UINT32 u4Gorder, UINT32 u4Border);
extern BOOL _VGfx_JugRect(const VGFX_QUADRILATERAL_SET_T _Quadrilateral);
extern void _VGfx_SetVGfxScaler(const VGFX_SCALER_PARAM_SET_T *prCompBlt);

extern void _VGFX_ResetReflect(void);
extern void _VGFX_ResetCoef4Tap(void);

#endif // __GFX_DRVIF_H__
