- rcar_du_crtc_write(rcrtc, VDSR, mode->vtotal - mode->vsync_end - 2);
- rcar_du_crtc_write(rcrtc, VDER, mode->vtotal - mode->vsync_end +
- mode->vdisplay - 2);
- rcar_du_crtc_write(rcrtc, VSPR, mode->vtotal - mode->vsync_end +
- mode->vsync_start - 1);
- rcar_du_crtc_write(rcrtc, VCR, mode->vtotal - 1);
+ if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
+ rcar_du_crtc_write(rcrtc, VDSR, (mode->vtotal / 2)
+ - (mode->vsync_end / 2) - 2);
+ rcar_du_crtc_write(rcrtc, VDER, (mode->vtotal / 2)
+ - (mode->vsync_end / 2)
+ + (mode->vdisplay / 2) - 2);
+ rcar_du_crtc_write(rcrtc, VSPR, (mode->vtotal / 2)
+ - (mode->vsync_end / 2)
+ + (mode->vsync_start / 2) - 1);
+ rcar_du_crtc_write(rcrtc, VCR, (mode->vtotal / 2) - 1);
+ } else {
+ rcar_du_crtc_write(rcrtc, VDSR, mode->vtotal
+ - mode->vsync_end - 2);
+ rcar_du_crtc_write(rcrtc, VDER, mode->vtotal - mode->vsync_end
+ + mode->vdisplay - 2);
+ rcar_du_crtc_write(rcrtc, VSPR, mode->vtotal - mode->vsync_end
+ + mode->vsync_start - 1);
+ rcar_du_crtc_write(rcrtc, VCR, mode->vtotal - 1);
+ }