mirror of
https://github.com/X11Libre/xf86-video-neomagic.git
synced 2026-03-24 01:24:16 +00:00
Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`
`git diff -w` & `git diff -b` show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-neomagic/-/merge_requests/11>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,8 +71,8 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-video-neomagic
|
||||
# Add & Override patterns for xf86-video-neomagic
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
|
||||
6
COPYING
6
COPYING
@@ -10,7 +10,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -67,7 +67,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Copyright (c) 1999, 2000 The XFree86 Project Inc.
|
||||
Copyright (c) 1999, 2000 The XFree86 Project Inc.
|
||||
based on code written by Mark Vojkovich <markv@valinux.com>
|
||||
|
||||
Copyright 2002 by Shigehiro Nomura.
|
||||
@@ -82,7 +82,7 @@ supporting documentation, and that the name of Shigehiro Nomura not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission. Shigehiro Nomura
|
||||
and its suppliers make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
SHIGEHIRO NOMURA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
NM2160 Register GUESS
|
||||
NM2160 Register GUESS
|
||||
--- Overlay and ZV capture ---
|
||||
|
||||
2002,2.3.
|
||||
|
||||
6
README
6
README
@@ -1,7 +1,7 @@
|
||||
|
||||
Information for NeoMagic Users
|
||||
NeoMagic Driver Version 0.2/4.0
|
||||
(based on version 2.0.0/3.3.3)
|
||||
(based on version 2.0.0/3.3.3)
|
||||
|
||||
|
||||
1) Supported hardware
|
||||
@@ -131,8 +131,8 @@
|
||||
* Horizontal centering for lower than panel resolution on NM2070.
|
||||
|
||||
8) Authors
|
||||
|
||||
The original version of the driver - written for Xfree86 3.3 -
|
||||
|
||||
The original version of the driver - written for Xfree86 3.3 -
|
||||
done by:
|
||||
Jens Owen (jens@tungstengraphics.com)
|
||||
Kevin E. Martin (kevin@precisioninsight.com)
|
||||
|
||||
4
TODO
4
TODO
@@ -1,5 +1,5 @@
|
||||
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
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
3. I2C Support:
|
||||
|
||||
a. Readback of clockline not implemented.
|
||||
a. Readback of clockline not implemented.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
#
|
||||
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -181,7 +181,7 @@ typedef struct {
|
||||
#define NEOACLPTR(p) &((NEOPtr)((p)->driverPrivate))->Accel
|
||||
|
||||
/* globals */
|
||||
typedef struct neoRec
|
||||
typedef struct neoRec
|
||||
{
|
||||
int NeoChipset;
|
||||
pciVideoPtr PciInfo;
|
||||
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -59,7 +59,7 @@ NeoShowCursor(ScrnInfoPtr pScrn)
|
||||
|
||||
/* turn cursor on */
|
||||
OUTREG(NEOREG_CURSCNTL, NEO_CURS_ENABLE);
|
||||
nPtr->NeoHWCursorShown = TRUE;
|
||||
nPtr->NeoHWCursorShown = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -67,9 +67,9 @@ NeoHideCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
|
||||
|
||||
/*
|
||||
* turn cursor off
|
||||
* turn cursor off
|
||||
*
|
||||
* Sometimes we loose the I/O map, so directly use I/O here
|
||||
*/
|
||||
@@ -99,7 +99,7 @@ neoSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
nAcl->CursorAddress);
|
||||
unsigned char *src = nPtr->NeoCursorImage;
|
||||
int xoff = 0, yoff = 0;
|
||||
|
||||
|
||||
if ((y < 0) && (y > (-MAX_CURS))) {
|
||||
yoff = -y;
|
||||
y = 0;
|
||||
@@ -111,16 +111,16 @@ neoSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
if (yoff != nPtr->NeoCursorPrevY || xoff !=nPtr->NeoCursorPrevX) {
|
||||
nPtr->NeoCursorPrevY = yoff;
|
||||
nPtr->NeoCursorPrevX = xoff;
|
||||
|
||||
|
||||
/* This is for sprites that move off the top of the display.
|
||||
* this code simply updates the pointer used for loading the sprite.
|
||||
* Note, in our driver's RealizeCursor, the allocated buffer size
|
||||
* is twice as large as needed, and we initialize the upper half to all
|
||||
* zeros, so we can use this pointer trick here.
|
||||
*/
|
||||
|
||||
|
||||
if (yoff) {
|
||||
src += (yoff * 16);
|
||||
src += (yoff * 16);
|
||||
}
|
||||
|
||||
/* This is for sprites that move off the left edge of the display.
|
||||
@@ -134,16 +134,16 @@ neoSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
for (i=0; i<256; i+=2) {
|
||||
bits = ((CARD32 *)src)[i];
|
||||
bits2 = ((CARD32 *)src)[i+1];
|
||||
|
||||
|
||||
REVBITS_32(bits);
|
||||
REVBITS_32(bits2);
|
||||
|
||||
|
||||
bits = ((bits >> xoff) | (bits2 << (32-xoff)));
|
||||
bits2 >>= xoff;
|
||||
|
||||
|
||||
REVBITS_32(bits);
|
||||
REVBITS_32(bits2);
|
||||
|
||||
|
||||
((CARD32 *) nAcl->CursTemp)[i] = bits;
|
||||
((CARD32 *) nAcl->CursTemp)[i+1] = bits2;
|
||||
}
|
||||
@@ -154,12 +154,12 @@ neoSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
bits2 = ((CARD32 *)src)[i+1];
|
||||
|
||||
REVBITS_32(bits2);
|
||||
|
||||
|
||||
bits = (bits2 >> (xoff-32));
|
||||
bits2 = 0;
|
||||
|
||||
|
||||
REVBITS_32(bits);
|
||||
|
||||
|
||||
((CARD32 *)nAcl->CursTemp)[i] = bits;
|
||||
((CARD32 *)nAcl->CursTemp)[i+1] = bits2;
|
||||
}
|
||||
@@ -169,10 +169,10 @@ neoSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
memcpy(_dest, src, 1024);
|
||||
OUTREG(NEOREG_CURSMEMPOS, ((0x000f & (nAcl->CursorAddress >> 10)) << 8) |
|
||||
((0x0ff0 & (nAcl->CursorAddress >> 10)) >> 4));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Move the cursor */
|
||||
OUTREG(NEOREG_CURSX, x);
|
||||
OUTREG(NEOREG_CURSY, y);
|
||||
@@ -200,7 +200,7 @@ _neoLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src, int xoff, int yoff)
|
||||
int i;
|
||||
unsigned char *_dest, *_src;
|
||||
int _width, _fill;
|
||||
|
||||
|
||||
for (i = 0; i< nPtr->CursorInfo->MaxHeight - yoff; i++) {
|
||||
_dest = ((unsigned char *)nPtr->NeoFbBase
|
||||
+ nAcl->CursorAddress
|
||||
@@ -209,22 +209,22 @@ _neoLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src, int xoff, int yoff)
|
||||
- (xoff & 0x38)) >> 3;
|
||||
_src = (src + ((nPtr->CursorInfo->MaxWidth >> 2) * i));
|
||||
_fill = (xoff & 0x38) >> 3;
|
||||
|
||||
|
||||
memcpy(_dest,_src,_width);
|
||||
memset(_dest + _width, 0, _fill);
|
||||
|
||||
|
||||
_dest += (nPtr->CursorInfo->MaxWidth >> 3);
|
||||
_src += (nPtr->CursorInfo->MaxWidth >> 3);
|
||||
memcpy(_dest,_src,_width);
|
||||
memset(_dest + _width, 0, _fill);
|
||||
}
|
||||
memset(nPtr->NeoFbBase + nAcl->CursorAddress
|
||||
memset(nPtr->NeoFbBase + nAcl->CursorAddress
|
||||
+ ((nPtr->CursorInfo->MaxWidth >> 2) * i),
|
||||
0, (nPtr->CursorInfo->MaxHeight - i)
|
||||
* (nPtr->CursorInfo->MaxWidth >> 2));
|
||||
/* set cursor address here or we loose the cursor on video mode change */
|
||||
/* Load storage location. */
|
||||
OUTREG(NEOREG_CURSMEMPOS, ((0x000f & (nAcl->CursorAddress >> 10)) << 8) |
|
||||
OUTREG(NEOREG_CURSMEMPOS, ((0x000f & (nAcl->CursorAddress >> 10)) << 8) |
|
||||
((0x0ff0 & (nAcl->CursorAddress >> 10)) >> 4));
|
||||
}
|
||||
|
||||
@@ -233,10 +233,10 @@ neoLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
|
||||
{
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
nPtr->NeoCursorImage = src; /* store src address for later use */
|
||||
|
||||
|
||||
/* Reset these because we have a new cursor image */
|
||||
nPtr->NeoCursorPrevY = nPtr->NeoCursorPrevX = 0;
|
||||
|
||||
|
||||
_neoLoadCursorImage(pScrn,src,0,0);
|
||||
}
|
||||
|
||||
@@ -263,14 +263,14 @@ neoRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
|
||||
SrcM = (CARD32*)pCurs->bits->mask;
|
||||
DstS = (CARD32*)mem;
|
||||
DstM = DstS + (DstPitch >> 1);
|
||||
|
||||
for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
|
||||
y--;
|
||||
|
||||
for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
|
||||
y--;
|
||||
pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
|
||||
for(x = 0; x < SrcPitch; x++) {
|
||||
pSrc[x] = ~SrcS[x] & SrcM[x];
|
||||
pMsk[x] = SrcM[x];
|
||||
for (z = 0; z < 4; z++) {
|
||||
for (z = 0; z < 4; z++) {
|
||||
((char *)pSrc)[x*4+z] =
|
||||
byte_reversed[((char *)pSrc)[x*4+z] & 0xFF];
|
||||
((char *)pMsk)[x*4+z] =
|
||||
@@ -310,7 +310,7 @@ NeoCursorInit(ScreenPtr pScreen)
|
||||
infoPtr->ShowCursor = NeoShowCursor;
|
||||
infoPtr->UseHWCursor = neoUseHWCursor;
|
||||
infoPtr->RealizeCursor = neoRealizeCursor;
|
||||
|
||||
|
||||
return(xf86InitCursor(pScreen, infoPtr));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "dgaproc.h"
|
||||
#include "vgaHW.h"
|
||||
|
||||
static Bool NEO_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
static Bool NEO_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
int *, int *, int *);
|
||||
static Bool NEO_SetMode(ScrnInfoPtr, DGAModePtr);
|
||||
static int NEO_GetViewport(ScrnInfoPtr);
|
||||
@@ -52,7 +52,7 @@ DGAFunctionRec NEODGAFuncs = {
|
||||
|
||||
Bool
|
||||
NEODGAInit(ScreenPtr pScreen)
|
||||
{
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
NEOPtr pNEO = NEOPTR(pScrn);
|
||||
DGAModePtr modes = NULL, newmodes = NULL, currentMode;
|
||||
@@ -101,13 +101,13 @@ NEODGAInit(ScreenPtr pScreen)
|
||||
currentMode->offset = 0;
|
||||
currentMode->address = pNEO->NeoFbBase;
|
||||
|
||||
currentMode->bytesPerScanline =
|
||||
currentMode->bytesPerScanline =
|
||||
((pScrn->displayWidth * Bpp) + 3) & ~3L;
|
||||
currentMode->imageWidth = pScrn->displayWidth;
|
||||
currentMode->imageHeight = imlines;
|
||||
currentMode->pixmapWidth = currentMode->imageWidth;
|
||||
currentMode->pixmapHeight = pixlines;
|
||||
currentMode->maxViewportX = currentMode->imageWidth -
|
||||
currentMode->maxViewportX = currentMode->imageWidth -
|
||||
currentMode->viewportWidth;
|
||||
currentMode->maxViewportY = currentMode->imageHeight -
|
||||
currentMode->viewportHeight;
|
||||
@@ -120,7 +120,7 @@ NEODGAInit(ScreenPtr pScreen)
|
||||
pNEO->numDGAModes = num;
|
||||
pNEO->DGAModes = modes;
|
||||
|
||||
return DGAInit(pScreen, &NEODGAFuncs, modes, num);
|
||||
return DGAInit(pScreen, &NEODGAFuncs, modes, num);
|
||||
}
|
||||
|
||||
static DisplayModePtr NEOSavedDGAModes[MAXSCREENS];
|
||||
@@ -134,7 +134,7 @@ NEO_SetMode(
|
||||
NEOPtr pNEO = NEOPTR(pScrn);
|
||||
|
||||
if(!pMode) { /* restore the original mode */
|
||||
if(pNEO->DGAactive) {
|
||||
if(pNEO->DGAactive) {
|
||||
pScrn->currentMode = NEOSavedDGAModes[index];
|
||||
NEOSwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
|
||||
NEOAdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
|
||||
@@ -148,11 +148,11 @@ NEO_SetMode(
|
||||
|
||||
NEOSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode));
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
NEO_GetViewport(
|
||||
ScrnInfoPtr pScrn
|
||||
){
|
||||
@@ -161,26 +161,26 @@ NEO_GetViewport(
|
||||
return pNEO->DGAViewportStatus;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
NEO_SetViewport(
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
int flags
|
||||
){
|
||||
NEOPtr pNEO = NEOPTR(pScrn);
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
|
||||
|
||||
NEOAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y));
|
||||
/* wait for retrace */
|
||||
while((hwp->readST01(hwp) & 0x08));
|
||||
while(!(hwp->readST01(hwp) & 0x08));
|
||||
|
||||
pNEO->DGAViewportStatus = 0;
|
||||
pNEO->DGAViewportStatus = 0;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
NEO_OpenFramebuffer(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
char **name,
|
||||
unsigned char **mem,
|
||||
int *size,
|
||||
|
||||
216
src/neo_driver.c
216
src/neo_driver.c
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -147,9 +147,9 @@ static int neoFindMode(int xres, int yres, int depth);
|
||||
static int pix24bpp = 0;
|
||||
|
||||
|
||||
static biosMode bios8[] = {
|
||||
static biosMode bios8[] = {
|
||||
{ 320, 240, 0x40 },
|
||||
{ 300, 400, 0x42 },
|
||||
{ 300, 400, 0x42 },
|
||||
{ 640, 400, 0x20 },
|
||||
{ 640, 480, 0x21 },
|
||||
{ 800, 600, 0x23 },
|
||||
@@ -180,7 +180,7 @@ static biosMode bios24[] = {
|
||||
|
||||
static DisplayModeRec neo800x480Mode = {
|
||||
NULL, /* prev */
|
||||
NULL, /* next */
|
||||
NULL, /* next */
|
||||
"800x480", /* identifier of this mode */
|
||||
MODE_OK, /* mode status */
|
||||
M_T_BUILTIN, /* mode type */
|
||||
@@ -221,7 +221,7 @@ static DisplayModeRec neo800x480Mode = {
|
||||
|
||||
static DisplayModeRec neo1024x480Mode = {
|
||||
NULL, /* prev */
|
||||
NULL, /* next */
|
||||
NULL, /* next */
|
||||
"1024x480", /* identifier of this mode */
|
||||
MODE_OK, /* mode status */
|
||||
M_T_BUILTIN, /* mode type */
|
||||
@@ -492,14 +492,14 @@ NEOProbe(DriverPtr drv, int flags)
|
||||
&devSections)) <= 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* PCI BUS */
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86GetPciVideoInfo() )
|
||||
#endif
|
||||
{
|
||||
numUsed = xf86MatchPciInstances(NEO_NAME, PCI_VENDOR_NEOMAGIC,
|
||||
NEOChipsets, NEOPCIchipsets,
|
||||
NEOChipsets, NEOPCIchipsets,
|
||||
devSections,numDevSections,
|
||||
drv, &usedChips);
|
||||
|
||||
@@ -557,12 +557,12 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
Bool height_480 = FALSE;
|
||||
Bool lcdCenterOptSet = FALSE;
|
||||
const char *s;
|
||||
|
||||
|
||||
if (flags & PROBE_DETECT) {
|
||||
neoProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* The vgahw module should be loaded here when needed */
|
||||
if (!xf86LoadSubModule(pScrn, "vgahw"))
|
||||
return FALSE;
|
||||
@@ -583,7 +583,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
{ NEOFreeRec(pScrn);\
|
||||
return FALSE;\
|
||||
}
|
||||
|
||||
|
||||
nPtr = NEOPTR(pScrn);
|
||||
|
||||
/* Since, the capabilities are determined by the chipset the very
|
||||
@@ -606,7 +606,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (nPtr->pEnt->location.type == BUS_PCI) {
|
||||
nPtr->PciInfo = xf86GetPciInfoForEntity(nPtr->pEnt->index);
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
nPtr->PciTag = pciTag(nPtr->PciInfo->bus,
|
||||
nPtr->PciTag = pciTag(nPtr->PciInfo->bus,
|
||||
nPtr->PciInfo->device,
|
||||
nPtr->PciInfo->func);
|
||||
#endif
|
||||
@@ -652,7 +652,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
VGAwGR(0x09,0x26);
|
||||
type = VGArGR(0x21);
|
||||
dpy = VGArGR(0x20);
|
||||
|
||||
|
||||
/* Determine panel width -- used in NeoValidMode. */
|
||||
w = VGArGR(0x20);
|
||||
VGAwGR(0x09,0x00);
|
||||
@@ -840,7 +840,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (!xf86SetDefaultVisual(pScrn, -1))
|
||||
if (!xf86SetDefaultVisual(pScrn, -1))
|
||||
return FALSE;
|
||||
|
||||
if (pScrn->depth > 1) {
|
||||
@@ -851,7 +851,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
nPtr->strangeLockups = TRUE;
|
||||
|
||||
|
||||
/* Collect all of the relevant option flags (fill in pScrn->options) */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
/* Process the options */
|
||||
@@ -890,7 +890,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
&nPtr->strangeLockups);
|
||||
nPtr->noAccelSet =
|
||||
xf86GetOptValBool(nPtr->Options, OPTION_NOACCEL,&nPtr->noAccel);
|
||||
|
||||
|
||||
nPtr->rotate = 0;
|
||||
if ((s = xf86GetOptValString(nPtr->Options, OPTION_ROTATE))) {
|
||||
if(!xf86NameCmp(s, "CW")) {
|
||||
@@ -898,7 +898,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
nPtr->shadowFB = TRUE;
|
||||
nPtr->swCursor = TRUE;
|
||||
nPtr->rotate = 1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Rotating screen clockwise - acceleration disabled\n");
|
||||
} else if(!xf86NameCmp(s, "CCW")) {
|
||||
nPtr->shadowFB = TRUE;
|
||||
@@ -909,7 +909,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid"
|
||||
"value for Option \"Rotate\"\n", s);
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Valid options are \"CW\" or \"CCW\"\n");
|
||||
}
|
||||
}
|
||||
@@ -919,10 +919,10 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
|
||||
nPtr->videoKey);
|
||||
} else {
|
||||
nPtr->videoKey = (1 << pScrn->offset.red) |
|
||||
nPtr->videoKey = (1 << pScrn->offset.red) |
|
||||
(1 << pScrn->offset.green) |
|
||||
(((pScrn->mask.blue >> pScrn->offset.blue) - 1)
|
||||
<< pScrn->offset.blue);
|
||||
<< pScrn->offset.blue);
|
||||
}
|
||||
if(xf86GetOptValInteger(nPtr->Options, OPTION_OVERLAYMEM,
|
||||
&(nPtr->overlay))) {
|
||||
@@ -956,7 +956,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (!lcdCenterOptSet)
|
||||
nPtr->lcdCenter = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (nPtr->internDisp && nPtr->externDisp)
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_CONFIG,
|
||||
"Simultaneous LCD/CRT display mode\n");
|
||||
@@ -1016,7 +1016,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
if (nPtr->shadowFB) {
|
||||
nPtr->noAccel = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
|
||||
}
|
||||
|
||||
@@ -1044,7 +1044,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
} else {
|
||||
nPtr->NeoMMIOAddr = 0;
|
||||
}
|
||||
|
||||
|
||||
if (nPtr->pEnt->location.type == BUS_PCI) {
|
||||
if (!nPtr->NeoLinearAddr) {
|
||||
nPtr->NeoLinearAddr = PCI_REGION_BASE(nPtr->PciInfo, 0, REGION_MEM);
|
||||
@@ -1085,8 +1085,8 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (xf86RegisterResources(nPtr->pEnt->index, NULL, ResExclusive))
|
||||
RETURN;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
RETURN;
|
||||
|
||||
@@ -1099,7 +1099,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n",
|
||||
pScrn->videoRam);
|
||||
}
|
||||
|
||||
|
||||
if (nPtr->pEnt->device->dacSpeeds[0] != 0) {
|
||||
maxClock = nPtr->pEnt->device->dacSpeeds[0];
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Max Clock: %d kHz\n",
|
||||
@@ -1120,7 +1120,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
clockRanges->minClock = 11000; /* guessed §§§ */
|
||||
clockRanges->maxClock = maxClock;
|
||||
clockRanges->clockIndex = -1; /* programmable */
|
||||
clockRanges->interlaceAllowed = FALSE;
|
||||
clockRanges->interlaceAllowed = FALSE;
|
||||
clockRanges->doubleScanAllowed = TRUE;
|
||||
|
||||
/* Subtract memory for HW cursor */
|
||||
@@ -1196,14 +1196,14 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
* driver and if the driver doesn't provide code to set them. They
|
||||
* are not pre-initialised at all.
|
||||
*/
|
||||
xf86SetCrtcForModes(pScrn, 0);
|
||||
|
||||
xf86SetCrtcForModes(pScrn, 0);
|
||||
|
||||
/* Set the current mode to the first in the list */
|
||||
pScrn->currentMode = pScrn->modes;
|
||||
|
||||
/* Print the list of modes being used */
|
||||
xf86PrintModes(pScrn);
|
||||
|
||||
|
||||
/* If monitor resolution is set on the command line, use it */
|
||||
xf86SetDpi(pScrn, 0, 0);
|
||||
|
||||
@@ -1225,7 +1225,7 @@ NEOEnterVT(VT_FUNC_ARGS_DECL)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
|
||||
|
||||
/* Should we re-save the text mode on each VT enter? */
|
||||
if(!neoModeInit(pScrn, pScrn->currentMode))
|
||||
return FALSE;
|
||||
@@ -1233,7 +1233,7 @@ NEOEnterVT(VT_FUNC_ARGS_DECL)
|
||||
if (nPtr->video)
|
||||
NEOResetVideo(pScrn);
|
||||
|
||||
if (nPtr->NeoHWCursorShown)
|
||||
if (nPtr->NeoHWCursorShown)
|
||||
NeoShowCursor(pScrn);
|
||||
NEOAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
|
||||
|
||||
@@ -1246,13 +1246,13 @@ NEOLeaveVT(VT_FUNC_ARGS_DECL)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
|
||||
|
||||
/* Invalidate the cached acceleration registers */
|
||||
if (nPtr->NeoHWCursorShown)
|
||||
if (nPtr->NeoHWCursorShown)
|
||||
NeoHideCursor(pScrn);
|
||||
neoRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &nPtr->NeoSavedReg, TRUE);
|
||||
neoLock(pScrn);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1267,11 +1267,11 @@ NEOLoadPalette(
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
|
||||
switch(pScrn->depth) {
|
||||
case 15:
|
||||
case 15:
|
||||
shift = Gshift = 1;
|
||||
break;
|
||||
case 16:
|
||||
shift = 0;
|
||||
shift = 0;
|
||||
Gshift = 0;
|
||||
break;
|
||||
default:
|
||||
@@ -1289,7 +1289,7 @@ NEOLoadPalette(
|
||||
DACDelay(hwp);
|
||||
hwp->writeDacData(hwp, colors[index].blue << shift);
|
||||
DACDelay(hwp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
@@ -1351,7 +1351,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
#endif
|
||||
unsigned char *FBStart;
|
||||
int height, width, displayWidth;
|
||||
|
||||
|
||||
/*
|
||||
* we need to get the ScrnInfoRec for this screen, so let's allocate
|
||||
* one first thing
|
||||
@@ -1369,12 +1369,12 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
/* Map the Neo memory and possible MMIO areas */
|
||||
if (!neoMapMem(pScrn))
|
||||
return FALSE;
|
||||
|
||||
|
||||
/*
|
||||
* next we save the current state and setup the first mode
|
||||
*/
|
||||
neoSave(pScrn);
|
||||
|
||||
|
||||
if (!neoModeInit(pScrn,pScrn->currentMode))
|
||||
return FALSE;
|
||||
vgaHWSaveScreen(pScreen,SCREEN_SAVER_ON);
|
||||
@@ -1384,7 +1384,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
* Reset visual list.
|
||||
*/
|
||||
miClearVisualTypes();
|
||||
|
||||
|
||||
/* Setup the visuals we support. */
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
miGetDefaultVisualMask(pScrn->depth),
|
||||
@@ -1405,7 +1405,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
width = pScrn->virtualX;
|
||||
height = pScrn->virtualY;
|
||||
}
|
||||
|
||||
|
||||
if(nPtr->shadowFB) {
|
||||
nPtr->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
|
||||
nPtr->ShadowPtr = malloc(nPtr->ShadowPitch * height);
|
||||
@@ -1438,7 +1438,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* must be after RGB ordering fixed */
|
||||
fbPictureInit(pScreen, 0, 0);
|
||||
|
||||
@@ -1446,12 +1446,12 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
|
||||
if (!nPtr->shadowFB)
|
||||
NEODGAInit(pScreen);
|
||||
|
||||
|
||||
nPtr->NeoHWCursorShown = FALSE;
|
||||
nPtr->NeoHWCursorInitialized = FALSE;
|
||||
nAcl->UseHWCursor = FALSE;
|
||||
nAcl->CursorAddress = -1;
|
||||
|
||||
|
||||
nAcl->cacheStart = -1;
|
||||
nAcl->cacheEnd = -1;
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
|
||||
@@ -1476,12 +1476,12 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
currentaddr &= 0xfffffc00;
|
||||
nAcl->CursorAddress = currentaddr;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Using H/W Cursor.\n");
|
||||
"Using H/W Cursor.\n");
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Too little space for H/W cursor.\n");
|
||||
}
|
||||
|
||||
|
||||
if (!nPtr->noAccel && !nPtr->NeoMMIOBase)
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
|
||||
"Acceleration disabled when not using MMIO\n");
|
||||
@@ -1508,15 +1508,15 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
BoxRec AvailFBArea;
|
||||
int lines = nAcl->cacheEnd /
|
||||
(pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
|
||||
if (!nPtr->noAccel && nPtr->NeoMMIOBase && lines > 1024)
|
||||
if (!nPtr->noAccel && nPtr->NeoMMIOBase && lines > 1024)
|
||||
lines = 1024;
|
||||
AvailFBArea.x1 = 0;
|
||||
AvailFBArea.y1 = 0;
|
||||
AvailFBArea.x2 = pScrn->displayWidth;
|
||||
AvailFBArea.y2 = lines;
|
||||
xf86InitFBManager(pScreen, &AvailFBArea);
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86InitFBManager(pScreen, &AvailFBArea);
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Using %i scanlines of offscreen memory \n",
|
||||
lines - pScrn->virtualY);
|
||||
}
|
||||
@@ -1527,17 +1527,17 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
if (nAcl->cacheStart >= nAcl->cacheEnd) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Too little space for pixmap cache.\n");
|
||||
}
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
|
||||
"Acceleration not available\n");
|
||||
}
|
||||
}
|
||||
|
||||
xf86SetBackingStore(pScreen);
|
||||
xf86SetSilkenMouse(pScreen);
|
||||
|
||||
/* Initialise cursor functions */
|
||||
miDCInitialize (pScreen, xf86GetPointerScreenFuncs());
|
||||
miDCInitialize (pScreen, xf86GetPointerScreenFuncs());
|
||||
|
||||
if (nAcl->CursorAddress != -1) {
|
||||
/* HW cursor functions */
|
||||
@@ -1550,7 +1550,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
nPtr->NeoHWCursorInitialized = TRUE;
|
||||
} else
|
||||
nAcl->UseHWCursor = FALSE;
|
||||
|
||||
|
||||
if (nPtr->shadowFB) {
|
||||
nPtr->refreshArea = neoRefreshArea;
|
||||
|
||||
@@ -1572,13 +1572,13 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
NEOShadowInit (pScreen);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Initialise default colourmap */
|
||||
if(!miCreateDefColormap(pScreen))
|
||||
return FALSE;
|
||||
|
||||
if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
|
||||
NEOLoadPalette, NULL,
|
||||
NEOLoadPalette, NULL,
|
||||
CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH))
|
||||
return FALSE;
|
||||
|
||||
@@ -1601,7 +1601,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
|
||||
|
||||
pScrn->memPhysBase = (unsigned long)nPtr->NeoLinearAddr;
|
||||
pScrn->fbOffset = 0;
|
||||
|
||||
|
||||
/* Wrap the current CloseScreen function */
|
||||
nPtr->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = NEOCloseScreen;
|
||||
@@ -1630,15 +1630,15 @@ NEOAdjustFrame(ADJUST_FRAME_ARGS_DECL)
|
||||
NEOPtr nPtr;
|
||||
vgaHWPtr hwp;
|
||||
int oldExtCRTDispAddr;
|
||||
int Base;
|
||||
int Base;
|
||||
|
||||
hwp = VGAHWPTR(pScrn);
|
||||
nPtr = NEOPTR(pScrn);
|
||||
|
||||
if (nPtr->showcache && y) {
|
||||
int lastline = nPtr->NeoFbMapSize /
|
||||
int lastline = nPtr->NeoFbMapSize /
|
||||
((pScrn->displayWidth * pScrn->bitsPerPixel) / 8);
|
||||
|
||||
|
||||
lastline -= pScrn->currentMode->VDisplay;
|
||||
y += pScrn->virtualY - 1;
|
||||
if (y > lastline) y = lastline;
|
||||
@@ -1713,7 +1713,7 @@ NEOCloseScreen(CLOSE_SCREEN_ARGS_DECL)
|
||||
static void
|
||||
NEOFreeScreen(FREE_SCREEN_ARGS_DECL)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
SCRN_INFO_PTR(arg);
|
||||
if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
|
||||
vgaHWFreeHWRec(pScrn);
|
||||
NEOFreeRec(pScrn);
|
||||
@@ -1726,7 +1726,7 @@ NEOValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
|
||||
SCRN_INFO_PTR(arg);
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
int vDisplay = mode->VDisplay * ((mode->Flags & V_DBLSCAN) ? 2 : 1);
|
||||
|
||||
|
||||
/*
|
||||
* Is there any LineCompare Bit 10? Where?
|
||||
* The 9 well known VGA bits give us a maximum height of 1024
|
||||
@@ -1736,7 +1736,7 @@ NEOValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
|
||||
|
||||
/*
|
||||
* Limit the modes to just those allowed by the various NeoMagic
|
||||
* chips.
|
||||
* chips.
|
||||
*/
|
||||
|
||||
if (nPtr->overrideValidate) {
|
||||
@@ -1773,7 +1773,7 @@ NEOValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
|
||||
return(MODE_OK);
|
||||
break;
|
||||
case 800 :
|
||||
if (mode->VDisplay == 600)
|
||||
if (mode->VDisplay == 600)
|
||||
return(MODE_OK);
|
||||
if ((mode->VDisplay == 480) && (nPtr->NeoPanelHeight == 480))
|
||||
return(MODE_OK);
|
||||
@@ -1806,7 +1806,7 @@ static void
|
||||
neoLock(ScrnInfoPtr pScrn)
|
||||
{
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
|
||||
|
||||
VGAwGR(0x09,0x00);
|
||||
vgaHWLock(hwp);
|
||||
}
|
||||
@@ -1815,7 +1815,7 @@ static void
|
||||
neoUnlock(ScrnInfoPtr pScrn)
|
||||
{
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
|
||||
|
||||
vgaHWUnlock(hwp);
|
||||
VGAwGR(0x09,0x26);
|
||||
}
|
||||
@@ -1849,7 +1849,7 @@ neoMapMem(ScrnInfoPtr pScrn)
|
||||
result);
|
||||
if (err)
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (nPtr->NeoMMIOAddr2 != 0){
|
||||
result = (void**)&nPtr->NeoMMIOBase2;
|
||||
err = pci_device_map_range(nPtr->PciInfo,
|
||||
@@ -1858,7 +1858,7 @@ neoMapMem(ScrnInfoPtr pScrn)
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
result);
|
||||
|
||||
if (err)
|
||||
if (err)
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
@@ -1935,12 +1935,12 @@ neoUnmapMem(ScrnInfoPtr pScrn)
|
||||
nPtr->NeoMMIOBase2 = NULL;
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)nPtr->NeoFbBase,
|
||||
nPtr->NeoFbMapSize);
|
||||
nPtr->NeoFbMapSize);
|
||||
#else
|
||||
pci_device_unmap_range(nPtr->PciInfo, (pointer)nPtr->NeoFbBase, nPtr->NeoFbMapSize);
|
||||
#endif
|
||||
nPtr->NeoFbBase = NULL;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1960,17 +1960,17 @@ neoSave(ScrnInfoPtr pScrn)
|
||||
* Whatever code is needed to get back to bank zero goes here.
|
||||
*/
|
||||
VGAwGR(0x15,0x00);
|
||||
|
||||
|
||||
/* get generic registers */
|
||||
vgaHWSave(pScrn, VgaSave, VGA_SR_ALL);
|
||||
|
||||
/*
|
||||
* The port I/O code necessary to read in the extended registers
|
||||
* The port I/O code necessary to read in the extended registers
|
||||
* into the fields of the vgaNeoRec structure goes here.
|
||||
*/
|
||||
|
||||
save->GeneralLockReg = VGArGR(0x0A);
|
||||
|
||||
|
||||
save->ExtCRTDispAddr = VGArGR(0x0E);
|
||||
if (nPtr->NeoChipset != NM2070) {
|
||||
save->ExtCRTOffset = VGArGR(0x0F);
|
||||
@@ -2007,7 +2007,7 @@ neoSave(ScrnInfoPtr pScrn)
|
||||
save->VCLK3NumeratorHigh = VGArGR(0x8F);
|
||||
save->VCLK3Denominator = VGArGR(0x9F);
|
||||
save->ProgramVCLK = TRUE;
|
||||
|
||||
|
||||
if (save->reg == NULL)
|
||||
save->reg = (regSavePtr)XNFcallocarray(sizeof(regSaveRec), 1);
|
||||
else
|
||||
@@ -2053,7 +2053,7 @@ neoProgramShadowRegs(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore)
|
||||
*/
|
||||
prog_lcd = (((VGArGR(0x20) & 0x3) == 0x1) && nPtr->internDisp);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Convoluted logic for shadow register programming.
|
||||
*
|
||||
@@ -2070,7 +2070,7 @@ neoProgramShadowRegs(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore)
|
||||
if (restore->PanelDispCntlReg2 & 0x84) {
|
||||
/* Don't program by default if in stretch mode */
|
||||
noProgramShadowRegs = TRUE;
|
||||
if (nPtr->progLcdStretch)
|
||||
if (nPtr->progLcdStretch)
|
||||
noProgramShadowRegs = FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -2104,8 +2104,8 @@ neoProgramShadowRegs(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore)
|
||||
}
|
||||
for (i = 0x60; i <= 0x64; i++) {
|
||||
VGAwCR(i, nPtr->NeoSavedReg.reg->CR[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Program the shadow regs based on the panel width. This works
|
||||
@@ -2281,7 +2281,7 @@ neoProgramShadowRegs(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
neoRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore,
|
||||
Bool restoreText)
|
||||
{
|
||||
@@ -2292,9 +2292,9 @@ neoRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore,
|
||||
Bool clock_hi = FALSE;
|
||||
|
||||
vgaHWProtect(pScrn,TRUE); /* Blank the screen */
|
||||
|
||||
|
||||
VGAwGR(0x09,0x26);
|
||||
|
||||
|
||||
/* Init the shadow registers if necessary */
|
||||
neoProgramShadowRegs(pScrn, VgaReg, restore);
|
||||
|
||||
@@ -2351,7 +2351,7 @@ neoRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore,
|
||||
/*
|
||||
* This function handles restoring the generic VGA registers. */
|
||||
vgaHWRestore(pScrn, VgaReg,
|
||||
VGA_SR_MODE
|
||||
VGA_SR_MODE
|
||||
| (restoreText ? (VGA_SR_FONTS | VGA_SR_CMAP) : 0));
|
||||
|
||||
VGAwGR(0x0E, restore->ExtCRTDispAddr);
|
||||
@@ -2424,7 +2424,7 @@ neoRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore,
|
||||
if (nPtr->NeoChipset == NM2200 || nPtr->NeoChipset == NM2230
|
||||
|| nPtr->NeoChipset == NM2360 || nPtr->NeoChipset == NM2380)
|
||||
clock_hi = TRUE;
|
||||
|
||||
|
||||
/* Program VCLK3 if needed. */
|
||||
if (restore->ProgramVCLK
|
||||
&& ((VGArGR(0x9B) != restore->VCLK3NumeratorLow)
|
||||
@@ -2464,18 +2464,18 @@ neoRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, NeoRegPtr restore,
|
||||
VGAwGR(i, restore->reg->GR[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VGAwGR (0x93, 0xc0); /* Gives faster framebuffer writes */
|
||||
|
||||
|
||||
/* Program vertical extension register */
|
||||
if (nPtr->NeoChipset == NM2200 || nPtr->NeoChipset == NM2230
|
||||
|| nPtr->NeoChipset == NM2360 || nPtr->NeoChipset == NM2380) {
|
||||
VGAwCR(0x70, restore->VerticalExt);
|
||||
}
|
||||
|
||||
|
||||
vgaHWProtect(pScrn, FALSE); /* Turn on screen */
|
||||
}
|
||||
|
||||
|
||||
static Bool
|
||||
neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
{
|
||||
@@ -2487,7 +2487,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
vgaRegPtr NeoStd = &hwp->ModeReg;
|
||||
Bool noLcdStretch = nPtr->noLcdStretch;
|
||||
int clockMul = 1;
|
||||
|
||||
|
||||
neoUnlock(pScrn);
|
||||
|
||||
/*
|
||||
@@ -2534,7 +2534,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
NeoNew->ExtCRTDispAddr = 0x10;
|
||||
|
||||
/* Vertical Extension */
|
||||
@@ -2545,9 +2545,9 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
|
||||
/* Fast write bursts on unless disabled. */
|
||||
if (nPtr->onPciBurst) {
|
||||
NeoNew->SysIfaceCntl1 = 0x30;
|
||||
NeoNew->SysIfaceCntl1 = 0x30;
|
||||
} else {
|
||||
NeoNew->SysIfaceCntl1 = 0x00;
|
||||
NeoNew->SysIfaceCntl1 = 0x00;
|
||||
}
|
||||
|
||||
/* If they are used, enable linear addressing and/or enable MMIO. */
|
||||
@@ -2653,7 +2653,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
} else if (mode->Flags & V_DBLSCAN) {
|
||||
nAcl->NoCursorMode = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* If the screen is to be centered, turn on the centering for the
|
||||
* various modes.
|
||||
@@ -2668,11 +2668,11 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
NeoNew->PanelHorizCenterReg3 = 0x00;
|
||||
NeoNew->PanelHorizCenterReg4 = 0x00;
|
||||
NeoNew->PanelHorizCenterReg5 = 0x00;
|
||||
|
||||
|
||||
if (nPtr->lcdCenter &&
|
||||
(NeoNew->PanelDispCntlReg1 & 0x02)) {
|
||||
Bool doCenter = FALSE;
|
||||
|
||||
|
||||
hoffset = 0;
|
||||
voffset = 0;
|
||||
if (mode->HDisplay == nPtr->NeoPanelWidth) {
|
||||
@@ -2700,7 +2700,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
* No centering required when the requested display width
|
||||
* equals the panel width.
|
||||
*/
|
||||
} else {
|
||||
} else {
|
||||
NeoNew->PanelDispCntlReg2 |= 0x01;
|
||||
if (noLcdStretch) {
|
||||
/* Calculate the vertical offsets. */
|
||||
@@ -2751,7 +2751,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!noLcdStretch &&
|
||||
(NeoNew->PanelDispCntlReg1 & 0x02)) {
|
||||
if (mode->HDisplay != nPtr->NeoPanelWidth)
|
||||
@@ -2767,9 +2767,9 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
NeoStd->Sequencer[1] |= 0x8;
|
||||
clockMul = 2;
|
||||
}
|
||||
|
||||
|
||||
NeoNew->biosMode = neoFindMode(mode->HDisplay,mode->VDisplay,pScrn->depth);
|
||||
|
||||
|
||||
/*
|
||||
* New->reg should be empty. Just in
|
||||
* case it isn't, warn us and clear it anyway.
|
||||
@@ -2791,7 +2791,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
NeoStd->MiscOutReg |= 0x0C;
|
||||
|
||||
neoRestore(pScrn, NeoStd, NeoNew, FALSE);
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -2809,7 +2809,7 @@ static void
|
||||
neoCalcVCLK(ScrnInfoPtr pScrn, long freq)
|
||||
{
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
|
||||
|
||||
int n, d, f;
|
||||
double f_out;
|
||||
double f_diff;
|
||||
@@ -2922,9 +2922,9 @@ neo_ddc1Read(ScrnInfoPtr pScrn)
|
||||
/* This needs to be investigated: we may have to swap this around */
|
||||
while (!(hwp->readST01(hwp)&0x8)) {};
|
||||
while (hwp->readST01(hwp)&0x8) {};
|
||||
|
||||
|
||||
tmp = (VGArGR(0xA1) & 0x08);
|
||||
|
||||
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
@@ -2943,10 +2943,10 @@ neo_ddc1(ScrnInfoPtr pScrn)
|
||||
|
||||
/* initialize chipset */
|
||||
reg1 = VGArCR(0x21);
|
||||
reg2 = VGArCR(0x1D);
|
||||
reg2 = VGArCR(0x1D);
|
||||
reg3 = VGArCR(0xA1);
|
||||
VGAwCR(0x21,0x00);
|
||||
VGAwCR(0x1D,0x01); /* some Voodoo */
|
||||
VGAwCR(0x1D,0x01); /* some Voodoo */
|
||||
VGAwGR(0xA1,0x2F);
|
||||
ret = xf86DoEDID_DDC1(XF86_SCRN_ARG(pScrn),neo_ddc1SetSpeed,neo_ddc1Read);
|
||||
/* undo initialization */
|
||||
@@ -2973,7 +2973,7 @@ neoDoDDC1(ScrnInfoPtr pScrn)
|
||||
static Bool
|
||||
neoDoDDC2(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
Bool ret = FALSE;
|
||||
|
||||
@@ -2992,7 +2992,7 @@ neoDoDDC2(ScrnInfoPtr pScrn)
|
||||
static Bool
|
||||
neoDoDDCVBE(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
vbeInfoPtr pVbe;
|
||||
Bool ret = FALSE;
|
||||
@@ -3049,7 +3049,7 @@ neoFindMode(int xres, int yres, int depth)
|
||||
}
|
||||
}
|
||||
return mode[size - 1].mode;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -56,7 +56,7 @@ neo_I2CPutBits(I2CBusPtr b, int clock, int data) {
|
||||
|
||||
VGAwCR(0x21,0x00);
|
||||
VGAwCR(0x1D,0x01);
|
||||
|
||||
|
||||
if(clock) reg |= 1;
|
||||
if(data) reg |= 0x4;
|
||||
VGAwGR(0xA1,reg);
|
||||
@@ -67,14 +67,14 @@ static void
|
||||
neo_I2CGetBits(I2CBusPtr b, int *clock, int *data) {
|
||||
unsigned int reg;
|
||||
vgaHWPtr hwp = VGAHWPTR(xf86Screens[b->scrnIndex]);
|
||||
|
||||
|
||||
reg = VGArGR(0xA1);
|
||||
*clock = 1 /* (reg & 0x?? ) */;
|
||||
*data = (reg & 0x8) != 0;
|
||||
/*ErrorF("neo_I2CGetBits: %d %d\n", *clock, *data);*/
|
||||
}
|
||||
|
||||
Bool
|
||||
Bool
|
||||
neo_I2CInit(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NEOPtr pNeo = NEOPTR(pScrn);
|
||||
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
enum region_type {
|
||||
REGION_MEM,
|
||||
REGION_IO
|
||||
REGION_IO
|
||||
};
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
|
||||
@@ -11,7 +11,7 @@ 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
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
Copyright (c) 1999, 2000 The XFree86 Project Inc.
|
||||
Copyright (c) 1999, 2000 The XFree86 Project Inc.
|
||||
based on code written by Mark Vojkovich <markv@valinux.com>
|
||||
*/
|
||||
|
||||
@@ -21,8 +21,8 @@ neoShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||
RegionPtr damage = DamageRegion(pBuf->pDamage);
|
||||
ScrnInfoPtr pScrn;
|
||||
pScrn = xf86ScreenToScrn(pScreen);
|
||||
|
||||
(NEOPTR(pScrn))->refreshArea (pScrn, REGION_NUM_RECTS(damage),
|
||||
|
||||
(NEOPTR(pScrn))->refreshArea (pScrn, REGION_NUM_RECTS(damage),
|
||||
REGION_RECTS(damage));
|
||||
}
|
||||
|
||||
@@ -32,14 +32,14 @@ neoRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
NEOPtr nPtr = NEOPTR(pScrn);
|
||||
int width, height, Bpp, FBPitch;
|
||||
unsigned char *src, *dst;
|
||||
|
||||
|
||||
Bpp = pScrn->bitsPerPixel >> 3;
|
||||
FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
|
||||
|
||||
while(num--) {
|
||||
width = (pbox->x2 - pbox->x1) * Bpp;
|
||||
height = pbox->y2 - pbox->y1;
|
||||
src = nPtr->ShadowPtr + (pbox->y1 * nPtr->ShadowPitch) +
|
||||
src = nPtr->ShadowPtr + (pbox->y1 * nPtr->ShadowPitch) +
|
||||
(pbox->x1 * Bpp);
|
||||
dst = nPtr->NeoFbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
|
||||
|
||||
@@ -48,10 +48,10 @@ neoRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
dst += FBPitch;
|
||||
src += nPtr->ShadowPitch;
|
||||
}
|
||||
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
neoPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
|
||||
@@ -89,11 +89,11 @@ neoRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 2; /* in dwords */
|
||||
|
||||
if(nPtr->rotate == 1) {
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = nPtr->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = nPtr->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
@@ -103,8 +103,8 @@ neoRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
dst = (CARD32*)dstPtr;
|
||||
count = height;
|
||||
while(count--) {
|
||||
*(dst++) = src[0] | (src[srcPitch] << 8) |
|
||||
(src[srcPitch * 2] << 16) |
|
||||
*(dst++) = src[0] | (src[srcPitch] << 8) |
|
||||
(src[srcPitch * 2] << 16) |
|
||||
(src[srcPitch * 3] << 24);
|
||||
src += srcPitch * 4;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ neoRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -135,14 +135,14 @@ neoRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 1; /* in dwords */
|
||||
|
||||
if(nPtr->rotate == 1) {
|
||||
dstPtr = (CARD16*)nPtr->NeoFbBase +
|
||||
dstPtr = (CARD16*)nPtr->NeoFbBase +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = (CARD16*)nPtr->ShadowPtr +
|
||||
srcPtr = (CARD16*)nPtr->ShadowPtr +
|
||||
((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD16*)nPtr->NeoFbBase +
|
||||
dstPtr = (CARD16*)nPtr->NeoFbBase +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = (CARD16*)nPtr->ShadowPtr +
|
||||
srcPtr = (CARD16*)nPtr->ShadowPtr +
|
||||
(y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
@@ -182,11 +182,11 @@ neoRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 2; /* blocks of 3 dwords */
|
||||
|
||||
if(nPtr->rotate == 1) {
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
(pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3);
|
||||
srcPtr = nPtr->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3);
|
||||
} else {
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
dstPtr = nPtr->NeoFbBase +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3);
|
||||
srcPtr = nPtr->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3;
|
||||
}
|
||||
@@ -197,18 +197,18 @@ neoRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
count = height;
|
||||
while(count--) {
|
||||
dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
|
||||
(src[srcPitch] << 24);
|
||||
(src[srcPitch] << 24);
|
||||
dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
|
||||
(src[srcPitch * 2] << 16) |
|
||||
(src[(srcPitch * 2) + 1] << 24);
|
||||
(src[(srcPitch * 2) + 1] << 24);
|
||||
dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
|
||||
(src[(srcPitch * 3) + 1] << 16) |
|
||||
(src[(srcPitch * 3) + 2] << 24);
|
||||
(src[(srcPitch * 3) + 2] << 24);
|
||||
dst += 3;
|
||||
src += srcPitch * 4;
|
||||
}
|
||||
srcPtr += nPtr->rotate * 3;
|
||||
dstPtr += dstPitch;
|
||||
dstPtr += dstPitch;
|
||||
}
|
||||
|
||||
pbox++;
|
||||
@@ -230,14 +230,14 @@ neoRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = pbox->y2 - pbox->y1;
|
||||
|
||||
if(nPtr->rotate == 1) {
|
||||
dstPtr = (CARD32*)nPtr->NeoFbBase +
|
||||
dstPtr = (CARD32*)nPtr->NeoFbBase +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
|
||||
srcPtr = (CARD32*)nPtr->ShadowPtr +
|
||||
srcPtr = (CARD32*)nPtr->ShadowPtr +
|
||||
((1 - pbox->y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD32*)nPtr->NeoFbBase +
|
||||
dstPtr = (CARD32*)nPtr->NeoFbBase +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
|
||||
srcPtr = (CARD32*)nPtr->ShadowPtr +
|
||||
srcPtr = (CARD32*)nPtr->ShadowPtr +
|
||||
(pbox->y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
|
||||
114
src/neo_video.c
114
src/neo_video.c
@@ -11,7 +11,7 @@ supporting documentation, and that the name of Shigehiro Nomura not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission. Shigehiro Nomura
|
||||
and its suppliers make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
SHIGEHIRO NOMURA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
@@ -41,31 +41,31 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
static XF86VideoAdaptorPtr NEOSetupVideo(ScreenPtr);
|
||||
|
||||
static int NEOPutVideo(ScrnInfoPtr, short, short, short, short,
|
||||
static int NEOPutVideo(ScrnInfoPtr, short, short, short, short,
|
||||
short, short, short, short, RegionPtr, pointer,
|
||||
DrawablePtr);
|
||||
|
||||
static void NEOStopVideo(ScrnInfoPtr, pointer, Bool);
|
||||
static int NEOSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
|
||||
static int NEOGetPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
|
||||
static void NEOQueryBestSize(ScrnInfoPtr, Bool, short, short, short,
|
||||
static void NEOQueryBestSize(ScrnInfoPtr, Bool, short, short, short,
|
||||
short, unsigned int *, unsigned int *, pointer);
|
||||
static int NEOPutImage(ScrnInfoPtr, short, short, short, short, short, short,
|
||||
static int NEOPutImage(ScrnInfoPtr, short, short, short, short, short, short,
|
||||
short, short, int, unsigned char *, short, short, Bool,
|
||||
RegionPtr, pointer, DrawablePtr);
|
||||
static int NEOQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
|
||||
static int NEOQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
|
||||
unsigned short *, int *, int *);
|
||||
|
||||
static void NEODisplayVideo(ScrnInfoPtr, int, int, short, short, int, int,
|
||||
static void NEODisplayVideo(ScrnInfoPtr, int, int, short, short, int, int,
|
||||
int, int, int, BoxPtr, short, short, short, short);
|
||||
|
||||
static void NEOInitOffscreenImages(ScreenPtr);
|
||||
static FBLinearPtr NEOAllocateMemory(ScrnInfoPtr, FBLinearPtr, int);
|
||||
|
||||
static int NEOAllocSurface(ScrnInfoPtr, int, unsigned short, unsigned short,
|
||||
static int NEOAllocSurface(ScrnInfoPtr, int, unsigned short, unsigned short,
|
||||
XF86SurfacePtr);
|
||||
static int NEOFreeSurface(XF86SurfacePtr);
|
||||
static int NEODisplaySurface(XF86SurfacePtr, short, short, short, short,
|
||||
static int NEODisplaySurface(XF86SurfacePtr, short, short, short, short,
|
||||
short, short, short, short, RegionPtr clipBoxes);
|
||||
static int NEOStopSurface(XF86SurfacePtr);
|
||||
static int NEOGetSurfaceAttribute(ScrnInfoPtr, Atom, INT32 *);
|
||||
@@ -84,7 +84,7 @@ NEOInitVideo(ScreenPtr pScreen)
|
||||
|
||||
numAdaptors = xf86XVListGenericAdaptors(pScrn, &overlayAdaptors);
|
||||
|
||||
if (nPtr->NeoChipset > NM2070
|
||||
if (nPtr->NeoChipset > NM2070
|
||||
&& nPtr->NeoMMIOBase2 != NULL){
|
||||
nPtr->video = TRUE;
|
||||
newAdaptor = NEOSetupVideo(pScreen);
|
||||
@@ -97,10 +97,10 @@ NEOInitVideo(ScreenPtr pScreen)
|
||||
numAdaptors = 1;
|
||||
overlayAdaptors = &newAdaptor;
|
||||
} else {
|
||||
newAdaptors = malloc((numAdaptors + 1)
|
||||
newAdaptors = malloc((numAdaptors + 1)
|
||||
* sizeof(XF86VideoAdaptorPtr*));
|
||||
if (newAdaptors){
|
||||
memcpy(newAdaptors, overlayAdaptors,
|
||||
memcpy(newAdaptors, overlayAdaptors,
|
||||
numAdaptors * sizeof(XF86VideoAdaptorPtr));
|
||||
newAdaptors[numAdaptors++] = newAdaptor;
|
||||
overlayAdaptors = newAdaptors;
|
||||
@@ -210,12 +210,12 @@ NEOSetupVideo(ScreenPtr pScreen)
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOSetupVideo\n");
|
||||
#endif
|
||||
if ((overlayAdaptor = calloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
sizeof(DevUnion) +
|
||||
sizeof(DevUnion) +
|
||||
sizeof(NEOPortRec))) == NULL){
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
overlayAdaptor->type = XvInputMask | XvImageMask | XvWindowMask
|
||||
overlayAdaptor->type = XvInputMask | XvImageMask | XvWindowMask
|
||||
| XvOutputMask | XvVideoMask;
|
||||
overlayAdaptor->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
|
||||
overlayAdaptor->name = "NeoMagic Video Engine";
|
||||
@@ -229,7 +229,7 @@ NEOSetupVideo(ScreenPtr pScreen)
|
||||
overlayAdaptor->pFormats = NEOVideoFormats;
|
||||
overlayAdaptor->nPorts = 1;
|
||||
overlayAdaptor->pPortPrivates = (DevUnion*) &overlayAdaptor[1];
|
||||
overlayAdaptor->pPortPrivates[0].ptr =
|
||||
overlayAdaptor->pPortPrivates[0].ptr =
|
||||
(pointer) &overlayAdaptor->pPortPrivates[1];
|
||||
overlayAdaptor->nAttributes = nElems(NEOVideoAttributes);
|
||||
overlayAdaptor->pAttributes = NEOVideoAttributes;
|
||||
@@ -259,7 +259,7 @@ NEOSetupVideo(ScreenPtr pScreen)
|
||||
xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
|
||||
xvColorKey = MAKE_ATOM("XV_COLORKEY");
|
||||
xvInterlace = MAKE_ATOM("XV_INTERLACE");
|
||||
|
||||
|
||||
NEOResetVideo(pScrn);
|
||||
|
||||
return (overlayAdaptor);
|
||||
@@ -295,7 +295,7 @@ NEOResetVideo(ScrnInfoPtr pScrn)
|
||||
}
|
||||
|
||||
static int
|
||||
NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
short src_x, short src_y, short drw_x, short drw_y,
|
||||
short src_w, short src_h, short drw_w, short drw_h,
|
||||
RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
|
||||
@@ -311,9 +311,9 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
VGA_HWP(pScrn);
|
||||
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: src: %d %d %d %d\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: src: %d %d %d %d\n",
|
||||
src_x, src_y, src_w, src_h);
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: drw: %d %d %d %d\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: drw: %d %d %d %d\n",
|
||||
drw_x, drw_y, drw_w, drw_h);
|
||||
#endif
|
||||
if (src_w > 720)
|
||||
@@ -337,7 +337,7 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
return(Success);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: %d %d %d %d\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: %d %d %d %d\n",
|
||||
x1, y1, x2, y2);
|
||||
#endif
|
||||
|
||||
@@ -346,7 +346,7 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
dstBox.x2 -= pScrn->frameX0;
|
||||
dstBox.y2 -= pScrn->frameY0;
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: dstBox %d %d %d %d\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: dstBox %d %d %d %d\n",
|
||||
dstBox.x1, dstBox.y1, dstBox.x2, dstBox.y2);
|
||||
#endif
|
||||
|
||||
@@ -366,20 +366,20 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
size = src_h * src_pitch * 2;
|
||||
|
||||
if (size > nPtr->overlay){
|
||||
if ((pPriv->linear = NEOAllocateMemory(pScrn, pPriv->linear, size))
|
||||
if ((pPriv->linear = NEOAllocateMemory(pScrn, pPriv->linear, size))
|
||||
== NULL){
|
||||
return (BadAlloc);
|
||||
}
|
||||
} else {
|
||||
pPriv->linear = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (pPriv->linear == NULL){
|
||||
offset = nPtr->overlay_offset;
|
||||
} else {
|
||||
offset = pPriv->linear->offset * bpp;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOPutVideo: offset=0x%x\n", offset);
|
||||
#endif
|
||||
@@ -401,7 +401,7 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
case NM2090:
|
||||
case NM2093:
|
||||
case NM2097:
|
||||
case NM2160:
|
||||
case NM2160:
|
||||
offset/=2;
|
||||
OUTGR(0xbc, 0x4f);
|
||||
break;
|
||||
@@ -412,7 +412,7 @@ NEOPutVideo(ScrnInfoPtr pScrn,
|
||||
OUTGR(0xbc, 0x2e);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
OUTGR(0xb1, (((dstBox.x2-1) >> 4) & 0xf0) | ((dstBox.x1 >> 8) & 0x0f));
|
||||
OUTGR(0xb2, dstBox.x1);
|
||||
@@ -522,7 +522,7 @@ NEOStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
|
||||
}
|
||||
|
||||
static int
|
||||
NEOSetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value,
|
||||
NEOSetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value,
|
||||
pointer data)
|
||||
{
|
||||
NEOPortPtr pPriv = (NEOPortPtr)data;
|
||||
@@ -568,7 +568,7 @@ NEOSetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value,
|
||||
}
|
||||
|
||||
static int
|
||||
NEOGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value,
|
||||
NEOGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value,
|
||||
pointer data)
|
||||
{
|
||||
NEOPortPtr pPriv = (NEOPortPtr)data;
|
||||
@@ -589,7 +589,7 @@ NEOGetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 *value,
|
||||
}
|
||||
|
||||
static void
|
||||
NEOQueryBestSize(ScrnInfoPtr pScrn, Bool motion,
|
||||
NEOQueryBestSize(ScrnInfoPtr pScrn, Bool motion,
|
||||
short vid_w, short vid_h, short drw_w, short drw_h,
|
||||
unsigned int *p_w, unsigned int *p_h,
|
||||
pointer data)
|
||||
@@ -602,7 +602,7 @@ NEOQueryBestSize(ScrnInfoPtr pScrn, Bool motion,
|
||||
}
|
||||
|
||||
static int
|
||||
NEOPutImage(ScrnInfoPtr pScrn,
|
||||
NEOPutImage(ScrnInfoPtr pScrn,
|
||||
short src_x, short src_y, short drw_x, short drw_y,
|
||||
short src_w, short src_h, short drw_w, short drw_h,
|
||||
int id, unsigned char *buf, short width, short height,
|
||||
@@ -627,7 +627,7 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
y1 = src_y;
|
||||
x2 = src_x + src_w;
|
||||
y2 = src_y + src_h;
|
||||
|
||||
|
||||
dstBox.x1 = drw_x;
|
||||
dstBox.y1 = drw_y;
|
||||
dstBox.x2 = drw_x + drw_w;
|
||||
@@ -641,17 +641,17 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
dstBox.x1 -= pScrn->frameX0;
|
||||
dstBox.y1 -= pScrn->frameY0;
|
||||
dstBox.x2 -= pScrn->frameX0;
|
||||
dstBox.y2 -= pScrn->frameY0;
|
||||
|
||||
dstBox.y2 -= pScrn->frameY0;
|
||||
|
||||
bpp = ((pScrn->bitsPerPixel + 1) >> 3);
|
||||
|
||||
|
||||
switch (id){
|
||||
case FOURCC_YV12:
|
||||
srcPitch = (width + 3) & ~3;
|
||||
offset2 = srcPitch * height;
|
||||
srcPitch2 = ((width >> 1) + 3) & ~3;
|
||||
offset3 = offset2 + (srcPitch2 * (height >> 1));
|
||||
dstPitch = ((width << 1) + 15) & ~15;
|
||||
dstPitch = ((width << 1) + 15) & ~15;
|
||||
break;
|
||||
case FOURCC_I420:
|
||||
srcPitch = (width + 3) & ~3;
|
||||
@@ -668,10 +668,10 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
dstPitch = (srcPitch + 15) & ~15;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
size = dstPitch * height;
|
||||
if (size > nPtr->overlay){
|
||||
if ((pPriv->linear = NEOAllocateMemory(pScrn, pPriv->linear, size))
|
||||
if ((pPriv->linear = NEOAllocateMemory(pScrn, pPriv->linear, size))
|
||||
== NULL){
|
||||
return (BadAlloc);
|
||||
}
|
||||
@@ -689,13 +689,13 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
} else {
|
||||
offset = pPriv->linear->offset * bpp;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"offset=%x\n", offset);
|
||||
#endif
|
||||
|
||||
dstStart = (unsigned char *)(nPtr->NeoFbBase + offset + left);
|
||||
|
||||
|
||||
switch (id){
|
||||
case FOURCC_YV12:
|
||||
case FOURCC_I420:
|
||||
@@ -706,7 +706,7 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
nLines = ((((y2 + 0xFFFF) >> 16) + 1) & ~1) - top;
|
||||
xf86XVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1),
|
||||
buf + offset2, buf + offset3,
|
||||
dstStart, srcPitch, srcPitch2,
|
||||
dstStart, srcPitch, srcPitch2,
|
||||
dstPitch, nLines, nPixels);
|
||||
break;
|
||||
default:
|
||||
@@ -722,14 +722,14 @@ NEOPutImage(ScrnInfoPtr pScrn,
|
||||
}
|
||||
NEODisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1,
|
||||
x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
|
||||
|
||||
|
||||
pPriv->videoStatus = CLIENT_VIDEO_ON;
|
||||
return (Success);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
NEOQueryImageAttributes(ScrnInfoPtr pScrn, int id,
|
||||
NEOQueryImageAttributes(ScrnInfoPtr pScrn, int id,
|
||||
unsigned short *width, unsigned short *height,
|
||||
int *pitches, int *offsets)
|
||||
{
|
||||
@@ -788,7 +788,7 @@ NEOQueryImageAttributes(ScrnInfoPtr pScrn, int id,
|
||||
}
|
||||
|
||||
static void
|
||||
NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
short width, short height, int pitch,
|
||||
int x1, int y1, int x2, int y2, BoxPtr dstBox,
|
||||
short src_w, short src_h, short drw_w, short drw_h)
|
||||
@@ -820,7 +820,7 @@ NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
*/
|
||||
int pre, post;
|
||||
int scale = 1;
|
||||
|
||||
|
||||
if (dstBox->x1 < WIDTH_THRESHOLD) {
|
||||
pre = dstBox->x1;
|
||||
post = 160 - pre;
|
||||
@@ -837,7 +837,7 @@ NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
dstBox->x2 = pScrn->virtualX;
|
||||
if (dstBox->x1 > 0) dstBox->x1 += 2;
|
||||
}
|
||||
|
||||
|
||||
fmt = 0x00;
|
||||
switch (id){
|
||||
case FOURCC_YV12:
|
||||
@@ -852,13 +852,13 @@ NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
}
|
||||
|
||||
offset += (x1 >> 15) & ~0x03;
|
||||
|
||||
|
||||
switch (nPtr->NeoChipset) {
|
||||
default:
|
||||
case NM2090:
|
||||
case NM2093:
|
||||
case NM2097:
|
||||
case NM2160:
|
||||
case NM2160:
|
||||
offset/=2;
|
||||
pitch/=2;
|
||||
OUTGR(0xbc, 0x4f);
|
||||
@@ -875,7 +875,7 @@ NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
hstretch = (double)0x1000 * 4 / (int)(nPtr->videoHZoom * 4);
|
||||
if (drw_w > src_w)
|
||||
hstretch = (((int)src_w) * hstretch) / (int) drw_w;
|
||||
|
||||
|
||||
vstretch = (double)0x1000 / nPtr->videoVZoom;
|
||||
if (drw_h > src_h)
|
||||
vstretch = (((int)src_h) * vstretch )/ (int) drw_h;
|
||||
@@ -891,7 +891,7 @@ NEODisplayVideo(ScrnInfoPtr pScrn, int id, int offset,
|
||||
OUTGR(0xb9, offset );
|
||||
OUTGR(0xba, pitch >> 8);
|
||||
OUTGR(0xbb, pitch);
|
||||
|
||||
|
||||
OUTGR(0xbd, 0x02);
|
||||
OUTGR(0xbe, 0x00);
|
||||
OUTGR(0xbf, 0x02);
|
||||
@@ -971,7 +971,7 @@ NEOAllocateMemory(ScrnInfoPtr pScrn, FBLinearPtr linear, int size)
|
||||
NULL, NULL)) == NULL){
|
||||
int max_size;
|
||||
|
||||
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16,
|
||||
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16,
|
||||
PRIORITY_EXTREME);
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
|
||||
@@ -982,15 +982,15 @@ NEOAllocateMemory(ScrnInfoPtr pScrn, FBLinearPtr linear, int size)
|
||||
}
|
||||
|
||||
xf86PurgeUnlockedOffscreenAreas(pScreen);
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen,
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen,
|
||||
size, 16, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
return (new_linear);
|
||||
}
|
||||
|
||||
static int
|
||||
NEOAllocSurface(ScrnInfoPtr pScrn, int id,
|
||||
NEOAllocSurface(ScrnInfoPtr pScrn, int id,
|
||||
unsigned short width, unsigned short height,
|
||||
XF86SurfacePtr surface)
|
||||
{
|
||||
@@ -1099,9 +1099,9 @@ NEODisplaySurface(XF86SurfacePtr surface,
|
||||
clipBoxes);
|
||||
NEOResetVideo(surface->pScrn);
|
||||
NEODisplayVideo(surface->pScrn, surface->id, surface->offsets[0],
|
||||
surface->width, surface->height, surface->pitches[0],
|
||||
surface->width, surface->height, surface->pitches[0],
|
||||
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
|
||||
|
||||
|
||||
pPriv->isOn = TRUE;
|
||||
if (portPriv->videoStatus & CLIENT_VIDEO_ON){
|
||||
REGION_EMPTY(surface->pScrn->pScreen, &portPriv->clip);
|
||||
@@ -1137,7 +1137,7 @@ NEOGetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attr, INT32 *value)
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOGetSurfaceAttribute\n");
|
||||
#endif
|
||||
return (NEOGetPortAttribute(pScrn,
|
||||
return (NEOGetPortAttribute(pScrn,
|
||||
attr, value, (pointer)nPtr->overlayAdaptor->pPortPrivates[0].ptr));
|
||||
}
|
||||
|
||||
@@ -1149,6 +1149,6 @@ NEOSetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attr, INT32 value)
|
||||
#ifdef DEBUG
|
||||
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOSetSurfaceAttribute\n");
|
||||
#endif
|
||||
return (NEOSetPortAttribute(pScrn,
|
||||
return (NEOSetPortAttribute(pScrn,
|
||||
attr, value, (pointer)nPtr->overlayAdaptor->pPortPrivates[0].ptr));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ supporting documentation, and that the name of Shigehiro Nomura not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission. Shigehiro Nomura
|
||||
and its suppliers make no representations about the suitability of this
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
software for any purpose. It is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
SHIGEHIRO NOMURA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
|
||||
Reference in New Issue
Block a user