OpenBSD Journal

KMS for Apple silicon machines

Contributed by rueda on from the kettenis-makes-smoother dept.

Mark Kettenis (kettenis@) committed support for Kernel Mode-Setting (KMS) on Apple silicon (arm64) machines:

Module name:	src
Changes by:	2024/01/22 11:54:01

Modified files:
	sys/arch/arm64/conf: GENERIC 
	sys/dev/pci/drm: files.drm 
	sys/dev/pci/drm/include/generated: autoconf.h 
Added files:
	sys/dev/pci/drm/apple: afk.c afk.h apldcp.c apldrm.c apple_drv.c 
	                       dcp-internal.h dcp.c dcp.h 
	                       dcp_backlight.c dptxep.c dptxep.h 
	                       ibootep.c iomfb.c iomfb.h 
	                       iomfb_internal.h iomfb_template.c 
	                       iomfb_template.h iomfb_v12_3.c 
	                       iomfb_v12_3.h iomfb_v13_3.c iomfb_v13_3.h 
	                       parser.c parser.h systemep.c trace.c 
	                       trace.h version_utils.h 
	sys/dev/pci/drm/include/linux: apple-mailbox.h args.h 
	sys/dev/pci/drm/include/linux/soc/apple: rtkit.h 

Log message:
Add apldcp(4) and apldrm(4).  Together these drivers provide KMS
functionality on Apple Silicom machines.  At this point the drivers
provide significant power savings when the display is blanked (and
during suspend) and backlight control.  Some support for HDMI output
is also included, but for now only when HDMI is used as the primary output.
In the future this should also provide displayport support.

This is a port of the the Asahi Linux drivers which can be found at

Note that this branch gets rebased from time to time.

These drivers do *not* bring us GPU accelerated graphics.  But there
are reports that things run "smoother".

There are some known bugs with backlight control: the backlight level
may not be restored properly after the display has been blanked, and
changing the backlight quickly un succession may break the backlight

ok jsg@

There have been several followup commits, and an important message to arm@:

Yesterday I committed apldcp(4) and apldrm(4).  Together these drivers
provide KMS (kernel mode setting) for the display subsystem on Apple
M1/M2 machines.  These drivers rely on up-to-date apple-boot firmware.
If you're not using sysupgrade(4) to update, you'll need to run the
following commands before booting a new kernel:

  # fw_update
  # installboot sd0

The drivers still have some rough edges.  I hope to iron those out in
the coming weeks.



(Comments are closed)


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]