Bug 82481

Summary: Onboard Intel GMA X4500HD fails to initialize under 3.16.x
Product: Drivers Reporter: da_audiophile
Component: Video(DRI - Intel)Assignee: Imre Deak (imre.deak)
Status: RESOLVED CODE_FIX    
Severity: high CC: argymeg, da_audiophile, diego.viola, intel-gfx-bugs, leho, manuelkrause, mlambda, oscar, riccardo.magliocchetti
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 3.16.1 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg with debugging enabled
dmesg after error and after starting X
GPU crash dump from '/sys/class/drm/card0/error'

Description da_audiophile 2014-08-15 20:36:02 UTC
Created attachment 146771 [details]
dmesg with debugging enabled

Upon updating to 3.16.1, I see the following in my dmesg accompanied by a black monitor.  The only solution is to reboot.  Unfortunately, the bug does not occur on every boot.  Seems to occur about 10 % of the time.

I have enabled debugging by creating /etc/modprobe.d/i915.conf which contains a single line, "options drm debug=0xe" and attached the output of dmesg with that enabled.  Note - my initramfs does not have i915 compiled in if that is important.  Glad to provide additional details.

% lspci -v
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])
	Subsystem: Gigabyte Technology Co., Ltd GA-EG45M-DS2H Mainboard
	Flags: bus master, fast devsel, latency 0, IRQ 47
	Memory at fd800000 (64-bit, non-prefetchable) [size=4M]
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at ff00 [size=8]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [d0] Power Management version 2
	Capabilities: [a4] PCI Advanced Features
	Kernel driver in use: i915
	Kernel modules: i915

Other users are affected by this as well[1],

1. https://bbs.archlinux.org/viewtopic.php?id=185650
Comment 1 da_audiophile 2014-08-15 20:38:58 UTC
I should have added to my initial report that the dmesg output I attached is with the system booting to the non-graphical login prompt.  If I start X after that error is thrown, here is output of dmesg.

