aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index add353e230f4..6b570079d185 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -58,27 +58,30 @@ int
58nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe) 58nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe)
59{ 59{
60 struct drm_crtc *crtc; 60 struct drm_crtc *crtc;
61 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 61 struct nouveau_crtc *nv_crtc;
62 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 62
63 if (nv_crtc->index == pipe) { 63 crtc = drm_crtc_from_index(dev, pipe);
64 nvif_notify_get(&nv_crtc->vblank); 64 if (!crtc)
65 return 0; 65 return -EINVAL;
66 } 66
67 } 67 nv_crtc = nouveau_crtc(crtc);
68 return -EINVAL; 68 nvif_notify_get(&nv_crtc->vblank);
69
70 return 0;
69} 71}
70 72
71void 73void
72nouveau_display_vblank_disable(struct drm_device *dev, unsigned int pipe) 74nouveau_display_vblank_disable(struct drm_device *dev, unsigned int pipe)
73{ 75{
74 struct drm_crtc *crtc; 76 struct drm_crtc *crtc;
75 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 77 struct nouveau_crtc *nv_crtc;
76 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 78
77 if (nv_crtc->index == pipe) { 79 crtc = drm_crtc_from_index(dev, pipe);
78 nvif_notify_put(&nv_crtc->vblank); 80 if (!crtc)
79 return; 81 return;
80 } 82
81 } 83 nv_crtc = nouveau_crtc(crtc);
84 nvif_notify_put(&nv_crtc->vblank);
82} 85}
83 86
84static inline int 87static inline int