On Tue, Sep 03, 2024 at 01:01:58AM +0300, xezo360hye wrote:
> > Synopsis: Boot fails with Intel GMA 945 (driver i915 crashes)
> > Category: system
> > Environment:
> System : OpenBSD 7.5
> Details : OpenBSD 7.5 (GENERIC) #79: Wed Mar 20 15:33:49 MDT
> 2024
> [email protected]:/usr/src/sys/arch/
> amd64/compile/GENERIC
>
> Architecture: OpenBSD.amd64
> Machine : amd64
>
> > Description:
> I have an old laptop (Fujitsu-Siemens Amilo Li 1820) with Core 2 T5200
> processor and 945 GMA graphics chip in it. I have tried using FreeBSD and
> OpenBSD there. On FreeBSD, the system crashes when I do `kldload i945kms'.
> OpenBSD tries to load the driver itself and crashes on boot, entering ddb.
>
> The kernel panic reason (`show panic') is "*cpu0: can't map aperture". Below
> I've copied the trace from the screen.
>
> panic: can't map aperture
> Stopped at db_enter+0x14: popq %rbp
> TID PID UID PRFLAGS PFLAGS CPU COMMAND
> * 0 0 0 0x10000 0x200 0 swapper
> db_enter() at db_enter+0x14
> panic(ffffffff8217cca3) at panic+0xb5
> i915_ggtt_init_hw(ffff800000078000) at i915_ggtt_init_hw+0x18d
> i915_driver_probe(ffff800000078000,0) at i915_driver_probe+0x407
> inteldrm_attachhook(ffff800000078000) at inteldrm_attachhook+0x47
> config_process_deferred_mountroot() at \
> config_process_deferred_mountroot+0x68
> main(e) at main+0x6cb
> end trace frame: 0x0, count: 8
>
> I'm using the latest OpenBSD release, updated just yesterday. This is a
> full-disk installation made from and used on another machine (which works
> just fine), I've pulled the hard drive and put it into this laptop to see if
> OpenBSD would work better out of the box than FreeBSD. Apparently no.
>
> I should also probably mention that on FreeBSD, the tty works fine until I
> load the i915kms module, OR try to `startx' with `xf86-video-intel'
> installed. Without it X defaults to the `vesa' driver and starts but does
> not give any sane picture (see attachment). In case these are related and
> info from FreeBSD is useful, I've already put the old drive back and will be
> able to provide further information as needed. I can also provide additional
> info about the OpenBSD system I'm running (although it's pretty much a fresh
> installation, except a few packages were added) but only when booted from
> another laptop.
>
> > How-To-Repeat:
> step 1. boot openbsd on system with 945GMA chip
> step 2. watch openbsd die
>
>
> I'd be glad if I could somehow help to solve this issue, but please note
> that I'm very new to OpenBSD so don't expect me to rewrite a driver on my
> own.
look for a bios option to change the amount of stolen/video memory
This diff (against -current) turns the panic into a printf.
It should allow the console to go back to vga when this occurs.
to temporarily disable inteldrm, at the boot prompt
boot -c
disable inteldrm*
quit
Index: sys/dev/pci/drm/i915/gt/intel_ggtt.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/gt/intel_ggtt.c,v
diff -u -p -r1.12 intel_ggtt.c
--- sys/dev/pci/drm/i915/gt/intel_ggtt.c 13 Aug 2024 00:08:07 -0000
1.12
+++ sys/dev/pci/drm/i915/gt/intel_ggtt.c 2 Sep 2024 22:46:09 -0000
@@ -101,8 +101,12 @@ static int ggtt_init_hw(struct i915_ggtt
PG_PMAP_WC);
if (bus_space_map(i915->bst, ggtt->gmadr.start,
ggtt->mappable_end,
- BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, &bsh))
- panic("can't map aperture");
+ BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, &bsh)) {
+ printf("%s: can't map aperture\n",
+ i915->sc_dev.dv_xname);
+ ggtt->vm.cleanup(&ggtt->vm);
+ return -EIO;
+ }
ggtt->iomap.base = ggtt->gmadr.start;
ggtt->iomap.size = ggtt->mappable_end;
ggtt->iomap.iomem = bus_space_vaddr(i915->bst, bsh);