aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/tegra/drm.c')
-rw-r--r--drivers/gpu/drm/tegra/drm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index e549afeece1f..d4f827593dfa 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -694,24 +694,28 @@ static const struct file_operations tegra_drm_fops = {
694 .llseek = noop_llseek, 694 .llseek = noop_llseek,
695}; 695};
696 696
697static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm, int pipe) 697static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm,
698 unsigned int pipe)
698{ 699{
699 struct drm_crtc *crtc; 700 struct drm_crtc *crtc;
700 701
701 list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) { 702 list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) {
702 struct tegra_dc *dc = to_tegra_dc(crtc); 703 if (pipe == drm_crtc_index(crtc))
703
704 if (dc->pipe == pipe)
705 return crtc; 704 return crtc;
706 } 705 }
707 706
708 return NULL; 707 return NULL;
709} 708}
710 709
711static u32 tegra_drm_get_vblank_counter(struct drm_device *dev, int crtc) 710static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, int pipe)
712{ 711{
712 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe);
713
714 if (!crtc)
715 return 0;
716
713 /* TODO: implement real hardware counter using syncpoints */ 717 /* TODO: implement real hardware counter using syncpoints */
714 return drm_vblank_count(dev, crtc); 718 return drm_crtc_vblank_count(crtc);
715} 719}
716 720
717static int tegra_drm_enable_vblank(struct drm_device *drm, int pipe) 721static int tegra_drm_enable_vblank(struct drm_device *drm, int pipe)