[PATCH v2 0/7] Add support for QEMU's ramfb display

Alper Nebi Yasak alpernebiyasak at gmail.com
Tue Aug 22 14:10:18 CEST 2023


This is a rebase of Alexander Graf's QEMU ramfb support series with
some changes of mine, in part to address reviews and to accommodate
other changes enabling Bochs video driver. The original cover letter is
as follows:

> QEMU implements multiple ways to expose graphics output to the virt
> machine, but most of them are incompatible with hardware virtualization.
>
> The one that does work reliably is ramfb. It's a very simple mechanism
> in which the guest reserves a memory region for the frame buffer and then
> notifies the host about its location and properties. The host then just
> displays the contents of the frame buffer on screen.
>
> This patch set adds support to drive the ramfb device in our QEMU arm
> targets. Theoretically, it should work as is with any of the other
> architectures as well though.
>
> With this driver, we have a very simple, KVM compatible way to expose
> GOP via UEFI to payloads and thus enable development and testing of
> graphical OS functionality with QEMU's -M virt.

Inspired by the "video: bochs: Remove the x86 limitation" series [1]
that was recently merged, I have also sent a series adding Bochs
video device support for ARM [2], and assuming that would get merged
before this I've rebased this on that to avoid conflicts.

[1] https://lore.kernel.org/u-boot/20230723044041.1089804-1-bmeng@tinylab.org/
[2] https://lore.kernel.org/u-boot/20230814173944.288356-1-alpernebiyasak@gmail.com/

Changes in v2:
- Remove extra "depends on DM_VIDEO" already in "if VIDEO"
- Drop drivers/video/MAINTAINERS file
- Decouple framebuffer allocation from EFI_LOADER
- Add .bind() method for ramfb driver
- Make resolution configurable with kconfig
- Move struct to qfw.h and add comments for members
- Use RAMFB_* definitions instead of DEFAULT_*
- Use if (IS_ENABLED(CONFIG_VIDEO_RAMFB)) instead of #ifdef
- Add patch "qfw: Add flag to allow probing before relocation"
- Rebase on "qemu: arm: Enable Bochs, console buffering, USB keyboard"
- Drop env changes from ARM (necessary but in prerequisite series)
- Drop imply VIDEO, SYS_CONSOLE_IN_ENV changes from ARM (in prereq.)
- Probe QFW in ARM QEMU board_early_init_f to bind ramfb pre-reloc
- Add IS_ENABLED(CONFIG_QFW) check and error handling to ARM QEMU
- Drop imply VIDEO, env changes from RISC-V patch (in u-boot/next)
- Drop imply SYS_CONSOLE_IS_IN_ENV from RISC-V patch (def. y if VIDEO)
- Probe QFW in RISC-V QEMU board_early_init_f to bind ramfb pre-reloc
- Add IS_ENABLED(CONFIG_QFW) check and error handling to RISC-V QEMU
- Add patch "x86: qemu: Enable ramfb by default"

v1: https://lore.kernel.org/u-boot/20220227144043.37359-1-agraf@csgraf.de/

Alexander Graf (5):
  qfw: Add WRITE definition
  ramfb: Add driver for ramfb display
  qfw: Spawn ramfb device if its file is present
  arm: qemu: Enable ramfb by default
  riscv: qemu: Enable ramfb by default

Alper Nebi Yasak (2):
  qfw: Add flag to allow probing before relocation
  x86: qemu: Enable ramfb by default

 arch/arm/Kconfig                        |  3 +
 arch/x86/cpu/qemu/Kconfig               |  4 +
 board/emulation/qemu-arm/qemu-arm.c     | 41 +++++++++++
 board/emulation/qemu-riscv/Kconfig      |  5 ++
 board/emulation/qemu-riscv/qemu-riscv.c | 41 +++++++++++
 board/emulation/qemu-x86/qemu-x86.c     | 47 ++++++++++++
 configs/qemu-x86_64_defconfig           |  4 +-
 configs/qemu-x86_defconfig              |  1 -
 drivers/misc/qfw.c                      | 25 +++++++
 drivers/misc/qfw_mmio.c                 |  1 +
 drivers/misc/qfw_pio.c                  |  1 +
 drivers/misc/qfw_sandbox.c              |  1 +
 drivers/video/Kconfig                   | 30 ++++++++
 drivers/video/Makefile                  |  1 +
 drivers/video/ramfb.c                   | 97 +++++++++++++++++++++++++
 include/qfw.h                           | 11 +++
 16 files changed, 309 insertions(+), 4 deletions(-)
 create mode 100644 drivers/video/ramfb.c


base-commit: 832148f675e427060be074c276956962fa9b5cb6
prerequisite-patch-id: 2c8662d18f6f1e2d4e014bcd5d468e0396064f4f
prerequisite-patch-id: 5f3e5e1d814187841ce299df0da16df16d0121c3
prerequisite-patch-id: adbd0fb953e726ea5ea0b248e00092dfc318fd46
prerequisite-patch-id: 7470d3af5e9ded16eb5a4de7c7264062dcb3ef7f
-- 
2.40.1



More information about the U-Boot mailing list