11.1Snia/*
21.1Snia * Copyright (c) 2025 The NetBSD Foundation, Inc.
31.1Snia * All rights reserved.
41.1Snia *
51.1Snia * Redistribution and use in source and binary forms, with or without
61.1Snia * modification, are permitted provided that the following conditions
71.1Snia * are met:
81.1Snia * 1. Redistributions of source code must retain the above copyright
91.1Snia *    notice, this list of conditions and the following disclaimer.
101.1Snia * 2. Redistributions in binary form must reproduce the above copyright
111.1Snia *    notice, this list of conditions and the following disclaimer in the
121.1Snia *    documentation and/or other materials provided with the distribution.
131.1Snia *
141.1Snia * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
151.1Snia * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
161.1Snia * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
171.1Snia * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
181.1Snia * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
191.1Snia * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
201.1Snia * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
211.1Snia * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
221.1Snia * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
231.1Snia * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
241.1Snia */
251.1Snia
261.1Snia#ifndef BOCHSFBVAR_H
271.1Snia#define BOCHSFBVAR_H
281.1Snia
291.1Snia#include <dev/wscons/wsdisplayvar.h>
301.1Snia#include <dev/wscons/wsconsio.h>
311.1Snia#include <dev/wsfont/wsfont.h>
321.1Snia#include <dev/rasops/rasops.h>
331.1Snia#include <dev/wscons/wsdisplay_vconsvar.h>
341.1Snia#include <dev/videomode/edidvar.h>
351.1Snia
361.1Snia#ifndef BOCHSFB_DEFAULT_WIDTH
371.1Snia#define BOCHSFB_DEFAULT_WIDTH	(1024)
381.1Snia#endif
391.1Snia
401.1Snia#ifndef BOCHSFB_DEFAULT_HEIGHT
411.1Snia#define BOCHSFB_DEFAULT_HEIGHT	(768)
421.1Snia#endif
431.1Snia
441.1Snia/* Structure for the Bochs FB driver */
451.1Sniastruct bochsfb_softc {
461.1Snia	device_t sc_dev;
471.1Snia
481.1Snia	/* PCI attachment */
491.1Snia	pci_chipset_tag_t sc_pc;
501.1Snia	pcitag_t sc_pcitag;
511.1Snia
521.1Snia	/* Bus space tags and handles */
531.1Snia	bus_space_tag_t sc_iot;          /* I/O space tag */
541.1Snia	bus_space_handle_t sc_ioh_vga;   /* VGA I/O handle */
551.1Snia	bus_space_handle_t sc_ioh_dispi; /* DISPI I/O handle */
561.1Snia
571.1Snia	bus_space_tag_t sc_mmiot;     /* MMIO space tag */
581.1Snia	bus_space_handle_t sc_mmioh;  /* MMIO handle for DISPI interface */
591.1Snia
601.1Snia	bus_space_tag_t sc_memt;      /* Memory space tag */
611.1Snia	bus_space_handle_t sc_fb_handle; /* Framebuffer handle */
621.1Snia
631.1Snia	bus_addr_t sc_mmio_addr;      /* MMIO base address */
641.1Snia	bus_size_t sc_mmio_size;      /* MMIO size */
651.1Snia
661.1Snia	bus_addr_t sc_fb_addr;        /* Framebuffer physical address */
671.1Snia	bus_size_t sc_fb_size;        /* Framebuffer size */
681.1Snia
691.1Snia	bool sc_has_mmio;             /* Whether MMIO is available */
701.1Snia
711.1Snia	/* Device Info */
721.1Snia	uint16_t sc_id;	  /* Device ID */
731.1Snia	pcireg_t sc_pci_id; /* PCI ID */
741.1Snia
751.1Snia	/* Video mode parameters */
761.1Snia	int sc_width, sc_height, sc_linebytes, sc_bpp;
771.1Snia	const struct videomode *sc_videomode;
781.1Snia
791.1Snia	uint8_t edid_buf[0x400]; /* EDID data buffer */
801.1Snia	struct edid_info sc_ei;
811.1Snia
821.1Snia	/* WS Display data */
831.1Snia	int sc_blank;
841.1Snia	int sc_mode;
851.1Snia	struct vcons_screen sc_console_screen;
861.1Snia	struct vcons_data vd;
871.1Snia	struct wsscreen_descr sc_defaultscreen_descr;
881.1Snia	const struct wsscreen_descr *sc_screens[1];
891.1Snia	struct wsscreen_list sc_screenlist;
901.1Snia};
911.1Snia
921.1Snia#endif /* BOCHSFBVAR_H */
93