added touchscreen support, detect all known PCI chips in the Neomagic line.
We'll not bother with ISA for now.
This commit is contained in:
parent
962b898868
commit
530371ceaf
|
@ -27,10 +27,33 @@
|
||||||
#include "neomagic.h"
|
#include "neomagic.h"
|
||||||
#include <sys/io.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
|
static Bool
|
||||||
neoCardInit (KdCardInfo *card)
|
neoCardInit (KdCardInfo *card)
|
||||||
{
|
{
|
||||||
NeoCardInfo *neoc;
|
NeoCardInfo *neoc;
|
||||||
|
struct NeoChipInfo *chip;
|
||||||
|
|
||||||
neoc = (NeoCardInfo *) xalloc (sizeof (NeoCardInfo));
|
neoc = (NeoCardInfo *) xalloc (sizeof (NeoCardInfo));
|
||||||
if (!neoc)
|
if (!neoc)
|
||||||
|
@ -42,6 +65,15 @@ neoCardInit (KdCardInfo *card)
|
||||||
return FALSE;
|
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);
|
iopl (3);
|
||||||
neoMapReg (card, neoc);
|
neoMapReg (card, neoc);
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,11 @@
|
||||||
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
|
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
|
||||||
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
|
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
|
||||||
|
|
||||||
#define NEOMAGIC_VENDOR 0x10c8
|
#define NEO_VENDOR 0x10c8
|
||||||
#define NEOMAGIC_NM2230 0x0025
|
#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_BLT_BUSY 0x00000001
|
||||||
#define NEO_BS0_FIFO_AVAIL 0x00000002
|
#define NEO_BS0_FIFO_AVAIL 0x00000002
|
||||||
|
@ -106,7 +109,6 @@ typedef volatile struct {
|
||||||
CARD32 dataPtr;
|
CARD32 dataPtr;
|
||||||
} NeoMMIO;
|
} NeoMMIO;
|
||||||
|
|
||||||
|
|
||||||
typedef struct _neoCardInfo {
|
typedef struct _neoCardInfo {
|
||||||
VesaCardPrivRec vesa;
|
VesaCardPrivRec vesa;
|
||||||
CARD32 reg_base;
|
CARD32 reg_base;
|
||||||
|
@ -118,10 +120,26 @@ typedef struct _neoCardInfo {
|
||||||
int srcOrg;
|
int srcOrg;
|
||||||
int srcPitch;
|
int srcPitch;
|
||||||
int srcPixelWidth;
|
int srcPixelWidth;
|
||||||
|
|
||||||
|
struct NeoChipInfo *chip;
|
||||||
|
|
||||||
CARD32 bltCntl;
|
CARD32 bltCntl;
|
||||||
|
|
||||||
} NeoCardInfo;
|
} 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 getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
|
||||||
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
|
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)
|
||||||
|
|
|
@ -26,13 +26,20 @@
|
||||||
#endif
|
#endif
|
||||||
#include "neomagic.h"
|
#include "neomagic.h"
|
||||||
|
|
||||||
|
extern struct NeoChipInfo neoChips[];
|
||||||
|
|
||||||
void
|
void
|
||||||
InitCard (char *name)
|
InitCard (char *name)
|
||||||
{
|
{
|
||||||
KdCardAttr attr;
|
KdCardAttr attr;
|
||||||
// NM2230 MagicGraph 256AV+ the only card I have for testing
|
struct NeoChipInfo *chip;
|
||||||
if (LinuxFindPci (NEOMAGIC_VENDOR, NEOMAGIC_NM2230, 0, &attr))
|
|
||||||
KdCardInfoAdd (&neoFuncs, &attr, 0);
|
for (chip = neoChips; chip->name != NULL; ++chip) {
|
||||||
|
int j = 0;
|
||||||
|
while (LinuxFindPci(chip->vendor, chip->device, j++, &attr)) {
|
||||||
|
KdCardInfoAdd(&neoFuncs, &attr, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -45,6 +52,9 @@ void
|
||||||
InitInput (int argc, char **argv)
|
InitInput (int argc, char **argv)
|
||||||
{
|
{
|
||||||
KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
|
KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
|
||||||
|
#ifdef TOUCHSCREEN
|
||||||
|
KdInitTouchScreen (&TsFuncs);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue