提交 9bc6db0d 编写于 作者: D Daniel Vetter

drm/nouveau: Use drm_crtc_vblank_off/on

With atomic nv50+ is already converted over to them, but the old
display code is still using it. Found in a 2 year old patch I have
lying around to un-export these old helpers!

v2: Drop the hand-rolled versions from resume/suspend code. Now that
crtc callbacks do this, we don't need a special case for s/r anymore.

v3: Remove unused variables.

v4: Don't remove drm_crtc_vblank_off from suspend paths, non-atomic
nouveau still needs that. But still switch to drm_crtc_vblank_off
since drm_vblank_off will disappear.

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161114114101.21731-1-daniel.vetter@ffwll.ch
上级 778e1a54
...@@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) ...@@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
if (nv_two_heads(dev)) if (nv_two_heads(dev))
NVSetOwner(dev, nv_crtc->index); NVSetOwner(dev, nv_crtc->index);
drm_vblank_pre_modeset(dev, nv_crtc->index); drm_crtc_vblank_off(crtc);
funcs->dpms(crtc, DRM_MODE_DPMS_OFF); funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
NVBlankScreen(dev, nv_crtc->index, true); NVBlankScreen(dev, nv_crtc->index, true);
...@@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc) ...@@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)
#endif #endif
funcs->dpms(crtc, DRM_MODE_DPMS_ON); funcs->dpms(crtc, DRM_MODE_DPMS_ON);
drm_vblank_post_modeset(dev, nv_crtc->index); drm_crtc_vblank_on(crtc);
} }
static void nv_crtc_destroy(struct drm_crtc *crtc) static void nv_crtc_destroy(struct drm_crtc *crtc)
......
...@@ -380,14 +380,14 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) ...@@ -380,14 +380,14 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
struct nouveau_display *disp = nouveau_display(dev); struct nouveau_display *disp = nouveau_display(dev);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct drm_connector *connector; struct drm_connector *connector;
int head; struct drm_crtc *crtc;
if (!suspend) if (!suspend)
drm_crtc_force_disable_all(dev); drm_crtc_force_disable_all(dev);
/* Make sure that drm and hw vblank irqs get properly disabled. */ /* Make sure that drm and hw vblank irqs get properly disabled. */
for (head = 0; head < dev->mode_config.num_crtc; head++) drm_for_each_crtc(crtc, dev)
drm_vblank_off(dev, head); drm_crtc_vblank_off(crtc);
/* disable flip completion events */ /* disable flip completion events */
nvif_notify_put(&drm->flip); nvif_notify_put(&drm->flip);
...@@ -723,7 +723,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) ...@@ -723,7 +723,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
struct nouveau_display *disp = nouveau_display(dev); struct nouveau_display *disp = nouveau_display(dev);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
int ret, head; int ret;
if (dev->mode_config.funcs->atomic_commit) { if (dev->mode_config.funcs->atomic_commit) {
nouveau_display_init(dev); nouveau_display_init(dev);
...@@ -777,10 +777,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) ...@@ -777,10 +777,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
drm_helper_resume_force_mode(dev); drm_helper_resume_force_mode(dev);
/* Make sure that drm and hw vblank irqs get resumed if needed. */
for (head = 0; head < dev->mode_config.num_crtc; head++)
drm_vblank_on(dev, head);
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册