/* 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.
 *
 *****************************************************************************/


#include "mt53_fb.h"
#include "mtgfx.h"

EXTERN HANDLE_T hMt53fbMutex;
EXTERN struct fb_info* mt53fb_get_fb_info(void);
EXTERN struct mt53fb_par* mt53fb_get_par(void);
EXTERN INT32 _mt53fb_vgfx_scaler_ioctl(void* pvArg);
EXTERN INT32 _mt53fb_vgfx_ioctl(void *pvArg);

#ifdef CC_DFB_SUPPORT_VDP_LAYER
EXTERN INT32 mt53fb_vdp_stretchblit(mt53fb_vdp_stretch_blit * pr_vdp_stretch_blit);
EXTERN INT32 _mt53fb_vdp_rotate_ioctl(void* pvArg);
#endif
EXTERN int _MTMMU_GetPhyPgd(unsigned long arg);
EXTERN int _MTMMU_PinMem(unsigned long arg);
EXTERN int _MTMMU_PinMem(unsigned long arg);
EXTERN int _MTMMU_UnPinMem(unsigned long arg);
EXTERN int _MTMMU_DMA_MAP_SINGLE(unsigned long arg);
EXTERN int _MTMMU_DMA_UNMAP_SINGLE(unsigned long arg);
EXTERN INT32 mt53fb_lock_ex_action(void* pvArg);
EXTERN INT32 mt53fb_flush_cache_action(void* pvArg);

EXTERN INT32 mt53fb_get_pgt_ioctl(unsigned long pvArg);
EXTERN INT32 mt53fb_pin_mem_ioctl(unsigned long pvArg);
EXTERN INT32 mt53fb_pin_iomem_ioctl(unsigned long pvArg);
EXTERN int _MTMMU_IoMap_PinMem(unsigned long arg);
EXTERN int mxx_iomap_user_pages(MTIOMMU_PIN_RANGE_T *pinRange);

EXTERN INT32 mt53fb_unpin_mem_ioctl(unsigned long pvArg);
EXTERN INT32 mt53fb_dma_map_single_ioctl(unsigned long pvArg);
EXTERN INT32 mt53fb_dma_unmap_single_ioctl(unsigned long pvArg);
EXTERN INT32 fb_gfx_cmps_blt(struct fb_info *info, const struct mt53fb_compress *prCompress);
#ifdef CC_B2R44K2K_SUPPORT
EXTERN INT32 mt53fb_b2r_stretchblit(mt53fb_b2r_stretch_blit * pr_b2r_stretch_blit);
#endif

