1
0
mirror of https://github.com/marqs85/ossc.git synced 2024-12-28 18:29:28 +00:00

fix optimized mode mask & position offsets

This commit is contained in:
marqs 2018-04-15 23:41:26 +03:00
parent dcd3d14a53
commit 70ab55c1fa
3 changed files with 12 additions and 7 deletions

View File

@ -669,7 +669,7 @@ begin
R_out <= {8{lt_box_enable_pp[`PP_PIPELINE_LENGTH]}};
G_out <= {8{lt_box_enable_pp[`PP_PIPELINE_LENGTH]}};
B_out <= {8{lt_box_enable_pp[`PP_PIPELINE_LENGTH]}};
end else if (border_enable_pp[`PP_PIPELINE_LENGTH-1]) begin
end else if (border_enable_pp[`PP_PIPELINE_LENGTH]) begin
R_out <= {2{X_MASK_BR}};
G_out <= {2{X_MASK_BR}};
B_out <= {2{X_MASK_BR}};
@ -947,7 +947,7 @@ begin
vcnt_2x <= 0;
line_out_idx_2x <= 0;
end else begin
if ((pclk_1x == 1'b0) & (line_change | frame_change)) begin //aligned with posedge of pclk_1x
if ((pclk_1x == 1'b1) & (line_change | frame_change)) begin //aligned with negedge of pclk_1x
hcnt_2x <= 0;
hcnt_2x_opt <= H_OPT_SAMPLE_SEL;
hcnt_2x_opt_ctr <= 0;

View File

@ -339,7 +339,7 @@ status_t get_status(tvp_input_t input, video_format format)
tvp_set_sync_lpf(tc.sync_lpf);
if (memcmp(&tc.col, &cm.cc.col, sizeof(color_setup_t)))
tvp_set_fine_gain_offset(&cm.cc.col);
tvp_set_fine_gain_offset(&tc.col);
#ifdef ENABLE_AUDIO
if ((tc.audio_dw_sampl != cm.cc.audio_dw_sampl) ||
@ -443,15 +443,20 @@ void set_videoinfo()
if (target_type == VIDEO_HDTV)
h_synclen *= 2;
// 1920x* modes need short hsync
if (h_synclen > cm.hsync_cut)
h_synclen -= cm.hsync_cut;
else
h_synclen = 1;
h_border = (((cm.sample_mult-h_opt_scale)*video_modes[cm.id].h_active)/2);
h_mask = h_border + h_opt_scale*cm.cc.h_mask;
h_opt_startoffs = h_border + (cm.sample_mult-h_opt_scale)*(h_synclen+(alt_u16)video_modes[cm.id].h_backporch);
h_opt_startoffs = (h_opt_startoffs/cm.sample_mult)*cm.sample_mult;
printf("h_border: %u, h_opt_startoffs: %u\n", h_border, h_opt_startoffs);
IOWR_ALTERA_AVALON_PIO_DATA(PIO_3_BASE, (cm.fpga_hmultmode<<30) |
((cm.cc.l5_fmt!=L5FMT_1600x1200)<<29) |
((((cm.sample_mult*h_synclen)-cm.hsync_cut)&0xff)<<20) |
(((cm.sample_mult*h_synclen)&0xff)<<20) |
(((cm.sample_mult*(alt_u16)video_modes[cm.id].h_backporch)&0x1ff)<<11) |
((cm.sample_mult*video_modes[cm.id].h_active)&0x7ff));
IOWR_ALTERA_AVALON_PIO_DATA(PIO_4_BASE, (h_mask<<19) |

View File

@ -187,13 +187,13 @@ alt_8 get_mode_id(alt_u32 totlines, alt_u8 progressive, alt_u32 hz, video_type t
cm.fpga_vmultmode = FPGA_V_MULTMODE_5X;
cm.fpga_hmultmode = FPGA_H_MULTMODE_OPTIMIZED;
cm.sample_mult = 5;
cm.hsync_cut = 120;
cm.hsync_cut = 24;
break;
case MODE_L5_256_COL:
cm.fpga_vmultmode = FPGA_V_MULTMODE_5X;
cm.fpga_hmultmode = FPGA_H_MULTMODE_OPTIMIZED;
cm.sample_mult = 6;
cm.hsync_cut = 120;
cm.hsync_cut = 20;
break;
default:
printf("WARNING: invalid target_lm\n");