diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-29 17:46:09 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-29 17:46:09 +0000 |
commit | 7de96dfa28ad41f95acf986a0427150f0aae515b (patch) | |
tree | 9dac15a44f79a34c89ea030e0e50ad3f0d30cd4f /sys | |
parent | d658c7c638e86cb075838fe8458b10c7dc2b5503 (diff) |
Fix depth detection when gpx is the console.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/vax/vsa/gpx.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/vax/vsa/gpx.c b/sys/arch/vax/vsa/gpx.c index dfa22023293..857f570c5db 100644 --- a/sys/arch/vax/vsa/gpx.c +++ b/sys/arch/vax/vsa/gpx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpx.c,v 1.4 2006/07/29 17:29:03 miod Exp $ */ +/* $OpenBSD: gpx.c,v 1.5 2006/07/29 17:46:08 miod Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -1065,8 +1065,9 @@ gpxcnprobe() /* Check for a recognized color depth */ tmp = virtual_avail; - ioaccess(tmp, GPXADDR + GPX_READBACK_OFFSET, 1); - depth = (*(u_int16_t *)tmp) & 0x00f0; + ioaccess(tmp, vax_trunc_page(GPXADDR + GPX_READBACK_OFFSET), 1); + depth = *(u_int16_t *) + (tmp + (GPX_READBACK_OFFSET & VAX_PGOFSET)) & 0x00f0; if (depth == 0x00f0 || depth == 0x0080) return (1); @@ -1094,8 +1095,9 @@ gpxcninit() struct rasops_info *ri; tmp = virtual_avail; - ioaccess(tmp, GPXADDR + GPX_READBACK_OFFSET, 1); - ss->ss_depth = ((*(u_int16_t *)tmp) & 0x00f0) == 0x00f0 ? 4 : 8; + ioaccess(tmp, vax_trunc_page(GPXADDR + GPX_READBACK_OFFSET), 1); + ss->ss_depth = (0x00f0 & *(u_int16_t *) + (tmp + (GPX_READBACK_OFFSET & VAX_PGOFSET))) == 0x00f0 ? 4 : 8; ss->ss_adder = (struct adder *)virtual_avail; virtual_avail += VAX_NBPG; |