#include <linux/module.h>
#include <linux/pci.h>
#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_fbdev_ttm.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_vram_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_module.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
#include <video/vga.h>
#define VBE_DISPI_IOPORT_INDEX …
#define VBE_DISPI_IOPORT_DATA …
#define VBE_DISPI_INDEX_ID …
#define VBE_DISPI_INDEX_XRES …
#define VBE_DISPI_INDEX_YRES …
#define VBE_DISPI_INDEX_BPP …
#define VBE_DISPI_INDEX_ENABLE …
#define VBE_DISPI_INDEX_BANK …
#define VBE_DISPI_INDEX_VIRT_WIDTH …
#define VBE_DISPI_INDEX_VIRT_HEIGHT …
#define VBE_DISPI_INDEX_X_OFFSET …
#define VBE_DISPI_INDEX_Y_OFFSET …
#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K …
#define VBE_DISPI_ID0 …
#define VBE_DISPI_ID1 …
#define VBE_DISPI_ID2 …
#define VBE_DISPI_ID3 …
#define VBE_DISPI_ID4 …
#define VBE_DISPI_ID5 …
#define VBE_DISPI_DISABLED …
#define VBE_DISPI_ENABLED …
#define VBE_DISPI_GETCAPS …
#define VBE_DISPI_8BIT_DAC …
#define VBE_DISPI_LFB_ENABLED …
#define VBE_DISPI_NOCLEARMEM …
static int bochs_modeset = …;
static int defx = …;
static int defy = …;
module_param_named(modeset, bochs_modeset, int, 0444);
MODULE_PARM_DESC(…) …;
module_param(defx, int, 0444);
module_param(defy, int, 0444);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
enum bochs_types { … };
struct bochs_device { … };
static void bochs_vga_writeb(struct bochs_device *bochs, u16 ioport, u8 val)
{ … }
static u8 bochs_vga_readb(struct bochs_device *bochs, u16 ioport)
{ … }
static u16 bochs_dispi_read(struct bochs_device *bochs, u16 reg)
{ … }
static void bochs_dispi_write(struct bochs_device *bochs, u16 reg, u16 val)
{ … }
static void bochs_hw_set_big_endian(struct bochs_device *bochs)
{ … }
static void bochs_hw_set_little_endian(struct bochs_device *bochs)
{ … }
#ifdef __BIG_ENDIAN
#define bochs_hw_set_native_endian …
#else
#define bochs_hw_set_native_endian(_b) …
#endif
static int bochs_get_edid_block(void *data, u8 *buf,
unsigned int block, size_t len)
{ … }
static int bochs_hw_load_edid(struct bochs_device *bochs)
{ … }
static int bochs_hw_init(struct drm_device *dev)
{ … }
static void bochs_hw_fini(struct drm_device *dev)
{ … }
static void bochs_hw_blank(struct bochs_device *bochs, bool blank)
{ … }
static void bochs_hw_setmode(struct bochs_device *bochs, struct drm_display_mode *mode)
{ … }
static void bochs_hw_setformat(struct bochs_device *bochs, const struct drm_format_info *format)
{ … }
static void bochs_hw_setbase(struct bochs_device *bochs, int x, int y, int stride, u64 addr)
{ … }
static const uint32_t bochs_formats[] = …;
static void bochs_plane_update(struct bochs_device *bochs, struct drm_plane_state *state)
{ … }
static void bochs_pipe_enable(struct drm_simple_display_pipe *pipe,
struct drm_crtc_state *crtc_state,
struct drm_plane_state *plane_state)
{ … }
static void bochs_pipe_disable(struct drm_simple_display_pipe *pipe)
{ … }
static void bochs_pipe_update(struct drm_simple_display_pipe *pipe,
struct drm_plane_state *old_state)
{ … }
static const struct drm_simple_display_pipe_funcs bochs_pipe_funcs = …;
static int bochs_connector_get_modes(struct drm_connector *connector)
{ … }
static const struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = …;
static const struct drm_connector_funcs bochs_connector_connector_funcs = …;
static void bochs_connector_init(struct drm_device *dev)
{ … }
static struct drm_framebuffer *
bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file,
const struct drm_mode_fb_cmd2 *mode_cmd)
{ … }
static const struct drm_mode_config_funcs bochs_mode_funcs = …;
static int bochs_kms_init(struct bochs_device *bochs)
{ … }
static int bochs_load(struct drm_device *dev)
{ … }
DEFINE_DRM_GEM_FOPS(bochs_fops);
static const struct drm_driver bochs_driver = …;
#ifdef CONFIG_PM_SLEEP
static int bochs_pm_suspend(struct device *dev)
{ … }
static int bochs_pm_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops bochs_pm_ops = …;
static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void bochs_pci_remove(struct pci_dev *pdev)
{ … }
static void bochs_pci_shutdown(struct pci_dev *pdev)
{ … }
static const struct pci_device_id bochs_pci_tbl[] = …;
static struct pci_driver bochs_pci_driver = …;
drm_module_pci_driver_if_modeset(…);
MODULE_DEVICE_TABLE(pci, bochs_pci_tbl);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;