Bug 69531 - Framebuffer flickering and corruption when inteldrmfb takes over fb0 from efifb
Summary: Framebuffer flickering and corruption when inteldrmfb takes over fb0 from efifb
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - Intel) (show other bugs)
Hardware: x86-64 Linux
: P3 normal
Assignee: Jesse Barnes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-28 03:38 UTC by Pierre-Loup A. Griffais
Modified: 2015-01-28 14:15 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.10.11
Subsystem:
Regression: No
Bisected commit-id:


Attachments
steamos dmesg with drm.debug=0x6 (118.50 KB, text/plain)
2014-01-28 22:51 UTC, Dylan Baker
Details
dmesg from gentoo 3.13 (102.47 KB, text/plain)
2014-01-29 21:20 UTC, Dylan Baker
Details
dmesg from gento with 3.13-r4-inherit-bios (102.72 KB, text/plain)
2014-01-29 21:21 UTC, Dylan Baker
Details

Description Pierre-Loup A. Griffais 2014-01-28 03:38:10 UTC
In SteamOS, GRUB is patched to leave the contents of the EFI framebuffer alone when booting the kernel, and the kernel is passed fbcon=vc:2-6 to leave VT1 alone, as to guarantee a smooth transition until X is started later. This works fine for drivers that don't attempt to mess with efifb, but on the Intel driver this results in screen flickering with colorful corruption near the top of the framebuffer, before the framebuffer contents settle to the correct picture.

I believe the Intel folks already have a solid repro scenario for this, but I'm happy to provide more data if others are interested.
Comment 1 Jesse Barnes 2014-01-28 17:59:47 UTC
I have some patches to the Intel driver that may help.  My code is available from the inherit-bios branch of my git tree on fdo: git://people.freedesktop.org/~jbarnes/linux.  Would it be possible for you to try that?
Comment 2 Dylan Baker 2014-01-28 19:53:38 UTC
I tested the inherit-bios branch on my gentoo based ivb-gt2 system. I've uploaded videos of steamos, gentoo with 3.13 from linus tree, and of the inherit-bios kernel. The problem is reduced in the inherit-bios branch, but not fixed entirely. You can get the videos from my fdo account: http://people.freedesktop.org/~dbaker/graphics_corpution_i915/
Comment 3 Jesse Barnes 2014-01-28 20:12:22 UTC
Hm, in the videos, I see some text messages display in both the stock and inherit-bios branches, but no corruption.  The corruption is clearly visible in the steamos video though.

