Bug 191206 - [drm] radeon or i915 freezes console on UEFI amd64 system
Summary: [drm] radeon or i915 freezes console on UEFI amd64 system
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Jean-Sébastien Pédron
URL:
Keywords: uefi
Depends on:
Blocks:
 
Reported: 2014-06-20 12:11 UTC by Dave Cottlehuber
Modified: 2015-09-03 08:27 UTC (History)
1 user (show)

See Also:


Attachments
Try to map Video BIOS in intel_bios.c (1.38 KB, patch)
2014-06-20 13:14 UTC, Jean-Sébastien Pédron
no flags Details | Diff
Try to map Video BIOS in intel_bios.c (V2) (1.38 KB, patch)
2014-06-23 09:16 UTC, Jean-Sébastien Pédron
no flags Details | Diff
Try to map Video BIOS in intel_bios.c (V2+log) (2.22 KB, patch)
2014-06-26 12:04 UTC, Jean-Sébastien Pédron
no flags Details | Diff
updated dmesg using current kernel + v2 patch (10.38 KB, text/plain)
2014-07-31 08:55 UTC, Dave Cottlehuber
no flags Details
resulting xorg.conf.new (6.77 KB, text/plain)
2014-07-31 09:02 UTC, Dave Cottlehuber
no flags Details
updated dmesg with patch & fixed kernel mw (95.88 KB, text/plain)
2014-07-31 12:08 UTC, Dave Cottlehuber
no flags Details
updated xorg.conf.new (6.77 KB, text/plain)
2014-07-31 12:10 UTC, Dave Cottlehuber
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Cottlehuber freebsd_committer freebsd_triage 2014-06-20 12:11:14 UTC
FreeBSD installs for the first time on this UEFI-only MacBook Pro from 2011 using http://ftp.at.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/11.0/FreeBSD-11.0-CURRENT-amd64-VT-20140614-r267488-memstick-uefi.img.xz

Following steps in https://www.freebsd.org/doc/handbook/x-config.html the console freezes when startx is run after either i915kms or radeonkms driver is loaded. The mouse pointer is still visible on the console, but its frozen completely.

System is still running, and accessible e.g. over ssh. Remote access can be organised if there's a need.

# FreeBSD build

Running -CURRENT UEFI-VT-amd64 image from mid June:
FreeBSD 11.0-CURRENT #0 r267488: Sun Jun 15 05:32:56 UTC 2014 root@grind.freebsd.org:/usr/obj/usr/src/sys/VT amd64

# Hardware

amd64 macbook pro 15" from feb 2011, dual card:

Chipset Model:    Intel HD Graphics 3000
  Type: GPU
  Bus:  Built-In
  VRAM (Total): 512 MB
  Vendor:   Intel (0x8086)
  Device ID:    0x0116
  Revision ID:  0x0009
  gMux Version: 1.9.23

Chipset Model:    AMD Radeon HD 6490M
  Type: GPU
  Bus:  PCIe
  PCIe Lane Width:  x8
  VRAM (Total): 256 MB
  Vendor:   ATI (0x1002)
  Device ID:    0x6760
  Revision ID:  0x0000
  ROM Revision: 113-C0170H-521
  gMux Version: 1.9.23
  EFI Driver Version:   01.00.521

Displays:
Color LCD:
  Display Type: LCD
  Resolution:   1680 x 1050
  Pixel Depth:  32-Bit Color (ARGB8888)
  Main Display: Yes
  Mirror:   Off
  Online:   Yes
  Built-In: Yes

More details at https://gist.github.com/dch/22c28211c539a6d612a4#file-hardware-md

# dmesg

https://gist.githubusercontent.com/dch/22c28211c539a6d612a4#dmesg
https://gist.github.com/dch/22c28211c539a6d612a4#file-dmesg-after-kldload-radeonkms-log

# xorg configure & logs

https://gist.github.com/dch/22c28211c539a6d612a4#file-xorg-conf-new
https://gist.github.com/dch/22c28211c539a6d612a4#file-xorg-configure-log
https://gist.github.com/dch/22c28211c539a6d612a4#file-xorg-0-log

# requested logs

https://gist.github.com/dch/22c28211c539a6d612a4#file-devinfo-vr-log
https://gist.github.com/dch/22c28211c539a6d612a4#file-kldstat-log
https://gist.github.com/dch/22c28211c539a6d612a4#file-rc-conf
https://gist.github.com/dch/22c28211c539a6d612a4#file-pkg-info-log
https://gist.github.com/dch/22c28211c539a6d612a4#file-pciconf-lvbce-log
Comment 1 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-06-20 13:14:36 UTC
Created attachment 143958 [details]
Try to map Video BIOS in intel_bios.c

