Skip to content

Commit 3269b54

Browse files
author
marqs
committed
collection of small new features and bug fixes
* added Legacy AV options * added support for custom EDID * added VRR flag (Freesync) option * added 1080p->540p A-LM option * enabled custom refresh option for frame-unlock mode * fixed full OSD restoration with hotkey * fixed VIC setting for P-LM passthru
1 parent ac95ced commit 3269b54

File tree

10 files changed

+102
-27
lines changed

10 files changed

+102
-27
lines changed

rtl/ic_frontends

software/sys_controller/av_controller.c

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,22 @@ int check_sdcard() {
861861
return ret;
862862
}
863863

864+
int update_edid() {
865+
FIL edid_file;
866+
unsigned bytes_read;
867+
868+
if (!sd_det)
869+
return -1;
870+
871+
if (!file_open(&edid_file, "edid.bin") && (f_size(&edid_file) == sizeof(pro_edid_bin))) {
872+
f_read(&edid_file, pro_edid_bin, sizeof(pro_edid_bin), &bytes_read);
873+
printf("Custom edid set\n");
874+
file_close(&edid_file);
875+
}
876+
877+
return 0;
878+
}
879+
864880
int init_hw()
865881
{
866882
int ret;
@@ -905,8 +921,12 @@ int init_hw()
905921
// Init Si5351C
906922
si5351_init(&si_dev);
907923

908-
//init ocsdc driver
924+
// Init ocsdc driver
909925
mmc_dev = ocsdc_mmc_init(SDC_CONTROLLER_QSYS_0_BASE, SDC_FREQ, SDC_HOST_CAPS);
926+
927+
// Load custom EDID if available and reset MMC/SD status as entering standby
928+
check_sdcard();
929+
update_edid();
910930
mmc_dev->has_init = 0;
911931
sd_det = sd_det_prev = 0;
912932

@@ -1044,15 +1064,13 @@ void switch_expansion(uint8_t exp_sel, uint8_t extra_av_out_mode) {
10441064
// Set expansion flags
10451065
if (((exp_sel == 0) && (exp_det == 1)) || (exp_sel == 2)) {
10461066
if (extra_av_out_mode)
1047-
sys_ctrl |= (1<<SCTRL_EXP_SEL_OFFS)|(extra_av_out_mode<<SCTRL_EXTRA_AV_O_OFFS);
1067+
sys_ctrl |= (1<<SCTRL_EXP_SEL_OFFS)|((extra_av_out_mode-1)<<SCTRL_EXTRA_AV_O_OFFS);
10481068
} else if ((exp_sel == 0) && (exp_det > 1)) {
10491069
sys_ctrl |= exp_det<<SCTRL_EXP_SEL_OFFS;
10501070
} else if (exp_sel > 2) {
10511071
sys_ctrl |= (exp_sel-1)<<SCTRL_EXP_SEL_OFFS;
10521072
}
10531073

1054-
sys_ctrl |= (extra_av_out_mode-1)<<SCTRL_EXTRA_AV_O_OFFS;
1055-
10561074
IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, sys_ctrl);
10571075
}
10581076

@@ -1167,10 +1185,7 @@ void update_settings(int init_setup) {
11671185
if (init_setup || (ts.osd_enable != cs.osd_enable) || (ts.osd_status_timeout != cs.osd_status_timeout)) {
11681186
osd->osd_config.enable = !!ts.osd_enable;
11691187
osd->osd_config.status_timeout = ts.osd_status_timeout;
1170-
if (is_menu_active()) {
1171-
render_osd_menu();
1172-
display_menu((rc_code_t)-1, (btn_code_t)-1);
1173-
}
1188+
refresh_osd();
11741189
}
11751190
if (init_setup || (ts.fan_pwm != cs.fan_pwm) || (ts.led_pwm != cs.led_pwm)) {
11761191
sys_ctrl &= ~(SCTRL_FAN_PWM_MASK|SCTRL_LED_PWM_MASK);
@@ -1749,6 +1764,8 @@ void mainloop()
17491764
sii1136_update_config(&siitx_dev, &cur_avconfig->hdmitx_cfg);
17501765
#endif
17511766

1767+
adv7280a_update_config(&advsdp_dev, &cur_avconfig->sdp_cfg);
1768+
17521769
pcm186x_update_config(&pcm_dev, &cur_avconfig->pcm_cfg);
17531770

17541771
#ifdef VIP

software/sys_controller/inc/avconfig.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
#ifdef INC_PCM186X
3737
#include "pcm186x.h"
3838
#endif
39+
#ifndef DExx_FW
3940
#include "adv7280a.h"
41+
#endif
4042

4143
#define SIGNED_NUMVAL_ZERO 128
4244

@@ -81,10 +83,11 @@ typedef enum {
8183
SCL_FL_ON = 0,
8284
SCL_FL_ON_2X = 1,
8385
SCL_FL_OFF_CLOSEST = 2,
84-
SCL_FL_OFF_50HZ = 3,
85-
SCL_FL_OFF_60HZ = 4,
86-
SCL_FL_OFF_100HZ = 5,
87-
SCL_FL_OFF_120HZ = 6,
86+
SCL_FL_OFF_PRESET = 3,
87+
SCL_FL_OFF_50HZ = 4,
88+
SCL_FL_OFF_60HZ = 5,
89+
SCL_FL_OFF_100HZ = 6,
90+
SCL_FL_OFF_120HZ = 7,
8891
} scl_fl_mode_t;
8992

9093
typedef struct {
@@ -203,6 +206,9 @@ typedef struct {
203206
#ifdef INC_PCM186X
204207
pcm186x_config pcm_cfg __attribute__ ((aligned (4)));
205208
#endif
209+
#ifndef DExx_FW
210+
adv7280a_config sdp_cfg __attribute__ ((aligned (4)));
211+
#endif
206212
} __attribute__((packed)) avconfig_t;
207213

208214
avconfig_t* get_current_avconfig();

software/sys_controller/inc/menu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void quick_adjust_phase(uint8_t dir);
141141
void display_menu(rc_code_t rcode, btn_code_t bcode);
142142
void set_func_ret_msg(char *msg);
143143
void update_osd_size(mode_data_t *vm_out);
144+
void refresh_osd();
144145
static void vm_select();
145146
static void vm_out_select();
146147
static void vm_tweak(uint16_t *v);

software/sys_controller/src/avconfig.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ int set_default_profile(int update_cc)
139139

140140
#ifdef DExx_FW
141141
tc.hdmitx_cfg.i2s_fs = IEC60958_FS_96KHZ;
142+
#else
143+
adv7280a_get_default_cfg(&tc.sdp_cfg);
142144
#endif
143145

144146
if (update_cc)

software/sys_controller/src/menu.c

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static const char *pm_ad_480p_desc[] = { "720x480 (Passthru)", "720x480i (Line d
9898
static const char *pm_ad_576p_desc[] = { "720x576 (Passthru)", "720x576i (Line drop)", "288p_CRT (Line drop)", "1920x1080i (Line1x)", "1920x1080 (Line2x)", "1920x1200 (Line2x)" };
9999
static const char *pm_ad_720p_desc[] = { "1280x720 (Passthru)", "2560x1440 (Line2x)" };
100100
static const char *pm_ad_1080i_desc[] = { "1920x1080i (Passthru)", "1920x1080 (Dint@L2x)" };
101-
static const char *pm_ad_1080p_desc[] = { "1920x1080 (Passthru)", "1920x1080i (Line drop)" };
101+
static const char *pm_ad_1080p_desc[] = { "1920x1080 (Passthru)", "1920x1080i (Line drop)", "540p_CRT (Line drop)" };
102102
static const char *sm_ad_240p_288p_desc[] = { "Generic 4:3", "SNES 256col", "SNES 512col", "MD 256col", "MD 320col", "PSX 256col", "PSX 320col", "PSX 384col", "PSX 512col", "PSX 640col", "SAT 320col", "SAT 352col", "SAT 640col", "SAT 704col", "N64 320col", "N64 640col", "Neo Geo 320col", "X68k 512col", "C64 4XXcol" };
103103
static const char *sm_ad_384p_desc[] = { "Generic 4:3", "VGA 640x350", "VGA 720x350", "VGA 640x400", "VGA 720x400", "GBI 240x360", "PC98 640x400" };
104104
static const char *sm_ad_480i_576i_desc[] = { "Generic 4:3", "Generic 16:9", "DTV 480i/576i 4:3", "DTV 480i/576i 16:9", "SNES 512col", "MD 320col", "PSX 512col", "PSX 640col", "SAT 640col", "SAT 704col", "N64 640col", "DC/PS2/GC 640col" };
@@ -107,6 +107,7 @@ static const char *sm_ad_576p_desc[] = { "Generic 4:3", "Generic 16:9", "DTV 576
107107
static const char *lm_deint_mode_desc[] = { "Bob", "Noninterlace restore" };
108108
static const char *ar_256col_desc[] = { "Pseudo 4:3 DAR", "1:1 PAR" };
109109
static const char *tx_mode_desc[] = { "HDMI (RGB Full)", "HDMI (RGB Limited)", "HDMI (YCbCr444)", "DVI" };
110+
static const char *hdmi_vrr_desc[] = { "Off", "Freesync" };
110111
static const char *sl_mode_desc[] = { LNG("Off","オフ"), LNG("Auto","オート"), LNG("On","オン") };
111112
static const char *sl_method_desc[] = { LNG("Multiplication","Multiplication"), LNG("Subtraction","Subtraction") };
112113
static const char *sl_type_desc[] = { LNG("Horizontal","ヨコ"), LNG("Vertical","タテ"), "Horiz. + Vert.", "Custom" };
@@ -134,7 +135,7 @@ static const char *lm_mode_desc[] = { "Pure", "Adaptive" };
134135
static const char *scl_out_mode_desc[] = { "720x480 (60Hz)", "720x480 WS (60Hz)", "720x576 (50Hz)", "720x576 WS (50Hz)", "1280x720 (50-120Hz)", "1280x1024 (60Hz)", "1920x1080i (50-60Hz)", "1920x1080 (50-120Hz)", "1600x1200 (60Hz)", "1920x1200 (50-60Hz)", "1920x1440 (50-60Hz)", "2560x1440 (50-60Hz)", "2880x2160 (50-60Hz)" };
135136
static const char *scl_crt_out_mode_desc[] = { "240p (60-120Hz)", "240p WS (60-120Hz)", "288p (50-100Hz)", "288p WS (50-100Hz)", "480i (60Hz)", "480i WS (60Hz)", "576i (50Hz)", "576i WS (50Hz)", "480p (60-120Hz)", "540p (50-60Hz)", "1024x768 (60-120Hz)", "1280x960 (60-120Hz)" };
136137
static const char *scl_out_type_desc[] = { "DFP", "CRT" };
137-
static const char *scl_framelock_desc[] = { "On", "On (2x source Hz)", "Off (source Hz)", "Off (50Hz)", "Off (60Hz)", "Off (100Hz)", "Off (120Hz)" };
138+
static const char *scl_framelock_desc[] = { "On", "On (2x source Hz)", "Off (source Hz)", "Off (preset Hz)", "Off (50Hz)", "Off (60Hz)", "Off (100Hz)", "Off (120Hz)" };
138139
static const char *scl_aspect_desc[] = { "Auto", "4:3", "16:9", "8:7", "1:1 source PAR", "Full" };
139140
static const char *scl_alg_desc[] = { "Auto", "Integer (underscan)", "Integer (overscan)", "Nearest", "Lanczos3", "Lanczos3_sharp", "Lanczos3&3_sharp", "Lanczos4", "GS sharp", "Custom scaler1.txt", "Custom scaler2.txt" };
140141
static const char *scl_gen_sr_desc[] = { "Auto", "Lowest", "Highest" };
@@ -153,9 +154,14 @@ static const char *sm_scl_576p_desc[] = { "Generic", "DTV 576p", "GC 640col" };
153154
static const char *timing_1080p120_desc[] = { "CVT-RB", "Min. blank", "CEA-861", "CEA-861 PR2x" };
154155
static const char *timing_2160p60_desc[] = { "CVT-RB PR2x", "Min. blank PR2x" };
155156
static const char *exp_sel_desc[] = { "Auto", "Off", "Extra AV out", "Legacy AV in", "UVC bridge" };
156-
static const char *extra_av_out_mode_desc[] = { "Off", "RGBHV", "RGBCS/RGBS", "RGsB" };
157+
static const char *extra_av_out_mode_desc[] = { "Off", "RGBHV", "RGBCS/RGBS", "RGsB", "YPbPr" };
157158
static const char *hdmi_timings_groups[] = { "HDMI other", "HDMI 240p", "HDMI 288p", "HDMI 384p", "HDMI 480i", "HDMI 576i", "HDMI 480p", "HDMI 576p", "HDMI 720p", "HDMI 1080i", "HDMI 1080p" };
158159
static const char *sdp_timings_groups[] = { "-", "SDP 240p", "SDP 288p", "-", "SDP 480i", "SDP 576i", "-", "-", "-", "-", "-" };
160+
static const char *sh_filt_c_desc[] = { "Auto 1.5MHz", "Auto 2.17MHz", "SH1", "SH2", "SH3", "SH4", "SH5", "Wideband" };
161+
static const char *comb_str_desc[] = { "Narrow", "Medium", "Medium+", "Wide" };
162+
static const char *comb_ctapsn_desc[] = { "3->2", "5->3", "5->4" };
163+
static const char *comb_ctapsp_desc[] = { "5->3 (2-tap)", "5->3 (3-tap)", "5->4 (4-tap)" };
164+
static const char *comb_mode_desc[] = { "Adaptive", "Off", "Fixed (top)", "Fixed (all)", "Fixed (bottom)" };
159165

160166
static void afe_bw_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%s%uMHz%s", (v==0 ? "Auto (" : ""), isl_get_afe_bw(&isl_dev, v), (v==0 ? ")" : "")); }
161167
static void sog_vth_disp(uint8_t v) { sniprintf(menu_row2, US2066_ROW_LEN+1, "%u mV", (v*20)); }
@@ -218,6 +224,17 @@ static void pixelderep_mode_disp(uint8_t v) {
218224
else
219225
sniprintf(menu_row2, US2066_ROW_LEN+1, "Auto (%ux)", advrx_dev.pixelderep_ifr+1);
220226
}
227+
228+
static void sh_filt_y_disp(uint8_t v) {
229+
if (v < 2)
230+
sniprintf(menu_row2, US2066_ROW_LEN+1, "Auto%s/wide", v ? "narrow" : "wide");
231+
else if (v < 20)
232+
sniprintf(menu_row2, US2066_ROW_LEN+1, "SVHS %u", v-1);
233+
else if (v < 25)
234+
sniprintf(menu_row2, US2066_ROW_LEN+1, "PAL %u", v-19);
235+
else
236+
sniprintf(menu_row2, US2066_ROW_LEN+1, "NTSC %u", v-24);
237+
}
221238
#endif
222239

223240
static arg_info_t vm_arg_info = {&vm_sel, 0, vm_plm_display_name};
@@ -250,8 +267,8 @@ MENU(menu_advtiming_out, P99_PROTECT({
250267
{ LNG("V. synclen","V. ドウキナガサ"), OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_synclen, V_SYNCLEN_MIN, V_SYNCLEN_MAX, vm_out_tweak } } },
251268
{ LNG("V. backporch","V. バックポーチ"), OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_bporch, V_BPORCH_MIN, V_BPORCH_MAX, vm_out_tweak } } },
252269
{ LNG("V. active","V. アクティブ"), OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_active, V_ACTIVE_MIN, V_ACTIVE_MAX, vm_out_tweak } } },
253-
{ "TP rfr rate", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_hz, 40, 144, vm_out_tweak } } },
254-
{ "TP rfr rate frac", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_hz_frac, 0, 99, vm_out_tweak } } },
270+
{ "Def rfr rate", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_hz, 40, 144, vm_out_tweak } } },
271+
{ "Def rfr rate frac", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_hz_frac, 0, 99, vm_out_tweak } } },
255272
{ "Display AR H", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_h_mask, 1, 255, vm_out_tweak } } },
256273
{ "Display AR V", OPT_AVCONFIG_NUMVAL_U16,{ .num_u16 = { &tc_v_mask, 1, 255, vm_out_tweak } } },
257274
}))
@@ -404,6 +421,7 @@ MENU(menu_output, P99_PROTECT({
404421
{ "Test pattern mode", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.tp_mode, OPT_WRAP, 0, (NUM_VIDEO_MODES-1), vm_display_name} } },
405422
{ LNG("TX mode","TXモード"), OPT_AVCONFIG_SELECTION, { .sel = { &tc.hdmitx_cfg.tx_mode, OPT_WRAP, SETTING_ITEM_LIST(tx_mode_desc) } } },
406423
{ "HDMI HDR flag", OPT_AVCONFIG_SELECTION, { .sel = { &tc.hdmitx_cfg.hdr, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
424+
{ "HDMI VRR flag", OPT_AVCONFIG_SELECTION, { .sel = { &tc.hdmitx_cfg.vrr, OPT_WRAP, SETTING_ITEM(hdmi_vrr_desc) } } },
407425
//{ "HDMI ITC", OPT_AVCONFIG_SELECTION, { .sel = { &tc.hdmi_itc, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
408426
#ifndef DExx_FW
409427
{ "1080p120 preset", OPT_AVCONFIG_SELECTION, { .sel = { &tc.timing_1080p120, OPT_WRAP, SETTING_ITEM_LIST(timing_1080p120_desc) } } },
@@ -450,9 +468,27 @@ MENU(menu_audio, P99_PROTECT({
450468
}))
451469

452470
#ifndef DExx_FW
471+
MENU(menu_sdp, P99_PROTECT({
472+
{ "NTSC pedestal", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.ntsc_pedestal, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
473+
{ "Brightness", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.brightness, OPT_NOWRAP, 0, 0xff, signed_disp } } },
474+
{ "Contrast", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.contrast, OPT_NOWRAP, 0, 0xff, value_disp } } },
475+
{ "Hue", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.hue, OPT_NOWRAP, 0, 0xff, signed_disp } } },
476+
{ "Shaping filter Y", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.sdp_cfg.sh_filt_y, OPT_NOWRAP, 0, 30, sh_filt_y_disp } } },
477+
{ "Shaping filter C", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.sh_filt_c, OPT_NOWRAP, SETTING_ITEM(sh_filt_c_desc) } } },
478+
{ "PAL Comb str", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_str_pal, OPT_NOWRAP, SETTING_ITEM(comb_str_desc) } } },
479+
{ "PAL Comb C taps", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_ctaps_pal, OPT_NOWRAP, SETTING_ITEM(comb_ctapsp_desc) } } },
480+
{ "PAL Comb C mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_cmode_pal, OPT_NOWRAP, SETTING_ITEM(comb_mode_desc) } } },
481+
{ "PAL Comb Y mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_ymode_pal, OPT_NOWRAP, SETTING_ITEM(comb_mode_desc) } } },
482+
{ "NTSC Comb str", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_str_ntsc, OPT_NOWRAP, SETTING_ITEM(comb_str_desc) } } },
483+
{ "NTSC Comb C taps", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_ctaps_ntsc, OPT_NOWRAP, SETTING_ITEM(comb_ctapsn_desc) } } },
484+
{ "NTSC Comb C mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_cmode_ntsc, OPT_NOWRAP, SETTING_ITEM(comb_mode_desc) } } },
485+
{ "NTSC Comb Y mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sdp_cfg.comb_ymode_ntsc, OPT_NOWRAP, SETTING_ITEM(comb_mode_desc) } } },
486+
}))
487+
453488
MENU(menu_exp, P99_PROTECT({
454489
{ "Expansion select", OPT_AVCONFIG_SELECTION, { .sel = { &tc.exp_sel, OPT_NOWRAP, SETTING_ITEM_LIST(exp_sel_desc) } } },
455490
{ "Extra AV out mode", OPT_AVCONFIG_SELECTION, { .sel = { &tc.extra_av_out_mode, OPT_NOWRAP, SETTING_ITEM_LIST(extra_av_out_mode_desc) } } },
491+
{ "Legacy AV opt.", OPT_SUBMENU, { .sub = { &menu_sdp, NULL, NULL } } },
456492
}))
457493
#endif
458494

