FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

amdgpu doesn't load on current #137

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi, It used to work with a kernel from january but it's broken now ;

FreeBSD 13.0-CURRENT #1 r345299

[drm] amdgpu kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io [drm] initializing kernel modesetting (OLAND 0x1002:0x6608 0x1028:0x2120 0x00). [drm] register mmio base: 0xF7E00000 [drm] register mmio size: 262144 [drm] PCI I/O BAR is not found. [drm] BIOS signature incorrect 0 0 ATOM BIOS: 113-C5790300-101 [drm] vm size is 64 GB, 2 levels, block size is 10-bit, fragment size is 9-bit drmn0: successfully loaded firmware image with name: radeon/oland_mc.bin drmn0: VRAM: 2048M 0x000000F400000000 - 0x000000F47FFFFFFF (2048M used) drmn0: GTT: 1024M 0x0000000000000000 - 0x000000003FFFFFFF Failed to add WC MTRR for [0xe0000000-0xefffffff]: -22; performance may suffer [drm] Detected VRAM RAM=2048M, BAR=256M [drm] RAM width 128bits DDR3 [drm:amdgpu_ttm_global_init] Failed setting up TTM memory accounting subsystem. [drm:amdgpu_device_ip_init] sw_init of IP block failed -12 drmn0: amdgpu_device_ip_init failed drmn0: Fatal error during GPU init [drm] amdgpu: finishing device. vgapci0: child drmn0 requested pci_disable_io vgapci0: child drmn0 requested pci_disable_io device_attach: drmn0 attach returned 12

vgapci0@pci0:1:0:0: class=0x030000 card=0x21201028 chip=0x66081002 rev=0x00 hdr=0x00 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Oland GL [FirePro W2100]' class = display subclass = VGA

gldisater commented 5 years ago

current r345127 and later panic on kldload amdgpu with drm-v4.16/drm-v4.16-fbsd13.0 and graphics/drm-current-kmod

https://share.icloud.com/photos/09OpjtyDsf71uh7xh8ps08wpw

I've had to go back to r345089 to have a working amdgpu. I'm using a Ryzen 7 1700 w/ rx480

johalun commented 5 years ago

I've had to go back to r345089

Do you have the exact revision that breaks it?

johalun commented 5 years ago

Some of the updates for linuxkpi 5.0 went in prematurely. These are r345090 -> r345110. Would be nice to know which one cause the breakage if someone could bisect.. I won't be able to spend time on this until Thursday afternoon UTC.

The drm-v4.16-fbsd13.0 branch is meant to be used when all updates are committed which will be soon.

johalun commented 5 years ago

The only think I can find in base linuxkpi that could cause problems is changes to DMAATTR* macros. This would however not be a problem is drm drivers are rebuilt from source against > r345127. Can you confirm that this is done?

gldisater commented 5 years ago

r345101 works with drm-v4.16, 102->115 fail to compile the kms-drm module - 127 compiles the module but panics the system on kldload

ghost commented 5 years ago

I'm here: 345103 good 345106 bad

johalun commented 5 years ago

@gldisater That's just because of a double define. IS_ALIGNED I think. You can easily get it to build if you remove the one in drm code or base.

ghost commented 5 years ago

it's https://svnweb.freebsd.org/base?view=revision&revision=345105

johalun commented 5 years ago

Hmm.. That is weird. It means that an error that was previously ignored is now detected...

johalun commented 5 years ago

Yep, a lot of them are failing. (return value oid = NULL)

--SNIP--
sysfs_create_dir: name: i2c-5, oid 0xfffff80015b64000
sysfs_create_dir: name: i2c-6, oid 0xfffff80015b63f00
sysfs_create_dir: name: i2c-7, oid 0xfffff80015b63e80
[drm] vm size is 64 GB, 2 levels, block size is 10-bit, fragment size is 9-bit
[drm:gmc_v8_0_init_microcode] 
drmn0: successfully loaded firmware image with name: amdgpu/polaris10_mc.bin
drmn0: VRAM: 8192M 0x000000F400000000 - 0x000000F5FFFFFFFF (8192M used)
drmn0: GTT: 256M 0x0000000000000000 - 0x000000000FFFFFFF
Successfully added WC MTRR for [0xe0000000-0xefffffff]: 0; 
[drm] Detected VRAM RAM=8192M, BAR=256M
[drm] RAM width 256bits GDDR5
sysfs_create_dir: name: memory_accounting, oid 0
sysfs_create_dir: name: kernel, oid 0
sysfs_create_file: name: kernel, oid 0
sysfs_create_file: name: kernel, oid 0
sysfs_create_file: name: kernel, oid 0
sysfs_create_file: name: kernel, oid 0
sysfs_create_file: name: kernel, oid 0
sysfs_create_dir: name: dma32, oid 0
sysfs_create_file: name: dma32, oid 0
sysfs_create_file: name: dma32, oid 0
sysfs_create_file: name: dma32, oid 0
sysfs_create_file: name: dma32, oid 0
sysfs_create_file: name: dma32, oid 0
[TTM] Zone  kernel: Available graphics memory: 3614640 kiB
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
sysfs_create_dir: name: pool, oid 0
sysfs_create_file: name: pool, oid 0
sysfs_create_file: name: pool, oid 0
sysfs_create_file: name: pool, oid 0
sysfs_create_dir: name: buffer_objects, oid 0
sysfs_create_file: name: buffer_objects, oid 0
[drm] amdgpu: 8192M of VRAM memory ready
[drm] amdgpu: 5294M of GTT memory ready.
i_size_write unimplemented
[drm] GART: num cpu pages 65536, num gpu pages 65536
[drm] PCIE GART of 256M enabled (table at 0x000000F400040000).
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
--SNIP--
johalun commented 5 years ago

Fixed and tested on 13-CURRENT here https://github.com/FreeBSDDesktop/kms-drm/tree/drm-v4.16 Can someone test this branch on a 12-RELEASE system to make sure nothing's broken? If OK, I'll cherry-pick this fix into the ports branch.

gldisater commented 5 years ago

drm-v4.16 does not compile on r345383 - unable to find pci_if.h

johalun commented 5 years ago

@gldisater try now.

gldisater commented 5 years ago

works on current for me now, i don't have a 12 BE on this system, but I could probably install one later

gldisater commented 5 years ago

Works for me on 12-STABLE

johalun commented 5 years ago

Awesome, thank you!

ghost commented 5 years ago

I have the following problem on 12.0-release (I don't use -RELEASE branch, expect pebkac): kldload /boot/modules/amdgpu.ko KLD amdgpu.ko: depends on ttm - not available or version mismatch

ls -l /boot/modules/ttm.ko ls: /boot/modules/ttm.ko: No such file or directory

cp /usr/ports/graphics/drm-fbsd12.0-kmod/work/stage/boot/modules/ttm.ko /boot/modules/ kldload /boot/modules/amdgpu.ko

It works after that

johalun commented 5 years ago

Yes that is expected since the port is not updated yet. I wanted to confirm that it works on 12.0 first. Thanks for locating the problem and testing! I'll get the port updated today.

ghost commented 5 years ago

It's also ok for me on current

johalun commented 5 years ago

Fixed in ports with https://svnweb.freebsd.org/ports?view=revision&revision=496567

ghost commented 5 years ago

thanks!