提交 e538092c 编写于 作者: M Mario Kleiner 提交者: Eric Anholt

drm/vc4: Enable precise vblank timestamping for interlaced modes.

On top of the interlaced video mode fix and with some additional
adjustments, this now works well. It has almost the same accuracy
as on regular progressive scan modes.
Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 36451467
...@@ -163,14 +163,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, ...@@ -163,14 +163,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
int vblank_lines; int vblank_lines;
int ret = 0; int ret = 0;
/*
* XXX Doesn't work well in interlaced mode yet, partially due
* to problems in vc4 kms or drm core interlaced mode handling,
* so disable for now in interlaced mode.
*/
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
return ret;
/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */
/* Get optional system timestamp before query. */ /* Get optional system timestamp before query. */
...@@ -191,10 +183,15 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, ...@@ -191,10 +183,15 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
/* Vertical position of hvs composed scanline. */ /* Vertical position of hvs composed scanline. */
*vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE); *vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE);
*hpos = 0;
if (mode->flags & DRM_MODE_FLAG_INTERLACE) {
*vpos /= 2;
/* No hpos info available. */ /* Use hpos to correct for field offset in interlaced mode. */
if (hpos) if (VC4_GET_FIELD(val, SCALER_DISPSTATX_FRAME_COUNT) % 2)
*hpos = 0; *hpos += mode->crtc_htotal / 2;
}
/* This is the offset we need for translating hvs -> pv scanout pos. */ /* This is the offset we need for translating hvs -> pv scanout pos. */
fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay; fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay;
...@@ -217,8 +214,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, ...@@ -217,8 +214,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
* position of the PV. * position of the PV.
*/ */
*vpos -= fifo_lines + 1; *vpos -= fifo_lines + 1;
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
*vpos /= 2;
ret |= DRM_SCANOUTPOS_ACCURATE; ret |= DRM_SCANOUTPOS_ACCURATE;
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册