* Copyright (c) 1991 University of Utah.
* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* %sccs.include.redist.c%
* from: Utah $Hdr: grf_machdep.c 1.1 92/01/21
* @(#)grf_machdep.c 7.1 (Berkeley) %G%
* Graphics display driver for the HP300/400 DIO/DIO-II based machines.
* This is the hardware-dependent configuration portion of the driver.
#include "hp/dev/device.h"
#include "hp/dev/grfioctl.h"
#include "hp/dev/grfvar.h"
#include "hp/dev/grfreg.h"
struct driver grfdriver
= { grfprobe
, "grf" };
* XXX called from ite console init routine.
* Does just what configure will do later but without printing anything.
register struct hp_hw
*hw
;
register struct hp_device
*hd
, *nhd
;
for (hw
= sc_table
; hw
->hw_type
; hw
++) {
if (!HW_ISDEV(hw
, D_BITMAP
))
* Found one, now match up with a logical unit number
for (hd
= hp_dinit
; hd
->hp_driver
; hd
++) {
if (hd
->hp_driver
!= &grfdriver
|| hd
->hp_alive
)
* Wildcarded. If first, remember as possible match.
if (hd
->hp_addr
== NULL
) {
* If exact match done searching, else keep looking.
if (sctova(hd
->hp_addr
) == addr
) {
* Found a match, initialize
if (nhd
&& grfinit(addr
, nhd
->hp_unit
))
* Normal init routine called by configure() code
struct grf_softc
*gp
= &grf_softc
[hd
->hp_unit
];
if ((gp
->g_flags
& GF_ALIVE
) == 0 &&
!grfinit(hd
->hp_addr
, hd
->hp_unit
))
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("%d color", gp
->g_display
.gd_colors
);
printf(" %s display\n", gp
->g_sw
->gd_desc
);
struct grf_softc
*gp
= &grf_softc
[unit
];
register struct grfsw
*gsw
;
gr
= (struct grfreg
*) addr
;
if (gr
->gr_id
!= GRFHWID
)
for (gsw
= grfsw
; gsw
< &grfsw
[ngrfsw
]; gsw
++)
if (gsw
->gd_hwid
== gr
->gr_id2
)
if (gsw
< &grfsw
[ngrfsw
] && (*gsw
->gd_init
)(gp
, addr
)) {
gp
->g_display
.gd_id
= gsw
->gd_swid
;