So are you down to trying to get rid of the text messages?
Comment 4 Pierre-Loup A. Griffais 2014-01-28 20:19:45 UTC
I also still seem to see some corruption near the top of the screen in the gentoo_inherit-bios.mp4, but the gentoo environment uses an unpatched GRUB and I'm not sure what initial mode the firmware is setting, so it's possible that transition also involves a modeswitch. If possible I would check the patches with a SteamOS GRUB/kernel and a Brix box, since it has a known good EFI firmware.
Comment 5 Dylan Baker 2014-01-28 21:31:34 UTC
Jesse: Unfortunately I can't get rid of the text from my boot the same way that steamos does, as I have an encrypted home partition and would have no way to decrypt it without virtual console 1.
I have uploaded pngs from the gentoo videos at around :03 which show the corruption (http://people.freedesktop.org/~dbaker/graphics_corpution_i915/). It is much harder to see on my system since it boots much faster than the brix box does, this may be becasue I don't use an initrd.

I attempted to apply the top 10 patches from jesse's branch to the steamos source, but they don't apply cleanly and I'm a terrible C programmer on a good day, so I'm not sure what more I'll be able to do without sources.
Comment 6 Jesse Barnes 2014-01-28 22:04:38 UTC
Did you try with i915.fastboot=1? Also, I'd be interested in getting logs from this boot with drm.debug=0x6.  Thanks.
Comment 7 Dylan Baker 2014-01-28 22:15:23 UTC
steamos, or the gentoo system?
Comment 8 Jesse Barnes 2014-01-28 22:23:18 UTC
Gentoo is fine since you can see the corruption there.
Comment 9 Dylan Baker 2014-01-28 22:51:24 UTC
Created attachment 123701 [details]
steamos dmesg with drm.debug=0x6
Comment 10 Jesse Barnes 2014-01-29 20:41:23 UTC
looks like the top of the log got cut off, and did you boot with i915.fastboot=1?  Can you post a log from the gentoo system with fastboot=1 including the early parts?  Thanks.
Comment 11 Dylan Baker 2014-01-29 21:20:44 UTC
Created attachment 123811 [details]
dmesg from gentoo 3.13
Comment 12 Dylan Baker 2014-01-29 21:21:18 UTC
Created attachment 123821 [details]
dmesg from gento with 3.13-r4-inherit-bios
Comment 13 Dylan Baker 2014-01-29 21:25:03 UTC
(In reply to Jesse Barnes from comment #10)
> looks like the top of the log got cut off, and did you boot with
> i915.fastboot=1?  Can you post a log from the gentoo system with fastboot=1
> including the early parts?  Thanks.

The kernel in steamos does not support i915.fastboot, setting it results in i915 not being loaded.
Comment 14 Jesse Barnes 2014-02-04 17:45:10 UTC
Ok I just updated the inherit-bios branch with code that ought to fix this.  I tested it here and it worked, but haven't yet tested on a BRIX box.  I should be able to do that next week when I get home, but in the meantime, can you try it out?

Thanks,
Jesse
Comment 15 Dylan Baker 2014-02-04 18:09:32 UTC
On my Ivybgride it has fixed the issue. My brix box has only steamos installed on it at the moment, but I'll try to fire up ubunut today or tomorrow and check there too.
Comment 16 Pierre-Loup A. Griffais 2014-02-05 19:17:03 UTC
I can try this out as well, but your git repository doesn't appear to be served over HTTP and this page seems to be down:

http://cgit.freedesktop.org/~jbarnes/linux/

If you attach me a patch I can apply on top of mainline I can let you know how it works on the Brix machines running SteamOS.
Comment 17 Jesse Barnes 2014-02-10 22:53:44 UTC
The latest patchset is in this thread (look for the series with the v10 patch):
http://lists.freedesktop.org/archives/intel-gfx/2014-February/039775.html

It applied cleanly last week against the drm-intel-nightly branch.

The git repo should be available through anonymous git using git:// if you want to use that instead.
Comment 18 Pierre-Loup A. Griffais 2014-02-27 03:23:33 UTC
Looks like this is far from applying cleanly on our 3.10 kernel, as intel_fbdev.c doesn't even exist there. For now we'll just live with this problem until someone becomes annoyed enough to do the rebase themselves. Thanks for looking into this, I saved the patch series for future use.
Comment 19 Jesse Barnes 2014-02-27 16:22:23 UTC
I'll install the latest SteamOS on my system in the meantime and see how hard a backport would be (the file used to be called intel_fb.c, but there are quite a few changes to deal with beyond that).
Comment 20 Chris Wilson 2014-02-27 20:21:53 UTC
If the goal is to simply fix the corruption (and potential GPU hangs), we can just disable all outputs at the beginning of i915.ko. That used to be a trivial operation...
Comment 21 Pierre-Loup A. Griffais 2014-02-27 20:51:31 UTC
Would that still result in a seamless transition between the bootloader and the driver, with no flickering of any kind?
Comment 22 Chris Wilson 2014-02-27 20:56:38 UTC
No, it hides the corruption by turning the outputs for ~.3s between loading of i915.ko and enabling fbcon. It is what the code used to do...

fastboot aims to eliminate all modesets between the BIOS and fbcon, thereby completely eliminate the flicker and corruption. It just has a few hacks remaining as the core modesetting code is not quite intelligent enough yet to handle the seamless transition.
Comment 23 Jani Nikula 2014-09-24 11:57:20 UTC
Jesse, where are we with this bug?
Comment 24 Jesse Barnes 2014-09-24 19:20:17 UTC
I'm not sure if anyone has tried to reproduce this now that the fbcon takeover code has landed, it may no longer be an issue.

Pierre-Loup, any updates?
Comment 25 Pierre-Loup A. Griffais 2014-09-24 19:23:17 UTC
Can you point me at the release I should be testing and any non-default parameters I should be passing at boot in order to try and reproduce the problem with the fbcon takeover code in effect?
Comment 26 Jesse Barnes 2014-09-24 19:42:57 UTC
Just the current drm-intel-nightly tree from git://anongit.freedesktop.org/drm-intel with the default parameters ought to be enough for testing.

You can also try passing the i915.fastboot=1 parameter on the boot line to see if that makes any difference, but I'd try without it first.
Comment 27 Jani Nikula 2015-01-28 14:15:45 UTC
Presumed fixed upstream, closing. Please reopen if the problem persists with current kernels.

Note You need to log in before you can comment on or make changes to this bug.