aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/tegra/drm.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 0f4eacb0af4f..2d57f6278db1 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -804,23 +804,10 @@ static const struct file_operations tegra_drm_fops = {
804 .llseek = noop_llseek, 804 .llseek = noop_llseek,
805}; 805};
806 806
807static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm,
808 unsigned int pipe)
809{
810 struct drm_crtc *crtc;
811
812 list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) {
813 if (pipe == drm_crtc_index(crtc))
814 return crtc;
815 }
816
817 return NULL;
818}
819
820static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, 807static u32 tegra_drm_get_vblank_counter(struct drm_device *drm,
821 unsigned int pipe) 808 unsigned int pipe)
822{ 809{
823 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 810 struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
824 struct tegra_dc *dc = to_tegra_dc(crtc); 811 struct tegra_dc *dc = to_tegra_dc(crtc);
825 812
826 if (!crtc) 813 if (!crtc)
@@ -831,7 +818,7 @@ static u32 tegra_drm_get_vblank_counter(struct drm_device *drm,
831 818
832static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) 819static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
833{ 820{
834 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 821 struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
835 struct tegra_dc *dc = to_tegra_dc(crtc); 822 struct tegra_dc *dc = to_tegra_dc(crtc);
836 823
837 if (!crtc) 824 if (!crtc)
@@ -844,7 +831,7 @@ static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
844 831
845static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) 832static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe)
846{ 833{
847 struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); 834 struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
848 struct tegra_dc *dc = to_tegra_dc(crtc); 835 struct tegra_dc *dc = to_tegra_dc(crtc);
849 836
850 if (crtc) 837 if (crtc)