Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/tc - Sweep abit preparing for code merge to have com...
details: https://anonhg.NetBSD.org/src/rev/a031f2d2944d
branches: trunk
changeset: 472787:a031f2d2944d
user: nisimura <nisimura%NetBSD.org@localhost>
date: Fri May 07 08:00:30 1999 +0000
description:
- Sweep abit preparing for code merge to have common 'vdacops' across
various graphics cards.
diffstat:
sys/dev/tc/cfb.c | 38 ++++++++++++++++++++------------------
sys/dev/tc/mfb.c | 22 +++++++++++++---------
sys/dev/tc/sfb.c | 37 ++++++++++++++++++++-----------------
sys/dev/tc/tfb.c | 38 +++++++++++++++++++++-----------------
sys/dev/tc/xcfb.c | 21 +++++++++++----------
5 files changed, 85 insertions(+), 71 deletions(-)
diffs (truncated from 500 to 300 lines):
diff -r 6a70f3787da4 -r a031f2d2944d sys/dev/tc/cfb.c
--- a/sys/dev/tc/cfb.c Fri May 07 06:18:56 1999 +0000
+++ b/sys/dev/tc/cfb.c Fri May 07 08:00:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cfb.c,v 1.10 1999/03/29 07:22:02 nisimura Exp $ */
+/* $NetBSD: cfb.c,v 1.11 1999/05/07 08:00:30 nisimura Exp $ */
/*
* Copyright (c) 1998 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.10 1999/03/29 07:22:02 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.11 1999/05/07 08:00:30 nisimura Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,17 +108,18 @@
int dc_blanked; /* currently has video disabled */
};
-struct hwcmap {
+struct hwcmap256 {
#define CMAP_SIZE 256 /* 256 R/G/B entries */
u_int8_t r[CMAP_SIZE];
u_int8_t g[CMAP_SIZE];
u_int8_t b[CMAP_SIZE];
};
-struct hwcursor {
+struct hwcursor64 {
struct wsdisplay_curpos cc_pos;
struct wsdisplay_curpos cc_hot;
struct wsdisplay_curpos cc_size;
+ struct wsdisplay_curpos cc_magic;
#define CURSOR_MAX_SIZE 64
u_int8_t cc_color[6];
u_int64_t cc_image[64 + 64];
@@ -127,8 +128,8 @@
struct cfb_softc {
struct device sc_dev;
struct fb_devconfig *sc_dc; /* device configuration */
- struct hwcmap sc_cmap; /* software copy of colormap */
- struct hwcursor sc_cursor; /* software copy of cursor */
+ struct hwcmap256 sc_cmap; /* software copy of colormap */
+ struct hwcursor64 sc_cursor; /* software copy of cursor */
int sc_curenb; /* cursor sprite enabled */
int sc_changed; /* need update of colormap */
#define DATA_ENB_CHANGED 0x01 /* cursor enable changed */
@@ -137,10 +138,10 @@
#define DATA_CMAP_CHANGED 0x08 /* colormap changed */
#define DATA_ALL_CHANGED 0x0f
int nscreens;
- short magic_x, magic_y; /* CX cursor location offset */
+};
+
#define CX_MAGIC_X 220
#define CX_MAGIC_Y 35
-};
#define CX_FB_OFFSET 0x000000
#define CX_FB_SIZE 0x100000
@@ -330,8 +331,8 @@
struct cfb_softc *sc = (struct cfb_softc *)self;
struct tc_attach_args *ta = aux;
struct wsemuldisplaydev_attach_args waa;
- struct hwcmap *cm;
- int console, i;
+ struct hwcmap256 *cm;
+ int console;
console = (ta->ta_addr == cfb_consaddr);
if (console) {
@@ -347,12 +348,11 @@
sc->sc_dc->dc_depth);
cm = &sc->sc_cmap;
- cm->r[0] = cm->g[0] = cm->b[0] = 0;
- for (i = 1; i < CMAP_SIZE; i++) {
- cm->r[i] = cm->g[i] = cm->b[i] = 0xff;
- }
- sc->magic_x = CX_MAGIC_X;
- sc->magic_y = CX_MAGIC_Y;
+ memset(cm, 255, sizeof(struct hwcmap256)); /* XXX */
+ cm->r[0] = cm->g[0] = cm->b[0] = 0; /* XXX */
+
+ sc->sc_cursor.cc_magic.x = CX_MAGIC_X;
+ sc->sc_cursor.cc_magic.y = CX_MAGIC_Y;
/* Establish an interrupt handler, and clear any pending interrupts */
tc_intr_establish(parent, ta->ta_cookie, TC_IPL_TTY, cfbintr, sc);
@@ -576,7 +576,7 @@
}
}
if (v & DATA_CMAP_CHANGED) {
- struct hwcmap *cm = &sc->sc_cmap;
+ struct hwcmap256 *cm = &sc->sc_cmap;
int index;
BT459_SELECT(vdac, 0);
@@ -802,7 +802,9 @@
x = sc->sc_cursor.cc_pos.x - sc->sc_cursor.cc_hot.x;
y = sc->sc_cursor.cc_pos.y - sc->sc_cursor.cc_hot.y;
- x += sc->magic_x; y += sc->magic_y; /* magic offset of CX coordinate */
+
+ x += sc->sc_cursor.cc_magic.x;
+ y += sc->sc_cursor.cc_magic.y;
s = spltty();
diff -r 6a70f3787da4 -r a031f2d2944d sys/dev/tc/mfb.c
--- a/sys/dev/tc/mfb.c Fri May 07 06:18:56 1999 +0000
+++ b/sys/dev/tc/mfb.c Fri May 07 08:00:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfb.c,v 1.10 1999/03/29 07:22:02 nisimura Exp $ */
+/* $NetBSD: mfb.c,v 1.11 1999/05/07 08:00:31 nisimura Exp $ */
/*
* Copyright (c) 1998 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.10 1999/03/29 07:22:02 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfb.c,v 1.11 1999/05/07 08:00:31 nisimura Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -132,10 +132,11 @@
int dc_blanked; /* currently has video disabled */
};
-struct hwcursor {
+struct hwcursor64 {
struct wsdisplay_curpos cc_pos;
struct wsdisplay_curpos cc_hot;
struct wsdisplay_curpos cc_size;
+ struct wsdisplay_curpos cc_magic;
#define CURSOR_MAX_SIZE 64
u_int8_t cc_color[6];
u_int64_t cc_image[64 + 64];
@@ -144,7 +145,7 @@
struct mfb_softc {
struct device sc_dev;
struct fb_devconfig *sc_dc; /* device configuration */
- struct hwcursor sc_cursor; /* software copy of cursor */
+ struct hwcursor64 sc_cursor; /* software copy of cursor */
int sc_curenb; /* cursor sprite enabled */
int sc_changed; /* need update of colormap */
#define DATA_ENB_CHANGED 0x01 /* cursor enable changed */
@@ -153,10 +154,10 @@
#define DATA_CMAP_CHANGED 0x08 /* colormap changed */
#define DATA_ALL_CHANGED 0x0f
int nscreens;
- short magic_x, magic_y; /* MX cursor location offset */
+};
+
#define MX_MAGIC_X 360
#define MX_MAGIC_Y 36
-};
#define MX_FB_OFFSET 0x200000
#define MX_FB_SIZE 0x40000
@@ -365,8 +366,9 @@
}
printf(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
sc->sc_dc->dc_depth);
- sc->magic_x = MX_MAGIC_X;
- sc->magic_y = MX_MAGIC_Y;
+
+ sc->sc_cursor.cc_magic.x = MX_MAGIC_X;
+ sc->sc_cursor.cc_magic.y = MX_MAGIC_Y;
tc_intr_establish(parent, ta->ta_cookie, TC_IPL_TTY, mfbintr, sc);
@@ -711,7 +713,9 @@
x = sc->sc_cursor.cc_pos.x - sc->sc_cursor.cc_hot.x;
y = sc->sc_cursor.cc_pos.y - sc->sc_cursor.cc_hot.y;
- x += sc->magic_x; y += sc->magic_y; /* magic offset of MX coordinate */
+
+ x += sc->sc_cursor.cc_magic.x;
+ y += sc->sc_cursor.cc_magic.y;
s = spltty();
diff -r 6a70f3787da4 -r a031f2d2944d sys/dev/tc/sfb.c
--- a/sys/dev/tc/sfb.c Fri May 07 06:18:56 1999 +0000
+++ b/sys/dev/tc/sfb.c Fri May 07 08:00:30 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.14 1999/03/29 07:22:02 nisimura Exp $ */
+/* $NetBSD: sfb.c,v 1.15 1999/05/07 08:00:31 nisimura Exp $ */
/*
* Copyright (c) 1998 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.14 1999/03/29 07:22:02 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.15 1999/05/07 08:00:31 nisimura Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -106,17 +106,18 @@
int dc_blanked; /* currently has video disabled */
};
-struct hwcmap {
+struct hwcmap256 {
#define CMAP_SIZE 256 /* 256 R/G/B entries */
u_int8_t r[CMAP_SIZE];
u_int8_t g[CMAP_SIZE];
u_int8_t b[CMAP_SIZE];
};
-struct hwcursor {
+struct hwcursor64 {
struct wsdisplay_curpos cc_pos;
struct wsdisplay_curpos cc_hot;
struct wsdisplay_curpos cc_size;
+ struct wsdisplay_curpos cc_magic;
#define CURSOR_MAX_SIZE 64
u_int8_t cc_color[6];
u_int64_t cc_image[64 + 64];
@@ -125,8 +126,8 @@
struct sfb_softc {
struct device sc_dev;
struct fb_devconfig *sc_dc; /* device configuration */
- struct hwcmap sc_cmap; /* software copy of colormap */
- struct hwcursor sc_cursor; /* software copy of cursor */
+ struct hwcmap256 sc_cmap; /* software copy of colormap */
+ struct hwcursor64 sc_cursor; /* software copy of cursor */
int sc_curenb; /* cursor sprite enabled */
int sc_changed; /* need update of colormap */
#define DATA_ENB_CHANGED 0x01 /* cursor enable changed */
@@ -135,10 +136,10 @@
#define DATA_CMAP_CHANGED 0x08 /* colormap changed */
#define DATA_ALL_CHANGED 0x0f
int nscreens;
- short magic_x, magic_y; /* HX cursor location offset */
+};
+
#define HX_MAGIC_X 368
#define HX_MAGIC_Y 38
-};
int sfbmatch __P((struct device *, struct cfdata *, void *));
void sfbattach __P((struct device *, struct device *, void *));
@@ -342,9 +343,9 @@
struct sfb_softc *sc = (struct sfb_softc *)self;
struct tc_attach_args *ta = aux;
struct wsemuldisplaydev_attach_args waa;
- struct hwcmap *cm;
+ struct hwcmap256 *cm;
caddr_t sfbasic;
- int console, i;
+ int console;
console = (ta->ta_addr == sfb_consaddr);
if (console) {
@@ -360,11 +361,11 @@
sc->sc_dc->dc_depth);
cm = &sc->sc_cmap;
- cm->r[0] = cm->g[0] = cm->b[0] = 0;
- for (i = 1; i < CMAP_SIZE; i++) {
- cm->r[i] = cm->g[i] = cm->b[i] = 0xff;
- }
- sc->magic_x = HX_MAGIC_X; sc->magic_y = HX_MAGIC_Y;
+ memset(cm, 255, sizeof(struct hwcmap256)); /* XXX */
+ cm->r[0] = cm->g[0] = cm->b[0] = 0; /* XXX */
+
+ sc->sc_cursor.cc_magic.x = HX_MAGIC_X;
+ sc->sc_cursor.cc_magic.y = HX_MAGIC_Y;
tc_intr_establish(parent, ta->ta_cookie, TC_IPL_TTY, sfbintr, sc);
@@ -593,7 +594,7 @@
}
}
if (v & DATA_CMAP_CHANGED) {
- struct hwcmap *cm = &sc->sc_cmap;
+ struct hwcmap256 *cm = &sc->sc_cmap;
int index;
BT459_SELECT(vdac, 0);
@@ -828,7 +829,9 @@
x = sc->sc_cursor.cc_pos.x - sc->sc_cursor.cc_hot.x;
y = sc->sc_cursor.cc_pos.y - sc->sc_cursor.cc_hot.y;
- x += sc->magic_x; y += sc->magic_y; /* magic offset of HX coordinate */
+
+ x += sc->sc_cursor.cc_magic.x;
+ y += sc->sc_cursor.cc_magic.y;
s = spltty();
Home |
Main Index |
Thread Index |
Old Index