Skip to content

drm/bochs: add the dispi VGA DRM driver - #126

Merged
FengHeting merged 3 commits into
ViudiraTech:developfrom
FengHeting:feature/bochs-drm
Nov 2, 2026
Merged

FengHeting merged 3 commits into
ViudiraTech:developfrom
FengHeting:feature/bochs-drm

Conversation

@FengHeting

Copy link
Copy Markdown
Contributor

Summary

Add a KMS driver for the Bochs dispi VGA adapter used by QEMU stdvga, Bochs and Simics.

  • The adapter exposes a linear 32bpp framebuffer (BAR0) and a small register window (BAR2). The driver discovers the PCI device, maps both BARs and drives the dispi registers, directly or through the legacy 0x1ce/0x1cf index pair, to set the scanout format, pitch and base.
  • EDID is read through the dispi EDID window; the mode list falls back to the adapter's reference modes and the boot geometry.
  • There is no hardware cursor, so the driver composites the cursor into the framebuffer and repaints the area underneath.
  • The console is handed the scanout; when no usable mode exists, the adapter is put back on the boot mode for simpledrm.
  • CONFIG_BOCHS is off by default. The probe is registered after the paravirtual GPU drivers and before the framebuffer fallback, and reports display ownership.

Dependencies

Stacked on the drm core PR for the probe(bool *display_owned) signature and the display-ownership handoff.

Testing

Builds with CONFIG_BOCHS=y; bochs.o and bochs_kms.o compile and bochs_probe is present. The default configuration is unchanged.

Add a KMS driver for the Bochs dispi VGA adapter used by QEMU stdvga,
Bochs and Simics.  The adapter exposes a linear 32bpp framebuffer and a
small register window; the driver discovers the PCI device, maps both
BARs, and drives the dispi registers, directly or through the legacy
0x1ce/0x1cf index pair, to set the scanout format, pitch and base.

The KMS pipeline reads the monitor EDID through the dispi EDID window
and falls back to the adapter's reference modes and the boot geometry.
The adapter has no hardware cursor, so the driver composites the cursor
into the framebuffer and repaints the area under it.  The console is
handed the scanout; if no usable mode exists, the adapter is put back
on the boot mode so simpledrm can keep the console.

CONFIG_BOCHS is off by default.

Signed-off-by: MicroFish <2609948707@qq.com>
Register the bochs probe behind CONFIG_BOCHS, after the paravirtual GPU
drivers and before the framebuffer fallback, so a stdvga adapter takes
the console before simpledrm does.

Signed-off-by: MicroFish <2609948707@qq.com>
@FengHeting
FengHeting merged commit b242731 into ViudiraTech:develop Nov 2, 2026
2 checks passed
@FengHeting
FengHeting deleted the feature/bochs-drm branch November 2, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant