/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/*
 * Copyright (c) 2024 MediaTek Inc.
 */
#ifndef _MTK_TV_DRM_VIDEO_FRC_CMD_H_
#define _MTK_TV_DRM_VIDEO_FRC_CMD_H_

#include <linux/platform_device.h>

//-------------------------------------------------------------------------------------------------
//  Local Defines
//-------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------
//  Enum
//-------------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------
//  Structures
//-------------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------
//  Global Functions
//-------------------------------------------------------------------------------------------------

const char *SenceToString(
	enum mtk_video_frc_pq_scene scene);
int mtk_video_display_frc_check_ipm_hv_size(
	struct mtk_tv_kms_context *pctx);
int mtk_video_display_frc_get_motion_status(
	struct mtk_tv_kms_context *pctx);
void mtk_video_display_frc_record_change(
	struct mtk_frc_debug_info dbgInfo);
void mtk_video_display_frc_mload_parsing(
	uint64_t *pu64Va,
	uint32_t *addr,
	uint16_t *data,
	uint16_t *mask);
void mtk_video_display_frc_print_info(
	struct mtk_tv_kms_context *pctx);

//-------------------------------------------------------------------------------------------------
//  Global IOCTRL Functions
//-------------------------------------------------------------------------------------------------

int mtk_video_display_frc_get_algo_version(
	uint32_t *pVer);
int mtk_video_display_frc_set_extra_latency(
	struct mtk_tv_kms_context *pctx,
	struct drm_mtk_tv_video_extra_latency *latency);
int mtk_video_display_set_hse_ioctl(
	struct drm_device *drm_dev,
	void *data,
	struct drm_file *file_priv);
int mtk_tv_drm_video_set_vrr_mode_type_ioctl(
	struct drm_device *drm_dev,
	void *data,
	struct drm_file *file_priv);

//-------------------------------------------------------------------------------------------------
//  Global SYSFS Functions
//-------------------------------------------------------------------------------------------------

int mtk_video_display_frc_set_debug_cmd_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_set_debug_cmd_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_set_dynamic_path_log_en_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_set_dynamic_path_log_en_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_force_dynamic_path_bypass_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_force_dynamic_path_bypass_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_force_dynamic_path_select_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_force_dynamic_path_select_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_rwdiff_frc_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_rwdiff_frc_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_set_extra_latency_info(
	struct device *dev,
	const char *buf);
int mtk_video_display_frc_get_extra_latency_info(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_perfect_vgsync_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_perfect_vgsync_show(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_check_motion_status_store(
	struct device *dev,
	const char *buf,
	unsigned int count);
int mtk_video_display_frc_get_algo_info(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_get_game_memc_cadenceInfo(
	struct device *dev,
	char *buf);
int mtk_video_display_frc_get_frc_algo_version(
	struct device *dev,
	char *buf);
void mtk_video_display_frc_set_repeat_mode(
	bool enable);
void mtk_video_display_frc_set_pattern(
	struct mtk_tv_kms_context *pctx,
	struct mtk_frc_pattern_info *pstPatternInfo);
int mtk_video_display_frc_get_cmd_history(
	char *buf);
int mtk_video_display_frc_reset_cmd_history(
	uint16_t reset);
#endif
