Commit e3bb355c authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/tv: Generate better pipe timings for TV encoder

To make vblank timestamps work better with the TV encoder let's
scale the pipe timings such that the relationship between the
TV active and TV blanking periods is mirrored in the
corresponding pipe timings.

Note that in reality the pipe runs at a faster speed during the
TV vblank, and correspondigly there are periods when the pipe
is enitrely stopped. We pretend that this isn't the case and
as such we incur some error in the vblank timestamps during
the TV vblank. Further explanation of the issues in a big
comment in the code.

This makes the vblank timestamps good enough to make
i965gm (which doesn't have a working frame counter with
the TV encoder) report correct frame numbers. Previously
you could get all kinds of nonsense which resulted in
eg. glxgears reporting that it's running at twice the
actual framerate in most cases.

v2: s/IS_GEN4(dev_priv)/IS_GEN(dev_priv, 4)/ in the comment
    for consistency
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181112170000.27531-15-ville.syrjala@linux.intel.comReviewed-by: default avatarImre Deak <imre.deak@intel.com>
parent a0ff6779
...@@ -4895,6 +4895,7 @@ enum { ...@@ -4895,6 +4895,7 @@ enum {
# define TV_OVERSAMPLE_NONE (2 << 18) # define TV_OVERSAMPLE_NONE (2 << 18)
/* Selects 8x oversampling */ /* Selects 8x oversampling */
# define TV_OVERSAMPLE_8X (3 << 18) # define TV_OVERSAMPLE_8X (3 << 18)
# define TV_OVERSAMPLE_MASK (3 << 18)
/* Selects progressive mode rather than interlaced */ /* Selects progressive mode rather than interlaced */
# define TV_PROGRESSIVE (1 << 17) # define TV_PROGRESSIVE (1 << 17)
/* Sets the colorburst to PAL mode. Required for non-M PAL modes. */ /* Sets the colorburst to PAL mode. Required for non-M PAL modes. */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment