Skip to content

Commit 8ff64c1

Browse files
committed
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: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent f114040 commit 8ff64c1

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • drivers/gpu/drm/tegra

‎drivers/gpu/drm/tegra/dc.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ static const struct drm_crtc_funcs tegra_crtc_funcs = {
736736

737737
static void tegra_crtc_disable(struct drm_crtc *crtc)
738738
{
739-
struct tegra_dc *dc = to_tegra_dc(crtc);
740739
struct drm_device *drm = crtc->dev;
741740
struct drm_plane *plane;
742741

@@ -752,7 +751,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc)
752751
}
753752
}
754753

755-
drm_vblank_off(drm, dc->pipe);
754+
drm_crtc_vblank_off(crtc);
756755
}
757756

758757
static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -841,8 +840,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc,
841840
u32 value;
842841
int err;
843842

844-
drm_vblank_pre_modeset(crtc->dev, dc->pipe);
845-
846843
err = tegra_crtc_setup_clk(crtc, mode);
847844
if (err) {
848845
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)
896893
unsigned int syncpt;
897894
unsigned long value;
898895

896+
drm_crtc_vblank_off(crtc);
897+
899898
/* hardware initialization */
900899
reset_control_deassert(dc->rst);
901900
usleep_range(10000, 20000);
@@ -943,7 +942,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc)
943942
value = GENERAL_ACT_REQ | WIN_A_ACT_REQ;
944943
tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL);
945944

946-
drm_vblank_post_modeset(crtc->dev, dc->pipe);
945+
drm_crtc_vblank_on(crtc);
947946
}
948947

949948
static void tegra_crtc_load_lut(struct drm_crtc *crtc)

0 commit comments

Comments
 (0)