Christoph Rudorff
2013-Oct-03 14:41 UTC
[Nouveau] [PATCH] drm/nouveau/fb: fix suspend/resume fbcon
On resume of a hibernated notebook, I get garbled virtual consoles. fb_set_suspend(*dev, state == 0 means dev is running ...) This patch fixes that issue for me: hibernate: kernel: nouveau [ DRM] suspending fbcon... kernel: nouveau [ DRM] suspending display... kernel: nouveau [ DRM] unpinning framebuffer(s)... kernel: nouveau [ DRM] evicting buffers... kernel: nouveau [ DRM] waiting for kernel channels to go idle... kernel: nouveau [ DRM] suspending client object trees... kernel: nouveau [ DRM] suspending kernel object tree... resume: kernel: nouveau [ DRM] re-enabling device... kernel: nouveau [ DRM] resuming kernel object tree... kernel: nouveau [ VBIOS][0000:01:00.0] running init tables kernel: nouveau [ DRM] resuming client object trees... kernel: nouveau [ DRM] resuming display... kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe000 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe000 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe240 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe400 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT https://bugs.freedesktop.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=PAGE_NOT_PRESENT https://bugs.freedesktop.org/show_bug.cgi?id=58556 https://bugs.freedesktop.org/show_bug.cgi?id=62835 https://bugs.freedesktop.org/show_bug.cgi?id=68037 https://bugs.freedesktop.org/show_bug.cgi?id=69029 https://bugs.freedesktop.org/show_bug.cgi?id=69928 --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 383f4e6..6148758 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -544,7 +544,7 @@ nouveau_do_resume(struct drm_device *dev) nouveau_pm_resume(dev); if (dev->mode_config.num_crtc) { - NV_INFO(drm, "resuming display...\n"); + NV_INFO(drm, "resuming display and fbcon...\n"); nouveau_display_resume(dev); } return 0; diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index b035317..46e37c0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -514,10 +514,10 @@ void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) struct nouveau_drm *drm = nouveau_drm(dev); console_lock(); if (state == 0) - nouveau_fbcon_save_disable_accel(dev); + nouveau_fbcon_restore_accel(dev); fb_set_suspend(drm->fbcon->helper.fbdev, state); if (state == 1) - nouveau_fbcon_restore_accel(dev); + nouveau_fbcon_save_disable_accel(dev); console_unlock(); } -- 1.7.10.4
Emil Velikov
2013-Oct-03 22:50 UTC
[Nouveau] [PATCH] drm/nouveau/fb: fix suspend/resume fbcon
On 03/10/13 15:41, Christoph Rudorff wrote:> On resume of a hibernated notebook, I get garbled virtual consoles. > > fb_set_suspend(*dev, state == 0 means dev is running ...) > > This patch fixes that issue for me: >Ouch, nice catch Christoph :) Seems like the following commit flipped the logic unintentionally, thus causing the issue. Stange enough I have no problems with s2d although I must admit it's not the most common thing I do. commit cf41d53bf5b95d77673b185cc3b20ae3257f79e2 Author: Ben Skeggs <bskeggs at redhat.com> Date: Wed Nov 9 14:31:16 2011 +1000 drm/nouveau: re-jig fbcon suspend/resume process a little Signed-off-by: Ben Skeggs <bskeggs at redhat.com>> hibernate: > kernel: nouveau [ DRM] suspending fbcon... > kernel: nouveau [ DRM] suspending display... > kernel: nouveau [ DRM] unpinning framebuffer(s)... > kernel: nouveau [ DRM] evicting buffers... > kernel: nouveau [ DRM] waiting for kernel channels to go idle... > kernel: nouveau [ DRM] suspending client object trees... > kernel: nouveau [ DRM] suspending kernel object tree... > resume: > kernel: nouveau [ DRM] re-enabling device... > kernel: nouveau [ DRM] resuming kernel object tree... > kernel: nouveau [ VBIOS][0000:01:00.0] running init tables > kernel: nouveau [ DRM] resuming client object trees... > kernel: nouveau [ DRM] resuming display... > kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe000 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT > kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe000 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT > kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe240 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT > kernel: nouveau E[ PFB][0000:01:00.0] trapped write at 0x00007fe400 on channel 0x0000fee0 [unknown] BAR/PFIFO_WRITE/FB reason: PAGE_NOT_PRESENT > > https://bugs.freedesktop.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content=PAGE_NOT_PRESENT > > https://bugs.freedesktop.org/show_bug.cgi?id=58556 > https://bugs.freedesktop.org/show_bug.cgi?id=62835 > https://bugs.freedesktop.org/show_bug.cgi?id=68037 > https://bugs.freedesktop.org/show_bug.cgi?id=69029 > https://bugs.freedesktop.org/show_bug.cgi?id=69928 > --- > drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c > index 383f4e6..6148758 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_drm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c > @@ -544,7 +544,7 @@ nouveau_do_resume(struct drm_device *dev) > nouveau_pm_resume(dev); > > if (dev->mode_config.num_crtc) { > - NV_INFO(drm, "resuming display...\n"); > + NV_INFO(drm, "resuming display and fbcon...\n"); > nouveau_display_resume(dev); > } > return 0; > diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > index b035317..46e37c0 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > @@ -514,10 +514,10 @@ void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) > struct nouveau_drm *drm = nouveau_drm(dev); > console_lock(); > if (state == 0) > - nouveau_fbcon_save_disable_accel(dev); > + nouveau_fbcon_restore_accel(dev); > fb_set_suspend(drm->fbcon->helper.fbdev, state); > if (state == 1) > - nouveau_fbcon_restore_accel(dev); > + nouveau_fbcon_save_disable_accel(dev); > console_unlock(); > }I'm not entirely sure this is correct. One needs to save and disable accleration before suspending the fb. Please try the following - if (state == 0) + if (state == 1) nouveau_fbcon_save_disable_accel(dev); fb_set_suspend(drm->fbcon->helper.fbdev, state); - if (state == 1) + if (state == 0) nouveau_fbcon_restore_accel(dev); console_unlock(); Cheers, Emil
Christoph Rudorff
2013-Oct-04 00:54 UTC
[Nouveau] [PATCH] drm/nouveau/fb: fix suspend/resume fbcon
Am Donnerstag, den 03.10.2013, 23:50 +0100 schrieb Emil Velikov:> I'm not entirely sure this is correct. One needs to save and disable > accleration before suspending the fb. Please try the following > > - if (state == 0) > + if (state == 1) > nouveau_fbcon_save_disable_accel(dev); > fb_set_suspend(drm->fbcon->helper.fbdev, state); > - if (state == 1) > + if (state == 0) > nouveau_fbcon_restore_accel(dev); > console_unlock(); > > Cheers, > EmilHi! That was my first try! I guessed the same but I got exactly one trap message on resume. So it's about first put the bucket and then open the water tap. ;) chris ps: just found these macros for the state in fb.h: FBINFO_STATE_RUNNING = 0 FBINFO_STATE_SUSPENDED = 1