Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Fixed 8bpp problem of mq200.
details: https://anonhg.NetBSD.org/src/rev/710dd69b1ba3
branches: trunk
changeset: 525622:710dd69b1ba3
user: takemura <takemura%NetBSD.org@localhost>
date: Sun Apr 14 06:07:40 2002 +0000
description:
Fixed 8bpp problem of mq200.
diffstat:
sys/arch/hpc/include/bootinfo.h | 8 +++++-
sys/arch/hpcmips/dev/mq200.c | 48 +++++++++++++++++++++++++++++++++-------
2 files changed, 46 insertions(+), 10 deletions(-)
diffs (97 lines):
diff -r 8a4057f654ed -r 710dd69b1ba3 sys/arch/hpc/include/bootinfo.h
--- a/sys/arch/hpc/include/bootinfo.h Sun Apr 14 04:22:38 2002 +0000
+++ b/sys/arch/hpc/include/bootinfo.h Sun Apr 14 06:07:40 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bootinfo.h,v 1.1 2002/02/01 18:16:04 uch Exp $ */
+/* $NetBSD: bootinfo.h,v 1.2 2002/04/14 06:07:40 takemura Exp $ */
/*-
* Copyright (c) 1999-2001
@@ -96,4 +96,10 @@
#define BIFB_D4_M2L_0x2 11
#define BIFBN_D4_M2L_0x2 "D4_M2L_0x2"
+#define BIFB_D1_M2L_0 12
+#define BIFBN_D1_M2L_0 "D1_M2L_0"
+
+#define BIFB_D1_M2L_1 13
+#define BIFBN_D1_M2L_1 "D1_M2L_1"
+
#endif /* _HPC_BOOTINFO_H_ */
diff -r 8a4057f654ed -r 710dd69b1ba3 sys/arch/hpcmips/dev/mq200.c
--- a/sys/arch/hpcmips/dev/mq200.c Sun Apr 14 04:22:38 2002 +0000
+++ b/sys/arch/hpcmips/dev/mq200.c Sun Apr 14 06:07:40 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mq200.c,v 1.19 2002/03/17 19:40:40 atatat Exp $ */
+/* $NetBSD: mq200.c,v 1.20 2002/04/14 06:07:41 takemura Exp $ */
/*-
* Copyright (c) 2000, 2001 TAKEMURA Shin
@@ -144,6 +144,20 @@
mq200_setup_regctx(sc);
mq200_mdsetup(sc);
if (sc->sc_md) {
+ int mode;
+
+ switch (sc->sc_fbconf.hf_pixel_width) {
+ case 1: mode = MQ200_GCC_1BPP; break;
+ case 2: mode = MQ200_GCC_2BPP; break;
+ case 4: mode = MQ200_GCC_4BPP; break;
+ case 8: mode = MQ200_GCC_8BPP; break;
+ case 16: mode = MQ200_GCC_16BPP_DIRECT; break;
+ default:
+ printf("%s: %dbpp isn't supported\n",
+ sc->sc_dev.dv_xname, sc->sc_fbconf.hf_pixel_width);
+ return;
+ }
+
if (sc->sc_md->md_flags & MQ200_MD_HAVEFP) {
sc->sc_flags |= MQ200_SC_GC2_ENABLE; /* FP */
}
@@ -164,15 +178,15 @@
mq200_setup(sc);
if (sc->sc_flags & MQ200_SC_GC2_ENABLE) /* FP */
- mq200_win_enable(sc, MQ200_GC2, MQ200_GCC_16BPP_DIRECT,
- 0x00080100,
- sc->sc_md->md_fp_width, sc->sc_md->md_fp_height,
- 1280);
+ mq200_win_enable(sc, MQ200_GC2, mode,
+ sc->sc_fbconf.hf_baseaddr,
+ sc->sc_fbconf.hf_width, sc->sc_fbconf.hf_height,
+ sc->sc_fbconf.hf_bytes_per_plane);
if (sc->sc_flags & MQ200_SC_GC1_ENABLE) /* CRT */
- mq200_win_enable(sc, MQ200_GC1, MQ200_GCC_16BPP_DIRECT,
- 0x00080100,
- sc->sc_md->md_fp_width, sc->sc_md->md_fp_height,
- 1280);
+ mq200_win_enable(sc, MQ200_GC1, mode,
+ sc->sc_fbconf.hf_baseaddr,
+ sc->sc_fbconf.hf_width, sc->sc_fbconf.hf_height,
+ sc->sc_fbconf.hf_bytes_per_plane);
}
#ifdef MQ200_DEBUG
if (sc->sc_md == NULL || bootverbose) {
@@ -344,6 +358,22 @@
switch (bootinfo->fb_type) {
/*
+ * monochrome
+ */
+ case BIFB_D1_M2L_1:
+ fb->hf_access_flags |= HPCFB_ACCESS_REVERSE;
+ /* fall through */
+ case BIFB_D1_M2L_0:
+ fb->hf_class = HPCFB_CLASS_GRAYSCALE;
+ fb->hf_access_flags |= HPCFB_ACCESS_STATIC;
+ fb->hf_pack_width = 8;
+ fb->hf_pixels_per_pack = 8;
+ fb->hf_pixel_width = 1;
+ fb->hf_class_data_length = sizeof(struct hf_gray_tag);
+ fb->hf_u.hf_gray.hf_flags = 0; /* reserved for future use */
+ break;
+
+ /*
* gray scale
*/
case BIFB_D2_M2L_3:
Home |
Main Index |
Thread Index |
Old Index