...
[  317.190460] [drm:i915_gem_open] 
[  317.190480] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[5] ENCODERS[5]
[  317.190496] [drm:intel_crtc_cursor_set] cursor off
[  317.190500] [drm:intel_crtc_set_config] [CRTC:5] [NOFB]
[  317.190507] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:5], mode_changed=0, fb_changed=0
[  317.190512] [drm:intel_crtc_cursor_set] cursor off
[  317.190515] [drm:intel_crtc_set_config] [CRTC:7] [NOFB]
[  317.190519] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:7], mode_changed=0, fb_changed=0
[  317.214756] [drm:i915_gem_open] 
[  317.231855] [drm:i915_gem_open] 
[  317.231890] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[5] ENCODERS[5]
[  317.234677] [drm:drm_mode_addfb] [FB:22]
[  317.234874] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[5] ENCODERS[5]
[  317.234882] [drm:drm_mode_getresources] CRTC[2] CONNECTORS[5] ENCODERS[5]
[  317.234920] [drm:intel_crtc_cursor_set] cursor off
[  317.234925] [drm:intel_crtc_cursor_set] cursor off
[  317.234928] [drm:drm_mode_getconnector] [CONNECTOR:8:?]
[  317.234937] [drm:drm_mode_getconnector] [CONNECTOR:8:?]
[  317.234965] [drm:drm_mode_getconnector] [CONNECTOR:11:?]
[  317.234970] [drm:drm_mode_getconnector] [CONNECTOR:11:?]
[  317.234991] [drm:drm_mode_getconnector] [CONNECTOR:15:?]
[  317.234996] [drm:drm_mode_getconnector] [CONNECTOR:15:?]
[  317.235016] [drm:drm_mode_getconnector] [CONNECTOR:17:?]
[  317.235022] [drm:drm_mode_getconnector] [CONNECTOR:17:?]
[  317.235042] [drm:drm_mode_getconnector] [CONNECTOR:19:?]
[  317.235048] [drm:drm_mode_getconnector] [CONNECTOR:19:?]
[  317.277392] [drm:drm_mode_addfb] [FB:22]
[  317.277412] [drm:drm_mode_setcrtc] [CRTC:5]
[  317.277415] [drm:intel_crtc_set_config] [CRTC:5] [NOFB]
[  317.277421] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:5], mode_changed=0, fb_changed=0
[  317.277426] [drm:drm_mode_setcrtc] [CRTC:7]
[  317.277428] [drm:intel_crtc_set_config] [CRTC:7] [NOFB]
[  317.277431] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:7], mode_changed=0, fb_changed=0
[  317.351124] [drm:i915_gem_open] 
[  317.351144] [drm:i915_gem_open] 
[  317.957180] [drm:i915_gem_open] 
[  318.247460] [drm:drm_mode_getconnector] [CONNECTOR:8:?]
[  318.247468] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:8:VGA-1]
[  318.247472] [drm:intel_crt_detect] [CONNECTOR:8:VGA-1] force=1
[  318.260009] [drm:intel_crt_detect] CRT not detected via hotplug
[  318.263345] [drm:gmbus_xfer] GMBUS [i915 gmbus vga] NAK for addr: 0050 r(1)
[  318.263350] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  318.263356] [drm:intel_crt_get_edid] CRT GMBUS EDID read failed, retry using GPIO bit-banging
[  318.263360] [drm:intel_gmbus_force_bit] enabling bit-banging on i915 gmbus vga. force bit now 1
[  318.263634] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  318.263637] [drm:intel_gmbus_force_bit] disabling bit-banging on i915 gmbus vga. force bit now 0
[  318.263639] [drm:intel_crt_detect_ddc] CRT not detected via DDC:0x50 [no valid EDID found]
[  318.263643] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:8:VGA-1] disconnected
[  318.263662] [drm:drm_mode_getconnector] [CONNECTOR:11:?]
[  318.263666] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:11:HDMI-A-1]
[  318.263668] [drm:intel_hdmi_detect] [CONNECTOR:11:HDMI-A-1]
[  318.266683] [drm:gmbus_xfer] GMBUS [i915 gmbus dpb] NAK for addr: 0050 r(1)
[  318.266688] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus dpb
[  318.266693] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:11:HDMI-A-1] disconnected
[  318.266704] [drm:drm_mode_getconnector] [CONNECTOR:15:?]
[  318.266708] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:15:DP-1]
[  318.266713] [drm:intel_dp_detect] [CONNECTOR:15:DP-1]
[  318.266717] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:15:DP-1] disconnected
[  318.266724] [drm:drm_mode_getconnector] [CONNECTOR:17:?]
[  318.266728] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:17:HDMI-A-2]
[  318.266732] [drm:intel_hdmi_detect] [CONNECTOR:17:HDMI-A-2]
[  318.270014] [drm:gmbus_xfer] GMBUS [i915 gmbus dpc] NAK for addr: 0050 r(1)
[  318.270018] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus dpc
[  318.270023] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:17:HDMI-A-2] disconnected
[  318.270039] [drm:drm_mode_getconnector] [CONNECTOR:19:?]
[  318.270043] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:19:DP-2]
[  318.270047] [drm:intel_dp_detect] [CONNECTOR:19:DP-2]
[  318.270051] [drm:drm_helper_probe_single_connector_modes_merge_bits] [CONNECTOR:19:DP-2] disconnected
[  318.334450] [drm:intel_dp_detect] [CONNECTOR:15:DP-1]
[  318.334479] [drm:intel_dp_detect] [CONNECTOR:19:DP-2]
[  318.334502] [drm:intel_hdmi_detect] [CONNECTOR:11:HDMI-A-1]
[  318.336698] [drm:gmbus_xfer] GMBUS [i915 gmbus dpb] NAK for addr: 0050 r(1)
[  318.336706] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus dpb
[  318.336756] [drm:intel_hdmi_detect] [CONNECTOR:17:HDMI-A-2]
[  318.340024] [drm:gmbus_xfer] GMBUS [i915 gmbus dpc] NAK for addr: 0050 r(1)
[  318.340029] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus dpc
[  318.340077] [drm:intel_crt_detect] [CONNECTOR:8:VGA-1] force=1
[  318.353358] [drm:intel_crt_detect] CRT not detected via hotplug
[  318.356691] [drm:gmbus_xfer] GMBUS [i915 gmbus vga] NAK for addr: 0050 r(1)
[  318.356696] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  318.356700] [drm:intel_crt_get_edid] CRT GMBUS EDID read failed, retry using GPIO bit-banging
[  318.356704] [drm:intel_gmbus_force_bit] enabling bit-banging on i915 gmbus vga. force bit now 1
[  318.356985] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  318.356987] [drm:intel_gmbus_force_bit] disabling bit-banging on i915 gmbus vga. force bit now 0
[  318.356990] [drm:intel_crt_detect_ddc] CRT not detected via DDC:0x50 [no valid EDID found]
[  318.528978] snd_hda_intel 0000:00:1b.0: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj.
[  318.931874] [drm:i915_gem_open] 
[  318.952707] [drm:drm_mode_addfb] [FB:23]
[  318.975236] [drm:i915_gem_open] 
[  337.144595] [drm:drm_mode_setcrtc] [CRTC:5]
[  337.144602] [drm:intel_crtc_set_config] [CRTC:5] [NOFB]
[  337.144610] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:5], mode_changed=0, fb_changed=0
[  337.144620] [drm:drm_mode_setcrtc] [CRTC:7]
[  337.144623] [drm:intel_crtc_set_config] [CRTC:7] [NOFB]
[  337.144627] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:7], mode_changed=0, fb_changed=0
[  337.149051] [drm:intel_crtc_cursor_set] cursor off
[  337.149054] [drm:intel_crtc_set_config] [CRTC:5] [NOFB]
[  337.149059] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:5], mode_changed=0, fb_changed=0
[  337.149062] [drm:intel_crtc_cursor_set] cursor off
[  337.149064] [drm:intel_crtc_set_config] [CRTC:7] [NOFB]
[  337.149066] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:7], mode_changed=0, fb_changed=0
[  337.165593] [drm:intel_crtc_cursor_set] cursor off
[  337.165601] [drm:intel_crtc_set_config] [CRTC:5] [NOFB]
[  337.165608] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:5], mode_changed=0, fb_changed=0
[  337.165613] [drm:intel_crtc_cursor_set] cursor off
[  337.165616] [drm:intel_crtc_set_config] [CRTC:7] [NOFB]
[  337.165620] [drm:intel_set_config_compute_mode_changes] computed changes for [CRTC:7], mode_changed=0, fb_changed=0
Comment 2 da_audiophile 2014-08-15 20:39:24 UTC
Created attachment 146781 [details]
dmesg after error and after starting X
Comment 3 Diego Viola 2014-08-16 03:54:46 UTC
I have the same problem.

