extern void vdin_source_bitdepth_reinit(struct vdin_dev_s *devp);
extern void set_invert_top_bot(bool invert_flag);
extern void vdin_clk_onoff(struct vdin_dev_s *devp, bool onoff);
+extern enum tvin_force_color_range_e color_range_force;
#endif
static int irq_max_count;
+enum tvin_force_color_range_e color_range_force = COLOR_RANGE_AUTO;
+
static void vdin_backup_histgram(struct vframe_s *vf, struct vdin_dev_s *devp);
char *vf_get_receiver_name(const char *provider_name);
if (vdin_dbg_en)
pr_info("TVIN_IOC_SNOWOFF(%d) ok\n\n", devp->index);
break;
+ case TVIN_IOC_GET_COLOR_RANGE:
+ if (copy_to_user(argp,
+ &color_range_force,
+ sizeof(enum tvin_force_color_range_e))) {
+ ret = -EFAULT;
+ pr_info("TVIN_IOC_GET_COLOR_RANGE err\n\n");
+ break;
+ }
+ pr_info("get color range-%d\n\n", color_range_force);
+ break;
+ case TVIN_IOC_SET_COLOR_RANGE:
+ if (copy_from_user(&color_range_force,
+ argp,
+ sizeof(enum tvin_force_color_range_e))) {
+ ret = -EFAULT;
+ pr_info("TVIN_IOC_SET_COLOR_RANGE err\n\n");
+ break;
+ }
+ pr_info("force color range-%d\n\n", color_range_force);
+ break;
default:
ret = -ENOIOCTLCMD;
/* pr_info("%s %d is not supported command\n", __func__, cmd); */
static int signal_status = TVIN_SIG_STATUS_NULL;
module_param(signal_status, int, 0664);
MODULE_PARM_DESC(signal_status, "signal_status");
+enum tvin_color_fmt_range_e tvin_get_force_fmt_range(
+ enum tvin_color_fmt_range_e fmt_range,
+ enum tvin_color_fmt_e color_fmt)
+{
+ if (color_fmt == TVIN_YUV444 ||
+ color_fmt == TVIN_YUV422) {
+ if (color_range_force == COLOR_RANGE_FULL)
+ fmt_range = TVIN_YUV_FULL;
+ else if (color_range_force == COLOR_RANGE_LIMIT)
+ fmt_range = TVIN_YUV_LIMIT;
+ } else if (color_fmt == TVIN_RGB444) {
+ if (color_range_force == COLOR_RANGE_FULL)
+ fmt_range = TVIN_RGB_FULL;
+ else if (color_range_force == COLOR_RANGE_LIMIT)
+ fmt_range = TVIN_RGB_LIMIT;
+ }
+ return fmt_range;
+}
+
/*
* check hdmirx color format
*/
vdin_hdr_flag = prop->vdin_hdr_Flag;
pre_vdin_hdr_flag = pre_prop->vdin_hdr_Flag;
+ if (color_range_force)
+ prop->color_fmt_range =
+ tvin_get_force_fmt_range(pre_prop->color_fmt_range,
+ pre_prop->color_format);
vdin_fmt_range = prop->color_fmt_range;
pre_vdin_fmt_range = pre_prop->color_fmt_range;
TVIN_COLOR_FMT_RANGE_MAX,
};
+enum tvin_force_color_range_e {
+ COLOR_RANGE_AUTO = 0,
+ COLOR_RANGE_FULL,
+ COLOR_RANGE_LIMIT,
+};
const char *tvin_color_fmt_str(enum tvin_color_fmt_e color_fmt);
enum tvin_scan_mode_e {
TVIN_SCAN_MODE_NULL = 0,
#define TVIN_IOC_UNFREEZE_VF _IO(_TM_T, 0x46)
#define TVIN_IOC_SNOWON _IO(_TM_T, 0x47)
#define TVIN_IOC_SNOWOFF _IO(_TM_T, 0x48)
+#define TVIN_IOC_GET_COLOR_RANGE _IOR(_TM_T, 0X49,\
+ enum tvin_force_color_range_e)
+#define TVIN_IOC_SET_COLOR_RANGE _IOW(_TM_T, 0X4a,\
+ enum tvin_force_color_range_e)
/* TVAFE */
#define TVIN_IOC_S_AFE_VGA_PARM _IOW(_TM_T, 0x16, struct tvafe_vga_parm_s)