Enabling either option VESAFB or the vesabios device without the other results
in i386 kernel build failure. This patch works around the problem by removing
#ifdef VESAFB in favor of NVESABIOS > 0.
Feedback welcome, especially if consensus is that I'm wasting my time on this
class of error because it will never get committed.
--david
Index: arch/i386/conf/GENERIC
===================================================================
RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.736
diff -u -p arch/i386/conf/GENERIC
--- arch/i386/conf/GENERIC 12 Jul 2012 09:45:56 -0000 1.736
+++ arch/i386/conf/GENERIC 21 Jul 2012 13:47:24 -0000
@@ -376,8 +376,7 @@ radeondrm* at vga? # ATI Radeon DRM driver
drm* at radeondrm?
#option VESABIOSVERBOSE
-#option VESAFB # VESA bios framebuffer support for X11
-#vesabios0 at mainbus?
+#vesabios0 at mainbus? # VESA bios framebuffer support for X11
pcppi0 at isa?
Index: dev/pci/vga_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/vga_pci.c,v
retrieving revision 1.67
diff -u -p dev/pci/vga_pci.c
--- dev/pci/vga_pci.c 14 Apr 2011 21:04:29 -0000 1.67
+++ dev/pci/vga_pci.c 21 Jul 2012 13:47:26 -0000
@@ -62,6 +62,7 @@
* rights to redistribute these changes.
*/
+#include "vesabios.h"
#include "vga.h"
#if defined(__i386__) || defined(__amd64__)
#include "acpi.h"
@@ -98,7 +99,7 @@
#include <machine/vga_post.h>
#endif
-#ifdef VESAFB
+#if NVESABIOS > 0
#include <dev/vesa/vesabiosvar.h>
#endif
@@ -120,7 +121,7 @@ int drmsubmatch(struct device *, void *, void *);
int vga_drm_print(void *, const char *);
#endif
-#ifdef VESAFB
+#if NVESABIOS > 0
int vesafb_putcmap(struct vga_pci_softc *, struct wsdisplay_cmap *);
int vesafb_getcmap(struct vga_pci_softc *, struct wsdisplay_cmap *);
#endif
@@ -245,7 +246,7 @@ vga_pci_attach(struct device *parent, struct device *s
reg |= PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
-#ifdef VESAFB
+#if NVESABIOS > 0
if (vesabios_softc != NULL && vesabios_softc->sc_nmodes > 0) {
sc->sc_textmode = vesafb_get_mode(sc);
printf(", vesafb\n");
@@ -393,7 +394,7 @@ drmsubmatch(struct device *parent, void *match, void *
paddr_t
vga_pci_mmap(void *v, off_t off, int prot)
{
-#ifdef VESAFB
+#if NVESABIOS > 0
struct vga_config *vc = (struct vga_config *)v;
struct vga_pci_softc *sc = (struct vga_pci_softc *)vc->vc_softc;
@@ -417,7 +418,7 @@ int
vga_pci_ioctl(void *v, u_long cmd, caddr_t addr, int flag, struct proc *pb)
{
int error = 0;
-#ifdef VESAFB
+#if NVESABIOS > 0
struct vga_config *vc = (struct vga_config *)v;
struct vga_pci_softc *sc = (struct vga_pci_softc *)vc->vc_softc;
struct wsdisplay_fbinfo *wdf;
@@ -426,7 +427,7 @@ vga_pci_ioctl(void *v, u_long cmd, caddr_t addr, int f
#endif
switch (cmd) {
-#ifdef VESAFB
+#if NVESABIOS > 0
case WSDISPLAYIO_SMODE:
mode = *(u_int *)addr;
switch (mode) {
Index: dev/pci/vga_pcivar.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/vga_pcivar.h,v
retrieving revision 1.14
diff -u -p dev/pci/vga_pcivar.h
--- dev/pci/vga_pcivar.h 8 Aug 2010 17:21:07 -0000 1.14
+++ dev/pci/vga_pcivar.h 21 Jul 2012 13:47:26 -0000
@@ -67,7 +67,7 @@ struct vga_pci_softc {
#ifdef X86EMU
struct vga_post *sc_posth;
#endif
-#ifdef VESAFB
+#if NVESABIOS > 0
int sc_width;
int sc_height;
int sc_depth;
@@ -90,7 +90,7 @@ struct vga_pci_bar *vga_pci_bar_map(struct vga_pci_sof
bus_size_t, int);
void vga_pci_bar_unmap(struct vga_pci_bar*);
-#ifdef VESAFB
+#if NVESABIOS > 0
int vesafb_find_mode(struct vga_pci_softc *, int, int, int);
void vesafb_set_mode(struct vga_pci_softc *, int);
int vesafb_get_mode(struct vga_pci_softc *);
Index: dev/vesa/files.vesa
===================================================================
RCS file: /cvs/src/sys/dev/vesa/files.vesa,v
retrieving revision 1.1
diff -u -p dev/vesa/files.vesa
--- dev/vesa/files.vesa 27 Nov 2006 18:04:28 -0000 1.1
+++ dev/vesa/files.vesa 21 Jul 2012 13:47:27 -0000
@@ -7,5 +7,4 @@ define vesabios {}
device vesabios
attach vesabios at mainbus
file dev/vesa/vesabios.c vesabios needs-flag
-
-file dev/vesa/vesafb.c vesafb needs-flag
+file dev/vesa/vesafb.c vesabios
Index: dev/vesa/vesafb.c
===================================================================
RCS file: /cvs/src/sys/dev/vesa/vesafb.c,v
retrieving revision 1.7
diff -u -p dev/vesa/vesafb.c
--- dev/vesa/vesafb.c 11 Nov 2009 00:01:34 -0000 1.7
+++ dev/vesa/vesafb.c 21 Jul 2012 13:47:27 -0000
@@ -48,6 +48,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "vesabios.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>