On Wed, Nov 13, 2019 at 10:07:08PM -0500, Brennan Vincent wrote:
>
>
> On Thu, 14 Nov 2019, Jonathan Gray wrote:
>
> > On Wed, Nov 13, 2019 at 10:59:47AM -0500, Brennan Vincent wrote:
> > > Hello,
> > >
> > > My kernel always panics on boot, unless I configure it with
> > > `disable amdgpu`, in which case everything is working fine with
> > > the integrated card.
> > >
> > > I have attached the dmesg from both trying to boot with `enable amdgpu`
> > > (as dmesg.bad) and a successful boot with `disable amdgpu`
> > > (as dmesg.good).
> > >
> > > This reproduces every time, on both 6.6 and -current.
> >
> > You hit a fatal error in amdgpu and the console selection in
> > the fallback path doesn't seem to work right.
> >
> > It looks like inteldrm has the same fb memory as efifb. efifb should
> > not attach when amdgpu hits the error as amdgpu is not the primary
> > device setup by uefi.
> >
> > Can you try this diff and report back on which message shows in dmesg?
>
> I have applied your diff, and the machine is now able to boot. I
> suspect from dmesg output that it is using the integrated GPU,
> (specifically because of the line `inteldrm0: 3840x2160, 32bpp`),
> but I don't know how to check for sure. (Is that what you expected?)
Yes, the other GPU will be render only. Machines don't have hardware
muxes anymore.
>
> `efifb primary` is printed.
ok, so drop that patch and try this one:
Index: sys/arch/amd64/amd64/efifb.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/efifb.c,v
retrieving revision 1.25
diff -u -p -r1.25 efifb.c
--- sys/arch/amd64/amd64/efifb.c 13 Oct 2019 10:56:31 -0000 1.25
+++ sys/arch/amd64/amd64/efifb.c 14 Nov 2019 03:22:55 -0000
@@ -520,15 +520,20 @@ efifb_is_primary(struct pci_attach_args
if (pci_mapreg_info(pc, tag, reg, type, &base, &size, NULL))
continue;
- if (bios_efiinfo != NULL && bios_efiinfo->fb_addr != 0)
- return (1);
+ if (bios_efiinfo != NULL &&
+ bios_efiinfo->fb_addr >= base &&
+ bios_efiinfo->fb_addr < base + size)
+ return 1;
+
+ if (efifb_console.paddr >= base &&
+ efifb_console.paddr < base + size)
+ return 1;
if (type & PCI_MAPREG_MEM_TYPE_64BIT)
reg += 4;
}
- /* XXX coreboot framebuffer isn't matched above. */
- return efifb_is_console(pa);;
+ return 0;
}
void