pconf->lcd_timing.de_vs_addr = de_vstart;
pconf->lcd_timing.de_ve_addr = de_vstart + v_active - 1;
- hstart = (de_hstart + h_period - hsync_bp - hsync_width) % h_period;
- hend = (de_hstart + h_period - hsync_bp) % h_period;
+ if (h_period) {
+ hstart = (de_hstart + h_period - hsync_bp - hsync_width) % h_period;
+ hend = (de_hstart + h_period - hsync_bp) % h_period;
+ } else {
+ hstart = 0;
+ hend = 0;
+ }
pconf->lcd_timing.hs_hs_addr = hstart;
pconf->lcd_timing.hs_he_addr = hend;
pconf->lcd_timing.hs_vs_addr = 0;
pconf->lcd_timing.hs_ve_addr = v_period - 1;
- pconf->lcd_timing.vs_hs_addr = (hstart + h_period) % h_period;
+ if (h_period) {
+ pconf->lcd_timing.vs_hs_addr = (hstart + h_period) % h_period;
+ vstart = (de_vstart + v_period - vsync_bp - vsync_width) % v_period;
+ vend = (de_vstart + v_period - vsync_bp) % v_period;
+ } else {
+ pconf->lcd_timing.vs_hs_addr = 0;
+ vstart = 0;
+ vend = 0;
+ }
pconf->lcd_timing.vs_he_addr = pconf->lcd_timing.vs_hs_addr;
- vstart = (de_vstart + v_period - vsync_bp - vsync_width) % v_period;
- vend = (de_vstart + v_period - vsync_bp) % v_period;
pconf->lcd_timing.vs_vs_addr = vstart;
pconf->lcd_timing.vs_ve_addr = vend;