-/*
- * XXX: called from ite console init routine.
- * Does just what configure will do later but without printing anything.
- */
-grfconfig()
-{
- register caddr_t addr;
- register struct hp_hw *hw;
- register struct hp_device *hd, *nhd;
-
- for (hw = sc_table; hw->hw_type; hw++) {
- if (hw->hw_type != BITMAP)
- continue;
- /*
- * Found one, now match up with a logical unit number
- */
- nhd = NULL;
- addr = hw->hw_addr;
- for (hd = hp_dinit; hd->hp_driver; hd++) {
- if (hd->hp_driver != &grfdriver || hd->hp_alive)
- continue;
- /*
- * Wildcarded. If first, remember as possible match.
- */
- if (hd->hp_addr == NULL) {
- if (nhd == NULL)
- nhd = hd;
- continue;
- }
- /*
- * Not wildcarded.
- * If exact match done searching, else keep looking.
- */
- if ((caddr_t)sctoaddr(hd->hp_addr) == addr) {
- nhd = hd;
- break;
- }
- }
- /*
- * Found a match, initialize
- */
- if (nhd && grfinit(addr, nhd->hp_unit)) {
- nhd->hp_addr = addr;
- }
- }
-}
-
-/*
- * Normal init routine called by configure() code
- */
-grfprobe(hd)
- struct hp_device *hd;
-{
- struct grf_softc *gp = &grf_softc[hd->hp_unit];
-
- if ((gp->g_flags & GF_ALIVE) == 0 &&
- !grfinit(hd->hp_addr, hd->hp_unit))
- return(0);
- printf("grf%d: %d x %d ", hd->hp_unit,
- gp->g_display.gd_dwidth, gp->g_display.gd_dheight);
- if (gp->g_display.gd_colors == 2)
- printf("monochrome");
- else
- printf("%d color", gp->g_display.gd_colors);
- printf(" %s display\n", grfdev[gp->g_type].gd_desc);
- return(1);
-}
-
-grfinit(addr, unit)
- caddr_t addr;
-{
- struct grf_softc *gp = &grf_softc[unit];
- struct grfreg *gr;
- register struct grfdev *gd;
-
- gr = (struct grfreg *) addr;
- if (gr->gr_id != GRFHWID)
- return(0);
- for (gd = grfdev; gd < &grfdev[ngrfdev]; gd++)
- if (gd->gd_hardid == gr->gr_id2)
- break;
- if (gd < &grfdev[ngrfdev] && (*gd->gd_init)(gp, addr)) {
- gp->g_display.gd_id = gd->gd_softid;
- gp->g_type = gd - grfdev;
- gp->g_flags = GF_ALIVE;
- return(1);
- }
- return(0);
-}
-