By reading your dmesg, it seems neither the i915 driver nor the Radeon driver find the Video BIOS. In the i915 case, the card is initialized, but without output connectors. In the Radeon case, the driver aborts the initialization process.

Currently, our i915 driver doesn't read the shadow copy of the Video BIOS, which is available at a fixed location in system memory if the card is the boot display. I attached patch which tries to map that Video BIOS shadow copy (only built-tested).

Could you please try it?
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2014-06-22 04:06:38 UTC
Thanks, building off r267488 (same as the snapshot) + patch, I get:


cc  -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /ramdisk/obj/ramdisk/src/sys/VT/opt_global.h -I. -I@ -I@/contrib/altq -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/ramdisk/obj/ramdisk/src/sys/VT  -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -gdwarf-2 -mno-aes -mno-avx -Qunused-arguments -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-unused-function     -mno-aes -mno-avx -Qunused-arguments -c /ramdisk/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_bios.c
/ramdisk/src/sys/modules/drm2/i915kms/../../../dev/drm2/i915/intel_bios.c:677:36: error: no member named 'dev' in 'struct drm_device'
                vga_dev = device_get_parent(dev->dev);
                                            ~~~  ^
1 error generated.
*** Error code 1


BTW if you have this as a git branch somewhere  can just check that out directly, will be easier :-)
Comment 3 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-06-23 09:16:35 UTC
Created attachment 144059 [details]
Try to map Video BIOS in intel_bios.c (V2)

Oh sorry, I tested it against my development branch where the structure member has a different name... New patch attached! :)

About my development branch (update DRM generic code to match Linux 3.8), it won't work on Intel hardware right now.
Comment 4 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-06-26 12:04:21 UTC
Created attachment 144155 [details]
Try to map Video BIOS in intel_bios.c (V2+log)

Add debug messages to previous patch.
Comment 5 Dave Cottlehuber freebsd_committer freebsd_triage 2014-07-31 08:55:20 UTC
Created attachment 145179 [details]
updated dmesg using current kernel + v2 patch

output of `Xorg -configure`:

.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 11.0-CURRENT amd64
Current Operating System: FreeBSD ice.skunkwerks.at 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r268111: Tue Jul  1 20:56:17 UTC 2014     root@grind.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Build Date: 27 July 2014  01:40:26PM

Current version of pixman: 0.32.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Jul 31 08:21:02 2014
List of video drivers:
        nv
        radeon
        r128
        mach64
        intel
        openchrome
        ati
        vesa
(++) Using config file: "/root/xorg.conf.new"
(II) [KMS] No DRICreatePCIBusID symbol, no kernel modesetting.
Number of created screens does not match number of detected devices.
  Configuration failed.
Server terminated with error (2). Closing log file.
Comment 6 Dave Cottlehuber freebsd_committer freebsd_triage 2014-07-31 09:02:03 UTC
Created attachment 145180 [details]
resulting xorg.conf.new

Further logfiles (Xorg.log etc) at https://gist.github.com/dch/a1a1fb600b50da505698
Comment 7 Dave Cottlehuber freebsd_committer freebsd_triage 2014-07-31 12:08:56 UTC
Created attachment 145183 [details]
updated dmesg with patch & fixed kernel mw

with fixed kernel
Comment 8 Dave Cottlehuber freebsd_committer freebsd_triage 2014-07-31 12:10:22 UTC
Created attachment 145184 [details]
updated xorg.conf.new

output from `Xorg -configure`

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 11.0-CURRENT amd64
Current Operating System: FreeBSD ice.skunkwerks.at 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r269326M: Thu Jul 31 11:21:59 UTC 2014     root@ice:/usr/obj/usr/src/sys/GENERIC amd64
Build Date: 27 July 2014  01:40:26PM

Current version of pixman: 0.32.4
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Jul 31 11:51:02 2014
List of video drivers:
	nv
	radeon
	r128
	mach64
	intel
	openchrome
	ati
	vesa
(++) Using config file: "/root/xorg.conf.new"
(II) [KMS] No DRICreatePCIBusID symbol, no kernel modesetting.
Number of created screens does not match number of detected devices.
  Configuration failed.
Server terminated with error (2). Closing log file.
Comment 9 Dave Cottlehuber freebsd_committer freebsd_triage 2014-07-31 12:13:40 UTC
last but not least Xorg logs updated at https://gist.github.com/dch/a1a1fb600b50da505698
Comment 10 Dave Cottlehuber freebsd_committer freebsd_triage 2015-09-03 08:27:54 UTC
I no longer have this system, it died and was replaced so it seems pointless to leave this open anymore.