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

drm/i915: Call drm_calc_timestamping_constants() earlier

Update the pixel/line/frame duration information when we switch to the
new pipe config. This will keep the timestamping constants in better
sync with the real hardware state.

Reviewed-by: mario.kleiner.de@gmail.com
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent 4b4b9238
...@@ -9660,6 +9660,14 @@ static int __intel_set_mode(struct drm_crtc *crtc, ...@@ -9660,6 +9660,14 @@ static int __intel_set_mode(struct drm_crtc *crtc,
/* mode_set/enable/disable functions rely on a correct pipe /* mode_set/enable/disable functions rely on a correct pipe
* config. */ * config. */
to_intel_crtc(crtc)->config = *pipe_config; to_intel_crtc(crtc)->config = *pipe_config;
/*
* Calculate and store various constants which
* are later needed by vblank and swap-completion
* timestamping. They are derived from true hwmode.
*/
drm_calc_timestamping_constants(crtc,
&pipe_config->adjusted_mode);
} }
/* Only after disabling all output pipelines that will be changed can we /* Only after disabling all output pipelines that will be changed can we
...@@ -9683,15 +9691,6 @@ static int __intel_set_mode(struct drm_crtc *crtc, ...@@ -9683,15 +9691,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
for_each_intel_crtc_masked(dev, prepare_pipes, intel_crtc) for_each_intel_crtc_masked(dev, prepare_pipes, intel_crtc)
dev_priv->display.crtc_enable(&intel_crtc->base); dev_priv->display.crtc_enable(&intel_crtc->base);
if (modeset_pipes) {
/* Calculate and store various constants which
* are later needed by vblank and swap-completion
* timestamping. They are derived from true hwmode.
*/
drm_calc_timestamping_constants(crtc,
&pipe_config->adjusted_mode);
}
/* FIXME: add subpixel order */ /* FIXME: add subpixel order */
done: done:
if (ret && crtc->enabled) if (ret && crtc->enabled)
......
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