Bug 58527 - xf86-video-modesetting: Broken video after hibernate
Summary: xf86-video-modesetting: Broken video after hibernate
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/other (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Patrik Jakobsson
QA Contact: Xorg Project Team
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-19 17:58 UTC by nucleo
Modified: 2013-04-16 14:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
modesetting after hibernate (863.25 KB, image/png)
2012-12-19 17:58 UTC, nucleo
no flags Details
gma500 kernel patch (7.70 KB, patch)
2013-04-08 01:48 UTC, nucleo
no flags Details | Splinter Review
dmesg (78.42 KB, text/plain)
2013-04-16 00:01 UTC, nucleo
no flags Details
dmesg (81.72 KB, text/plain)
2013-04-16 12:42 UTC, nucleo
no flags Details

Description nucleo 2012-12-19 17:58:13 UTC
Created attachment 71813 [details]
modesetting after hibernate

Description of problem:
Video broken when system waked up after hibernate.
System is Asus X101CH with Intel gma3600 video card (gma500_gfx kernel driver used).


Version-Release number of selected component (if applicable):
xf86-video-modesetting-0.5.0
xorg-x11-server-1.13.1 (Fedora 18)

How reproducible:
Every time.

Steps to Reproduce:
1. Start hibernate mode from menus or run "systemctl start systemd-hibernate.service".
2. Resume system.
  
Actual results:
Xorg video broken (see screenshot) no errors in Xorg.0.log.
I can switch to terminal with Ctrl+Alt+F2, video there is fine, then I can restart kdm.service (and Xorg server) and then video in Xorg becames fine.

Expected results:
Video should not be broken after hibernate.

Additional info:
After suspend video is fine.
Video is not broken after hibernate if fbdev Xorg driver used instead of modesetting.
Comment 1 nucleo 2013-01-12 02:50:40 UTC
The same problem with xf86-video-modesetting-0.6.0 driver.
Comment 2 Patrik Jakobsson 2013-02-28 19:56:13 UTC
I have similar problems with Poulsbo (same kernel driver) but on suspend. We need to probe outputs and set the mode again upon resume. Fbdev seems to force a modeset on resume (by a VT switch) but modesetting does not. I'll see if I can fix this.
Comment 3 Patrik Jakobsson 2013-03-28 14:10:23 UTC
On second thought, it seems your GTT mappings are lost after hibernate and we need to remap the pages. fbdev is still working because the stolen memory it uses is already mapped by the bios.

Unfortunately I have a different issue that I need to solve first before I can get to the point where your problem appears. I'll report back when I have something for you to test.
Comment 4 nucleo 2013-03-29 16:29:34 UTC
(In reply to comment #3)
Thanks for working on this issue.
I tried last release xf86-video-modesetting-0.7.0, issue still present.
Comment 5 Patrik Jakobsson 2013-04-07 19:11:12 UTC
I've now (hopefully) addressed all the issues with hibernate/suspend for cedarview and poulsbo. Could you please test my tree at:

https://github.com/patjak/drm-gma500.git gma500-next

Thanks
Patrik
Comment 6 nucleo 2013-04-08 01:48:04 UTC
Created attachment 77569 [details] [review]
gma500 kernel patch

I still use 3.5.6 kernel, so I applied to its sources this patch with last 5 commits from drm-gma500.git.
But unfortunately nothing changed. Still video broken after hibernation and fine after suspend.
Comment 7 Patrik Jakobsson 2013-04-15 23:14:39 UTC
Thanks for testing.

I've added some debugging info in commit:
1611f8457768716ba2397e0cdcc92c863cf9b58b
drm/gma500: Add debugging info to psb_gtt_restore()

It should tell us how many of the ranges (if any) are restored and the total size. Could you apply that patch, boot with drm.debug=0xe and attach the dmesg output?

It could also be worth trying to compile the full kernel instead of patching up 3.5.6, there are plenty of changes since then.
Comment 8 nucleo 2013-04-16 00:01:05 UTC
Created attachment 78045 [details]
dmesg

Now I applied last 10 commits from drm-gma500.git to gma500 from 3.8.7 kernel.
Comment 9 nucleo 2013-04-16 00:03:59 UTC
I mean last 8 commits.
dmesg just after system started after hibernation.
Result after hibernation was the same.
Comment 10 Patrik Jakobsson 2013-04-16 00:51:46 UTC
Ok, you're not hitting the psb_gtt_restore path at all. There must be something missing in 3.5.6 that is present in 3.8-rc6. There are plenty of power management fixes since the 3.5 days so it's a pain to track it down.

The only thing I can recommend is for you to try out my 3.8-rc6 tree.

If you hit the gtt restore code you should see (in dmesg) something like:
[drm:psb_gtt_restore], Restored 2 of 6 gtt ranges (4143 KB)

One range is your framebuffer and the other is your cursor buffer.

Thanks
Comment 11 nucleo 2013-04-16 12:42:06 UTC
Created attachment 78078 [details]
dmesg

Now I booted with kernel from drm-gma500.git, and looks like problem with video after hibernation fixed.
In Comment 8 I forgot to say that booted with kernel 3.8.7 and pached gma500 module but maybe commits used for patch not enough.
Comment 12 Patrik Jakobsson 2013-04-16 13:12:56 UTC
Great, thanks for testing.

It seems a bit odd that 3.8.7 with the patches applied didn't work but perhaps I overlooked something. Now that I know these patches don't wreck havoc on Cedarview I'm gonna ask for it to be pulled into drm-next and for inclusion in 3.10.
Comment 13 nucleo 2013-04-16 13:14:51 UTC
What missing patch needed to fix problem in older kernel?
Comment 14 Patrik Jakobsson 2013-04-16 13:54:14 UTC
There are 57 patches touching gma500 since 3.5 and that is not including any changes made to drm. I'm afraid it's not worth backporting this.
Comment 15 nucleo 2013-04-16 14:50:42 UTC
I tried to compile with kernel 3.8.7 gma500 code from drm-gma500.git but with reverted two commits that makes compilation failed
https://github.com/patjak/drm-gma500/commit/362063619cf67c2c2fc2eb90951b2623cbb69a7c#drivers/gpu/drm/gma500/framebuffer.c
https://github.com/patjak/drm-gma500/commit/0a819515fc346b4e79d6e3fc01d837a660452c74#drivers/gpu/drm/gma500/psb_drv.c

But this module also don't fixes video after hibernation and I don't see message
[drm:psb_gtt_restore], Restored 2 of 4 gtt ranges (2415 KB)

Maybe answer why patched gma500 don't work with 3.8.7 kernel is in reason why psb_gtt_restore don't called and some simple fix for this can be found?


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.