@@ -1373,6 +1409,13 @@ void update_osd_size(mode_data_t *vm_out) {
13731409
osd->osd_config.y_size = osd_size;
13741410
}
13751411

1412+
void refresh_osd() {
1413+
if (menu_active && (cstm_f == NULL)) {
1414+
render_osd_menu();
1415+
display_menu((rc_code_t)-1, (btn_code_t)-1);
1416+
}
1417+
}
1418+
13761419
static void vm_select() {
13771420
vm_edit = vm_sel;
13781421
tc_h_samplerate = video_modes_plm[vm_edit].timings.h_total;

software/sys_controller/src/userdata.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const ude_item_map ude_profile_items[] = {
125125
UDE_ITEM(58, 58, tc.audio_fmt),
126126
#ifdef VIP
127127
UDE_ITEM(59, 68, tc.scl_out_mode),
128-
UDE_ITEM(60, 58, tc.scl_framelock),
128+
UDE_ITEM(60, 75, tc.scl_framelock),
129129
UDE_ITEM(61, 62, tc.scl_aspect),
130130
UDE_ITEM(62, 69, tc.scl_alg),
131131
UDE_ITEM(63, 58, tc.scl_edge_thold),
@@ -151,7 +151,7 @@ const ude_item_map ude_profile_items[] = {
151151
UDE_ITEM(76, 58, tc.hdmitx_cfg),
152152
#endif
153153
#ifdef INC_SII1136
154-
UDE_ITEM(77, 69, tc.hdmitx_cfg),
154+
UDE_ITEM(77, 75, tc.hdmitx_cfg),
155155
#endif
156156
#ifdef INC_ADV761X
157157
UDE_ITEM(78, 69, tc.hdmirx_cfg),
@@ -163,7 +163,7 @@ const ude_item_map ude_profile_items[] = {
163163
UDE_ITEM(80, 74, tc.scl_crt_out_mode),
164164
UDE_ITEM(81, 62, tc.scl_out_type),
165165
#endif
166-
UDE_ITEM(82, 64, tc.pm_ad_1080p),
166+
UDE_ITEM(82, 75, tc.pm_ad_1080p),
167167
UDE_ITEM(83, 67, tc.l6_mode),
168168
UDE_ITEM(84, 68, tc.shmask_mode),
169169
UDE_ITEM(85, 72, tc.timing_1080p120),
@@ -173,8 +173,11 @@ const ude_item_map ude_profile_items[] = {
173173
UDE_ITEM(88, 74, tc.scl_gen_sr),
174174
#endif
175175
UDE_ITEM(89, 74, tc.exp_sel),
176-
UDE_ITEM(90, 74, tc.extra_av_out_mode),
176+
UDE_ITEM(90, 75, tc.extra_av_out_mode),
177177
// 91 reserved for sdp_timings
178+
#ifndef DExx_FW
179+
UDE_ITEM(92, 75, tc.sdp_cfg),
180+
#endif
178181
};
179182

180183
int write_userdata(uint8_t entry) {

software/sys_controller/src/video_modes.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ int get_scaler_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm_
464464
} else {
465465
if (cc->scl_framelock == SCL_FL_OFF_CLOSEST)
466466
vm_out->timings.v_hz_x100 = vm_in->timings.v_hz_x100;
467+
else if (cc->scl_framelock == SCL_FL_OFF_PRESET)
468+
;
467469
else if (mode_hz_index == 0)
468470
vm_out->timings.v_hz_x100 = 5000;
469471
else if (mode_hz_index == 1)
@@ -594,7 +596,7 @@ int get_adaptive_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out
594596
const ad_mode_t pm_ad_576p_map[] = {{STDMODE_576p, 0}, {STDMODE_576i, -1}, {STDMODE_288p_CRT, -1}, {STDMODE_1080i_50, 0}, {STDMODE_1080p_50, 1}, {STDMODE_1920x1200_50, 1}};
595597
const ad_mode_t pm_ad_720p_map[] = {{STDMODE_720p_50, 0}, {STDMODE_2560x1440_50, 1}};
596598
const ad_mode_t pm_ad_1080i_map[] = {{STDMODE_1080i_50, 0}, {STDMODE_1080p_50, 1}};
597-
const ad_mode_t pm_ad_1080p_map[] = {{STDMODE_1080p_50, 0}, {STDMODE_1080i_50, -1}};
599+
const ad_mode_t pm_ad_1080p_map[] = {{STDMODE_1080p_50, 0}, {STDMODE_1080i_50, -1}, {STDMODE_540p_50_CRT, -1}};
598600

599601

600602
const smp_mode_t sm_240p_288p_map[] = {SM_GEN_4_3,
@@ -908,7 +910,6 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
908910
mindiff_lines = diff_lines;
909911
mindiff_v_hz_x100 = diff_v_hz_x100;
910912
mindiff_lm = target_lm;
911-
nonsampled_v_mult = *group_ptr[mode_preset->group]+1;
912913
} else if ((mindiff_lines <= 2) && (diff_lines > mindiff_lines)) {
913914
// Break out if suitable mode already found
914915
break;
@@ -935,6 +936,8 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
935936
vm_in->timings.v_backporch = mode_preset->timings.v_backporch;
936937
if (!vm_in->timings.h_total)
937938
vm_in->timings.h_total = mode_preset->timings.h_total;
939+
else
940+
nonsampled_v_mult = *group_ptr[mode_preset->group]+1;
938941
vm_in->timings.h_total_adj = mode_preset->timings.h_total_adj;
939942
vm_in->sampler_phase = mode_preset->sampler_phase;
940943
vm_in->mask.h = mode_preset->mask.h;

software/sys_controller/src/video_modes_list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ static
322322
#endif
323323
const sync_timings_t sdp_timings_default[NUM_VIDEO_GROUPS] = {
324324
{0}, // GROUP_NONE
325-
{ 720, 240, 0, 858, 0, 262, 67, 13, 62, 3, 0}, // GROUP_240P
325+
{ 720, 240, 0, 858, 0, 262, 74, 19, 62, 3, 0}, // GROUP_240P
326326
{ 704, 288, 0, 864, 0, 312, 79, 17, 63, 3, 0}, // GROUP_288P
327327
{0}, // GROUP_384P
328-
{ 720, 240, 6500, 858, 0, 525, 67, 13, 62, 3, 1}, // GROUP_480I
328+
{ 720, 240, 6500, 858, 0, 525, 74, 19, 62, 3, 1}, // GROUP_480I
329329
{ 720, 288, 5500, 864, 0, 625, 79, 17, 63, 3, 1}, // GROUP_576I
330330
{0}, // GROUP_480P
331331
{0}, // GROUP_576P

0 commit comments

Comments
 (0)