Commit 8ff64c17 authored by Thierry Reding's avatar Thierry Reding

drm/tegra: dc: Add missing call to drm_vblank_on()

When the CRTC is enabled, make sure the VBLANK machinery is enabled.
Failure to do so will cause drm_vblank_get() to not enable the VBLANK on
the CRTC and VBLANK-synchronized page-flips won't work.

While at it, get rid of the legacy drm_vblank_pre_modeset() and
drm_vblank_post_modeset() calls that are replaced by drm_vblank_on()
and drm_vblank_off().
Reported-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Tested-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent f114040e
...@@ -736,7 +736,6 @@ static const struct drm_crtc_funcs tegra_crtc_funcs = { ...@@ -736,7 +736,6 @@ static const struct drm_crtc_funcs tegra_crtc_funcs = {
static void tegra_crtc_disable(struct drm_crtc *crtc) static void tegra_crtc_disable(struct drm_crtc *crtc)
{ {
struct tegra_dc *dc = to_tegra_dc(crtc);
struct drm_device *drm = crtc->dev; struct drm_device *drm = crtc->dev;
struct drm_plane *plane; struct drm_plane *plane;
...@@ -752,7 +751,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) ...@@ -752,7 +751,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc)
} }
} }
drm_vblank_off(drm, dc->pipe); drm_crtc_vblank_off(crtc);
} }
static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc, static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc,
...@@ -841,8 +840,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, ...@@ -841,8 +840,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc,
u32 value; u32 value;
int err; int err;
drm_vblank_pre_modeset(crtc->dev, dc->pipe);
err = tegra_crtc_setup_clk(crtc, mode); err = tegra_crtc_setup_clk(crtc, mode);
if (err) { if (err) {
dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err); dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err);
...@@ -896,6 +893,8 @@ static void tegra_crtc_prepare(struct drm_crtc *crtc) ...@@ -896,6 +893,8 @@ static void tegra_crtc_prepare(struct drm_crtc *crtc)
unsigned int syncpt; unsigned int syncpt;
unsigned long value; unsigned long value;
drm_crtc_vblank_off(crtc);
/* hardware initialization */ /* hardware initialization */
reset_control_deassert(dc->rst); reset_control_deassert(dc->rst);
usleep_range(10000, 20000); usleep_range(10000, 20000);
...@@ -943,7 +942,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc) ...@@ -943,7 +942,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc)
value = GENERAL_ACT_REQ | WIN_A_ACT_REQ; value = GENERAL_ACT_REQ | WIN_A_ACT_REQ;
tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL); tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL);
drm_vblank_post_modeset(crtc->dev, dc->pipe); drm_crtc_vblank_on(crtc);
} }
static void tegra_crtc_load_lut(struct drm_crtc *crtc) static void tegra_crtc_load_lut(struct drm_crtc *crtc)
......
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