I get this in dmesg:

[   12.413399] [drm:i915_gem_init] *ERROR* Failed to initialize GPU, declaring it wedged

OpenGL is broken. Xv is also broken.

I can't watch any videos in mpv/mplayer/vlc with vo_xv. Also, glxgears returns this:

[diego@myhost ~]$ glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
intel_do_flush_locked failed: Invalid argument
[diego@myhost ~]$ 

Any ideas?
Comment 4 Diego Viola 2014-08-16 03:55:21 UTC
Arch Linux (x86_64) here.
Comment 5 mlambda 2014-08-16 13:04:41 UTC
Same here with Arch Linux x86_64, too:

$lspci -v
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 305a
        Flags: bus master, fast devsel, latency 0, IRQ 43
        Memory at fe400000 (64-bit, non-prefetchable) [size=4M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at dc00 [size=8]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915
$dmesg
[    5.208389] [drm] Memory usable by graphics device = 2048M
[    5.208393] [drm] Replacing VGA console driver
[    5.208397] checking generic (d0000000 300000) vs hw (d0000000 10000000)
[    5.208398] fb: switching to inteldrmfb from VESA VGA
[    5.208419] Console: switching to colour dummy device 80x25
[    5.226719] i915 0000:00:02.0: irq 43 for MSI/MSI-X
[    5.226732] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    5.226734] [drm] Driver supports precise vblank timestamp query.
[    5.226804] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    5.283364] [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 (valid? 1) head 0000b174 tail 00000000 start 00303000 [expected 00303000]
[    5.283378] [drm:i915_gem_init] *ERROR* Failed to initialize GPU, declaring it wedged

$uname -a
Linux xxxx 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux
Comment 6 mlambda 2014-08-17 13:10:06 UTC
Created attachment 146901 [details]
GPU crash dump from '/sys/class/drm/card0/error'

Sometimes, I can make the error disappear by rebooting, but now I got a new error (I'm not quite sure, how to reproduce this one, though):

$dmesg
[10633.643449] [drm] GPU HANG: ecode -1:0x00000000, reason: Command parser error, iir 0x0d23f01d, action: continue
[10633.643453] [drm] GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.
[10633.643454] [drm] Please file a _new_ bug report on bugs.freedesktop.org against DRI -> DRM/Intel
[10633.643455] [drm] drm/i915 developers can then reassign to the right component if it's not a kernel issue.
[10633.643456] [drm] The gpu crash dump is required to analyze gpu hangs, so please always attach it.
[10633.643457] [drm] GPU crash dump saved to /sys/class/drm/card0/error
Comment 7 Diego Viola 2014-08-20 13:51:14 UTC
They have submitted some patches here that apparently solves the problem:

https://bugs.freedesktop.org/show_bug.cgi?id=76554
Comment 8 Jani Nikula 2014-08-20 14:08:11 UTC
(In reply to Diego Viola from comment #7)
> They have submitted some patches here that apparently solves the problem:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=76554

Presuming dupe, fixed by

commit ece4a17d237a79f63fbfaf3f724a12b6d500555c
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Thu Aug 7 16:29:53 2014 +0200

    drm/i915: read HEAD register back in init_ring_common() to enforce ordering
Comment 9 Diego Viola 2014-08-20 14:21:15 UTC
(In reply to Jani Nikula from comment #8)
> (In reply to Diego Viola from comment #7)
> > They have submitted some patches here that apparently solves the problem:
> > 
> > https://bugs.freedesktop.org/show_bug.cgi?id=76554
> 
> Presuming dupe, fixed by
> 
> commit ece4a17d237a79f63fbfaf3f724a12b6d500555c
> Author: Jiri Kosina <jkosina@suse.cz>
> Date:   Thu Aug 7 16:29:53 2014 +0200
> 
>     drm/i915: read HEAD register back in init_ring_common() to enforce
> ordering

Thank you so much for this.

Will Linux 3.16.2 include this fix?
Comment 10 Jani Nikula 2014-08-21 07:36:35 UTC
(In reply to Diego Viola from comment #9)
> Will Linux 3.16.2 include this fix?

Up to the stable team, out of our hands.
Comment 11 Jani Nikula 2014-08-22 12:47:41 UTC
*** Bug 82831 has been marked as a duplicate of this bug. ***
Comment 12 Riccardo Magliocchetti 2014-09-06 19:14:57 UTC
(In reply to Diego Viola from comment #9)
> Will Linux 3.16.2 include this fix?

It looks like it didn't make it
Comment 13 Manuel Krause 2014-10-12 00:24:21 UTC
This particular ducttape-fix from Comment 8 is included in 3.16.4: 
See https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.16.4

But, Jani, it's no duplicate of 
 https://bugs.freedesktop.org/show_bug.cgi?id=76554. 

Some people affected by this BUG may have mixed these BUG's experiences. 

Manuel Krause