FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

radeonkms / Kaveri / R7 with UEFI boot crash on load #147

Closed RealDeuce closed 2 years ago

RealDeuce commented 7 years ago

radeonkms crashes on load on my system. Device is not supported by amdgpu,

core.txt

This system isn't going anywhere, so when you have time to look at radeonkms, I'll still have it available to verify.

RealDeuce commented 7 years ago

Adding pciconf output, ioread32() is in the I/O space

vgapci0@pci0:0:1:0: class=0x030000 card=0x225e103c chip=0x13131002 rev=0x00 hdr=0x00 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Kaveri [Radeon R7 Graphics]' class = display subclass = VGA bar [10] = type Prefetchable Memory, range 64, base 0xd0000000, size 268435456, enabled bar [18] = type Prefetchable Memory, range 64, base 0xe0000000, size 8388608, enabled bar [20] = type I/O Port, range 32, base 0xf000, size 256, enabled bar [24] = type Memory, range 32, base 0xff700000, size 262144, enabled cap 09[48] = vendor (length 8) cap 01[50] = powerspec 3 supports D0 D1 D2 D3 current D0 cap 10[58] = PCI-Express 2 root endpoint max data 128(256) RO NS cap 05[a0] = MSI supports 1 message, 64 bit ecap 000b[100] = Vendor 1 ID 1 ecap 0019[270] = PCIe Sec 1 lane errors 0 ecap 000f[2b0] = ATS 1 ecap 0013[2c0] = unknown 1 ecap 001b[2d0] = unknown 1 PCI-e errors = Non-Fatal Error Detected Unsupported Request Detected

RealDeuce commented 7 years ago

After noticing this:

drmn0: failed to load firmware image radeon_BONAIRE_vce_bin drmn0: radeon_vce: Can't load firmware "radeon/BONAIRE_vce.bin" drmn0: failed VCE (-2) init.

I did a search/replace s|radeon/BONAIRE|radeon/bonaire|g to match to .ko filename and got better results, but it still crashed.

core.txt

I noticed the failed firmware version check, so I disabled lines 130-134 of In drivers/gpu/drm/radeon/radeon_vce.c ("/ we can only work with this fw version for now /") and it still crashed.

core2.txt

The log from before I disabled the firmware check actually looks better since there's no "disabling GPU acceleration" line.

I rebuilt the kernel without vt(4) and VESA in case there was an interaction of some kind with vt(4). I had to remove the vt_fb_attach/detach calls as well or the drm module wouldn't load, but it still crashed.

core3.txt

After that, I retried amdgpu in case the case mismatch was the cause.

It loads without crashing, but I got the following errors: [drm] Initialized [drm] amdgpu kernel modesetting enabled. [drm:drm_pci_init] linux_pci_find failed!

Turns out the PCI ID is inside an #ifdef CONFIG_DRM_AMDGPU_CIK, so I added that to drivers/gpu/drm/drm_os_config.h, and it appears to have attached fine, but just running a simple modeset test from drm-howto crashed the system:

core4.txt

And with that, I'm done for the night. I'm happy to test anything further.

RealDeuce commented 7 years ago

Quickly hacking ioread32()/iowrite32() to inl()/outl() allows both radeonkms and amgpu to work correctly with the modeset utility.

ghost commented 6 years ago

@RealDeuce I am running FreeBSD at my second machine with Kaveri APU using radeonkms. X.org uses modesetting by default and everything just works. So this issue is no longer true. But I didn't test amdgpu (do we need amdgpu at kaveri anyway?).