freebsd / drm-kmod

drm driver for FreeBSD
157 stars 68 forks source link

i915kms from drm-61-kmod causes kernel panic with A380 card #319

Open oyvinht opened 1 month ago

oyvinht commented 1 month ago

Describe the bug Kernel panic when loading i915kms, as shown in image below.

FreeBSD version FreeBSD beta-orionis 14.1-RELEASE-p3 FreeBSD 14.1-RELEASE-p3 GENERIC amd64 1401000 1401000

PCI Info

hostb0@pci0:0:0:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14d8 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI none0@pci0:0:0:2: class=0x080600 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14d9 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = base peripheral subclass = IOMMU hostb1@pci0:0:1:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14da subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI pcib1@pci0:0:1:1: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x14db subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = PCI-PCI hostb2@pci0:0:2:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14da subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI pcib5@pci0:0:2:1: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x14db subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = PCI-PCI pcib13@pci0:0:2:2: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x14db subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = PCI-PCI hostb3@pci0:0:3:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14da subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb4@pci0:0:4:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14da subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb5@pci0:0:8:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14da subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI pcib14@pci0:0:8:1: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x14dd subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = PCI-PCI pcib15@pci0:0:8:3: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x14dd subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = PCI-PCI none1@pci0:0:20:0: class=0x0c0500 rev=0x71 hdr=0x00 vendor=0x1022 device=0x790b subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH SMBus Controller' class = serial bus subclass = SMBus isab0@pci0:0:20:3: class=0x060100 rev=0x51 hdr=0x00 vendor=0x1022 device=0x790e subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH LPC Bridge' class = bridge subclass = PCI-ISA hostb6@pci0:0:24:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e0 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb7@pci0:0:24:1: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e1 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb8@pci0:0:24:2: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e2 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb9@pci0:0:24:3: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e3 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb10@pci0:0:24:4: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e4 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb11@pci0:0:24:5: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e5 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb12@pci0:0:24:6: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e6 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI hostb13@pci0:0:24:7: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x14e7 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = bridge subclass = HOST-PCI pcib2@pci0:1:0:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x8086 device=0x4fa1 subvendor=0x0000 subdevice=0x0000 vendor = 'Intel Corporation' class = bridge subclass = PCI-PCI pcib3@pci0:2:1:0: class=0x060400 rev=0x00 hdr=0x01 vendor=0x8086 device=0x4fa4 subvendor=0x8086 subdevice=0x4fa4 vendor = 'Intel Corporation' class = bridge subclass = PCI-PCI pcib4@pci0:2:4:0: class=0x060400 rev=0x00 hdr=0x01 vendor=0x8086 device=0x4fa4 subvendor=0x8086 subdevice=0x0000 vendor = 'Intel Corporation' class = bridge subclass = PCI-PCI vgapci0@pci0:3:0:0: class=0x030000 rev=0x05 hdr=0x00 vendor=0x8086 device=0x56a5 subvendor=0x1849 subdevice=0x6006 vendor = 'Intel Corporation' device = 'DG2 [Arc A380]' class = display subclass = VGA hdac0@pci0:4:0:0: class=0x040300 rev=0x00 hdr=0x00 vendor=0x8086 device=0x4f92 subvendor=0x1849 subdevice=0x6006 vendor = 'Intel Corporation' device = 'DG2 Audio Controller' class = multimedia subclass = HDA pcib6@pci0:5:0:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f4 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Upstream Port' class = bridge subclass = PCI-PCI pcib7@pci0:6:0:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI pcib8@pci0:6:8:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI pcib9@pci0:6:9:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI pcib10@pci0:6:10:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI pcib11@pci0:6:12:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI pcib12@pci0:6:13:0: class=0x060400 rev=0x01 hdr=0x01 vendor=0x1022 device=0x43f5 subvendor=0x1b21 subdevice=0x3328 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset PCIe Switch Downstream Port' class = bridge subclass = PCI-PCI re0@pci0:10:0:0: class=0x020000 rev=0x05 hdr=0x00 vendor=0x10ec device=0x8125 subvendor=0x1043 subdevice=0x87d7 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8125 2.5GbE Controller' class = network subclass = ethernet xhci0@pci0:11:0:0: class=0x0c0330 rev=0x01 hdr=0x00 vendor=0x1022 device=0x43f7 subvendor=0x1b21 subdevice=0x1142 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset USB 3.2 Controller' class = serial bus subclass = USB ahci0@pci0:12:0:0: class=0x010601 rev=0x01 hdr=0x00 vendor=0x1022 device=0x43f6 subvendor=0x1b21 subdevice=0x1062 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = '600 Series Chipset SATA Controller' class = mass storage subclass = SATA nvme0@pci0:13:0:0: class=0x010802 rev=0x01 hdr=0x00 vendor=0x1987 device=0x5016 subvendor=0x1987 subdevice=0x5016 vendor = 'Phison Electronics Corporation' device = 'E16 PCIe4 NVMe Controller' class = mass storage subclass = NVM vgapci1@pci0:14:0:0: class=0x030000 rev=0xc2 hdr=0x00 vendor=0x1002 device=0x164e subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Raphael' class = display subclass = VGA hdac1@pci0:14:0:1: class=0x040300 rev=0x00 hdr=0x00 vendor=0x1002 device=0x1640 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Rembrandt Radeon High Definition Audio Controller' class = multimedia subclass = HDA none2@pci0:14:0:2: class=0x108000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x1649 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Family 19h PSP/CCP' class = encrypt/decrypt xhci1@pci0:14:0:3: class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15b6 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = serial bus subclass = USB xhci2@pci0:14:0:4: class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15b7 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = serial bus subclass = USB xhci3@pci0:15:0:0: class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15b8 subvendor=0x1043 subdevice=0x8877 vendor = 'Advanced Micro Devices, Inc. [AMD]' class = serial bus subclass = USB

DRM KMOD version drm-61-kmod 6.1.92

To Reproduce Install an Intel A380 card. The one used here is an ASRock Intel Arc A380 Low Profile.

Then do either:

sudo kldload i915kms

or start Xorg with the "intel" driver.

Screenshots intel_debug

Additional context

lin72h commented 1 month ago

I think you need newly merged 6.6-drm-kmod for intel discrete GPU

oyvinht commented 1 month ago

Oh, right, thanks. That requires 15-CURRENT to compile, I guess.

oyvinht commented 4 weeks ago

For what it's worth, I complied drm-kmod on 14-stable, and did some rudimentary debugging.

For now, I discovered that I could at least replace the normal UEFI framebuffer and switch the console to 3840 x 2160 by commenting out from drivers/gpu/drm/i915/i915_gem.c:

@@ -1192,12 +1192,12 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
         * FIXME: break up the workarounds and apply them at the right time!
         */
        intel_clock_gating_init(dev_priv);
-
+        /*
        for_each_gt(gt, dev_priv, i) {
                ret = intel_gt_init(gt);
                if (ret)
                        goto err_unlock;
-       }
+       }*/

and add a return before setting ppgtt->vm.insert_page = gen8_ppgtt_insert_entry; in drivers/gpu/drm/i915/gt/gen8_ppgtt.c.

I'll see if I can find the time to debug a little deeper.

It crashed on starting X with modesetting, though (I have no debugger screenshot).