Index: radeon_pci.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/radeon/radeon_pci.c,v retrieving revision 1.4 diff -p -u -r1.4 radeon_pci.c --- radeon_pci.c 26 Jul 2014 07:36:09 -0000 1.4 +++ radeon_pci.c 14 Feb 2015 06:17:32 -0000 @@ -82,6 +82,9 @@ struct radeon_softc { } sc_task_u; struct drm_device *sc_drm_dev; struct pci_dev sc_pci_dev; + /* XXX Used to claim the VGA device before attach_real */ + bus_space_handle_t sc_temp_memh; + bool sc_temp_set; }; struct radeon_device * @@ -165,6 +168,15 @@ radeon_attach(device_t parent, device_t sc->sc_dev = NULL; sc->sc_pa = *pa; + /* + * XXX + * We map the VGA registers, so that other driver don't + * think they can. This stops vga@isa or pcdisplay@isa + * attaching, and stealing wsdisplay0. Yuck. + */ + sc->sc_temp_set = bus_space_map(pa->pa_memt, 0xb0000, 0x10000, 0, + &sc->sc_temp_memh); + config_mountroot(self, &radeon_attach_real); } @@ -180,6 +192,13 @@ radeon_attach_real(device_t self) ok = radeon_pci_lookup(pa, &flags); KASSERT(ok); + /* + * XXX + * Unmap the VGA registers so the DRM code can map them. + */ + if (sc->sc_temp_set) + bus_space_unmap(pa->pa_memt, sc->sc_temp_memh, 0x10000); + sc->sc_task_state = RADEON_TASK_ATTACH; SIMPLEQ_INIT(&sc->sc_task_u.attach);