1: int32_t AG903_VidMgrCommitSetting(
void)
2: {
3: int32_t i;
4:
5:
6:
if (CheckFormatCompatibility(VidContext.vid_format) !=
true) {
7:
return -
AG903_EINVAL;
8: }
9:
10:
15:
for (i = 0; i <
AG903_VID_MGR_MAX_IN_PORTS; i++) {
16:
AG903_VidMgrInputHandle *handle = (
AG903_VidMgrInputHandle *)&VidContext.in_ports[i];
17:
if (VidContext.used_in_ports[i] ==
true && handle->is_dirty ==
true) {
18:
AG903_VidPrmSetVIDIOnCTRL(i, handle->sync_signal);
19:
20:
VIDPrmParamVIDIOnMOD mod;
21: mod.vpol = handle->inout_vsync_pol;
22: mod.hpol = handle->inout_hsync_pol;
23: mod.dpol = handle->in_de_pol;
24: mod.fpol = handle->in_field_pol;
25: mod.cpol = handle->in_clk_pol;
26:
AG903_VidPrmSetVIDIOnMOD(i, &mod);
27:
28:
AG903_VidPrmSetVIDIOnOHPRM0(i, GET_H_PULSE(handle->h_pulse_width));
29:
AG903_VidPrmSetVIDIOnOHPRM1(i, GET_H_FPORCH(handle->h_front_porch), GET_H_BPORCH(handle->h_back_porch));
30:
AG903_VidPrmSetVIDIOnOVPRM0(i, GET_V_PULSE(handle->v_pulse_width));
31:
AG903_VidPrmSetVIDIOnOVPRM1(i, GET_V_FPORCH(handle->v_front_porch), GET_V_BPORCH(handle->v_back_porch));
32:
AG903_VidPrmSetVIDIOnOSIZE(i, GET_H_FSIZE(handle->v_frame_size), GET_V_FSIZE(handle->h_frame_size));
33: }
34: }
35:
36:
for (i = 0; i <
AG903_VID_MGR_MAX_OUT_PORTS; i++) {
37:
AG903_VidMgrOutputHandle *handle = (
AG903_VidMgrOutputHandle *)&VidContext.out_ports[i];
38:
if (VidContext.used_out_ports[i] ==
true && handle->is_dirty ==
true) {
39:
40:
VIDPrmParamVIDCOnMOD mod;
41: mod.tdmblk = GET_TDMBLK(handle->tdm);
42: mod.tdmtrs = GET_TDMTRS(handle->tdm);
43: mod.delay = handle->delay;
44: mod.trsdec = handle->trs_dec_enable;
45:
AG903_VidPrmSetVIDCOnMOD(i, &mod);
46:
47:
VIDPrmParamVIDCOnTRSPRM trsprm;
48: trsprm.efp = handle->trs_efp;
49: trsprm.ofp = handle->trs_ofp;
50: trsprm.vfp = GET_TRS_VFP(handle->trs_vfp);
51: trsprm.href = handle->trs_href;
52: trsprm.hfp = GET_TRS_HFP(handle->trs_hfp);
53:
AG903_VidPrmSetVIDCOnTRSPRM(i, &trsprm);
54:
55:
AG903_VidPrmSetVIDCOnSDPRM(i, GET_VMAX(handle->v_max), GET_HMAX(handle->h_max));
56: }
57: }
58:
59:
return AG903_ENONE;
60: }