Because of the way the Linux code behind apldrm(4) is structured it may
authorkettenis <kettenis@openbsd.org>
Mon, 29 Jan 2024 14:52:25 +0000 (14:52 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 29 Jan 2024 14:52:25 +0000 (14:52 +0000)
commitd788c4b21dd74bf3351258127a1ef2e91853b42c
tree51a7cc90a650fd3f574911a7ff7e6c7fd64d0436
parent4ee61787c81c9528bbb35ce669563a9280e3c97a
Because of the way the Linux code behind apldrm(4) is structured it may
fail to create a framebuffer without propagating an error to its callers.
Prevent a kernel panic by explicitly checking that we have a framebuffer.
To prevent us ending up with no framebuffer at all, only claim the
framebuffer in apldrm(4) when we actually created our own.  Delay the
attach of simplefb(4) such that we check whether someone else claimed its
framebuffer until apldrm(4) has done its thing.

tested by robert@
ok jsg@
sys/arch/arm64/dev/mainbus.c
sys/dev/pci/drm/apple/apldrm.c