mirror of
https://github.com/X11Libre/xf86-video-nv.git
synced 2026-03-23 17:19:17 +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-nv/-/merge_requests/29>
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
a3691dad26
commit
5bafcc79bf
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,8 +71,8 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-video-nv
|
||||
# Add & Override patterns for xf86-video-nv
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
|
||||
@@ -48,12 +48,12 @@
|
||||
((c & 0xff) << 24)
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
ConvertCursor1555(NVPtr pNv, CARD32 *src, CARD16 *dst)
|
||||
{
|
||||
CARD32 b, m;
|
||||
int i, j;
|
||||
|
||||
|
||||
for ( i = 0; i < 32; i++ ) {
|
||||
b = *src++;
|
||||
m = *src++;
|
||||
@@ -84,7 +84,7 @@ ConvertCursor8888(NVPtr pNv, CARD32 *src, CARD32 *dst)
|
||||
{
|
||||
CARD32 b, m;
|
||||
int i, j;
|
||||
|
||||
|
||||
for ( i = 0; i < 128; i++ ) {
|
||||
b = *src++;
|
||||
m = *src++;
|
||||
@@ -181,13 +181,13 @@ NVSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
if ((pNv->curFg != fore) || (pNv->curBg != back)) {
|
||||
pNv->curFg = fore;
|
||||
pNv->curBg = back;
|
||||
|
||||
|
||||
TransformCursor(pNv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
NVShowCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
@@ -203,14 +203,14 @@ NVHideCursor(ScrnInfoPtr pScrn)
|
||||
NVShowHideCursor(pNv, 0);
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
NVUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
static Bool
|
||||
static Bool
|
||||
NVUseHWCursorARGB(ScreenPtr pScreen, CursorPtr pCurs)
|
||||
{
|
||||
if((pCurs->bits->width <= 64) && (pCurs->bits->height <= 64))
|
||||
@@ -241,7 +241,7 @@ NVLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs)
|
||||
tmp = (alpha << 24) |
|
||||
(((*image & 0xff) * alpha) / 255) |
|
||||
((((*image & 0xff00) * alpha) / 255) & 0xff00) |
|
||||
((((*image & 0xff0000) * alpha) / 255) & 0xff0000);
|
||||
((((*image & 0xff0000) * alpha) / 255) & 0xff0000);
|
||||
}
|
||||
image++;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
@@ -267,7 +267,7 @@ NVLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs)
|
||||
}
|
||||
#endif
|
||||
|
||||
Bool
|
||||
Bool
|
||||
NVCursorInit(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
@@ -276,7 +276,7 @@ NVCursorInit(ScreenPtr pScreen)
|
||||
|
||||
infoPtr = xf86CreateCursorInfoRec();
|
||||
if(!infoPtr) return FALSE;
|
||||
|
||||
|
||||
pNv->CursorInfoRec = infoPtr;
|
||||
|
||||
if(pNv->alphaCursor)
|
||||
@@ -285,7 +285,7 @@ NVCursorInit(ScreenPtr pScreen)
|
||||
infoPtr->MaxWidth = infoPtr->MaxHeight = 32;
|
||||
|
||||
infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32;
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32;
|
||||
infoPtr->SetCursorColors = NVSetCursorColors;
|
||||
infoPtr->SetCursorPosition = NVSetCursorPosition;
|
||||
infoPtr->LoadCursorImage = NVLoadCursorImage;
|
||||
|
||||
34
src/nv_dac.c
34
src/nv_dac.c
@@ -84,7 +84,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
int vertTotal = mode->CrtcVTotal - 2;
|
||||
int vertBlankStart = mode->CrtcVDisplay - 1;
|
||||
int vertBlankEnd = mode->CrtcVTotal - 1;
|
||||
|
||||
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
NVRegPtr nvReg = &pNv->ModeReg;
|
||||
NVFBLayout *pLayout = &pNv->CurrentLayout;
|
||||
@@ -104,15 +104,15 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
* Set all CRTC values.
|
||||
*/
|
||||
|
||||
if(mode->Flags & V_INTERLACE)
|
||||
if(mode->Flags & V_INTERLACE)
|
||||
vertTotal |= 1;
|
||||
|
||||
if(pNv->FlatPanel == 1) {
|
||||
vertStart = vertTotal - 3;
|
||||
vertStart = vertTotal - 3;
|
||||
vertEnd = vertTotal - 2;
|
||||
vertBlankStart = vertStart;
|
||||
horizStart = horizTotal - 5;
|
||||
horizEnd = horizTotal - 2;
|
||||
horizEnd = horizTotal - 2;
|
||||
horizBlankEnd = horizTotal + 4;
|
||||
if(pNv->Architecture == NV_ARCH_30)
|
||||
horizTotal += 2;
|
||||
@@ -121,7 +121,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
pVga->CRTC[0x0] = NV_Set8Bits(horizTotal);
|
||||
pVga->CRTC[0x1] = NV_Set8Bits(horizDisplay);
|
||||
pVga->CRTC[0x2] = NV_Set8Bits(horizBlankStart);
|
||||
pVga->CRTC[0x3] = NV_SetBitField(horizBlankEnd,4:0,4:0)
|
||||
pVga->CRTC[0x3] = NV_SetBitField(horizBlankEnd,4:0,4:0)
|
||||
| NV_SetBit(7);
|
||||
pVga->CRTC[0x4] = NV_Set8Bits(horizStart);
|
||||
pVga->CRTC[0x5] = NV_SetBitField(horizBlankEnd,5:5,7:7)
|
||||
@@ -156,7 +156,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
| NV_SetBitField(vertDisplay,10:10,1:1)
|
||||
| NV_SetBitField(vertTotal,10:10,0:0);
|
||||
|
||||
nvReg->horiz = NV_SetBitField(horizTotal,8:8,0:0)
|
||||
nvReg->horiz = NV_SetBitField(horizTotal,8:8,0:0)
|
||||
| NV_SetBitField(horizDisplay,8:8,1:1)
|
||||
| NV_SetBitField(horizBlankStart,8:8,2:2)
|
||||
| NV_SetBitField(horizStart,8:8,3:3);
|
||||
@@ -187,19 +187,19 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
pVga->DAC[(i*3)+2] = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Calculate the extended registers.
|
||||
*/
|
||||
|
||||
if(pLayout->depth < 24)
|
||||
if(pLayout->depth < 24)
|
||||
i = pLayout->depth;
|
||||
else i = 32;
|
||||
|
||||
if(pNv->Architecture >= NV_ARCH_10)
|
||||
pNv->CURSOR = (U032 *)(pNv->FbStart + pNv->CursorStart);
|
||||
|
||||
NVCalcStateExt(pNv,
|
||||
NVCalcStateExt(pNv,
|
||||
nvReg,
|
||||
i,
|
||||
pLayout->displayWidth,
|
||||
@@ -235,15 +235,15 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
nvReg->crtcOwner = 3;
|
||||
nvReg->pllsel |= 0x20000800;
|
||||
nvReg->vpll = pNv->PRAMDAC0[0x0508/4];
|
||||
if(pNv->twoStagePLL)
|
||||
if(pNv->twoStagePLL)
|
||||
nvReg->vpllB = pNv->PRAMDAC0[0x0578/4];
|
||||
} else
|
||||
} else
|
||||
if(pNv->twoHeads) {
|
||||
nvReg->head = pNv->PCRTC0[0x00000860/4] | 0x00001000;
|
||||
nvReg->head2 = pNv->PCRTC0[0x00002860/4] & ~0x00001000;
|
||||
nvReg->crtcOwner = 0;
|
||||
nvReg->vpll2 = pNv->PRAMDAC0[0x0520/4];
|
||||
if(pNv->twoStagePLL)
|
||||
if(pNv->twoStagePLL)
|
||||
nvReg->vpll2B = pNv->PRAMDAC0[0x057C/4];
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
if(mode->Flags & V_DBLSCAN)
|
||||
nvReg->cursorConfig |= (1 << 4);
|
||||
if(pNv->alphaCursor) {
|
||||
if((pNv->Chipset & 0x0ff0) != 0x0110)
|
||||
if((pNv->Chipset & 0x0ff0) != 0x0110)
|
||||
nvReg->cursorConfig |= 0x04011000;
|
||||
else
|
||||
nvReg->cursorConfig |= 0x14011000;
|
||||
@@ -268,7 +268,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
nvReg->dither = pNv->PRAMDAC[0x083C/4] & ~1;
|
||||
if(pNv->FPDither)
|
||||
nvReg->dither |= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nvReg->timingH = 0;
|
||||
@@ -278,7 +278,7 @@ NVDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
NVDACRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, NVRegPtr nvReg,
|
||||
Bool primary)
|
||||
{
|
||||
@@ -308,12 +308,12 @@ NVDACSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, NVRegPtr nvReg,
|
||||
saveFonts = FALSE;
|
||||
#endif
|
||||
|
||||
vgaHWSave(pScrn, vgaReg, VGA_SR_CMAP | VGA_SR_MODE |
|
||||
vgaHWSave(pScrn, vgaReg, VGA_SR_CMAP | VGA_SR_MODE |
|
||||
(saveFonts? VGA_SR_FONTS : 0));
|
||||
NVUnloadStateExt(pNv, nvReg);
|
||||
|
||||
/* can't read this reliably on NV11 */
|
||||
if((pNv->Chipset & 0x0ff0) == 0x0110)
|
||||
if((pNv->Chipset & 0x0ff0) == 0x0110)
|
||||
nvReg->crtcOwner = pNv->CRTCnumber;
|
||||
}
|
||||
|
||||
|
||||
44
src/nv_dga.c
44
src/nv_dga.c
@@ -9,7 +9,7 @@
|
||||
#include "dgaproc.h"
|
||||
|
||||
|
||||
static Bool NV_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
static Bool NV_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
int *, int *, int *);
|
||||
static Bool NV_SetMode(ScrnInfoPtr, DGAModePtr);
|
||||
static int NV_GetViewport(ScrnInfoPtr);
|
||||
@@ -58,7 +58,7 @@ SECOND_PASS:
|
||||
(size <= pNv->ScratchBufferStart)) {
|
||||
|
||||
if(secondPitch)
|
||||
pitch = secondPitch;
|
||||
pitch = secondPitch;
|
||||
|
||||
if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
break;
|
||||
@@ -91,8 +91,8 @@ SECOND_PASS:
|
||||
mode->address = pNv->FbStart;
|
||||
mode->bytesPerScanline = pitch * Bpp;
|
||||
mode->imageWidth = pitch;
|
||||
mode->imageHeight = pNv->ScratchBufferStart /
|
||||
mode->bytesPerScanline;
|
||||
mode->imageHeight = pNv->ScratchBufferStart /
|
||||
mode->bytesPerScanline;
|
||||
mode->pixmapWidth = mode->imageWidth;
|
||||
mode->pixmapHeight = mode->imageHeight;
|
||||
mode->maxViewportX = mode->imageWidth - mode->viewportWidth;
|
||||
@@ -116,32 +116,32 @@ SECOND_PASS:
|
||||
|
||||
Bool
|
||||
NVDGAInit(ScreenPtr pScreen)
|
||||
{
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
DGAModePtr modes = NULL;
|
||||
int num = 0;
|
||||
|
||||
/* 8 */
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
(pScrn->bitsPerPixel == 8),
|
||||
(pScrn->bitsPerPixel != 8) ? 0 : pScrn->displayWidth,
|
||||
0, 0, 0, PseudoColor);
|
||||
|
||||
/* 15 */
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
(pScrn->bitsPerPixel == 16),
|
||||
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
|
||||
0x7c00, 0x03e0, 0x001f, TrueColor);
|
||||
|
||||
/* 16 */
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
(pScrn->bitsPerPixel == 16),
|
||||
(pScrn->depth != 16) ? 0 : pScrn->displayWidth,
|
||||
0xf800, 0x07e0, 0x001f, TrueColor);
|
||||
|
||||
/* 32 */
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
modes = NVSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
(pScrn->bitsPerPixel == 32),
|
||||
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
|
||||
0xff0000, 0x00ff00, 0x0000ff, TrueColor);
|
||||
@@ -149,18 +149,18 @@ NVDGAInit(ScreenPtr pScreen)
|
||||
pNv->numDGAModes = num;
|
||||
pNv->DGAModes = modes;
|
||||
|
||||
return DGAInit(pScreen, &NV_DGAFuncs, modes, num);
|
||||
return DGAInit(pScreen, &NV_DGAFuncs, modes, num);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
BitsSet(unsigned long data)
|
||||
{
|
||||
unsigned long mask;
|
||||
int set = 0;
|
||||
|
||||
for(mask = 1; mask; mask <<= 1)
|
||||
if(mask & data) set++;
|
||||
if(mask & data) set++;
|
||||
|
||||
return set;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ NV_SetMode(
|
||||
if(!pMode) { /* restore the original mode */
|
||||
if(pNv->DGAactive)
|
||||
memcpy(&pNv->CurrentLayout, &SavedLayouts[index], sizeof(NVFBLayout));
|
||||
|
||||
|
||||
pScrn->currentMode = pNv->CurrentLayout.mode;
|
||||
NVSwitchMode(pScrn, pScrn->currentMode);
|
||||
NVAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
|
||||
@@ -192,7 +192,7 @@ NV_SetMode(
|
||||
/* update CurrentLayout */
|
||||
pNv->CurrentLayout.bitsPerPixel = pMode->bitsPerPixel;
|
||||
pNv->CurrentLayout.depth = pMode->depth;
|
||||
pNv->CurrentLayout.displayWidth = pMode->bytesPerScanline /
|
||||
pNv->CurrentLayout.displayWidth = pMode->bytesPerScanline /
|
||||
(pMode->bitsPerPixel >> 3);
|
||||
pNv->CurrentLayout.weight.red = BitsSet(pMode->red_mask);
|
||||
pNv->CurrentLayout.weight.green = BitsSet(pMode->green_mask);
|
||||
@@ -200,13 +200,13 @@ NV_SetMode(
|
||||
/* NVModeInit() will set the mode field */
|
||||
NVSwitchMode(pScrn, pMode->mode);
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
NV_GetViewport(
|
||||
ScrnInfoPtr pScrn
|
||||
){
|
||||
@@ -215,10 +215,10 @@ NV_GetViewport(
|
||||
return pNv->DGAViewportStatus;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
NV_SetViewport(
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
int flags
|
||||
){
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
@@ -228,12 +228,12 @@ NV_SetViewport(
|
||||
while(VGA_RD08(pNv->PCIO, 0x3da) & 0x08);
|
||||
while(!(VGA_RD08(pNv->PCIO, 0x3da) & 0x08));
|
||||
|
||||
pNv->DGAViewportStatus = 0;
|
||||
pNv->DGAViewportStatus = 0;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
NV_OpenFramebuffer(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
char **name,
|
||||
unsigned char **mem,
|
||||
int *size,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#define LINE_LINES(i) 0x00008400\
|
||||
+(i)*8
|
||||
#define LINE_LINES_POINT0_X 15:0
|
||||
#define LINE_LINES_POINT0_Y 31:16
|
||||
#define LINE_LINES_POINT0_Y 31:16
|
||||
#define LINE_LINES_POINT1_X 47:32
|
||||
#define LINE_LINES_POINT1_Y 63:48
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
#define STRETCH_BLIT_OPERATION_COPY 0x00000003
|
||||
#define STRETCH_BLIT_OPERATION_BLEND 0x00000002
|
||||
#define STRETCH_BLIT_CLIP_POINT 0x0000E308
|
||||
#define STRETCH_BLIT_CLIP_POINT_X 15:0
|
||||
#define STRETCH_BLIT_CLIP_POINT_X 15:0
|
||||
#define STRETCH_BLIT_CLIP_POINT_Y 31:16
|
||||
#define STRETCH_BLIT_CLIP_POINT 0x0000E308
|
||||
#define STRETCH_BLIT_CLIP_SIZE 0x0000E30C
|
||||
|
||||
120
src/nv_driver.c
120
src/nv_driver.c
@@ -753,7 +753,7 @@ NVAvailableOptions(int chipid, int busid)
|
||||
if(chipid == 0x12D20018) {
|
||||
return RivaAvailableOptions(chipid, busid);
|
||||
}
|
||||
|
||||
|
||||
return NVOptions;
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
|
||||
#define MAX_CHIPS MAXSCREENS
|
||||
|
||||
|
||||
static CARD32
|
||||
static CARD32
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
NVGetPCIXpressChip (struct pci_device *dev)
|
||||
#else
|
||||
@@ -827,7 +827,7 @@ NVGetPCIXpressChip (pciVideoPtr pVideo)
|
||||
|
||||
pcicmd = pciReadLong(Tag, PCI_CMD_STAT_REG);
|
||||
pciWriteLong(Tag, PCI_CMD_STAT_REG, pcicmd | PCI_CMD_MEM_ENABLE);
|
||||
|
||||
|
||||
regs = xf86MapPciMem(-1, VIDMEM_MMIO, Tag, pVideo->memBase[0], 0x2000);
|
||||
|
||||
pciid = regs[0x1800/4];
|
||||
@@ -837,9 +837,9 @@ NVGetPCIXpressChip (pciVideoPtr pVideo)
|
||||
pciWriteLong(Tag, PCI_CMD_STAT_REG, pcicmd);
|
||||
#endif
|
||||
|
||||
if((pciid & 0x0000ffff) == 0x000010DE)
|
||||
if((pciid & 0x0000ffff) == 0x000010DE)
|
||||
pciid = 0x10DE0000 | (pciid >> 16);
|
||||
else
|
||||
else
|
||||
if((pciid & 0xffff0000) == 0xDE100000) /* wrong endian */
|
||||
pciid = 0x10DE0000 | ((pciid << 8) & 0x0000ff00) |
|
||||
((pciid >> 8) & 0x000000ff);
|
||||
@@ -984,18 +984,18 @@ NVProbe(DriverPtr drv, int flags)
|
||||
Bool foundScreen = FALSE;
|
||||
|
||||
|
||||
if ((numDevSections = xf86MatchDevice(NV_DRIVER_NAME, &devSections)) <= 0)
|
||||
if ((numDevSections = xf86MatchDevice(NV_DRIVER_NAME, &devSections)) <= 0)
|
||||
return FALSE; /* no matching device section */
|
||||
|
||||
if (!(ppPci = xf86GetPciVideoInfo()))
|
||||
if (!(ppPci = xf86GetPciVideoInfo()))
|
||||
return FALSE; /* no PCI cards found */
|
||||
|
||||
numUsed = 0;
|
||||
|
||||
/* Create the NVChipsets and NVPciChipsets from found devices */
|
||||
while (*ppPci && (numUsed < MAX_CHIPS)) {
|
||||
if(((*ppPci)->vendor == PCI_VENDOR_NVIDIA_SGS) ||
|
||||
((*ppPci)->vendor == PCI_VENDOR_NVIDIA))
|
||||
if(((*ppPci)->vendor == PCI_VENDOR_NVIDIA_SGS) ||
|
||||
((*ppPci)->vendor == PCI_VENDOR_NVIDIA))
|
||||
{
|
||||
SymTabRec *nvchips = NVKnownChipsets;
|
||||
int pciid = ((*ppPci)->vendor << 16) | (*ppPci)->chipType;
|
||||
@@ -1029,7 +1029,7 @@ NVProbe(DriverPtr drv, int flags)
|
||||
|
||||
/* terminate the list */
|
||||
NVChipsets[numUsed].token = -1;
|
||||
NVChipsets[numUsed].name = NULL;
|
||||
NVChipsets[numUsed].name = NULL;
|
||||
NVPciChipsets[numUsed].numChipset = -1;
|
||||
NVPciChipsets[numUsed].PCIid = -1;
|
||||
NVPciChipsets[numUsed].resList = RES_UNDEFINED;
|
||||
@@ -1037,8 +1037,8 @@ NVProbe(DriverPtr drv, int flags)
|
||||
numUsed = xf86MatchPciInstances(NV_NAME, 0, NVChipsets, NVPciChipsets,
|
||||
devSections, numDevSections, drv,
|
||||
&usedChips);
|
||||
|
||||
if (numUsed <= 0)
|
||||
|
||||
if (numUsed <= 0)
|
||||
return FALSE;
|
||||
|
||||
if (flags & PROBE_DETECT)
|
||||
@@ -1054,9 +1054,9 @@ NVProbe(DriverPtr drv, int flags)
|
||||
if(G80GetScrnInfoRec(NVPciChipsets, usedChips[i]))
|
||||
foundScreen = TRUE;
|
||||
} else {
|
||||
if(NVGetScrnInfoRec(NVPciChipsets, usedChips[i]))
|
||||
if(NVGetScrnInfoRec(NVPciChipsets, usedChips[i]))
|
||||
foundScreen = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(devSections);
|
||||
@@ -1099,7 +1099,7 @@ NVSwitchModeVBE(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
* displayed location in the video memory.
|
||||
*/
|
||||
/* Usually mandatory */
|
||||
void
|
||||
void
|
||||
NVAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
|
||||
{
|
||||
int startAddr;
|
||||
@@ -1174,7 +1174,7 @@ NVLeaveVTVBE(ScrnInfoPtr pScrn)
|
||||
NVSaveRestoreVBE(pScrn, MODE_RESTORE);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
NVBlockHandler (BLOCKHANDLER_ARGS_DECL)
|
||||
{
|
||||
ScrnInfoPtr pScrnInfo = xf86ScreenToScrn(pScreen);
|
||||
@@ -1182,12 +1182,12 @@ NVBlockHandler (BLOCKHANDLER_ARGS_DECL)
|
||||
|
||||
if (pNv->DMAKickoffCallback)
|
||||
(*pNv->DMAKickoffCallback)(pScrnInfo);
|
||||
|
||||
|
||||
pScreen->BlockHandler = pNv->BlockHandler;
|
||||
(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
|
||||
pScreen->BlockHandler = NVBlockHandler;
|
||||
|
||||
if (pNv->VideoTimerCallback)
|
||||
if (pNv->VideoTimerCallback)
|
||||
(*pNv->VideoTimerCallback)(pScrnInfo, currentTime.milliseconds);
|
||||
|
||||
}
|
||||
@@ -1301,7 +1301,7 @@ Bool NVI2CInit(ScrnInfoPtr pScrn)
|
||||
mod = "ddc";
|
||||
if(xf86LoadSubModule(pScrn, mod)) {
|
||||
return NVDACi2cInit(pScrn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
@@ -1327,7 +1327,7 @@ NVModesAdd(DisplayModePtr Modes, DisplayModePtr Additions)
|
||||
|
||||
while (Mode->next)
|
||||
Mode = Mode->next;
|
||||
|
||||
|
||||
Mode->next = Additions;
|
||||
Additions->prev = Mode;
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
* not at the start of each server generation. This means that
|
||||
* only things that are persistent across server generations can
|
||||
* be initialised here. xf86Screens[] is (pScrn is a pointer to one
|
||||
* of these). Privates allocated using xf86AllocateScrnInfoPrivateIndex()
|
||||
* of these). Privates allocated using xf86AllocateScrnInfoPrivateIndex()
|
||||
* are too, and should be used for data that must persist across
|
||||
* server generations.
|
||||
*
|
||||
@@ -1386,7 +1386,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
||||
if (pNv->pEnt->location.type != BUS_PCI)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Find the PCI info for this screen */
|
||||
pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
@@ -1403,7 +1403,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->pInt = xf86InitInt10(pNv->pEnt->index);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
xf86SetOperatingState(resVgaIo, pNv->pEnt->index, ResUnusedOpr);
|
||||
xf86SetOperatingState(resVgaMem, pNv->pEnt->index, ResDisableOpr);
|
||||
@@ -1422,7 +1422,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
from = X_CONFIG;
|
||||
} else if (pNv->pEnt->device->chipID >= 0) {
|
||||
pNv->Chipset = pNv->pEnt->device->chipID;
|
||||
pScrn->chipset = (char *)xf86TokenToString(NVKnownChipsets,
|
||||
pScrn->chipset = (char *)xf86TokenToString(NVKnownChipsets,
|
||||
pNv->Chipset);
|
||||
from = X_CONFIG;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
|
||||
@@ -1437,7 +1437,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->Chipset = NVGetPCIXpressChip(pNv->PciInfo);
|
||||
}
|
||||
|
||||
pScrn->chipset = (char *)xf86TokenToString(NVKnownChipsets,
|
||||
pScrn->chipset = (char *)xf86TokenToString(NVKnownChipsets,
|
||||
pNv->Chipset);
|
||||
if(!pScrn->chipset)
|
||||
pScrn->chipset = "Unknown NVIDIA chipset";
|
||||
@@ -1534,7 +1534,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86FreeInt10(pNv->pInt);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a vgaHWRec
|
||||
*/
|
||||
@@ -1547,7 +1547,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
#else
|
||||
vgaHWSetStdFuncs(VGAHWPTR(pScrn));
|
||||
#endif
|
||||
|
||||
|
||||
/* We use a programmable clock */
|
||||
pScrn->progClock = TRUE;
|
||||
|
||||
@@ -1593,12 +1593,12 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (xf86ReturnOptValBool(pNv->Options, OPTION_SHADOW_FB, FALSE)) {
|
||||
pNv->ShadowFB = TRUE;
|
||||
pNv->NoAccel = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
|
||||
}
|
||||
if (xf86ReturnOptValBool(pNv->Options, OPTION_FBDEV, FALSE)) {
|
||||
pNv->FBDev = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Using framebuffer device\n");
|
||||
}
|
||||
if (pNv->FBDev) {
|
||||
@@ -1607,7 +1607,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86FreeInt10(pNv->pInt);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL)) {
|
||||
xf86FreeInt10(pNv->pInt);
|
||||
return FALSE;
|
||||
@@ -1626,7 +1626,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->NoAccel = TRUE;
|
||||
pNv->HWCursor = FALSE;
|
||||
pNv->Rotate = 1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Rotating screen clockwise - acceleration disabled\n");
|
||||
} else
|
||||
if(!xf86NameCmp(s, "CCW")) {
|
||||
@@ -1634,7 +1634,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->NoAccel = TRUE;
|
||||
pNv->HWCursor = FALSE;
|
||||
pNv->Rotate = -1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Rotating screen counter clockwise - acceleration disabled\n");
|
||||
} else
|
||||
if(!xf86NameCmp(s, "RandR")) {
|
||||
@@ -1652,9 +1652,9 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
"\"RandR\"'.\n");
|
||||
#endif
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
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\", \"CCW\", and \"RandR\"\n");
|
||||
}
|
||||
}
|
||||
@@ -1663,9 +1663,9 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
|
||||
pNv->videoKey);
|
||||
} else {
|
||||
pNv->videoKey = (1 << pScrn->offset.red) |
|
||||
pNv->videoKey = (1 << pScrn->offset.red) |
|
||||
(1 << pScrn->offset.green) |
|
||||
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
|
||||
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
|
||||
}
|
||||
|
||||
if (xf86GetOptValBool(pNv->Options, OPTION_FLAT_PANEL, &(pNv->FlatPanel))) {
|
||||
@@ -1676,15 +1676,15 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
pNv->FPDither = FALSE;
|
||||
if (xf86GetOptValBool(pNv->Options, OPTION_FP_DITHER, &(pNv->FPDither)))
|
||||
if (xf86GetOptValBool(pNv->Options, OPTION_FP_DITHER, &(pNv->FPDither)))
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "enabling flat panel dither\n");
|
||||
|
||||
if (xf86GetOptValInteger(pNv->Options, OPTION_CRTC_NUMBER,
|
||||
&pNv->CRTCnumber))
|
||||
&pNv->CRTCnumber))
|
||||
{
|
||||
if((pNv->CRTCnumber < 0) || (pNv->CRTCnumber > 1)) {
|
||||
pNv->CRTCnumber = -1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Invalid CRTC number. Must be 0 or 1\n");
|
||||
}
|
||||
} else {
|
||||
@@ -1692,7 +1692,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
|
||||
if (xf86GetOptValInteger(pNv->Options, OPTION_FP_TWEAK,
|
||||
if (xf86GetOptValInteger(pNv->Options, OPTION_FP_TWEAK,
|
||||
&pNv->PanelTweak))
|
||||
{
|
||||
pNv->usePanelTweak = TRUE;
|
||||
@@ -1788,7 +1788,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
|
||||
(unsigned long)pNv->IOAddress);
|
||||
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86RegisterResources(pNv->pEnt->index, NULL, ResExclusive)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -1868,7 +1868,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pNv->alphaCursor = (pNv->Architecture >= NV_ARCH_10) &&
|
||||
((pNv->Chipset & 0x0ff0) != 0x0100);
|
||||
|
||||
if ((pScrn->monitor->nHsync == 0) &&
|
||||
if ((pScrn->monitor->nHsync == 0) &&
|
||||
(pScrn->monitor->nVrefresh == 0))
|
||||
config_mon_rates = FALSE;
|
||||
else
|
||||
@@ -1883,7 +1883,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kBytes\n",
|
||||
pScrn->videoRam);
|
||||
|
||||
|
||||
pNv->FbMapSize = pScrn->videoRam * 1024;
|
||||
|
||||
/*
|
||||
@@ -1922,7 +1922,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
clockRanges->clockIndex = -1; /* programmable */
|
||||
clockRanges->doubleScanAllowed = TRUE;
|
||||
if((pNv->Architecture == NV_ARCH_20) ||
|
||||
((pNv->Architecture == NV_ARCH_10) &&
|
||||
((pNv->Architecture == NV_ARCH_10) &&
|
||||
((pNv->Chipset & 0x0ff0) != 0x0100) &&
|
||||
((pNv->Chipset & 0x0ff0) != 0x0150)))
|
||||
{
|
||||
@@ -2169,7 +2169,7 @@ static Bool
|
||||
NVUnmapMem(ScrnInfoPtr pScrn)
|
||||
{
|
||||
NVPtr pNv;
|
||||
|
||||
|
||||
pNv = NVPTR(pScrn);
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
@@ -2185,7 +2185,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)
|
||||
|
||||
|
||||
/*
|
||||
* Initialise a new mode.
|
||||
* Initialise a new mode.
|
||||
*/
|
||||
|
||||
static Bool
|
||||
@@ -2269,7 +2269,7 @@ NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode)
|
||||
/*
|
||||
* Restore the initial (text) mode.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
NVRestore(ScrnInfoPtr pScrn)
|
||||
{
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
@@ -2305,8 +2305,8 @@ static void NVBacklightEnable(NVPtr pNv, Bool on)
|
||||
define the ones we know for sure. */
|
||||
|
||||
#if defined(__powerpc__)
|
||||
if((pNv->Chipset == 0x10DE0179) ||
|
||||
(pNv->Chipset == 0x10DE0189) ||
|
||||
if((pNv->Chipset == 0x10DE0179) ||
|
||||
(pNv->Chipset == 0x10DE0189) ||
|
||||
(pNv->Chipset == 0x10DE0329))
|
||||
{
|
||||
/* NV17,18,34 Apple iMac, iBook, PowerBook */
|
||||
@@ -2321,7 +2321,7 @@ static void NVBacklightEnable(NVPtr pNv, Bool on)
|
||||
pNv->PCRTC0[0x081C/4] = tmp_pcrt;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if(pNv->LVDS) {
|
||||
if(pNv->twoHeads) {
|
||||
if((pNv->Chipset & 0x0ff0) != 0x0110) {
|
||||
@@ -2457,7 +2457,7 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
int width, height, displayWidth, offscreenHeight, shadowHeight;
|
||||
BoxRec AvailFBArea;
|
||||
|
||||
/*
|
||||
/*
|
||||
* First get the ScrnInfoRec
|
||||
*/
|
||||
pScrn = xf86ScreenToScrn(pScreen);
|
||||
@@ -2522,7 +2522,7 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
|
||||
/* Setup the visuals we support. */
|
||||
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
miGetDefaultVisualMask(pScrn->depth), 8,
|
||||
pScrn->defaultVisual))
|
||||
return FALSE;
|
||||
@@ -2596,7 +2596,7 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
}
|
||||
|
||||
fbPictureInit (pScreen, 0, 0);
|
||||
|
||||
|
||||
xf86SetBlackWhitePixels(pScreen);
|
||||
|
||||
if(!pNv->ShadowFB) /* hardware cursor needs to wrap this layer */
|
||||
@@ -2616,15 +2616,15 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
xf86SetBackingStore(pScreen);
|
||||
xf86SetSilkenMouse(pScreen);
|
||||
|
||||
/* Initialize software cursor.
|
||||
/* Initialize software cursor.
|
||||
Must precede creation of the default colormap */
|
||||
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
|
||||
|
||||
/* Initialize HW cursor layer.
|
||||
/* Initialize HW cursor layer.
|
||||
Must follow software cursor initialization*/
|
||||
if (pNv->HWCursor) {
|
||||
if (pNv->HWCursor) {
|
||||
if(!NVCursorInit(pScreen))
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Hardware cursor initialization failed\n");
|
||||
}
|
||||
|
||||
@@ -2632,10 +2632,10 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!miCreateDefColormap(pScreen))
|
||||
return FALSE;
|
||||
|
||||
/* Initialize colormap layer.
|
||||
/* Initialize colormap layer.
|
||||
Must follow initialization of the default colormap */
|
||||
if(!xf86HandleColormaps(pScreen, 256, 8,
|
||||
(pNv->FBDev ? fbdevHWLoadPaletteWeak() : NVDACLoadPalette),
|
||||
(pNv->FBDev ? fbdevHWLoadPaletteWeak() : NVDACLoadPalette),
|
||||
NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR))
|
||||
return FALSE;
|
||||
|
||||
@@ -2671,7 +2671,7 @@ NVScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
xf86DPMSInit(pScreen, NVDPMSSetLCD, 0);
|
||||
else
|
||||
xf86DPMSInit(pScreen, NVDPMSSet, 0);
|
||||
|
||||
|
||||
pScrn->memPhysBase = pNv->FbAddress;
|
||||
pScrn->fbOffset = 0;
|
||||
|
||||
|
||||
112
src/nv_hw.c
112
src/nv_hw.c
@@ -143,7 +143,7 @@ static void nvGetClocks(NVPtr pNv, unsigned int *MClk, unsigned int *NVClk)
|
||||
*MClk = ((N * NB * pNv->CrystalFreqKHz) / (M * MB)) >> P;
|
||||
|
||||
pll = pNv->PMC[0x4000/4];
|
||||
P = (pll >> 16) & 0x07;
|
||||
P = (pll >> 16) & 0x07;
|
||||
pll = pNv->PMC[0x4004/4];
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
@@ -154,12 +154,12 @@ static void nvGetClocks(NVPtr pNv, unsigned int *MClk, unsigned int *NVClk)
|
||||
} else
|
||||
if(pNv->twoStagePLL) {
|
||||
pll = pNv->PRAMDAC0[0x0504/4];
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
P = (pll >> 16) & 0x0F;
|
||||
pll = pNv->PRAMDAC0[0x0574/4];
|
||||
if(pll & 0x80000000) {
|
||||
MB = pll & 0xFF;
|
||||
MB = pll & 0xFF;
|
||||
NB = (pll >> 8) & 0xFF;
|
||||
} else {
|
||||
MB = 1;
|
||||
@@ -168,8 +168,8 @@ static void nvGetClocks(NVPtr pNv, unsigned int *MClk, unsigned int *NVClk)
|
||||
*MClk = ((N * NB * pNv->CrystalFreqKHz) / (M * MB)) >> P;
|
||||
|
||||
pll = pNv->PRAMDAC0[0x0500/4];
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
P = (pll >> 16) & 0x0F;
|
||||
pll = pNv->PRAMDAC0[0x0570/4];
|
||||
if(pll & 0x80000000) {
|
||||
@@ -180,16 +180,16 @@ static void nvGetClocks(NVPtr pNv, unsigned int *MClk, unsigned int *NVClk)
|
||||
NB = 1;
|
||||
}
|
||||
*NVClk = ((N * NB * pNv->CrystalFreqKHz) / (M * MB)) >> P;
|
||||
} else
|
||||
} else
|
||||
if(((pNv->Chipset & 0x0ff0) == 0x0300) ||
|
||||
((pNv->Chipset & 0x0ff0) == 0x0330))
|
||||
{
|
||||
pll = pNv->PRAMDAC0[0x0504/4];
|
||||
M = pll & 0x0F;
|
||||
M = pll & 0x0F;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
P = (pll >> 16) & 0x07;
|
||||
if(pll & 0x00000080) {
|
||||
MB = (pll >> 4) & 0x07;
|
||||
MB = (pll >> 4) & 0x07;
|
||||
NB = (pll >> 19) & 0x1f;
|
||||
} else {
|
||||
MB = 1;
|
||||
@@ -211,14 +211,14 @@ static void nvGetClocks(NVPtr pNv, unsigned int *MClk, unsigned int *NVClk)
|
||||
*NVClk = ((N * NB * pNv->CrystalFreqKHz) / (M * MB)) >> P;
|
||||
} else {
|
||||
pll = pNv->PRAMDAC0[0x0504/4];
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
P = (pll >> 16) & 0x0F;
|
||||
*MClk = (N * pNv->CrystalFreqKHz / M) >> P;
|
||||
|
||||
pll = pNv->PRAMDAC0[0x0500/4];
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
M = pll & 0xFF;
|
||||
N = (pll >> 8) & 0xFF;
|
||||
P = (pll >> 16) & 0x0F;
|
||||
*NVClk = (N * pNv->CrystalFreqKHz / M) >> P;
|
||||
}
|
||||
@@ -369,8 +369,8 @@ static void nv4CalcArbitration (
|
||||
}
|
||||
|
||||
static void nv4UpdateArbitrationSettings (
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned *burst,
|
||||
unsigned *lwm,
|
||||
NVPtr pNv
|
||||
@@ -462,7 +462,7 @@ static void nv10CalcArbitration (
|
||||
mclks += 1;
|
||||
|
||||
if ((!video_enable) && (arb->memory_width == 128))
|
||||
{
|
||||
{
|
||||
mclk_extra = (bpp == 32) ? 31 : 42; /* Margin of error */
|
||||
min_mclk_extra = 17;
|
||||
}
|
||||
@@ -560,7 +560,7 @@ static void nv10CalcArbitration (
|
||||
m2us = us_pipe_min + us_min_mclk_extra;
|
||||
|
||||
/* pclk cycles to drain */
|
||||
p1clk = m2us * pclk_freq/(1000*1000);
|
||||
p1clk = m2us * pclk_freq/(1000*1000);
|
||||
p2 = p1clk * bpp / 8; /* bytes drained. */
|
||||
|
||||
if((p2 < m1) && (m1 > 0)) {
|
||||
@@ -579,9 +579,9 @@ static void nv10CalcArbitration (
|
||||
if (clwm > 1023){ /* Have some margin */
|
||||
fifo->valid = 0;
|
||||
found = 0;
|
||||
if(min_mclk_extra == 0)
|
||||
if(min_mclk_extra == 0)
|
||||
found = 1; /* Can't adjust anymore! */
|
||||
else
|
||||
else
|
||||
min_mclk_extra--;
|
||||
}
|
||||
}
|
||||
@@ -596,8 +596,8 @@ static void nv10CalcArbitration (
|
||||
}
|
||||
|
||||
static void nv10UpdateArbitrationSettings (
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned *burst,
|
||||
unsigned *lwm,
|
||||
NVPtr pNv
|
||||
@@ -636,7 +636,7 @@ static void nv30UpdateArbitrationSettings (
|
||||
NVPtr pNv,
|
||||
unsigned *burst,
|
||||
unsigned *lwm
|
||||
)
|
||||
)
|
||||
{
|
||||
unsigned int MClk, NVClk;
|
||||
unsigned int fifo_size, burst_size, graphics_lwm;
|
||||
@@ -646,7 +646,7 @@ static void nv30UpdateArbitrationSettings (
|
||||
graphics_lwm = fifo_size - burst_size;
|
||||
|
||||
nvGetClocks(pNv, &MClk, &NVClk);
|
||||
|
||||
|
||||
*burst = 0;
|
||||
burst_size >>= 5;
|
||||
while(burst_size >>= 1) (*burst)++;
|
||||
@@ -687,7 +687,7 @@ static void nForceUpdateArbitrationSettings (
|
||||
unsigned int uMClkPostDiv;
|
||||
|
||||
uMClkPostDiv = (READ_LONG(3, 0x6C) >> 8) & 0xf;
|
||||
if(!uMClkPostDiv) uMClkPostDiv = 4;
|
||||
if(!uMClkPostDiv) uMClkPostDiv = 4;
|
||||
MClk = 400000 / uMClkPostDiv;
|
||||
} else {
|
||||
MClk = READ_LONG(5, 0x4C) / 1000;
|
||||
@@ -714,7 +714,7 @@ static void nForceUpdateArbitrationSettings (
|
||||
if((dimm[0] + dimm[1]) != dimm[2]) {
|
||||
ErrorF("WARNING: "
|
||||
"your nForce DIMMs are not arranged in optimal banks!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sim_data.mem_latency = 3;
|
||||
@@ -757,11 +757,11 @@ static void CalcVClock (
|
||||
unsigned DeltaNew, DeltaOld;
|
||||
unsigned VClk, Freq;
|
||||
unsigned M, N, P;
|
||||
|
||||
|
||||
DeltaOld = 0xFFFFFFFF;
|
||||
|
||||
VClk = (unsigned)clockIn;
|
||||
|
||||
|
||||
if (pNv->CrystalFreqKHz == 13500) {
|
||||
lowM = 7;
|
||||
highM = 13;
|
||||
@@ -833,7 +833,7 @@ static void CalcVClock2Stage (
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate extended mode parameters (SVGA) and save in a
|
||||
* Calculate extended mode parameters (SVGA) and save in a
|
||||
* mode state structure.
|
||||
*/
|
||||
void NVCalcStateExt (
|
||||
@@ -844,7 +844,7 @@ void NVCalcStateExt (
|
||||
int hDisplaySize,
|
||||
int height,
|
||||
int dotClock,
|
||||
int flags
|
||||
int flags
|
||||
)
|
||||
{
|
||||
int pixelDepth, VClk = 0;
|
||||
@@ -866,8 +866,8 @@ void NVCalcStateExt (
|
||||
switch (pNv->Architecture)
|
||||
{
|
||||
case NV_ARCH_04:
|
||||
nv4UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
nv4UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
&(state->arbitration0),
|
||||
&(state->arbitration1),
|
||||
pNv);
|
||||
@@ -893,8 +893,8 @@ void NVCalcStateExt (
|
||||
((pNv->Chipset & 0xfff0) == 0x03D0) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0530))
|
||||
{
|
||||
state->arbitration0 = 128;
|
||||
state->arbitration1 = 0x0480;
|
||||
state->arbitration0 = 128;
|
||||
state->arbitration1 = 0x0480;
|
||||
} else
|
||||
if(((pNv->Chipset & 0xffff) == 0x01A0) ||
|
||||
((pNv->Chipset & 0xffff) == 0x01f0))
|
||||
@@ -905,8 +905,8 @@ void NVCalcStateExt (
|
||||
&(state->arbitration1),
|
||||
pNv);
|
||||
} else if(pNv->Architecture < NV_ARCH_30) {
|
||||
nv10UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
nv10UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
&(state->arbitration0),
|
||||
&(state->arbitration1),
|
||||
pNv);
|
||||
@@ -918,7 +918,7 @@ void NVCalcStateExt (
|
||||
state->cursor0 = 0x80 | (pNv->CursorStart >> 17);
|
||||
state->cursor1 = (pNv->CursorStart >> 11) << 2;
|
||||
state->cursor2 = pNv->CursorStart >> 24;
|
||||
if (flags & V_DBLSCAN)
|
||||
if (flags & V_DBLSCAN)
|
||||
state->cursor1 |= 2;
|
||||
state->pllsel = 0x10000700;
|
||||
state->config = pNv->PFB[0x00000200/4];
|
||||
@@ -954,7 +954,7 @@ void NVLoadStateExt (
|
||||
if(pNv->Architecture == NV_ARCH_04) {
|
||||
if (state)
|
||||
pNv->PFB[0x0200/4] = state->config;
|
||||
} else
|
||||
} else
|
||||
if((pNv->Architecture < NV_ARCH_40) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0040))
|
||||
{
|
||||
@@ -973,7 +973,7 @@ void NVLoadStateExt (
|
||||
{
|
||||
regions = 15;
|
||||
}
|
||||
|
||||
|
||||
for(i = 0; i < regions; i++) {
|
||||
pNv->PFB[(0x0600 + (i * 0x10))/4] = 0;
|
||||
pNv->PFB[(0x0604 + (i * 0x10))/4] = pNv->FbMapSize - 1;
|
||||
@@ -1060,15 +1060,15 @@ void NVLoadStateExt (
|
||||
pNv->PRAMIN[0x082A] |= 0x01000000;
|
||||
pNv->PRAMIN[0x0832] |= 0x01000000;
|
||||
pNv->PRAMIN[0x083A] |= 0x01000000;
|
||||
pNv->PRAMIN[0x0842] |= 0x01000000;
|
||||
pNv->PRAMIN[0x0842] |= 0x01000000;
|
||||
pNv->PRAMIN[0x0819] = 0x01000000;
|
||||
pNv->PRAMIN[0x0839] = 0x01000000;
|
||||
#endif
|
||||
} else {
|
||||
pNv->PRAMIN[0x0000] = 0x80000010;
|
||||
pNv->PRAMIN[0x0001] = 0x80011201;
|
||||
pNv->PRAMIN[0x0001] = 0x80011201;
|
||||
pNv->PRAMIN[0x0002] = 0x80000011;
|
||||
pNv->PRAMIN[0x0003] = 0x80011202;
|
||||
pNv->PRAMIN[0x0003] = 0x80011202;
|
||||
pNv->PRAMIN[0x0004] = 0x80000012;
|
||||
pNv->PRAMIN[0x0005] = 0x80011203;
|
||||
pNv->PRAMIN[0x0006] = 0x80000013;
|
||||
@@ -1161,7 +1161,7 @@ void NVLoadStateExt (
|
||||
pNv->PGRAPH[0x0720/4] = 0x00000001;
|
||||
|
||||
pNv->PGRAPH[0x0810/4] = 0x00000000;
|
||||
pNv->PGRAPH[0x0608/4] = 0xFFFFFFFF;
|
||||
pNv->PGRAPH[0x0608/4] = 0xFFFFFFFF;
|
||||
} else {
|
||||
pNv->PGRAPH[0x0080/4] = 0xFFFFFFFF;
|
||||
pNv->PGRAPH[0x0080/4] = 0x00000000;
|
||||
@@ -1258,7 +1258,7 @@ void NVLoadStateExt (
|
||||
|
||||
pNv->PGRAPH[0x0b38/4] = 0x2ffff800;
|
||||
pNv->PGRAPH[0x0b3c/4] = 0x00006000;
|
||||
pNv->PGRAPH[0x032C/4] = 0x01000000;
|
||||
pNv->PGRAPH[0x032C/4] = 0x01000000;
|
||||
pNv->PGRAPH[0x0220/4] = 0x00001200;
|
||||
} else
|
||||
if(pNv->Architecture == NV_ARCH_30) {
|
||||
@@ -1277,15 +1277,15 @@ void NVLoadStateExt (
|
||||
|
||||
if((pNv->Chipset & 0x0ff0) >= 0x0250) {
|
||||
pNv->PGRAPH[0x0890/4] = 0x00080000;
|
||||
pNv->PGRAPH[0x0610/4] = 0x304B1FB6;
|
||||
pNv->PGRAPH[0x0B80/4] = 0x18B82880;
|
||||
pNv->PGRAPH[0x0B84/4] = 0x44000000;
|
||||
pNv->PGRAPH[0x0098/4] = 0x40000080;
|
||||
pNv->PGRAPH[0x0B88/4] = 0x000000ff;
|
||||
pNv->PGRAPH[0x0610/4] = 0x304B1FB6;
|
||||
pNv->PGRAPH[0x0B80/4] = 0x18B82880;
|
||||
pNv->PGRAPH[0x0B84/4] = 0x44000000;
|
||||
pNv->PGRAPH[0x0098/4] = 0x40000080;
|
||||
pNv->PGRAPH[0x0B88/4] = 0x000000ff;
|
||||
} else {
|
||||
pNv->PGRAPH[0x0880/4] = 0x00080000;
|
||||
pNv->PGRAPH[0x0094/4] = 0x00000005;
|
||||
pNv->PGRAPH[0x0B80/4] = 0x45CAA208;
|
||||
pNv->PGRAPH[0x0B80/4] = 0x45CAA208;
|
||||
pNv->PGRAPH[0x0B84/4] = 0x24000000;
|
||||
pNv->PGRAPH[0x0098/4] = 0x00000040;
|
||||
pNv->PGRAPH[0x0750/4] = 0x00E00038;
|
||||
@@ -1296,7 +1296,7 @@ void NVLoadStateExt (
|
||||
}
|
||||
|
||||
if((pNv->Architecture < NV_ARCH_40) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0040))
|
||||
((pNv->Chipset & 0xfff0) == 0x0040))
|
||||
{
|
||||
for(i = 0; i < 32; i++) {
|
||||
pNv->PGRAPH[(0x0900/4) + i] = pNv->PFB[(0x0240/4) + i];
|
||||
@@ -1342,7 +1342,7 @@ void NVLoadStateExt (
|
||||
if(((pNv->Chipset & 0xfff0) == 0x0090) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x01D0) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0290) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0390))
|
||||
((pNv->Chipset & 0xfff0) == 0x0390))
|
||||
{
|
||||
pNv->PGRAPH[0x0DF0/4] = pNv->PFB[0x0200/4];
|
||||
pNv->PGRAPH[0x0DF4/4] = pNv->PFB[0x0204/4];
|
||||
@@ -1429,7 +1429,7 @@ void NVLoadStateExt (
|
||||
pNv->PCRTC0[0x2860/4] = state->head2;
|
||||
}
|
||||
pNv->PRAMDAC[0x0404/4] |= (1 << 25);
|
||||
|
||||
|
||||
pNv->PMC[0x8704/4] = 1;
|
||||
pNv->PMC[0x8140/4] = 0;
|
||||
pNv->PMC[0x8920/4] = 0;
|
||||
@@ -1441,15 +1441,15 @@ void NVLoadStateExt (
|
||||
pNv->PCRTC[0x0810/4] = state->cursorConfig;
|
||||
pNv->PCRTC[0x0830/4] = state->displayV - 3;
|
||||
pNv->PCRTC[0x0834/4] = state->displayV - 1;
|
||||
|
||||
|
||||
if(pNv->FlatPanel) {
|
||||
if((pNv->Chipset & 0x0ff0) == 0x0110) {
|
||||
pNv->PRAMDAC[0x0528/4] = state->dither;
|
||||
} else
|
||||
} else
|
||||
if(pNv->twoHeads) {
|
||||
pNv->PRAMDAC[0x083C/4] = state->dither;
|
||||
}
|
||||
|
||||
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x53);
|
||||
VGA_WR08(pNv->PCIO, 0x03D5, state->timingH);
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x54);
|
||||
@@ -1580,7 +1580,7 @@ void NVUnloadStateExt
|
||||
|
||||
if((pNv->Chipset & 0x0ff0) == 0x0110) {
|
||||
state->dither = pNv->PRAMDAC[0x0528/4];
|
||||
} else
|
||||
} else
|
||||
if(pNv->twoHeads) {
|
||||
state->dither = pNv->PRAMDAC[0x083C/4];
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* This file includes any environment or machine specific values to access the
|
||||
* HW. Put all affected includes, typdefs, etc. here so the riva_hw.* files
|
||||
* can stay generic in nature.
|
||||
*/
|
||||
*/
|
||||
#include "compiler.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static CARD8 NVReadDacData(vgaHWPtr pVga)
|
||||
return (VGA_RD08(pNv->PDIO, VGA_DAC_DATA));
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
NVIsConnected (ScrnInfoPtr pScrn, int output)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
@@ -168,7 +168,7 @@ NVIsConnected (ScrnInfoPtr pScrn, int output)
|
||||
Bool present;
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Probing for analog device on output %s...\n",
|
||||
"Probing for analog device on output %s...\n",
|
||||
output ? "B" : "A");
|
||||
|
||||
if(output) {
|
||||
@@ -224,7 +224,7 @@ NVSelectHeadRegisters(ScrnInfoPtr pScrn, int head)
|
||||
}
|
||||
}
|
||||
|
||||
static xf86MonPtr
|
||||
static xf86MonPtr
|
||||
NVProbeDDC (ScrnInfoPtr pScrn, int bus)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
@@ -234,7 +234,7 @@ NVProbeDDC (ScrnInfoPtr pScrn, int bus)
|
||||
|
||||
pNv->DDCBase = bus ? 0x36 : 0x3e;
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Probing for EDID on I2C bus %s...\n", bus ? "B" : "A");
|
||||
|
||||
#ifdef EDID_COMPLETE_RAWDATA
|
||||
@@ -268,7 +268,7 @@ NVProbeDDC (ScrnInfoPtr pScrn, int bus)
|
||||
"DFP" : "CRT");
|
||||
xf86PrintEDID( MonInfo );
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
" ... none found\n");
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ static void nv10GetConfig (NVPtr pNv)
|
||||
pNv->RamAmountKBytes = 256*1024;
|
||||
|
||||
pNv->CrystalFreqKHz = (pNv->PEXTDEV[0x0000/4] & (1 << 6)) ? 14318 : 13500;
|
||||
|
||||
|
||||
if(pNv->twoHeads && (implementation != 0x0110))
|
||||
{
|
||||
if(pNv->PEXTDEV[0x0000/4] & (1 << 22))
|
||||
@@ -533,7 +533,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x28);
|
||||
if(VGA_RD08(pNv->PCIO, 0x03D5) & 0x80) {
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x33);
|
||||
if(!(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01))
|
||||
if(!(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01))
|
||||
Television = TRUE;
|
||||
FlatPanel = 1;
|
||||
} else {
|
||||
@@ -542,14 +542,14 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
|
||||
"HW is currently programmed for %s\n",
|
||||
FlatPanel ? (Television ? "TV" : "DFP") : "CRT");
|
||||
}
|
||||
}
|
||||
|
||||
if(pNv->FlatPanel == -1) {
|
||||
pNv->FlatPanel = FlatPanel;
|
||||
pNv->Television = Television;
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Forcing display type to %s as specified\n",
|
||||
"Forcing display type to %s as specified\n",
|
||||
pNv->FlatPanel ? "DFP" : "CRT");
|
||||
}
|
||||
} else {
|
||||
@@ -559,11 +559,11 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
Bool analog_on_A, analog_on_B;
|
||||
CARD32 oldhead;
|
||||
CARD8 cr44;
|
||||
|
||||
|
||||
if(implementation != 0x0110) {
|
||||
if(pNv->PRAMDAC0[0x0000052C/4] & 0x100)
|
||||
outputAfromCRTC = 1;
|
||||
else
|
||||
else
|
||||
outputAfromCRTC = 0;
|
||||
if(pNv->PRAMDAC0[0x0000252C/4] & 0x100)
|
||||
outputBfromCRTC = 1;
|
||||
@@ -598,7 +598,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
NVLockUnlock(pNv, 0);
|
||||
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x28);
|
||||
slaved_on_A = VGA_RD08(pNv->PCIO, 0x03D5) & 0x80;
|
||||
slaved_on_A = VGA_RD08(pNv->PCIO, 0x03D5) & 0x80;
|
||||
if(slaved_on_A) {
|
||||
VGA_WR08(pNv->PCIO, 0x03D4, 0x33);
|
||||
tvA = !(VGA_RD08(pNv->PCIO, 0x03D5) & 0x01);
|
||||
@@ -615,7 +615,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
FlatPanel = 1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
|
||||
"CRTC 0 is currently programmed for DFP\n");
|
||||
} else
|
||||
} else
|
||||
if(slaved_on_B && !tvB) {
|
||||
CRTCnumber = 1;
|
||||
FlatPanel = 1;
|
||||
@@ -650,7 +650,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
} else
|
||||
if(monitorA) {
|
||||
FlatPanel = monitorA->features.input_type ? 1 : 0;
|
||||
} else
|
||||
} else
|
||||
if(monitorB) {
|
||||
FlatPanel = monitorB->features.input_type ? 1 : 0;
|
||||
}
|
||||
@@ -674,7 +674,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
}
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Forcing display type to %s as specified\n",
|
||||
"Forcing display type to %s as specified\n",
|
||||
pNv->FlatPanel ? "DFP" : "CRT");
|
||||
}
|
||||
|
||||
@@ -692,12 +692,12 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Forcing CRTCNumber %i as specified\n", pNv->CRTCnumber);
|
||||
}
|
||||
|
||||
|
||||
if(monitorA) {
|
||||
if((monitorA->features.input_type && pNv->FlatPanel) ||
|
||||
(!monitorA->features.input_type && !pNv->FlatPanel))
|
||||
{
|
||||
if(monitorB) {
|
||||
if(monitorB) {
|
||||
free(monitorB);
|
||||
monitorB = NULL;
|
||||
}
|
||||
@@ -709,7 +709,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
|
||||
if(monitorB) {
|
||||
if((monitorB->features.input_type && !pNv->FlatPanel) ||
|
||||
(!monitorB->features.input_type && pNv->FlatPanel))
|
||||
(!monitorB->features.input_type && pNv->FlatPanel))
|
||||
{
|
||||
free(monitorB);
|
||||
} else {
|
||||
@@ -730,7 +730,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Using %s on CRTC %i\n",
|
||||
pNv->FlatPanel ? (pNv->Television ? "TV" : "DFP") : "CRT",
|
||||
pNv->FlatPanel ? (pNv->Television ? "TV" : "DFP") : "CRT",
|
||||
pNv->CRTCnumber);
|
||||
|
||||
if(pNv->FlatPanel && !pNv->Television) {
|
||||
@@ -757,7 +757,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
pNv->PRAMDAC0[0x08B0/4] = 0x00010004;
|
||||
if(pNv->PRAMDAC0[0x08B4/4] & 1)
|
||||
pNv->LVDS = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel is %s\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel is %s\n",
|
||||
pNv->LVDS ? "LVDS" : "TMDS");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 1999, The XFree86 Project Inc.
|
||||
Copyright (c) 1999, The XFree86 Project Inc.
|
||||
Written by Mark Vojkovich <markv@valinux.com>
|
||||
*/
|
||||
|
||||
@@ -31,14 +31,14 @@ NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
NVPtr pNv = NVPTR(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 = pNv->ShadowPtr + (pbox->y1 * pNv->ShadowPitch) +
|
||||
src = pNv->ShadowPtr + (pbox->y1 * pNv->ShadowPitch) +
|
||||
(pbox->x1 * Bpp);
|
||||
dst = pNv->FbStart + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
|
||||
|
||||
@@ -47,10 +47,10 @@ NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
dst += FBPitch;
|
||||
src += pNv->ShadowPitch;
|
||||
}
|
||||
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
NVPointerMoved(ScrnInfoPtr pScrn, int x, int y)
|
||||
@@ -92,11 +92,11 @@ NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 2; /* in dwords */
|
||||
|
||||
if(pNv->Rotate == 1) {
|
||||
dstPtr = pNv->FbStart +
|
||||
dstPtr = pNv->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = pNv->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = pNv->FbStart +
|
||||
dstPtr = pNv->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = pNv->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
@@ -106,8 +106,8 @@ NVRefreshArea8(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;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ NVRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -143,14 +143,14 @@ NVRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 1; /* in dwords */
|
||||
|
||||
if(pNv->Rotate == 1) {
|
||||
dstPtr = (CARD16*)pNv->FbStart +
|
||||
dstPtr = (CARD16*)pNv->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = (CARD16*)pNv->ShadowPtr +
|
||||
srcPtr = (CARD16*)pNv->ShadowPtr +
|
||||
((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD16*)pNv->FbStart +
|
||||
dstPtr = (CARD16*)pNv->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = (CARD16*)pNv->ShadowPtr +
|
||||
srcPtr = (CARD16*)pNv->ShadowPtr +
|
||||
(y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
@@ -191,14 +191,14 @@ NVRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = pbox->y2 - pbox->y1;
|
||||
|
||||
if(pNv->Rotate == 1) {
|
||||
dstPtr = (CARD32*)pNv->FbStart +
|
||||
dstPtr = (CARD32*)pNv->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
|
||||
srcPtr = (CARD32*)pNv->ShadowPtr +
|
||||
srcPtr = (CARD32*)pNv->ShadowPtr +
|
||||
((1 - pbox->y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD32*)pNv->FbStart +
|
||||
dstPtr = (CARD32*)pNv->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
|
||||
srcPtr = (CARD32*)pNv->ShadowPtr +
|
||||
srcPtr = (CARD32*)pNv->ShadowPtr +
|
||||
(pbox->y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
|
||||
184
src/nv_video.c
184
src/nv_video.c
@@ -93,13 +93,13 @@ static void NVInitOffscreenImages (ScreenPtr pScreen);
|
||||
|
||||
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
|
||||
|
||||
static Atom xvBrightness, xvContrast, xvColorKey, xvSaturation,
|
||||
static Atom xvBrightness, xvContrast, xvColorKey, xvSaturation,
|
||||
xvHue, xvAutopaintColorKey, xvSetDefaults, xvDoubleBuffer,
|
||||
xvITURBT709, xvSyncToVBlank;
|
||||
|
||||
/* client libraries expect an encoding */
|
||||
static XF86VideoEncodingRec DummyEncoding =
|
||||
{
|
||||
{
|
||||
0,
|
||||
"XV_IMAGE",
|
||||
2046, 2046,
|
||||
@@ -108,7 +108,7 @@ static XF86VideoEncodingRec DummyEncoding =
|
||||
|
||||
#define NUM_FORMATS_ALL 6
|
||||
|
||||
XF86VideoFormatRec NVFormats[NUM_FORMATS_ALL] =
|
||||
XF86VideoFormatRec NVFormats[NUM_FORMATS_ALL] =
|
||||
{
|
||||
{15, TrueColor}, {16, TrueColor}, {24, TrueColor},
|
||||
{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
|
||||
@@ -168,7 +168,7 @@ static XF86ImageRec NVImages[NUM_IMAGES_ALL] =
|
||||
XVIMAGE_RGB
|
||||
};
|
||||
|
||||
static void
|
||||
static void
|
||||
NVSetPortDefaults (ScrnInfoPtr pScrnInfo, NVPortPrivPtr pPriv)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
@@ -184,23 +184,23 @@ NVSetPortDefaults (ScrnInfoPtr pScrnInfo, NVPortPrivPtr pPriv)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
NVResetVideo (ScrnInfoPtr pScrnInfo)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
int satSine, satCosine;
|
||||
double angle;
|
||||
|
||||
|
||||
angle = (double)pPriv->hue * 3.1415927 / 180.0;
|
||||
|
||||
|
||||
satSine = pPriv->saturation * sin(angle);
|
||||
if (satSine < -1024)
|
||||
satSine = -1024;
|
||||
satCosine = pPriv->saturation * cos(angle);
|
||||
if (satCosine < -1024)
|
||||
satCosine = -1024;
|
||||
|
||||
|
||||
pNv->PMC[0x8910/4] = (pPriv->brightness << 16) | pPriv->contrast;
|
||||
pNv->PMC[0x8914/4] = (pPriv->brightness << 16) | pPriv->contrast;
|
||||
pNv->PMC[0x8918/4] = (satSine << 16) | (satCosine & 0xffff);
|
||||
@@ -210,7 +210,7 @@ NVResetVideo (ScrnInfoPtr pScrnInfo)
|
||||
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
NVStopOverlay (ScrnInfoPtr pScrnInfo)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
@@ -228,9 +228,9 @@ NVAllocateOverlayMemory(
|
||||
FBLinearPtr new_linear;
|
||||
|
||||
if(linear) {
|
||||
if(linear->size >= size)
|
||||
if(linear->size >= size)
|
||||
return linear;
|
||||
|
||||
|
||||
if(xf86ResizeOffscreenLinear(linear, size))
|
||||
return linear;
|
||||
|
||||
@@ -239,20 +239,20 @@ NVAllocateOverlayMemory(
|
||||
|
||||
pScreen = xf86ScrnToScreen(pScrn);
|
||||
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 32,
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 32,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if(!new_linear) {
|
||||
int max_size;
|
||||
|
||||
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 32,
|
||||
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 32,
|
||||
PRIORITY_EXTREME);
|
||||
|
||||
|
||||
if(max_size < size)
|
||||
return NULL;
|
||||
|
||||
xf86PurgeUnlockedOffscreenAreas(pScreen);
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 32,
|
||||
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 32,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -293,11 +293,11 @@ void NVInitVideo (ScreenPtr pScreen)
|
||||
int num_adaptors;
|
||||
|
||||
if((pScrn->bitsPerPixel != 8) && (pNv->Architecture >= NV_ARCH_10) &&
|
||||
((pNv->Architecture <= NV_ARCH_30) ||
|
||||
((pNv->Architecture <= NV_ARCH_30) ||
|
||||
((pNv->Chipset & 0xfff0) == 0x0040)))
|
||||
{
|
||||
overlayAdaptor = NVSetupOverlayVideo(pScreen);
|
||||
|
||||
|
||||
if(overlayAdaptor)
|
||||
NVInitOffscreenImages(pScreen);
|
||||
}
|
||||
@@ -306,7 +306,7 @@ void NVInitVideo (ScreenPtr pScreen)
|
||||
blitAdaptor = NVSetupBlitVideo(pScreen);
|
||||
|
||||
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);
|
||||
|
||||
|
||||
if(blitAdaptor || overlayAdaptor) {
|
||||
int size = num_adaptors;
|
||||
|
||||
@@ -334,7 +334,7 @@ void NVInitVideo (ScreenPtr pScreen)
|
||||
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
|
||||
|
||||
if (newAdaptors)
|
||||
free(newAdaptors);
|
||||
free(newAdaptors);
|
||||
}
|
||||
|
||||
|
||||
@@ -401,20 +401,20 @@ NVSetupBlitVideo (ScreenPtr pScreen)
|
||||
return adapt;
|
||||
}
|
||||
|
||||
static XF86VideoAdaptorPtr
|
||||
static XF86VideoAdaptorPtr
|
||||
NVSetupOverlayVideo (ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrnInfo = xf86ScreenToScrn(pScreen);
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
XF86VideoAdaptorPtr adapt;
|
||||
NVPortPrivPtr pPriv;
|
||||
|
||||
|
||||
if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
sizeof(NVPortPrivRec) +
|
||||
sizeof(NVPortPrivRec) +
|
||||
sizeof(DevUnion))))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
|
||||
adapt->flags = VIDEO_OVERLAID_IMAGES|VIDEO_CLIP_TO_VIEWPORT;
|
||||
@@ -441,19 +441,19 @@ NVSetupOverlayVideo (ScreenPtr pScreen)
|
||||
adapt->QueryBestSize = NVQueryBestSize;
|
||||
adapt->PutImage = NVPutImage;
|
||||
adapt->QueryImageAttributes = NVQueryImageAttributes;
|
||||
|
||||
|
||||
pPriv->videoStatus = 0;
|
||||
pPriv->currentBuffer = 0;
|
||||
pPriv->grabbedByV4L = FALSE;
|
||||
pPriv->blitter = FALSE;
|
||||
|
||||
NVSetPortDefaults (pScrnInfo, pPriv);
|
||||
|
||||
|
||||
/* gotta uninit this someplace */
|
||||
REGION_NULL(pScreen, &pPriv->clip);
|
||||
|
||||
|
||||
pNv->overlayAdaptor = adapt;
|
||||
|
||||
|
||||
xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
|
||||
xvDoubleBuffer = MAKE_ATOM("XV_DOUBLE_BUFFER");
|
||||
xvContrast = MAKE_ATOM("XV_CONTRAST");
|
||||
@@ -494,7 +494,7 @@ NVPutOverlayImage (
|
||||
int buffer = pPriv->currentBuffer;
|
||||
|
||||
/* paint the color key */
|
||||
if(pPriv->autopaintColorKey &&
|
||||
if(pPriv->autopaintColorKey &&
|
||||
(pPriv->grabbedByV4L ||
|
||||
!REGION_EQUAL(pScrnInfo->pScreen, &pPriv->clip, clipBoxes)))
|
||||
{
|
||||
@@ -608,7 +608,7 @@ NVPutBlitImage (
|
||||
NVDmaNext (pNv, 0);
|
||||
|
||||
NVDmaStart(pNv, STRETCH_BLIT_CLIP_POINT, 6);
|
||||
NVDmaNext (pNv, (pbox->y1 << 16) | pbox->x1);
|
||||
NVDmaNext (pNv, (pbox->y1 << 16) | pbox->x1);
|
||||
NVDmaNext (pNv, ((pbox->y2 - pbox->y1) << 16) | (pbox->x2 - pbox->x1));
|
||||
NVDmaNext (pNv, point);
|
||||
NVDmaNext (pNv, size);
|
||||
@@ -648,18 +648,18 @@ static void NVStopOverlayVideo
|
||||
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
|
||||
|
||||
if(pPriv->grabbedByV4L) return;
|
||||
|
||||
REGION_EMPTY(pScrnInfo->pScreen, &pPriv->clip);
|
||||
|
||||
REGION_EMPTY(pScrnInfo->pScreen, &pPriv->clip);
|
||||
|
||||
if(Exit) {
|
||||
if(pPriv->videoStatus & CLIENT_VIDEO_ON)
|
||||
if(pPriv->videoStatus & CLIENT_VIDEO_ON)
|
||||
NVStopOverlay(pScrnInfo);
|
||||
NVFreeOverlayMemory(pScrnInfo);
|
||||
pPriv->videoStatus = 0;
|
||||
} else {
|
||||
} else {
|
||||
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
|
||||
pPriv->videoStatus = OFF_TIMER | CLIENT_VIDEO_ON;
|
||||
pPriv->videoTime = currentTime.milliseconds + OFF_DELAY;
|
||||
pPriv->videoTime = currentTime.milliseconds + OFF_DELAY;
|
||||
pNv->VideoTimerCallback = NVVideoTimerCallback;
|
||||
}
|
||||
}
|
||||
@@ -676,14 +676,14 @@ static void NVStopBlitVideo
|
||||
|
||||
static int NVSetOverlayPortAttribute
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
Atom attribute,
|
||||
INT32 value,
|
||||
INT32 value,
|
||||
pointer data
|
||||
)
|
||||
{
|
||||
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
|
||||
|
||||
|
||||
if (attribute == xvBrightness)
|
||||
{
|
||||
if ((value < -512) || (value > 512))
|
||||
@@ -718,7 +718,7 @@ static int NVSetOverlayPortAttribute
|
||||
else if (attribute == xvColorKey)
|
||||
{
|
||||
pPriv->colorKey = value;
|
||||
REGION_EMPTY(pScrnInfo->pScreen, &pPriv->clip);
|
||||
REGION_EMPTY(pScrnInfo->pScreen, &pPriv->clip);
|
||||
}
|
||||
else if (attribute == xvAutopaintColorKey)
|
||||
{
|
||||
@@ -738,7 +738,7 @@ static int NVSetOverlayPortAttribute
|
||||
}
|
||||
else
|
||||
return BadMatch;
|
||||
|
||||
|
||||
NVResetVideo(pScrnInfo);
|
||||
return Success;
|
||||
}
|
||||
@@ -746,14 +746,14 @@ static int NVSetOverlayPortAttribute
|
||||
|
||||
static int NVGetOverlayPortAttribute
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
Atom attribute,
|
||||
INT32 *value,
|
||||
INT32 *value,
|
||||
pointer data
|
||||
)
|
||||
{
|
||||
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
|
||||
|
||||
|
||||
if (attribute == xvBrightness)
|
||||
*value = pPriv->brightness;
|
||||
else if (attribute == xvDoubleBuffer)
|
||||
@@ -772,7 +772,7 @@ static int NVGetOverlayPortAttribute
|
||||
*value = (pPriv->iturbt_709) ? 1 : 0;
|
||||
else
|
||||
return BadMatch;
|
||||
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -786,7 +786,7 @@ static int NVSetBlitPortAttribute
|
||||
{
|
||||
NVPortPrivPtr pPriv = (NVPortPrivPtr)data;
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
|
||||
|
||||
if ((attribute == xvSyncToVBlank) && pNv->WaitVSyncPossible) {
|
||||
if ((value < 0) || (value > 1))
|
||||
return BadValue;
|
||||
@@ -824,14 +824,14 @@ static int NVGetBlitPortAttribute
|
||||
*/
|
||||
static void NVQueryBestSize
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
Bool motion,
|
||||
short vid_w,
|
||||
short vid_h,
|
||||
short vid_h,
|
||||
short drw_w,
|
||||
short drw_h,
|
||||
short drw_h,
|
||||
unsigned int *p_w,
|
||||
unsigned int *p_h,
|
||||
unsigned int *p_h,
|
||||
pointer data
|
||||
)
|
||||
{
|
||||
@@ -841,7 +841,7 @@ static void NVQueryBestSize
|
||||
drw_h = vid_h >> 3;
|
||||
|
||||
*p_w = drw_w;
|
||||
*p_h = drw_h;
|
||||
*p_h = drw_h;
|
||||
}
|
||||
|
||||
static void NVCopyData420
|
||||
@@ -982,20 +982,20 @@ static void NVCopyDataRGB
|
||||
* PutImage
|
||||
*/
|
||||
static int NVPutImage
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
short src_x,
|
||||
short src_y,
|
||||
short src_y,
|
||||
short drw_x,
|
||||
short drw_y,
|
||||
short src_w,
|
||||
short src_h,
|
||||
short src_h,
|
||||
short drw_w,
|
||||
short drw_h,
|
||||
int id,
|
||||
unsigned char *buf,
|
||||
unsigned char *buf,
|
||||
short width,
|
||||
short height,
|
||||
short height,
|
||||
Bool Sync,
|
||||
RegionPtr clipBoxes,
|
||||
pointer data,
|
||||
@@ -1028,7 +1028,7 @@ static int NVPutImage
|
||||
|
||||
/* make the compiler happy */
|
||||
s2offset = s3offset = srcPitch2 = 0;
|
||||
|
||||
|
||||
if(!pPriv->blitter) {
|
||||
if(src_w > (drw_w << 3))
|
||||
drw_w = src_w >> 3;
|
||||
@@ -1041,16 +1041,16 @@ static int NVPutImage
|
||||
xb = src_x + src_w;
|
||||
ya = src_y;
|
||||
yb = src_y + src_h;
|
||||
|
||||
|
||||
dstBox.x1 = drw_x;
|
||||
dstBox.x2 = drw_x + drw_w;
|
||||
dstBox.y1 = drw_y;
|
||||
dstBox.y2 = drw_y + drw_h;
|
||||
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &xa, &xb, &ya, &yb, clipBoxes,
|
||||
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &xa, &xb, &ya, &yb, clipBoxes,
|
||||
width, height))
|
||||
return Success;
|
||||
|
||||
|
||||
if(!pPriv->blitter) {
|
||||
dstBox.x1 -= pScrnInfo->frameX0;
|
||||
dstBox.x2 -= pScrnInfo->frameX0;
|
||||
@@ -1087,8 +1087,8 @@ static int NVPutImage
|
||||
if(pPriv->doubleBuffer)
|
||||
newSize <<= 1;
|
||||
|
||||
pPriv->linear = NVAllocateOverlayMemory(pScrnInfo,
|
||||
pPriv->linear,
|
||||
pPriv->linear = NVAllocateOverlayMemory(pScrnInfo,
|
||||
pPriv->linear,
|
||||
newSize);
|
||||
|
||||
if(!pPriv->linear) return BadAlloc;
|
||||
@@ -1107,15 +1107,15 @@ static int NVPutImage
|
||||
if(!pPriv->currentBuffer)
|
||||
offset += (newSize * bpp) >> 1;
|
||||
skip = TRUE;
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
if(pPriv->currentBuffer)
|
||||
offset += (newSize * bpp) >> 1;
|
||||
}
|
||||
|
||||
dst_start = pNv->FbStart + offset;
|
||||
|
||||
/* We need to enlarge the copied rectangle by a pixel so the HW
|
||||
|
||||
/* We need to enlarge the copied rectangle by a pixel so the HW
|
||||
filtering doesn't pick up junk laying outside of the source */
|
||||
|
||||
left = (xa - 0x00010000) >> 16;
|
||||
@@ -1156,7 +1156,7 @@ static int NVPutImage
|
||||
left &= ~1;
|
||||
npixels = ((right + 1) & ~1) - left;
|
||||
nlines = bottom - top;
|
||||
|
||||
|
||||
left <<= 1;
|
||||
buf += (top * srcPitch) + left;
|
||||
dst_start += left + (top * dstPitch);
|
||||
@@ -1184,13 +1184,13 @@ static int NVPutImage
|
||||
width, height, src_w, src_h, drw_w, drw_h,
|
||||
clipBoxes);
|
||||
} else {
|
||||
NVPutOverlayImage(pScrnInfo, offset, id, dstPitch, &dstBox,
|
||||
NVPutOverlayImage(pScrnInfo, offset, id, dstPitch, &dstBox,
|
||||
xa, ya, xb, yb,
|
||||
width, height, src_w, src_h, drw_w, drw_h,
|
||||
width, height, src_w, src_h, drw_w, drw_h,
|
||||
clipBoxes);
|
||||
pPriv->currentBuffer ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
@@ -1199,25 +1199,25 @@ static int NVPutImage
|
||||
*/
|
||||
static int NVQueryImageAttributes
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
int id,
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
int id,
|
||||
unsigned short *w,
|
||||
unsigned short *h,
|
||||
unsigned short *h,
|
||||
int *pitches,
|
||||
int *offsets
|
||||
)
|
||||
{
|
||||
int size, tmp;
|
||||
|
||||
|
||||
if(*w > 2046)
|
||||
*w = 2046;
|
||||
if(*h > 2046)
|
||||
*h = 2046;
|
||||
|
||||
|
||||
*w = (*w + 1) & ~1;
|
||||
if (offsets)
|
||||
offsets[0] = 0;
|
||||
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case FOURCC_YV12:
|
||||
@@ -1258,7 +1258,7 @@ static int NVQueryImageAttributes
|
||||
return size;
|
||||
}
|
||||
|
||||
static void NVVideoTimerCallback
|
||||
static void NVVideoTimerCallback
|
||||
(
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
Time currentTime
|
||||
@@ -1269,7 +1269,7 @@ static void NVVideoTimerCallback
|
||||
NVPortPrivPtr pBlitPriv = NULL;
|
||||
Bool needCallback = FALSE;
|
||||
|
||||
if(!pScrnInfo->vtSema) return;
|
||||
if(!pScrnInfo->vtSema) return;
|
||||
|
||||
if(pNv->overlayAdaptor) {
|
||||
pOverPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
@@ -1282,7 +1282,7 @@ static void NVVideoTimerCallback
|
||||
if(!pBlitPriv->videoStatus)
|
||||
pBlitPriv = NULL;
|
||||
}
|
||||
|
||||
|
||||
if(pOverPriv) {
|
||||
if(pOverPriv->videoTime < currentTime) {
|
||||
if(pOverPriv->videoStatus & OFF_TIMER) {
|
||||
@@ -1294,7 +1294,7 @@ static void NVVideoTimerCallback
|
||||
if(pOverPriv->videoStatus & FREE_TIMER) {
|
||||
NVFreeOverlayMemory(pScrnInfo);
|
||||
pOverPriv->videoStatus = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
needCallback = TRUE;
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ static void NVVideoTimerCallback
|
||||
if(pBlitPriv) {
|
||||
if(pBlitPriv->videoTime < currentTime) {
|
||||
NVFreeBlitMemory(pScrnInfo);
|
||||
pBlitPriv->videoStatus = 0;
|
||||
pBlitPriv->videoStatus = 0;
|
||||
} else {
|
||||
needCallback = TRUE;
|
||||
}
|
||||
@@ -1320,13 +1320,13 @@ static int
|
||||
NVAllocSurface (
|
||||
ScrnInfoPtr pScrnInfo,
|
||||
int id,
|
||||
unsigned short w,
|
||||
unsigned short w,
|
||||
unsigned short h,
|
||||
XF86SurfacePtr surface
|
||||
)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
int size, bpp;
|
||||
|
||||
bpp = pScrnInfo->bitsPerPixel >> 3;
|
||||
@@ -1349,7 +1349,7 @@ NVAllocSurface (
|
||||
surface->width = w;
|
||||
surface->height = h;
|
||||
surface->pScrn = pScrnInfo;
|
||||
surface->pitches = &pPriv->pitch;
|
||||
surface->pitches = &pPriv->pitch;
|
||||
surface->offsets = &pPriv->offset;
|
||||
surface->devPrivate.ptr = (pointer)pPriv;
|
||||
surface->id = id;
|
||||
@@ -1376,7 +1376,7 @@ NVStopSurface (XF86SurfacePtr surface)
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
NVFreeSurface (XF86SurfacePtr surface)
|
||||
{
|
||||
NVPortPrivPtr pPriv = (NVPortPrivPtr)(surface->devPrivate.ptr);
|
||||
@@ -1399,7 +1399,7 @@ NVGetSurfaceAttribute (
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
|
||||
|
||||
return NVGetOverlayPortAttribute(pScrnInfo, attribute, value, (pointer)pPriv);
|
||||
}
|
||||
|
||||
@@ -1412,16 +1412,16 @@ NVSetSurfaceAttribute(
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrnInfo);
|
||||
NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv);
|
||||
|
||||
|
||||
return NVSetOverlayPortAttribute(pScrnInfo, attribute, value, (pointer)pPriv);
|
||||
}
|
||||
|
||||
static int
|
||||
NVDisplaySurface (
|
||||
XF86SurfacePtr surface,
|
||||
short src_x, short src_y,
|
||||
short src_x, short src_y,
|
||||
short drw_x, short drw_y,
|
||||
short src_w, short src_h,
|
||||
short src_w, short src_h,
|
||||
short drw_w, short drw_h,
|
||||
RegionPtr clipBoxes
|
||||
)
|
||||
@@ -1443,18 +1443,18 @@ NVDisplaySurface (
|
||||
xb = src_x + src_w;
|
||||
ya = src_y;
|
||||
yb = src_y + src_h;
|
||||
|
||||
|
||||
dstBox.x1 = drw_x;
|
||||
dstBox.x2 = drw_x + drw_w;
|
||||
dstBox.y1 = drw_y;
|
||||
dstBox.y2 = drw_y + drw_h;
|
||||
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &xa, &xb, &ya, &yb, clipBoxes,
|
||||
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &xa, &xb, &ya, &yb, clipBoxes,
|
||||
surface->width, surface->height))
|
||||
{
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
dstBox.x1 -= pScrnInfo->frameX0;
|
||||
dstBox.x2 -= pScrnInfo->frameX0;
|
||||
dstBox.y1 -= pScrnInfo->frameY0;
|
||||
|
||||
16
src/nv_xaa.c
16
src/nv_xaa.c
@@ -85,7 +85,7 @@ NVDmaKickoff(NVPtr pNv)
|
||||
to solve this problem */
|
||||
#define SKIPS 8
|
||||
|
||||
void
|
||||
void
|
||||
NVDmaWait (
|
||||
NVPtr pNv,
|
||||
int size
|
||||
@@ -111,7 +111,7 @@ NVDmaWait (
|
||||
pNv->dmaCurrent = pNv->dmaPut = SKIPS;
|
||||
pNv->dmaFree = dmaGet - (SKIPS + 1);
|
||||
}
|
||||
} else
|
||||
} else
|
||||
pNv->dmaFree = dmaGet - pNv->dmaCurrent - 1;
|
||||
}
|
||||
}
|
||||
@@ -129,13 +129,13 @@ NVWaitVSync(NVPtr pNv)
|
||||
NVDmaNext (pNv, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
currentRop = 0-15 solid fill
|
||||
16-31 8x8 pattern fill
|
||||
32-47 solid fill with planemask
|
||||
32-47 solid fill with planemask
|
||||
*/
|
||||
|
||||
static void
|
||||
static void
|
||||
NVSetPattern(
|
||||
ScrnInfoPtr pScrn,
|
||||
CARD32 clr0,
|
||||
@@ -153,7 +153,7 @@ NVSetPattern(
|
||||
NVDmaNext (pNv, pat1);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
NVSetRopSolid(ScrnInfoPtr pScrn, CARD32 rop, CARD32 planemask)
|
||||
{
|
||||
NVPtr pNv = NVPTR(pScrn);
|
||||
@@ -165,7 +165,7 @@ NVSetRopSolid(ScrnInfoPtr pScrn, CARD32 rop, CARD32 planemask)
|
||||
NVDmaNext (pNv, NVCopyROP_PM[rop]);
|
||||
pNv->currentRop = rop + 32;
|
||||
}
|
||||
} else
|
||||
} else
|
||||
if (pNv->currentRop != rop) {
|
||||
if(pNv->currentRop >= 16)
|
||||
NVSetPattern(pScrn, ~0, ~0, ~0, ~0);
|
||||
@@ -183,7 +183,7 @@ void NVResetGraphics(ScrnInfoPtr pScrn)
|
||||
|
||||
if(pNv->NoAccel) return;
|
||||
|
||||
pitch = pNv->CurrentLayout.displayWidth *
|
||||
pitch = pNv->CurrentLayout.displayWidth *
|
||||
(pNv->CurrentLayout.bitsPerPixel >> 3);
|
||||
|
||||
pNv->dmaBase = (CARD32*)(&pNv->FbStart[pNv->FbUsableSize]);
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
(((c & 0xf80000) >> 9 ) | ((c & 0xf800) >> 6 ) | ((c & 0xf8) >> 3 ) | 0x8000)
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
RivaConvertCursor1555(RivaPtr pRiva, CARD32 *src, CARD16 *dst)
|
||||
{
|
||||
CARD32 b, m;
|
||||
int i, j;
|
||||
|
||||
|
||||
for ( i = 0; i < 32; i++ ) {
|
||||
b = *src++;
|
||||
m = *src++;
|
||||
@@ -112,13 +112,13 @@ RivaSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
if ((pRiva->curFg != fore) || (pRiva->curBg != back)) {
|
||||
pRiva->curFg = fore;
|
||||
pRiva->curBg = back;
|
||||
|
||||
|
||||
RivaTransformCursor(pRiva);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
RivaShowCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
@@ -134,14 +134,14 @@ RivaHideCursor(ScrnInfoPtr pScrn)
|
||||
pRiva->riva.ShowHideCursor(&pRiva->riva, 0);
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
RivaUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Bool
|
||||
Bool
|
||||
RivaCursorInit(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
@@ -150,12 +150,12 @@ RivaCursorInit(ScreenPtr pScreen)
|
||||
|
||||
infoPtr = xf86CreateCursorInfoRec();
|
||||
if(!infoPtr) return FALSE;
|
||||
|
||||
|
||||
pRiva->CursorInfoRec = infoPtr;
|
||||
|
||||
infoPtr->MaxWidth = infoPtr->MaxHeight = 32;
|
||||
infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32;
|
||||
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32;
|
||||
infoPtr->SetCursorColors = RivaSetCursorColors;
|
||||
infoPtr->SetCursorPosition = RivaSetCursorPosition;
|
||||
infoPtr->LoadCursorImage = RivaLoadCursorImage;
|
||||
|
||||
@@ -45,7 +45,7 @@ RivaDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
int vertTotal = mode->CrtcVTotal - 2;
|
||||
int vertBlankStart = mode->CrtcVDisplay - 1;
|
||||
int vertBlankEnd = mode->CrtcVTotal - 1;
|
||||
|
||||
|
||||
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
RivaRegPtr rivaReg = &pRiva->ModeReg;
|
||||
@@ -64,13 +64,13 @@ RivaDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
* Set all CRTC values.
|
||||
*/
|
||||
|
||||
if(mode->Flags & V_INTERLACE)
|
||||
if(mode->Flags & V_INTERLACE)
|
||||
vertTotal |= 1;
|
||||
|
||||
pVga->CRTC[0x0] = RIVA_Set8Bits(horizTotal);
|
||||
pVga->CRTC[0x1] = RIVA_Set8Bits(horizDisplay);
|
||||
pVga->CRTC[0x2] = RIVA_Set8Bits(horizBlankStart);
|
||||
pVga->CRTC[0x3] = RIVA_SetBitField(horizBlankEnd,4:0,4:0)
|
||||
pVga->CRTC[0x3] = RIVA_SetBitField(horizBlankEnd,4:0,4:0)
|
||||
| RIVA_SetBit(7);
|
||||
pVga->CRTC[0x4] = RIVA_Set8Bits(horizStart);
|
||||
pVga->CRTC[0x5] = RIVA_SetBitField(horizBlankEnd,5:5,7:7)
|
||||
@@ -102,7 +102,7 @@ RivaDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
| RIVA_SetBitField(vertDisplay,10:10,1:1)
|
||||
| RIVA_SetBitField(vertTotal,10:10,0:0);
|
||||
|
||||
rivaReg->horiz = RIVA_SetBitField(horizTotal,8:8,0:0)
|
||||
rivaReg->horiz = RIVA_SetBitField(horizTotal,8:8,0:0)
|
||||
| RIVA_SetBitField(horizDisplay,8:8,1:1)
|
||||
| RIVA_SetBitField(horizBlankStart,8:8,2:2)
|
||||
| RIVA_SetBitField(horizStart,8:8,3:3);
|
||||
@@ -132,16 +132,16 @@ RivaDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
pVga->DAC[(i*3)+2] = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Calculate the extended registers.
|
||||
*/
|
||||
|
||||
if(pLayout->depth < 24)
|
||||
if(pLayout->depth < 24)
|
||||
i = pLayout->depth;
|
||||
else i = 32;
|
||||
|
||||
pRiva->riva.CalcStateExt(&pRiva->riva,
|
||||
pRiva->riva.CalcStateExt(&pRiva->riva,
|
||||
rivaReg,
|
||||
i,
|
||||
pLayout->displayWidth,
|
||||
@@ -157,7 +157,7 @@ RivaDACInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
RivaDACRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, RivaRegPtr rivaReg,
|
||||
Bool primary)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ RivaDACSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, RivaRegPtr rivaReg,
|
||||
|
||||
pRiva->riva.LockUnlock(&pRiva->riva, 0);
|
||||
|
||||
vgaHWSave(pScrn, vgaReg, VGA_SR_CMAP | VGA_SR_MODE |
|
||||
vgaHWSave(pScrn, vgaReg, VGA_SR_CMAP | VGA_SR_MODE |
|
||||
(saveFonts? VGA_SR_FONTS : 0));
|
||||
pRiva->riva.UnloadStateExt(&pRiva->riva, rivaReg);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "riva_proto.h"
|
||||
#include "dgaproc.h"
|
||||
|
||||
static Bool Riva_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
static Bool Riva_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
int *, int *, int *);
|
||||
static Bool Riva_SetMode(ScrnInfoPtr, DGAModePtr);
|
||||
static int Riva_GetViewport(ScrnInfoPtr);
|
||||
@@ -57,7 +57,7 @@ SECOND_PASS:
|
||||
(size <= pRiva->FbUsableSize)) {
|
||||
|
||||
if(secondPitch)
|
||||
pitch = secondPitch;
|
||||
pitch = secondPitch;
|
||||
|
||||
if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
break;
|
||||
@@ -90,7 +90,7 @@ SECOND_PASS:
|
||||
mode->address = pRiva->FbStart;
|
||||
mode->bytesPerScanline = pitch * Bpp;
|
||||
mode->imageWidth = pitch;
|
||||
mode->imageHeight = pRiva->FbUsableSize / mode->bytesPerScanline;
|
||||
mode->imageHeight = pRiva->FbUsableSize / mode->bytesPerScanline;
|
||||
mode->pixmapWidth = mode->imageWidth;
|
||||
mode->pixmapHeight = mode->imageHeight;
|
||||
mode->maxViewportX = mode->imageWidth - mode->viewportWidth;
|
||||
@@ -114,26 +114,26 @@ SECOND_PASS:
|
||||
|
||||
Bool
|
||||
RivaDGAInit(ScreenPtr pScreen)
|
||||
{
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
DGAModePtr modes = NULL;
|
||||
int num = 0;
|
||||
|
||||
/* 8 */
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
(pScrn->bitsPerPixel == 8),
|
||||
(pScrn->bitsPerPixel != 8) ? 0 : pScrn->displayWidth,
|
||||
0, 0, 0, PseudoColor);
|
||||
|
||||
/* 15 */
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
(pScrn->bitsPerPixel == 16),
|
||||
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
|
||||
0x7c00, 0x03e0, 0x001f, TrueColor);
|
||||
|
||||
/* 32 */
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
modes = RivaSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
(pScrn->bitsPerPixel == 32),
|
||||
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
|
||||
0xff0000, 0x00ff00, 0x0000ff, TrueColor);
|
||||
@@ -141,18 +141,18 @@ RivaDGAInit(ScreenPtr pScreen)
|
||||
pRiva->numDGAModes = num;
|
||||
pRiva->DGAModes = modes;
|
||||
|
||||
return DGAInit(pScreen, &Riva_DGAFuncs, modes, num);
|
||||
return DGAInit(pScreen, &Riva_DGAFuncs, modes, num);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
BitsSet(unsigned long data)
|
||||
{
|
||||
unsigned long mask;
|
||||
int set = 0;
|
||||
|
||||
for(mask = 1; mask; mask <<= 1)
|
||||
if(mask & data) set++;
|
||||
if(mask & data) set++;
|
||||
|
||||
return set;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ Riva_SetMode(
|
||||
if(!pMode) { /* restore the original mode */
|
||||
if(pRiva->DGAactive)
|
||||
memcpy(&pRiva->CurrentLayout, &SavedLayouts[index], sizeof(RivaFBLayout));
|
||||
|
||||
|
||||
pScrn->currentMode = pRiva->CurrentLayout.mode;
|
||||
RivaSwitchMode(pScrn, pScrn->currentMode);
|
||||
RivaAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
|
||||
@@ -184,7 +184,7 @@ Riva_SetMode(
|
||||
/* update CurrentLayout */
|
||||
pRiva->CurrentLayout.bitsPerPixel = pMode->bitsPerPixel;
|
||||
pRiva->CurrentLayout.depth = pMode->depth;
|
||||
pRiva->CurrentLayout.displayWidth = pMode->bytesPerScanline /
|
||||
pRiva->CurrentLayout.displayWidth = pMode->bytesPerScanline /
|
||||
(pMode->bitsPerPixel >> 3);
|
||||
pRiva->CurrentLayout.weight.red = BitsSet(pMode->red_mask);
|
||||
pRiva->CurrentLayout.weight.green = BitsSet(pMode->green_mask);
|
||||
@@ -192,13 +192,13 @@ Riva_SetMode(
|
||||
/* RivaModeInit() will set the mode field */
|
||||
RivaSwitchMode(pScrn, pMode->mode);
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
Riva_GetViewport(
|
||||
ScrnInfoPtr pScrn
|
||||
){
|
||||
@@ -207,10 +207,10 @@ Riva_GetViewport(
|
||||
return pRiva->DGAViewportStatus;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
Riva_SetViewport(
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
int flags
|
||||
){
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
@@ -220,12 +220,12 @@ Riva_SetViewport(
|
||||
while(VGA_RD08(pRiva->riva.PCIO, 0x3da) & 0x08);
|
||||
while(!(VGA_RD08(pRiva->riva.PCIO, 0x3da) & 0x08));
|
||||
|
||||
pRiva->DGAViewportStatus = 0;
|
||||
pRiva->DGAViewportStatus = 0;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
Riva_OpenFramebuffer(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
char **name,
|
||||
unsigned char **mem,
|
||||
int *size,
|
||||
|
||||
@@ -87,13 +87,13 @@ static const OptionInfoRec RivaOptions[] = {
|
||||
*/
|
||||
static int pix24bpp = 0;
|
||||
|
||||
/*
|
||||
/*
|
||||
* ramdac info structure initialization
|
||||
*/
|
||||
static RivaRamdacRec DacInit = {
|
||||
FALSE, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
0, NULL, NULL, NULL, NULL
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -171,15 +171,15 @@ RivaSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
* displayed location in the video memory.
|
||||
*/
|
||||
/* Usually mandatory */
|
||||
void
|
||||
void
|
||||
RivaAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
|
||||
{
|
||||
int startAddr;
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
RivaFBLayout *pLayout = &pRiva->CurrentLayout;
|
||||
|
||||
if(pRiva->ShowCache && y && pScrn->vtSema)
|
||||
y += pScrn->virtualY - 1;
|
||||
if(pRiva->ShowCache && y && pScrn->vtSema)
|
||||
y += pScrn->virtualY - 1;
|
||||
|
||||
startAddr = (((y*pLayout->displayWidth)+x)*(pLayout->bitsPerPixel/8));
|
||||
pRiva->riva.SetStartAddress(&pRiva->riva, startAddr);
|
||||
@@ -312,7 +312,7 @@ Bool RivaI2CInit(ScrnInfoPtr pScrn)
|
||||
mod = "ddc";
|
||||
if(xf86LoadSubModule(pScrn, mod)) {
|
||||
return RivaDACi2cInit(pScrn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
@@ -349,7 +349,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
* not at the start of each server generation. This means that
|
||||
* only things that are persistent across server generations can
|
||||
* be initialised here. xf86Screens[] is (pScrn is a pointer to one
|
||||
* of these). Privates allocated using xf86AllocateScrnInfoPrivateIndex()
|
||||
* of these). Privates allocated using xf86AllocateScrnInfoPrivateIndex()
|
||||
* are too, and should be used for data that must persist across
|
||||
* server generations.
|
||||
*
|
||||
@@ -371,7 +371,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pRiva->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
||||
if (pRiva->pEnt->location.type != BUS_PCI)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Find the PCI info for this screen */
|
||||
pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index);
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
@@ -383,12 +383,12 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Initialize the card through int10 interface if needed */
|
||||
if (xf86LoadSubModule(pScrn, "int10")) {
|
||||
#if !defined(__alpha__)
|
||||
#if !defined(__alpha__)
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n");
|
||||
pRiva->pInt = xf86InitInt10(pRiva->pEnt->index);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
xf86SetOperatingState(resVgaIo, pRiva->pEnt->index, ResUnusedOpr);
|
||||
xf86SetOperatingState(resVgaMem, pRiva->pEnt->index, ResDisableOpr);
|
||||
@@ -469,7 +469,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86FreeInt10(pRiva->pInt);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a vgaHWRec
|
||||
*/
|
||||
@@ -478,7 +478,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
return FALSE;
|
||||
}
|
||||
vgaHWSetStdFuncs(VGAHWPTR(pScrn));
|
||||
|
||||
|
||||
/* We use a programmable clock */
|
||||
pScrn->progClock = TRUE;
|
||||
|
||||
@@ -522,12 +522,12 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (xf86ReturnOptValBool(pRiva->Options, OPTION_SHADOW_FB, FALSE)) {
|
||||
pRiva->ShadowFB = TRUE;
|
||||
pRiva->NoAccel = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
|
||||
}
|
||||
if (xf86ReturnOptValBool(pRiva->Options, OPTION_FBDEV, FALSE)) {
|
||||
pRiva->FBDev = TRUE;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Using framebuffer device\n");
|
||||
}
|
||||
if (pRiva->FBDev) {
|
||||
@@ -536,7 +536,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86FreeInt10(pRiva->pInt);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (!fbdevHWInit(pScrn, pRiva->PciInfo, NULL)) {
|
||||
xf86FreeInt10(pRiva->pInt);
|
||||
return FALSE;
|
||||
@@ -554,7 +554,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pRiva->NoAccel = TRUE;
|
||||
pRiva->HWCursor = FALSE;
|
||||
pRiva->Rotate = 1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Rotating screen clockwise - acceleration disabled\n");
|
||||
} else
|
||||
if(!xf86NameCmp(s, "CCW")) {
|
||||
@@ -562,12 +562,12 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pRiva->NoAccel = TRUE;
|
||||
pRiva->HWCursor = FALSE;
|
||||
pRiva->Rotate = -1;
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
"Rotating screen counter clockwise - acceleration disabled\n");
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n",
|
||||
(unsigned long)pRiva->IOAddress);
|
||||
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86RegisterResources(pRiva->pEnt->index, NULL, ResExclusive)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -657,7 +657,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kBytes\n",
|
||||
pScrn->videoRam);
|
||||
|
||||
|
||||
pRiva->FbMapSize = pScrn->videoRam * 1024;
|
||||
|
||||
/*
|
||||
@@ -815,7 +815,7 @@ RivaMapMem(ScrnInfoPtr pScrn)
|
||||
|
||||
/*
|
||||
* Map IO registers to virtual address space
|
||||
*/
|
||||
*/
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
void *tmp;
|
||||
|
||||
@@ -875,12 +875,12 @@ static Bool
|
||||
RivaUnmapMem(ScrnInfoPtr pScrn)
|
||||
{
|
||||
RivaPtr pRiva;
|
||||
|
||||
|
||||
pRiva = RivaPTR(pScrn);
|
||||
|
||||
/*
|
||||
* Unmap IO registers to virtual address space
|
||||
*/
|
||||
*/
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
pci_device_unmap_range(pRiva->PciInfo, pRiva->IOBase, 0x1000000);
|
||||
pci_device_unmap_range(pRiva->PciInfo, pRiva->FbBase, pRiva->FbMapSize);
|
||||
@@ -898,7 +898,7 @@ RivaUnmapMem(ScrnInfoPtr pScrn)
|
||||
|
||||
|
||||
/*
|
||||
* Initialise a new mode.
|
||||
* Initialise a new mode.
|
||||
*/
|
||||
|
||||
static Bool
|
||||
@@ -909,7 +909,7 @@ RivaModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
RivaRegPtr rivaReg;
|
||||
|
||||
|
||||
|
||||
/* Initialise the ModeReg values */
|
||||
if (!vgaHWInit(pScrn, mode))
|
||||
return FALSE;
|
||||
@@ -940,7 +940,7 @@ RivaModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
/*
|
||||
* Restore the initial (text) mode.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
RivaRestore(ScrnInfoPtr pScrn)
|
||||
{
|
||||
vgaHWPtr hwp = VGAHWPTR(pScrn);
|
||||
@@ -1006,7 +1006,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
int width, height, displayWidth;
|
||||
BoxRec AvailFBArea;
|
||||
|
||||
/*
|
||||
/*
|
||||
* First get the ScrnInfoRec
|
||||
*/
|
||||
pScrn = xf86ScreenToScrn(pScreen);
|
||||
@@ -1024,7 +1024,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!RivaMapMem(pScrn))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Map the VGA memory when the primary video */
|
||||
if (pRiva->Primary && !pRiva->FBDev) {
|
||||
hwp->MapSize = 0x10000;
|
||||
@@ -1074,7 +1074,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
pScrn->defaultVisual))
|
||||
return FALSE;
|
||||
} else {
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
if (!miSetVisualTypes(pScrn->depth,
|
||||
miGetDefaultVisualMask(pScrn->depth), 8,
|
||||
pScrn->defaultVisual))
|
||||
return FALSE;
|
||||
@@ -1142,7 +1142,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
}
|
||||
|
||||
fbPictureInit (pScreen, 0, 0);
|
||||
|
||||
|
||||
xf86SetBlackWhitePixels(pScreen);
|
||||
|
||||
|
||||
@@ -1152,7 +1152,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
AvailFBArea.x1 = 0;
|
||||
AvailFBArea.y1 = 0;
|
||||
AvailFBArea.x2 = pScrn->displayWidth;
|
||||
AvailFBArea.y2 = (min(pRiva->FbUsableSize, 32*1024*1024)) /
|
||||
AvailFBArea.y2 = (min(pRiva->FbUsableSize, 32*1024*1024)) /
|
||||
(pScrn->displayWidth * pScrn->bitsPerPixel / 8);
|
||||
xf86InitFBManager(pScreen, &AvailFBArea);
|
||||
|
||||
@@ -1160,16 +1160,16 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
xf86SetSilkenMouse(pScreen);
|
||||
|
||||
|
||||
/* Initialize software cursor.
|
||||
/* Initialize software cursor.
|
||||
Must precede creation of the default colormap */
|
||||
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
|
||||
|
||||
|
||||
/* Initialize HW cursor layer.
|
||||
/* Initialize HW cursor layer.
|
||||
Must follow software cursor initialization*/
|
||||
if (pRiva->HWCursor) {
|
||||
if (pRiva->HWCursor) {
|
||||
if(!RivaCursorInit(pScreen))
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Hardware cursor initialization failed\n");
|
||||
}
|
||||
|
||||
@@ -1177,15 +1177,15 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
if (!miCreateDefColormap(pScreen))
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Initialize colormap layer.
|
||||
|
||||
/* Initialize colormap layer.
|
||||
Must follow initialization of the default colormap */
|
||||
if(!xf86HandleColormaps(pScreen, 256, 8,
|
||||
(pRiva->FBDev ? fbdevHWLoadPaletteWeak() : Rivadac->LoadPalette),
|
||||
(pRiva->FBDev ? fbdevHWLoadPaletteWeak() : Rivadac->LoadPalette),
|
||||
NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR))
|
||||
return FALSE;
|
||||
|
||||
|
||||
|
||||
if(pRiva->ShadowFB) {
|
||||
RefreshAreaFuncPtr refreshArea = RivaRefreshArea;
|
||||
|
||||
@@ -1213,7 +1213,7 @@ RivaScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
|
||||
xf86DPMSInit(pScreen, RivaDPMSSet, 0);
|
||||
|
||||
|
||||
|
||||
pScrn->memPhysBase = pRiva->FbAddress;
|
||||
pScrn->fbOffset = 0;
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ static int nv3_iterate(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_i
|
||||
ainfo->first_vacc = 0;
|
||||
if (last!=cur)
|
||||
{
|
||||
ns = 1000000 * (vmisses*state->mem_page_miss + state->mem_latency)/state->mclk_khz;
|
||||
ns = 1000000 * (vmisses*state->mem_page_miss + state->mem_latency)/state->mclk_khz;
|
||||
vlwm = ns * ainfo->vdrain_rate/ 1000000;
|
||||
vlwm = ainfo->vocc - vlwm;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ static int nv3_iterate(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_i
|
||||
}
|
||||
}
|
||||
}
|
||||
static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_info *ainfo)
|
||||
static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_info *ainfo)
|
||||
{
|
||||
long ens, vns, mns, gns;
|
||||
int mmisses, gmisses, vmisses, eburst_size, mburst_size;
|
||||
@@ -442,7 +442,7 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state, nv3_arb_in
|
||||
static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_info *ainfo)
|
||||
{
|
||||
int done, g,v, p;
|
||||
|
||||
|
||||
done = 0;
|
||||
for (p=0; p < 2; p++)
|
||||
{
|
||||
@@ -451,7 +451,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
|
||||
for (v=128; v >=32; v = v>> 1)
|
||||
{
|
||||
ainfo->priority = p;
|
||||
ainfo->gburst_size = g;
|
||||
ainfo->gburst_size = g;
|
||||
ainfo->vburst_size = v;
|
||||
done = nv3_arb(res_info, state,ainfo);
|
||||
if (done && (g==128))
|
||||
@@ -466,7 +466,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
|
||||
Done:
|
||||
return done;
|
||||
}
|
||||
static void nv3CalcArbitration
|
||||
static void nv3CalcArbitration
|
||||
(
|
||||
nv3_fifo_info * res_info,
|
||||
nv3_sim_state * state
|
||||
@@ -516,8 +516,8 @@ static void nv3CalcArbitration
|
||||
}
|
||||
static void nv3UpdateArbitrationSettings
|
||||
(
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned VClk,
|
||||
unsigned pixelDepth,
|
||||
unsigned *burst,
|
||||
unsigned *lwm,
|
||||
RIVA_HW_INST *chip
|
||||
@@ -526,7 +526,7 @@ static void nv3UpdateArbitrationSettings
|
||||
nv3_fifo_info fifo_data;
|
||||
nv3_sim_state sim_data;
|
||||
unsigned int M, N, P, pll, MClk;
|
||||
|
||||
|
||||
pll = chip->PRAMDAC[0x00000504/4];
|
||||
M = (pll >> 0) & 0xFF; N = (pll >> 8) & 0xFF; P = (pll >> 16) & 0x0F;
|
||||
MClk = (N * chip->CrystalFreqKHz / M) >> P;
|
||||
@@ -581,16 +581,16 @@ static int CalcVClock
|
||||
unsigned DeltaNew, DeltaOld;
|
||||
unsigned VClk, Freq;
|
||||
unsigned M, N, P;
|
||||
|
||||
|
||||
DeltaOld = 0xFFFFFFFF;
|
||||
|
||||
VClk = (unsigned)clockIn;
|
||||
|
||||
|
||||
if (chip->CrystalFreqKHz == 13500)
|
||||
{
|
||||
lowM = 7;
|
||||
highM = 12;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lowM = 8;
|
||||
@@ -627,7 +627,7 @@ static int CalcVClock
|
||||
return (DeltaOld != 0xFFFFFFFF);
|
||||
}
|
||||
/*
|
||||
* Calculate extended mode parameters (SVGA) and save in a
|
||||
* Calculate extended mode parameters (SVGA) and save in a
|
||||
* mode state structure.
|
||||
*/
|
||||
static void CalcStateExt
|
||||
@@ -639,7 +639,7 @@ static void CalcStateExt
|
||||
int hDisplaySize,
|
||||
int height,
|
||||
int dotClock,
|
||||
int flags
|
||||
int flags
|
||||
)
|
||||
{
|
||||
int pixelDepth, VClk = 0, m = 0, n = 0, p = 0;
|
||||
@@ -655,8 +655,8 @@ static void CalcStateExt
|
||||
pixelDepth = (bpp + 1)/8;
|
||||
CalcVClock(dotClock, &VClk, &m, &n, &p, chip);
|
||||
|
||||
nv3UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
nv3UpdateArbitrationSettings(VClk,
|
||||
pixelDepth * 8,
|
||||
&(state->arbitration0),
|
||||
&(state->arbitration1),
|
||||
chip);
|
||||
@@ -792,7 +792,7 @@ static void LoadStateExt
|
||||
chip->PCRTC[0x00000100/4] = chip->VBlankBit;
|
||||
/*
|
||||
* Set interrupt enable.
|
||||
*/
|
||||
*/
|
||||
chip->PMC[0x00000140/4] = chip->EnableIRQ & 0x01;
|
||||
/*
|
||||
* Set current state pointer.
|
||||
@@ -803,7 +803,7 @@ static void LoadStateExt
|
||||
*/
|
||||
chip->FifoFreeCount = 0;
|
||||
/* Free count from first subchannel */
|
||||
chip->FifoEmptyCount = chip->Rop->FifoFree;
|
||||
chip->FifoEmptyCount = chip->Rop->FifoFree;
|
||||
}
|
||||
|
||||
static void UnloadStateExt
|
||||
@@ -895,7 +895,7 @@ static void nv3GetConfig
|
||||
{
|
||||
if (((chip->PMC[0x00000000/4] & 0xF0) == 0x20)
|
||||
&& ((chip->PMC[0x00000000/4] & 0x0F) >= 0x02))
|
||||
{
|
||||
{
|
||||
/*
|
||||
* SDRAM 128 ZX.
|
||||
*/
|
||||
@@ -912,12 +912,12 @@ static void nv3GetConfig
|
||||
chip->RamAmountKBytes = 1024 * 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
chip->RamBandwidthKBytesPerSec = 1000000;
|
||||
chip->RamAmountKBytes = 1024 * 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -937,7 +937,7 @@ static void nv3GetConfig
|
||||
chip->RamAmountKBytes = 1024 * 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
chip->CrystalFreqKHz = (chip->PEXTDEV[0x00000000/4] & 0x00000040) ? 14318 : 13500;
|
||||
chip->CURSOR = &(chip->PRAMIN[0x00008000/4 - 0x0800/4]);
|
||||
chip->VBlankBit = 0x00000100;
|
||||
|
||||
@@ -227,7 +227,7 @@ typedef volatile struct
|
||||
U032 RenderBufferOffset;
|
||||
U032 ZBufferOffset;
|
||||
} RivaSurface3D;
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* Virtualized RIVA H/W interface. *
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* This file includes any environment or machine specific values to access the
|
||||
* HW. Put all affected includes, typdefs, etc. here so the riva_hw.* files
|
||||
* can stay generic in nature.
|
||||
*/
|
||||
*/
|
||||
#include "compiler.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ static CARD8 RivaReadDacData(vgaHWPtr pVga)
|
||||
|
||||
|
||||
|
||||
static xf86MonPtr
|
||||
static xf86MonPtr
|
||||
RivaProbeDDC (ScrnInfoPtr pScrn)
|
||||
{
|
||||
RivaPtr pRiva = RivaPTR(pScrn);
|
||||
@@ -177,7 +177,7 @@ RivaProbeDDC (ScrnInfoPtr pScrn)
|
||||
" ... found one\n");
|
||||
xf86PrintEDID( MonInfo );
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
" ... none found\n");
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ Riva3Setup(ScrnInfoPtr pScrn)
|
||||
CARD32 regBase = pRiva->IOAddress;
|
||||
CARD32 frameBase = pRiva->FbAddress;
|
||||
xf86MonPtr monitor;
|
||||
|
||||
|
||||
pRiva->Save = RivaDACSave;
|
||||
pRiva->Restore = RivaDACRestore;
|
||||
pRiva->ModeInit = RivaDACInit;
|
||||
@@ -226,7 +226,7 @@ Riva3Setup(ScrnInfoPtr pScrn)
|
||||
*/
|
||||
pVga->MMIOBase = (CARD8 *)pRiva;
|
||||
pVga->MMIOOffset = 0;
|
||||
|
||||
|
||||
/*
|
||||
* No IRQ in use.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 1999, The XFree86 Project Inc.
|
||||
Copyright (c) 1999, The XFree86 Project Inc.
|
||||
Written by Mark Vojkovich <markv@valinux.com>
|
||||
*/
|
||||
|
||||
@@ -20,14 +20,14 @@ RivaRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
RivaPtr pRiva = RivaPTR(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 = pRiva->ShadowPtr + (pbox->y1 * pRiva->ShadowPitch) +
|
||||
src = pRiva->ShadowPtr + (pbox->y1 * pRiva->ShadowPitch) +
|
||||
(pbox->x1 * Bpp);
|
||||
dst = pRiva->FbStart + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
|
||||
|
||||
@@ -36,10 +36,10 @@ RivaRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
dst += FBPitch;
|
||||
src += pRiva->ShadowPitch;
|
||||
}
|
||||
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RivaPointerMoved(ScrnInfoPtr pScrn, int x, int y)
|
||||
@@ -76,11 +76,11 @@ RivaRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 2; /* in dwords */
|
||||
|
||||
if(pRiva->Rotate == 1) {
|
||||
dstPtr = pRiva->FbStart +
|
||||
dstPtr = pRiva->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = pRiva->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = pRiva->FbStart +
|
||||
dstPtr = pRiva->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = pRiva->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
@@ -90,8 +90,8 @@ RivaRefreshArea8(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;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ RivaRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
|
||||
pbox++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -122,14 +122,14 @@ RivaRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = (y2 - y1) >> 1; /* in dwords */
|
||||
|
||||
if(pRiva->Rotate == 1) {
|
||||
dstPtr = (CARD16*)pRiva->FbStart +
|
||||
dstPtr = (CARD16*)pRiva->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
|
||||
srcPtr = (CARD16*)pRiva->ShadowPtr +
|
||||
srcPtr = (CARD16*)pRiva->ShadowPtr +
|
||||
((1 - y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD16*)pRiva->FbStart +
|
||||
dstPtr = (CARD16*)pRiva->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
|
||||
srcPtr = (CARD16*)pRiva->ShadowPtr +
|
||||
srcPtr = (CARD16*)pRiva->ShadowPtr +
|
||||
(y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
@@ -165,14 +165,14 @@ RivaRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
|
||||
height = pbox->y2 - pbox->y1;
|
||||
|
||||
if(pRiva->Rotate == 1) {
|
||||
dstPtr = (CARD32*)pRiva->FbStart +
|
||||
dstPtr = (CARD32*)pRiva->FbStart +
|
||||
(pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
|
||||
srcPtr = (CARD32*)pRiva->ShadowPtr +
|
||||
srcPtr = (CARD32*)pRiva->ShadowPtr +
|
||||
((1 - pbox->y2) * srcPitch) + pbox->x1;
|
||||
} else {
|
||||
dstPtr = (CARD32*)pRiva->FbStart +
|
||||
dstPtr = (CARD32*)pRiva->FbStart +
|
||||
((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
|
||||
srcPtr = (CARD32*)pRiva->ShadowPtr +
|
||||
srcPtr = (CARD32*)pRiva->ShadowPtr +
|
||||
(pbox->y1 * srcPitch) + pbox->x2 - 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ RivaSetPattern(RivaPtr pRiva, int clr0, int clr1, int pat0, int pat1)
|
||||
*/
|
||||
static void
|
||||
RivaSetRopSolid(RivaPtr pRiva, int rop)
|
||||
{
|
||||
{
|
||||
if (pRiva->currentRop != rop) {
|
||||
if (pRiva->currentRop >= 16)
|
||||
RivaSetPattern(pRiva, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
@@ -87,7 +87,7 @@ RivaResetGraphics(ScrnInfoPtr pScrn)
|
||||
if(pRiva->NoAccel) return;
|
||||
|
||||
RIVA_FIFO_FREE(pRiva->riva, Patt, 1);
|
||||
pRiva->riva.Patt->Shape = 0;
|
||||
pRiva->riva.Patt->Shape = 0;
|
||||
RivaDisableClipping(pScrn);
|
||||
pRiva->currentRop = 16; /* to force RivaSetRopSolid to reset the pattern */
|
||||
RivaSetRopSolid(pRiva, GXcopy);
|
||||
|
||||
Reference in New Issue
Block a user