Skip to contentSkip to conversation

drm/bochs: new driver

PATCH In review Gerd Hoffmann 3 participants 4 messages Dec 17, 2013 – Dec 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/bochs: new driver

DRM driver for (virtual) vga cards using the bochs dispi interface, such as the qemu standard vga (qemu -vga std).

Don't bother supporting anything but 32bpp for now, even though the virtual hardware is able to do that.

Known issue: mmap(/dev/fb0) doesn't work.

---
[ v2: fix 32bit build ]

---
 drivers/gpu/drm/Kconfig             |   2 +
 drivers/gpu/drm/Makefile            |   1 +
 drivers/gpu/drm/bochs/Kconfig       |  11 +
 drivers/gpu/drm/bochs/Makefile      |   4 +
 drivers/gpu/drm/bochs/bochs.h       | 164 +++++++++++
 drivers/gpu/drm/bochs/bochs_drv.c   | 178 ++++++++++++
 drivers/gpu/drm/bochs/bochs_fbdev.c | 215 ++++++++++++++
 drivers/gpu/drm/bochs/bochs_hw.c    | 177 ++++++++++++
 drivers/gpu/drm/bochs/bochs_kms.c   | 294 +++++++++++++++++++
 drivers/gpu/drm/bochs/bochs_mm.c    | 546 ++++++++++++++++++++++++++++++++++++
 10 files changed, 1592 insertions(+)
 create mode 100644 drivers/gpu/drm/bochs/Kconfig
 create mode 100644 drivers/gpu/drm/bochs/Makefile
 create mode 100644 drivers/gpu/drm/bochs/bochs.h
 create mode 100644 drivers/gpu/drm/bochs/bochs_drv.c
 create mode 100644 drivers/gpu/drm/bochs/bochs_fbdev.c
 create mode 100644 drivers/gpu/drm/bochs/bochs_hw.c
 create mode 100644 drivers/gpu/drm/bochs/bochs_kms.c
 create mode 100644 drivers/gpu/drm/bochs/bochs_mm.c
drivers/gpu/drm/Kconfig +2 -0
index f864275..5f6e715 100644
@@ -188,6 +188,8 @@ source "drivers/gpu/drm/tilcdc/Kconfig"
 
 source "drivers/gpu/drm/qxl/Kconfig"
 
+source "drivers/gpu/drm/bochs/Kconfig"
+
 source "drivers/gpu/drm/msm/Kconfig"
 
 source "drivers/gpu/drm/tegra/Kconfig"
drivers/gpu/drm/Makefile +1 -0
index cc08b84..e6997e4 100644
@@ -56,6 +56,7 @@ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
 obj-$(CONFIG_DRM_OMAP)	+= omapdrm/
 obj-$(CONFIG_DRM_TILCDC)	+= tilcdc/
 obj-$(CONFIG_DRM_QXL) += qxl/
+obj-$(CONFIG_DRM_BOCHS) += bochs/
 obj-$(CONFIG_DRM_MSM) += msm/
 obj-$(CONFIG_DRM_TEGRA) += tegra/
 obj-y			+= i2c/
drivers/gpu/drm/bochs/Kconfig new file +11 -0
new file mode 100644
index 0000000..c8fcf12
@@ -0,0 +1,11 @@
+config DRM_BOCHS
+	tristate "DRM Support for bochs dispi vga interface (qemu stdvga)"
+	depends on DRM && PCI
+	select DRM_KMS_HELPER
+	select FB_SYS_FILLRECT
+	select FB_SYS_COPYAREA
+	select FB_SYS_IMAGEBLIT
+	select DRM_TTM
+	help
+	  Choose this option for qemu.
+	  If M is selected the module will be called bochs-drm.
drivers/gpu/drm/bochs/Makefile new file +4 -0
new file mode 100644
index 0000000..844a556
@@ -0,0 +1,4 @@
+ccflags-y := -Iinclude/drm
+bochs-drm-y := bochs_drv.o bochs_mm.o bochs_kms.o bochs_fbdev.o bochs_hw.o
+
+obj-$(CONFIG_DRM_BOCHS)	+= bochs-drm.o
drivers/gpu/drm/bochs/bochs.h new file +164 -0

164 lines not on this page · raw message

drivers/gpu/drm/bochs/bochs_drv.c new file +178 -0

178 lines not on this page · raw message

drivers/gpu/drm/bochs/bochs_fbdev.c new file +215 -0

215 lines not on this page · raw message

drivers/gpu/drm/bochs/bochs_hw.c new file +177 -0

177 lines not on this page · raw message

drivers/gpu/drm/bochs/bochs_kms.c new file +294 -0

294 lines not on this page · raw message

drivers/gpu/drm/bochs/bochs_mm.c new file +546 -0

546 lines not on this page · raw message

Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 5 lines · Gerd Hoffmann

DRM driver for (virtual) vga cards using the bochs dispi interface, such as the qemu standard vga (qemu -vga std).

Don't bother supporting anything but 32bpp for now, even though the virtual hardware is able to do that.

Hi Gerd,

just took a quick look over this and it seems in pretty good shape, the one worry I have is if you've tested with vesafb loaded, since you do some pci_request_regions and fail hard, if vesafb has some of the resources this can end up failing the driver load for no good reason. I haven't verified there is a problem here its just something we've had in the past.

Dave.

#2 lore raw
Quoted 7 lines · Dave Airlie
Quoted 5 lines · Gerd Hoffmann

DRM driver for (virtual) vga cards using the bochs dispi interface, such as the qemu standard vga (qemu -vga std).

Don't bother supporting anything but 32bpp for now, even though the virtual hardware is able to do that.

Quoted 8 lines

Hi Gerd,

just took a quick look over this and it seems in pretty good shape, the one worry I have is if you've tested with vesafb loaded, since you do some pci_request_regions and fail hard, if vesafb has some of the resources this can end up failing the driver load for no good reason. I haven't verified there is a problem here its just something we've had in the past.

Tested, works. bochs_pci_probe handles it before calling drm_get_pci_dev, simliar to cirrus.

cheers,
Gerd

#3 lore raw

Hi

Quoted 17 lines · Gerd Hoffmann
Quoted 7 lines · Dave Airlie
Quoted 5 lines · Gerd Hoffmann

DRM driver for (virtual) vga cards using the bochs dispi interface, such as the qemu standard vga (qemu -vga std).

Don't bother supporting anything but 32bpp for now, even though the virtual hardware is able to do that.

Quoted 8 lines

Hi Gerd,

just took a quick look over this and it seems in pretty good shape, the one worry I have is if you've tested with vesafb loaded, since you do some pci_request_regions and fail hard, if vesafb has some of the resources this can end up failing the driver load for no good reason. I haven't verified there is a problem here its just something we've had in the past.

Quoted 2 lines

Tested, works. bochs_pci_probe handles it before calling drm_get_pci_dev, simliar to cirrus.

It fails with CONFIG_X86_SYSFB=y and CONFIG_FB_SIMPLE=y. But imho that should get fixed in sysfb, not the drivers loaded on top.

Thanks
David