From 2396983652dd9f4dece0baa427b6727717baf11f Mon Sep 17 00:00:00 2001 From: poma Date: Sun, 26 Oct 2014 04:18:48 +0100 Subject: [PATCH] Revert "drm/nv50/kms: Set VBLANK time in modeset script" This reverts commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f. Restored the functionality of the display - display is powered on during: - boot from soft-off(S5) - thaw from hibernate(S4) - resume from suspend(S3) and stays on. Tests: - S3 core debug echo core > /sys/power/pm_test echo mem > /sys/power/state - S4 core debug echo core > /sys/power/pm_test echo disk > /sys/power/state - S3 none debug (systemctl suspend) echo none > /sys/power/pm_test echo mem > /sys/power/state - S4 none debug (systemctl hibernate) echo none > /sys/power/pm_test echo disk > /sys/power/state - S5 soft-off systemctl poweroff/reboot All tests PASSED. Tested with: 3.18.0-rc1.git-2396983-drm-fixes+ --- drivers/gpu/drm/nouveau/nv50_display.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index ae873d1..83d7c50 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -1066,7 +1066,7 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, u32 vscan = (mode->flags & DRM_MODE_FLAG_DBLSCAN) ? 2 : 1; u32 hactive, hsynce, hbackp, hfrontp, hblanke, hblanks; u32 vactive, vsynce, vbackp, vfrontp, vblanke, vblanks; - u32 vblan2e = 0, vblan2s = 1, vblankus = 0; + u32 vblan2e = 0, vblan2s = 1; u32 *push; int ret; @@ -1083,11 +1083,6 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, vblanke = vsynce + vbackp; vfrontp = (mode->vsync_start - mode->vdisplay) * vscan / ilace; vblanks = vactive - vfrontp - 1; - /* XXX: Safe underestimate, even "0" works */ - vblankus = (vactive - mode->vdisplay - 2) * hactive; - vblankus *= 1000; - vblankus /= mode->clock; - if (mode->flags & DRM_MODE_FLAG_INTERLACE) { vblan2e = vactive + vsynce + vbackp; vblan2s = vblan2e + (mode->vdisplay * vscan / ilace); @@ -1104,14 +1099,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); evo_data(push, 0x00800000 | mode->clock); evo_data(push, (ilace == 2) ? 2 : 0); - evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8); + evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6); evo_data(push, 0x00000000); evo_data(push, (vactive << 16) | hactive); evo_data(push, ( vsynce << 16) | hsynce); evo_data(push, (vblanke << 16) | hblanke); evo_data(push, (vblanks << 16) | hblanks); evo_data(push, (vblan2e << 16) | vblan2s); - evo_data(push, vblankus); + evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1); evo_data(push, 0x00000000); evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2); evo_data(push, 0x00000311); -- 2.1.0