xserver/hw/kdrive/neomagic neomagic.c, 1.1, 1.2 neomagic.h, 1.1,
1.2 neomagicstub.c, 1.1, 1.2
Brent Cook
xserver-commit at pdx.freedesktop.org
Sat Apr 3 14:26:39 PST 2004
- Previous message: xserver/hw/kdrive/neomagic Makefile.am, NONE, 1.1 neo_draw.c, NONE,
1.1 neomagic.c, NONE, 1.1 neomagic.h, NONE, 1.1 neomagicstub.c,
NONE, 1.1
- Next message: xserver/hw/kdrive/neomagic backend.c, NONE, 1.1 backend.h, NONE,
1.1 Makefile.am, 1.1, 1.2 neo_draw.c, 1.1, 1.2 neomagic.c, 1.2,
1.3 neomagic.h, 1.2, 1.3 neomagicstub.c, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: busterb
Update of /cvs/xserver/xserver/hw/kdrive/neomagic
In directory pdx:/tmp/cvs-serv29747
Modified Files:
neomagic.c neomagic.h neomagicstub.c
Log Message:
added touchscreen support, detect all known PCI chips in the Neomagic line.
We'll not bother with ISA for now.
Index: neomagic.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neomagic.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/neomagic.c 3 Apr 2004 22:22:48 -0000 1.1
+++ b/neomagic.c 3 Apr 2004 22:26:37 -0000 1.2
@@ -27,10 +27,33 @@
#include "neomagic.h"
#include <sys/io.h>
+struct NeoChipInfo neoChips[] = {
+ {NEO_VENDOR, 0x0001, CAP_NM2070, "MagicGraph 128 (NM2070)",
+ 896, 65000, 2048, 0x100, 1024, 1024, 1024},
+ {NEO_VENDOR, 0x0002, CAP_NM2090, "MagicGraph 128V (NM2090)",
+ 1152, 80000, 2048, 0x100, 2048, 1024, 1024},
+ {NEO_VENDOR, 0x0003, CAP_NM2090, "MagicGraph 128ZV (NM2093)",
+ 1152, 80000, 2048, 0x100, 2048, 1024, 1024},
+ {NEO_VENDOR, 0x0083, CAP_NM2097, "MagicGraph 128ZV+ (NM2097)",
+ 1152, 80000, 1024, 0x100, 2048, 1024, 1024},
+ {NEO_VENDOR, 0x0004, CAP_NM2097, "MagicGraph 128XD (NM2160)",
+ 2048, 90000, 1024, 0x100, 2048, 1024, 1024},
+ {NEO_VENDOR, 0x0005, CAP_NM2200, "MagicGraph 256AV (NM2200)",
+ 2560, 110000, 1024, 0x1000, 4096, 1280, 1024},
+ {NEO_VENDOR, 0x0025, CAP_NM2200, "MagicGraph 256AV+ (NM2230)",
+ 3008, 110000, 1024, 0x1000, 4096, 1280, 1024},
+ {NEO_VENDOR, 0x0006, CAP_NM2200, "MagicGraph 256ZX (NM2360)",
+ 4096, 110000, 1024, 0x1000, 4096, 1280, 1024},
+ {NEO_VENDOR, 0x0016, CAP_NM2200, "MagicGraph 256XL+ (NM2380)",
+ 6144, 110000, 1024, 0x1000, 8192, 1280, 1024},
+ {0, 0, 0, NULL},
+};
+
static Bool
neoCardInit (KdCardInfo *card)
{
NeoCardInfo *neoc;
+ struct NeoChipInfo *chip;
neoc = (NeoCardInfo *) xalloc (sizeof (NeoCardInfo));
if (!neoc)
@@ -42,6 +65,15 @@
return FALSE;
}
+ for (chip = neoChips; chip->name != NULL; ++chip) {
+ if (chip->device == card->attr.deviceID) {
+ neoc->chip = chip;
+ break;
+ }
+ }
+
+ ErrorF("Using Neomagic card: %s\n", neoc->chip->name);
+
iopl (3);
neoMapReg (card, neoc);
Index: neomagic.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neomagic.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/neomagic.h 3 Apr 2004 22:22:48 -0000 1.1
+++ b/neomagic.h 3 Apr 2004 22:26:37 -0000 1.2
@@ -38,8 +38,11 @@
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
-#define NEOMAGIC_VENDOR 0x10c8
-#define NEOMAGIC_NM2230 0x0025
+#define NEO_VENDOR 0x10c8
+#define CAP_NM2070 0x01 /* If it's a NM2070 series */
+#define CAP_NM2090 0x02 /* If it's a NM2090 series */
+#define CAP_NM2097 0x03 /* If it's a NM2097 series */
+#define CAP_NM2200 0x04 /* If it's a NM2200 series */
#define NEO_BS0_BLT_BUSY 0x00000001
#define NEO_BS0_FIFO_AVAIL 0x00000002
@@ -106,7 +109,6 @@
CARD32 dataPtr;
} NeoMMIO;
-
typedef struct _neoCardInfo {
VesaCardPrivRec vesa;
CARD32 reg_base;
@@ -118,10 +120,26 @@
int srcOrg;
int srcPitch;
int srcPixelWidth;
+
+ struct NeoChipInfo *chip;
CARD32 bltCntl;
} NeoCardInfo;
+
+struct NeoChipInfo {
+ CARD16 vendor;
+ CARD16 device;
+ CARD8 caps;
+ char *name;
+ int videoRam;
+ int maxClock;
+ int cursorMem;
+ int cursorOff;
+ int linearSize;
+ int maxWidth;
+ int maxHeight;
+};
#define getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
Index: neomagicstub.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neomagicstub.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/neomagicstub.c 3 Apr 2004 22:22:48 -0000 1.1
+++ b/neomagicstub.c 3 Apr 2004 22:26:37 -0000 1.2
@@ -26,13 +26,20 @@
#endif
#include "neomagic.h"
+extern struct NeoChipInfo neoChips[];
+
void
InitCard (char *name)
{
KdCardAttr attr;
- // NM2230 MagicGraph 256AV+ the only card I have for testing
- if (LinuxFindPci (NEOMAGIC_VENDOR, NEOMAGIC_NM2230, 0, &attr))
- KdCardInfoAdd (&neoFuncs, &attr, 0);
+ struct NeoChipInfo *chip;
+
+ for (chip = neoChips; chip->name != NULL; ++chip) {
+ int j = 0;
+ while (LinuxFindPci(chip->vendor, chip->device, j++, &attr)) {
+ KdCardInfoAdd(&neoFuncs, &attr, 0);
+ }
+ }
}
void
@@ -45,6 +52,9 @@
InitInput (int argc, char **argv)
{
KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
+#ifdef TOUCHSCREEN
+ KdInitTouchScreen (&TsFuncs);
+#endif
}
void
- Previous message: xserver/hw/kdrive/neomagic Makefile.am, NONE, 1.1 neo_draw.c, NONE,
1.1 neomagic.c, NONE, 1.1 neomagic.h, NONE, 1.1 neomagicstub.c,
NONE, 1.1
- Next message: xserver/hw/kdrive/neomagic backend.c, NONE, 1.1 backend.h, NONE,
1.1 Makefile.am, 1.1, 1.2 neo_draw.c, 1.1, 1.2 neomagic.c, 1.2,
1.3 neomagic.h, 1.2, 1.3 neomagicstub.c, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the xserver-commit
mailing list