Commit 3685e43c authored by Kaleb Keithley Keithley's avatar Kaleb Keithley Keithley
Browse files

Initial revision

parents
NM2160 Register GUESS
--- Overlay and ZV capture ---
2002,2.3.
1. Overlay
GRB0 bit5 Format; 0:YUY2/1:RGB
bit1 1
bit0 Enable overlay ; 1:enable/0:disable
GRB1 bit7:4 X2[11:8]
bit3:0 X1[11:8]
GRB2 X1[7:0]
GRB3 X2[7:0]
GRB4 bit7:4 Y2[11:8]
bit3:0 Y1[11:8]
GRB5 Y1[7:0]
GRB6 Y2[7:0]
GRB7 VRAM offset[24:17]
GRB8 VRAM offset[16:9]
GRB9 VRAM offset[8:1]
GRBA Width in byte[15:8]
GRBB Width in byte[7:0]
GRBC 0x4f
GRBD -
GRBE -
GRBF bit2 0:normal/1:mirror
bit1:0 b'10'
GRC0 X scale[15:8] ; x1.0 == 0x1000
GRC1 X scale[7:0]
GRC2 Y scale[15:8] ; x1.0 == 0x1000
GRC3 Y scale[7:0]
GRC4 brightness ; -128 to +127
GRC5 Color key(R)
GRC6 Color key(G) / Color key(8bpp)
GRC7 Color key(B)
2. ZV capture
GR0A bit5 Enable extended SR reg. ; 1:enable/0:disable
bit0 1
SR08 bit7:1 b'1010000'
bit0 Enable capture ; 1:enable/0:disable
SR09 0x11
SR0A 0x00
SR0B -
SR0C VRAM offset[8:1]
SR0D VRAM offset[16:9]
SR0E VRAM offset[24:17]
SR0F -
SR10 -
SR11 -
SR12 -
SR13 -
SR14 Y1[7:0]
SR15 Y2[7:0]
SR16 bit7:4 Y2[11:4]
bit3:0 Y1[11:4]
SR17 X1[7:0]
SR18 X2[7:0]
SR19 bit7:4 X2[11:8]
bit3:0 X1[11:8]
SR1A Width in byte[7:0]
SR1B Width in byte[15:8]
SR1C 0xfb
SR1D 0x00
SR1E 0xe2
SR1F 0x02
s.nomura@mba.nifty.ne.jp
Information for NeoMagic Users
NeoMagic Driver Version 0.2/4.0
(based on version 2.0.0/3.3.3)
1) Supported hardware
* NeoMagic 2200 (MagicMedia256AV)
* NeoMagic 2160 (MagicGraph128XD)
* NeoMagic 2097 (MagicGraph128ZV+)
* NeoMagic 2093 (MagicGraph128ZV)
* NeoMagic 2090 (MagicGraph128V)
* NeoMagic 2070 (MagicGraph128)
2) Features
* Full support for internal flat panels, external monitors, and
simultaneous internal/external displays.
* Complete set of Panel Resolutions supported including stretch and
centering modes for running lower resolutions on fixed resolution
panels.
* Support for depths of 8, 15, 16 and 24 bits per pixel.
* Hardware Cursor support to reduce sprite flicker.
* Hardware accelerated drawing engine for 8, 15 and 16 bit per
pixel modes.
* Fully programmable clocks supported in external monitor only
mode.
* Robust text mode restore for VT switching.
3) Technical Notes
* Enable both internal "intern_disp" and external "extern_disp"
options to get simultaneous panel/CRT support.
4) Reported Working Laptops
* Acer Travelmate 7120T
* Acer Extensa 367, 367D & 710TE
* Actebis TN559Pro
* Asus P6300
* CTX EzBook 700 & 77X series
* Compaq Presario 1080, 1210, 1215, 1220, 1610, 1611, 1620, 1621 & 1640
* Dell Inspiron 3000 & 3200
* Dell Latitude CP, CPi, LM & XPi
* Digital VP HiNote 575, 703, 717 & 720
* FIC DESIGNote 5550
* Fujitsu LifeBook 420D & 656Tx
* Gateway 2000 Solo 2300XL, 2500LS & 5150
* Highscreen XD Advance II 21,1" TFT
* Hi-Grade Notino AS6000 pII/266Mhz
* Hitachi VisionBook Plus 5000
* HP Omnibook 800, 3000, 3100, 4100 & Sojourn
* IBM ThinkPad 380D, 380E, 380ED, 380XD, 385XD, 560X & 600
* LEO DESIGNote 5550
* Micron Transport XKE
* NEC Ready 330T
* NEC Versa 2780 MT, 5060X, 5080X, 6060 & 6230
* NEC MB12C/UV (mobio NX)
* OPTI Phoenix
* Panasonic CF_S21, CF-25 MKIII & CF-35
* Quantex H-1330
* Sceptre 4500
* SEH DESIGNote 5550
* Siemens Nixdorf Scenic 510
* Sony PCG-505, PCG-705, PCG-717, PCG-719 & PCG-731
* TI Extensa 660 CDT
* Toshiba Libretto 100CT
* Toshiba Protege SS3000
* UMAX 520T
5) Configuration
The driver auto-detects all device info included memory size, so
use the following device section in your XF86Config file:
Section "Device"
Identifier "NeoMagic"
EndSection
or let xf86config or XF86Setup do this for you.
But if you have problems with auto-detection, you can specify:
VideoRam - in kilobytes
DacSpeed - in MHz
MemBase - physical address of the linear framebuffer
IOBase - physical address of the memory mapped IO registers
6) Driver Options
"no_linear" - banked framebuffer mode
"no_accel" - software rendering only
"sw_cursor" - software cursor only
"no_mmio" - use I/O space directly
"intern_disp" - enable internal display (default)
"extern_disp" - enable external display
"no_stretch" - disable stretching of lower resolution modes on panel
"lcd_center" - center lower resolution modes on panel
NOTE: Stretching of panel image is on by default for lower panel
resolutions.
Options useful for special lcd mode setting (should not be needed):
"prog_lcd_mode_regs" - set special lcd mode registers (2070 default)
"no_prog_lcd_mode_regs" - don't set lcd mode registers (non-2070 default)
"prog_lcd_mode_stretch" - force lcd mode regs if stretching is enabled
"no_prog_lcd_mode_stretch" - no lcd mode regs if stretching (default)
Option for subnotebooks and other laptops with uncommon size panels:
"override_validate_mode" - disable LCD mode checking
WARNING: Disabling mode checking will allow for invalid modes that
could damage your LCD.
7) Known Limitations
* External monitor support on the NM2070.
* Banked, or no_linear mode on the NM2070.
* Horizontal centering for lower than panel resolution on NM2070.
8) Authors
The original version of the driver - written for Xfree86 3.3 -
done by:
Jens Owen (jens@tungstengraphics.com)
Kevin E. Martin (kevin@precisioninsight.com)
Precision Insight, Inc.
Cedar Park, TX USA
http://www.precisioninsight.com
Port to Xfree86 4.0 done by:
Egbert Eich (Egbert.Eich@Physik.TU-Darmstadt.de)
$XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/README,v 1.2 2002/10/30 12:52:20 alanh Exp $
1. Acceleration:
a. Limitations from 3.3 apply.
b. No CPU to Screen color expand. Chipset requires SCANLINE_PAD_BYTE
XAA only supports SCANLINE_PAD_WORD
2. Driver itself:
a. VL bus probe might be too intrusive
b. min clock guessed 11.0 MHz
c. guessed: interlace allowed only when external display is enabled.
d. display pitch guessed to be 8 bit.
3. I2C Support:
a. Readback of clockline not implemented.
$XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/TODO,v 1.1 1999/04/17 07:06:16 dawes Exp $
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.man,v 1.4 2003/02/20 03:22:52 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH NEOMAGIC __drivermansuffix__ __vendorversion__
.SH NAME
neomagic \- Neomagic video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qneomagic\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B neomagic
is an XFree86 driver for the Neomagic graphics chipsets found in many
laptop computers.
.SH SUPPORTED HARDWARE
.B neomagic
supports the following chipsets:
.PP
.TP
MagicGraph 128 (NM2070)
.TP
MagicGraph 128V (NM2090)
.TP
MagicGraph 128ZV (NM2093)
.TP
MagicGraph 128ZV+ (NM2097)
.TP
MagicGraph 128XD (NM2160)
.TP
MagicGraph 256AV (NM2200)
.TP
MagicGraph 256AV+ (NM2230)
.TP
MagicGraph 256ZX (NM2360)
.TP
MagicGraph 256XL+ (NM2380)
.PP
The driver supports depths 8, 15, 16 and 24 for all chipsets except the
NM2070 which does not support depth 24. All depths are accelerated except for
depth 24 which is only accelerated on NM2200
and newer models. All visuals are supported in depth 8. TrueColor and
DirectColor visuals are supported in the other depths.
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
The following driver
.B Options
are supported
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
Disable or enable acceleration. Default: acceleration is enabled.
.TP
.BI "Option \*qSWCursor\*q \*q" boolean \*q
Disable or enable software cursor. Default: software cursor is disable
and a hardware cursor is used.
.TP
.BI "Option \*qPCIBurst\*q \*q" boolean \*q
Disable or enable PCI burst modes. Default: enabled.
.TP
.BI "Option \*qRotate\*q \*qCW\*q"
.TP
.BI "Option \*qRotate\*q \*qCCW\*q"
Rotate the display clockwise or counterclockwise. This mode is unaccelerated.
Default: no rotation.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. Default: off.
.TP
.BI "Option \*qOverlayMem\*q \*q" integer \*q
Reserve the given amount of memory (in bytes) for the XVideo overlay. On
boards with limited memory, display of large XVideo buffers might fail due
to insufficient available memory. Using this option solves the problem at
the expense of reducing the memory avilable for other operations. For
full\-resolution DVDs, 829440 bytes (720x576x2) are necessary.
.PP
.B Note
.br
On some laptops using the 2160 chipset (MagicGraph 128XD) the
following options are needed to avoid a lock-up of the graphic engine:
.nf
Option "XaaNoScanlineImageWriteRect"
Option "XaaNoScanlineCPUToScreenColorExpandFill"
.fi
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
Authors include: Jens Owen, Kevin E. Martin, and also Egbert Eich,
Mark Vojkovich, Alan Hourihane.
/**********************************************************************
Copyright 1998, 1999 by Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Precision Insight not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. Precision Insight
and its suppliers make no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h,v 1.23 2002/10/30 12:52:21 alanh Exp $ */
/*
* The original Precision Insight driver for
* XFree86 v.3.3 has been sponsored by Red Hat.
*
* Authors:
* Jens Owen (jens@tungstengraphics.com)
* Kevin E. Martin (kevin@precisioninsight.com)
*
* Port to Xfree86 v.4.0
* 1998, 1999 by Egbert Eich (Egbert.Eich@Physik.TU-Darmstadt.DE)
*/
/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
/* Everything using inb/outb, etc needs "compiler.h" */
#include "compiler.h"
#include "xaa.h"
#include "xaalocal.h" /* XAA internals as we replace some of XAA */
#include "xf86Cursor.h"
#include "shadowfb.h"
#include "vbe.h"
/* Needed by the Shadow Framebuffer */
#include "shadow.h"
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
#include "xf86i2c.h"
#ifdef XvExtension
# include "xf86xv.h"
# include "Xv.h"
#endif /* XvExtension */
/*
* Driver data structures.
*/
#include "neo_reg.h"
#include "neo_macros.h"
/* Supported chipsets */
typedef enum {
NM2070,
NM2090,
NM2093,
NM2097,
NM2160,
NM2200,
NM2230,
NM2360,
NM2380
} NEOType;
/* function prototypes */
extern Bool NEOSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
extern void NEOAdjustFrame(int scrnIndex, int x, int y, int flags);
/* in neo_2070.c */
extern Bool Neo2070AccelInit(ScreenPtr pScreen);
/* in neo_2090.c */
extern Bool Neo2090AccelInit(ScreenPtr pScreen);
/* in neo_2097.c */
extern Bool Neo2097AccelInit(ScreenPtr pScreen);
/* in neo_2200.c */
extern Bool Neo2200AccelInit(ScreenPtr pScreen);
/* in neo_cursor.c */
extern Bool NeoCursorInit(ScreenPtr pScrn);
extern void NeoShowCursor(ScrnInfoPtr pScrn);
extern void NeoHideCursor(ScrnInfoPtr pScrn);
/* in neo_bank.c */
int NEOSetReadWrite(ScreenPtr pScreen, int bank);
int NEOSetWrite(ScreenPtr pScreen, int bank);
int NEOSetRead(ScreenPtr pScreen, int bank);
/* in neo_i2c.c */
extern Bool neo_I2CInit(ScrnInfoPtr pScrn);
/* in neo_shadow.c */
void neoShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf);
void neoPointerMoved(int index, int x, int y);
void neoRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void neoRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void neoRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void neoRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void neoRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
/* in neo_dga.c */
Bool NEODGAInit(ScreenPtr pScreen);
/* in neo_video.c */
extern void NEOInitVideo(ScreenPtr pScreen);
extern void NEOResetVideo(ScrnInfoPtr pScrn);
/* shadow regs */
#define NEO_EXT_CR_MAX 0x85
#define NEO_EXT_GR_MAX 0xC7
typedef struct {
unsigned char CR[NEO_EXT_CR_MAX+1];
unsigned char GR[NEO_EXT_GR_MAX+1];
} regSaveRec, *regSavePtr;
/* registers */
typedef struct {
unsigned char GeneralLockReg;
unsigned char ExtCRTDispAddr;
unsigned char ExtCRTOffset;
unsigned char SysIfaceCntl1;
unsigned char SysIfaceCntl2;
unsigned char ExtColorModeSelect;
unsigned char SingleAddrPage;
unsigned char DualAddrPage;
unsigned char biosMode;
unsigned char PanelDispCntlReg1;
unsigned char PanelDispCntlReg2;
unsigned char PanelDispCntlReg3;
unsigned char PanelVertCenterReg1;
unsigned char PanelVertCenterReg2;
unsigned char PanelVertCenterReg3;
unsigned char PanelVertCenterReg4;
unsigned char PanelVertCenterReg5;
unsigned char PanelHorizCenterReg1;
unsigned char PanelHorizCenterReg2;
unsigned char PanelHorizCenterReg3;
unsigned char PanelHorizCenterReg4;
unsigned char PanelHorizCenterReg5;
unsigned char Sequencer1;
Bool ProgramVCLK;
unsigned char VCLK3NumeratorLow;
unsigned char VCLK3NumeratorHigh;
unsigned char VCLK3Denominator;
unsigned char VerticalExt;
regSavePtr reg;
} NeoRegRec, *NeoRegPtr;
typedef struct {
/* Hardware cursor address */
unsigned int CursorAddress;
Bool UseHWCursor;
Bool NoCursorMode;
unsigned char CursTemp[1024];
/* Boundaries of the pixmap cache */
unsigned int cacheStart;
unsigned int cacheEnd;
/* Blitter */
unsigned int tmpBltCntlFlags;
unsigned int BltCntlFlags;
unsigned int BltModeFlags;
unsigned int ColorShiftAmt;
unsigned int Pitch;
unsigned int PixelWidth;
unsigned int PlaneMask;
int CPUToScreenColorExpandFill_x;
int CPUToScreenColorExpandFill_y;
int CPUToScreenColorExpandFill_w;
int CPUToScreenColorExpandFill_h;
int CPUToScreenColorExpandFill_skipleft;
} NEOACLRec, *NEOACLPtr;
#define NEOACLPTR(p) &((NEOPtr)((p)->driverPrivate))->Accel
/* globals */
typedef struct neoRec
{
int NeoChipset;
pciVideoPtr PciInfo;
PCITAG PciTag;
EntityInfoPtr pEnt;
XAAInfoRecPtr AccelInfoRec;
NEOACLRec Accel;
unsigned long NeoMMIOAddr;
unsigned long NeoLinearAddr;
unsigned char* NeoMMIOBase;
unsigned long NeoMMIOAddr2;
unsigned char* NeoMMIOBase2;
unsigned char* NeoFbBase;
long NeoFbMapSize;
unsigned long vgaIOBase;
DGAModePtr DGAModes;
int numDGAModes;
Bool DGAactive;
int DGAViewportStatus;
/* ??? */
int NeoFifoCount;
/* cursor */
int NeoCursorMem;
Bool NeoHWCursorShown;
Bool NeoHWCursorInitialized;
xf86CursorInfoPtr CursorInfo;
int NeoCursorOffset;
int NeoCursorPrevX;
int NeoCursorPrevY;
unsigned char *NeoCursorImage;
/* Panels size */
int NeoPanelWidth;
int NeoPanelHeight;
/* options */
OptionInfoPtr Options;
Bool noLinear;
Bool noAccel;
Bool noAccelSet;
Bool swCursor;
Bool noMMIO;
Bool internDisp;
Bool externDisp;
Bool noLcdStretch;
Bool shadowFB;
Bool lcdCenter;
Bool onPciBurst;
Bool progLcdRegs;
Bool progLcdStretch;
Bool progLcdStretchOpt;
Bool overrideValidate;
Bool strangeLockups;
/* registers */
NeoRegRec NeoModeReg;
NeoRegRec NeoSavedReg;
/* proc pointer */
CloseScreenProcPtr CloseScreen;
I2CBusPtr I2C;
vbeInfoPtr pVbe;
unsigned char * ShadowPtr;
int ShadowPitch;
RefreshAreaFuncPtr refreshArea;
void (*PointerMoved)(int index, int x, int y);
int rotate;
Bool showcache;
#ifdef XvExtension
Bool video;
double videoHZoom;
double videoVZoom;
XF86VideoAdaptorPtr overlayAdaptor;
int overlay;
int overlay_offset;
int videoKey;
int interlace;
#endif /* XvExtension */
} NEORec, *NEOPtr;
typedef struct {
int x_res;
int y_res;
int mode;
} biosMode;
/* The privates of the NEO driver */
#define NEOPTR(p) ((NEOPtr)((p)->driverPrivate))
/* I/O register offsets */
#define GRAX 0x3CE
/* vga IO functions */
#define VGArCR(index) (*hwp->readCrtc)(hwp, index)
#define VGAwCR(index, val) (*hwp->writeCrtc)(hwp, index, val)
#define VGArGR(index) (*hwp->readGr)(hwp, index)
#define VGAwGR(index, val) (*hwp->writeGr)(hwp, index, val)
#define VGArSR(index) (*hwp->readSeq)(hwp, index)
#define VGAwSR(index, val) (*hwp->writeSeq)(hwp, index, val)
/* memory mapped register access macros */
#define INREG8(addr) MMIO_IN8(nPtr->NeoMMIOBase, addr)
#define INREG16(addr) MMIO_IN16(nPtr->NeoMMIOBase, addr)
#define INREG(addr) MMIO_IN32(nPtr->NeoMMIOBase, addr)
#define OUTREG8(addr, val) MMIO_OUT8(nPtr->NeoMMIOBase, addr, val)
#define OUTREG16(addr, val) MMIO_OUT16(nPtr->NeoMMIOBase, addr, val)
#define OUTREG(addr, val) MMIO_OUT32(nPtr->NeoMMIOBase, addr, val)
/* This swizzle macro is to support the manipulation of cursor masks when
* the sprite moves off the left edge of the display. This code is
* platform specific, and is known to work with 32bit little endian machines
*/
#define SWIZZLE32(__b) { \
((unsigned char *)&__b)[0] = byte_reversed[((unsigned char *)&__b)[0]]; \
((unsigned char *)&__b)[1] = byte_reversed[((unsigned char *)&__b)[1]]; \
((unsigned char *)&__b)[2] = byte_reversed[((unsigned char *)&__b)[2]]; \
((unsigned char *)&__b)[3] = byte_reversed[((unsigned char *)&__b)[3]]; \