From 9aa8ab9279831b0f4520628afbfc53175f00ad97 Mon Sep 17 00:00:00 2001 From: takemura Date: Sun, 21 Jan 2001 14:00:32 +0000 Subject: [PATCH] Use rasops with 4bit depth. --- sys/arch/hpcmips/conf/files.hpcmips | 4 ++-- sys/arch/hpcmips/dev/bivideo.c | 19 +++++++++++++++++-- sys/arch/hpcmips/dev/mq200.c | 23 +++++++++++++++++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/sys/arch/hpcmips/conf/files.hpcmips b/sys/arch/hpcmips/conf/files.hpcmips index 403921c294b0..83703839fd49 100644 --- a/sys/arch/hpcmips/conf/files.hpcmips +++ b/sys/arch/hpcmips/conf/files.hpcmips @@ -1,4 +1,4 @@ -# $NetBSD: files.hpcmips,v 1.43 2001/01/17 00:07:25 fvdl Exp $ +# $NetBSD: files.hpcmips,v 1.44 2001/01/21 14:00:32 takemura Exp $ # maxpartitions must be first item in files.${ARCH}. maxpartitions 8 @@ -76,7 +76,7 @@ defopt PCKBD_LAYOUT # Simple framebuffer interface for wsdisplay define hpcfbif {} -device hpcfb: wsemuldisplaydev, rasops1, rasops2, rasops8, rasops15, rasops16 +device hpcfb: wsemuldisplaydev, rasops1, rasops2, rasops4, rasops8, rasops15, rasops16 attach hpcfb at hpcfbif file arch/hpcmips/dev/hpcfb.c hpcfb needs-flag diff --git a/sys/arch/hpcmips/dev/bivideo.c b/sys/arch/hpcmips/dev/bivideo.c index be791c5af15f..860d9bf2f4b8 100644 --- a/sys/arch/hpcmips/dev/bivideo.c +++ b/sys/arch/hpcmips/dev/bivideo.c @@ -1,4 +1,4 @@ -/* $NetBSD: bivideo.c,v 1.15 2001/01/21 09:11:29 takemura Exp $ */ +/* $NetBSD: bivideo.c,v 1.16 2001/01/21 14:00:32 takemura Exp $ */ /*- * Copyright (c) 1999 @@ -37,7 +37,7 @@ static const char _copyright[] __attribute__ ((unused)) = "Copyright (c) 1999 Shin Takemura. All rights reserved."; static const char _rcsid[] __attribute__ ((unused)) = - "$Id: bivideo.c,v 1.15 2001/01/21 09:11:29 takemura Exp $"; + "$Id: bivideo.c,v 1.16 2001/01/21 14:00:32 takemura Exp $"; #include #include @@ -243,6 +243,21 @@ bivideo_init(fb) fb->hf_u.hf_gray.hf_flags = 0; /* reserved for future use */ break; + case BIFB_D4_M2L_F: + case BIFB_D4_M2L_Fx2: + fb->hf_access_flags |= HPCFB_ACCESS_REVERSE; + /* fall through */ + case BIFB_D4_M2L_0: + case BIFB_D4_M2L_0x2: + fb->hf_class = HPCFB_CLASS_GRAYSCALE; + fb->hf_access_flags |= HPCFB_ACCESS_STATIC; + fb->hf_pack_width = 8; + fb->hf_pixels_per_pack = 2; + fb->hf_pixel_width = 4; + fb->hf_class_data_length = sizeof(struct hf_gray_tag); + fb->hf_u.hf_gray.hf_flags = 0; /* reserved for future use */ + break; + /* * indexed color */ diff --git a/sys/arch/hpcmips/dev/mq200.c b/sys/arch/hpcmips/dev/mq200.c index bbb70877eb88..aa72efbef018 100644 --- a/sys/arch/hpcmips/dev/mq200.c +++ b/sys/arch/hpcmips/dev/mq200.c @@ -1,4 +1,4 @@ -/* $NetBSD: mq200.c,v 1.6 2001/01/05 09:09:48 sato Exp $ */ +/* $NetBSD: mq200.c,v 1.7 2001/01/21 14:00:32 takemura Exp $ */ /*- * Copyright (c) 2000 Takemura Shin @@ -134,7 +134,11 @@ mq200_attach(sc) printf("%s: WARNING: unable to establish hard power hook\n", sc->sc_dev.dv_xname); - mq200_fbinit(&sc->sc_fbconf); + if (mq200_fbinit(&sc->sc_fbconf) != 0) { + /* just return so that hpcfb will not be attached */ + return; + } + sc->sc_fbconf.hf_baseaddr = (u_long)bootinfo->fb_addr; sc->sc_fbconf.hf_offset = (u_long)sc->sc_fbconf.hf_baseaddr - MIPS_PHYS_TO_KSEG1(mips_ptob(mips_btop(sc->sc_baseaddr))); @@ -292,6 +296,21 @@ mq200_fbinit(fb) fb->hf_u.hf_gray.hf_flags = 0; /* reserved for future use */ break; + case BIFB_D4_M2L_F: + case BIFB_D4_M2L_Fx2: + fb->hf_access_flags |= HPCFB_ACCESS_REVERSE; + /* fall through */ + case BIFB_D4_M2L_0: + case BIFB_D4_M2L_0x2: + fb->hf_class = HPCFB_CLASS_GRAYSCALE; + fb->hf_access_flags |= HPCFB_ACCESS_STATIC; + fb->hf_pack_width = 8; + fb->hf_pixels_per_pack = 2; + fb->hf_pixel_width = 4; + fb->hf_class_data_length = sizeof(struct hf_gray_tag); + fb->hf_u.hf_gray.hf_flags = 0; /* reserved for future use */ + break; + /* * indexed color */