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-chips/-/merge_requests/14>
This commit is contained in:
Alan Coopersmith
2025-08-12 17:24:09 -07:00
committed by Enrico Weigelt, metux IT consult
parent aa2ae84941
commit aebbb3fbf5
20 changed files with 620 additions and 620 deletions

4
.gitignore vendored
View File

@@ -71,8 +71,8 @@ core
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for xf86-video-chips
# Add & Override patterns for xf86-video-chips
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
#

View File

@@ -19,7 +19,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
#
drivermandir = $(DRIVER_MAN_DIR)

View File

@@ -163,4 +163,4 @@
} \
} \
}

View File

@@ -46,14 +46,14 @@
#define ctQWORDALIGN 0x5000000L
/* This shouldn't be used because not all chip rev's
* have BR09 and BR0A, and I haven't even defined
* macros to write to these registers
* macros to write to these registers
*/
#define ctEXPCOLSEL 0x8000000L
/* Macros to do useful things with the C&T BitBLT engine */
/* For some odd reason the blitter busy bit occasionly "locks up" when
* it gets polled to fast. However I have observed this behavior only
/* For some odd reason the blitter busy bit occasionly "locks up" when
* it gets polled to fast. However I have observed this behavior only
* when doing ScreenToScreenColorExpandFill on a 65550. This operation
* was broken anyway (the source offset register is not observed) therefore
* no action was taken.

View File

@@ -67,7 +67,7 @@
#define CTNAME(subname) CATNAME(CHIPS,subname)
#endif
Bool
Bool
CTNAME(AccelInit)(ScreenPtr pScreen)
{
return FALSE;

View File

@@ -2,30 +2,30 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
* This software is furnished under license and may be used and copied only in
* accordance with the following terms and conditions. Subject to these
* conditions, you may download, copy, install, use, modify and distribute
* this software in source and/or binary form. No title or ownership is
* This software is furnished under license and may be used and copied only in
* accordance with the following terms and conditions. Subject to these
* conditions, you may download, copy, install, use, modify and distribute
* this software in source and/or binary form. No title or ownership is
* transferred hereby.
* 1) Any source code used, modified or distributed must reproduce and retain
* this copyright notice and list of conditions as they appear in the
* 1) Any source code used, modified or distributed must reproduce and retain
* this copyright notice and list of conditions as they appear in the
* source file.
*
* 2) No right is granted to use any trade name, trademark, or logo of Digital
* Equipment Corporation. Neither the "Digital Equipment Corporation" name
* nor any trademark or logo of Digital Equipment Corporation may be used
* to endorse or promote products derived from this software without the
* 2) No right is granted to use any trade name, trademark, or logo of Digital
* Equipment Corporation. Neither the "Digital Equipment Corporation" name
* nor any trademark or logo of Digital Equipment Corporation may be used
* to endorse or promote products derived from this software without the
* prior written permission of Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied warranties,
* including but not limited to, any implied warranties of merchantability,
* fitness for a particular purpose, or non-infringement are disclaimed. In
* no event shall DIGITAL be liable for any damages whatsoever, and in
* particular, DIGITAL shall not be liable for special, indirect,
* consequential, or incidental damages or damages for lost profits, loss
* of revenue or loss of use, whether such damages arise in contract,
* no event shall DIGITAL be liable for any damages whatsoever, and in
* particular, DIGITAL shall not be liable for special, indirect,
* consequential, or incidental damages or damages for lost profits, loss
* of revenue or loss of use, whether such damages arise in contract,
* negligence, tort, under statute, in equity, at law or otherwise, even if
* advised of the possibility of such damage.
* advised of the possibility of such damage.
*/
#ifdef HAVE_CONFIG_H
@@ -65,7 +65,7 @@
#ifdef DIRECT_REGISTER_ACCESS
int
CHIPSSetRead(ScreenPtr pScreen, int bank)
{
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
outw(cPtr->PIOBase + 0x3D6, ((((bank << 3) & 0xFF) << 8) | 0x10));
@@ -352,9 +352,9 @@ CHIPSHiQVSetReadWritePlanar(ScreenPtr pScreen, int bank)
int
CHIPSSetRead(ScreenPtr pScreen, int bank)
{
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x10, ((bank << 3) & 0xFF));
#ifdef __arm32__
@@ -373,7 +373,7 @@ int
CHIPSSetWrite(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x11, ((bank << 3) & 0xFF));
#ifdef __arm32__
@@ -392,7 +392,7 @@ int
CHIPSSetReadWrite(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x10, ((bank << 3) & 0xFF));
cPtr->writeXR(cPtr, 0x11, ((bank << 3) & 0xFF));
@@ -411,7 +411,7 @@ int
CHIPSSetReadPlanar(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x10, ((bank << 5) & 0xFF));
#ifdef __arm32__
@@ -429,7 +429,7 @@ int
CHIPSSetWritePlanar(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x11, ((bank << 5) & 0xFF));
#ifdef __arm32__
@@ -447,7 +447,7 @@ int
CHIPSSetReadWritePlanar(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
cPtr->writeXR(cPtr, 0x10, ((bank << 5) & 0xFF));
cPtr->writeXR(cPtr, 0x11, ((bank << 5) & 0xFF));
@@ -467,7 +467,7 @@ CHIPSWINSetRead(ScreenPtr pScreen, int bank)
{
CHIPSPtr cPtr = CHIPSPTR(xf86ScreenToScrn(pScreen));
register unsigned char tmp;
cPtr->writeXR(cPtr, 0x10, ((bank << 3) & 0xFF));
tmp = cPtr->readXR(cPtr, 0x0C) & 0xEF;
cPtr->writeXR(cPtr, 0x0C, ((bank >> 1) & 0x10) | tmp);

View File

@@ -2,24 +2,24 @@
/*
* Copyright 1994 The XFree86 Project
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* Hardware Cursor for Trident utilizing XAA Cursor code.
* Written by Alan Hourihane <alanh@fairlite.demon.co.uk>
* Modified for Chips and Technologies by David Bateman <dbateman@eng.uts.edu.au>
@@ -34,7 +34,7 @@
#include "xf86_OSproc.h"
/* Everything using inb/outb, etc needs "compiler.h" */
#include "compiler.h"
#include "compiler.h"
/* Drivers that need to access the PCI config space directly need this */
#include "xf86Pci.h"
@@ -68,13 +68,13 @@ CHIPSShowCursor(ScrnInfoPtr pScrn)
CHIPSPtr cPtr = CHIPSPTR(pScrn);
unsigned char tmp;
CURSOR_SYNC(pScrn);
CURSOR_SYNC(pScrn);
/* turn the cursor on */
if (IS_HiQV(cPtr)) {
tmp = cPtr->readXR(cPtr, 0xA0);
cPtr->writeXR(cPtr, 0xA0, (tmp & 0xF8) | 5);
if (cPtr->UseDualChannel &&
if (cPtr->UseDualChannel &&
(! xf86IsEntityShared(pScrn->entityList[0]))) {
unsigned int IOSS, MSS;
IOSS = cPtr->readIOSS(cPtr);
@@ -106,14 +106,14 @@ CHIPSHideCursor(ScrnInfoPtr pScrn)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
unsigned char tmp;
CURSOR_SYNC(pScrn);
/* turn the cursor off */
if (IS_HiQV(cPtr)) {
tmp = cPtr->readXR(cPtr, 0xA0);
cPtr->writeXR(cPtr, 0xA0, tmp & 0xF8);
if (cPtr->UseDualChannel &&
if (cPtr->UseDualChannel &&
(! xf86IsEntityShared(pScrn->entityList[0]))) {
unsigned int IOSS, MSS;
IOSS = cPtr->readIOSS(cPtr);
@@ -144,9 +144,9 @@ static void
CHIPSSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CURSOR_SYNC(pScrn);
if (x < 0)
x = ~(x-1) | 0x8000;
if (y < 0)
@@ -158,7 +158,7 @@ CHIPSSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
cPtr->writeXR(cPtr, 0xA5, (x >> 8) & 0x87);
cPtr->writeXR(cPtr, 0xA6, y & 0xFF);
cPtr->writeXR(cPtr, 0xA7, (y >> 8) & 0x87);
if (cPtr->UseDualChannel &&
if (cPtr->UseDualChannel &&
(! xf86IsEntityShared(pScrn->entityList[0]))) {
unsigned int IOSS, MSS;
IOSS = cPtr->readIOSS(cPtr);
@@ -195,7 +195,7 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
CHIPSPtr cPtr = CHIPSPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
CARD32 packedcolfg, packedcolbg;
CURSOR_SYNC(pScrn);
if (IS_HiQV(cPtr)) {
@@ -207,7 +207,7 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
/* Write the new colours to the extended VGA palette. Palette
* index is incremented after each write, so only write index
* once
* once
*/
hwp->writeDacWriteAddr(hwp, 0x04);
if (xr80 & 0x80) {
@@ -230,7 +230,7 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
/* Enable normal palette addressing */
cPtr->writeXR(cPtr, 0x80, xr80);
if (cPtr->UseDualChannel &&
if (cPtr->UseDualChannel &&
(! xf86IsEntityShared(pScrn->entityList[0]))) {
unsigned int IOSS, MSS;
IOSS = cPtr->readIOSS(cPtr);
@@ -245,7 +245,7 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
/* Write the new colours to the extended VGA palette. Palette
* index is incremented after each write, so only write index
* once
* once
*/
hwp->writeDacWriteAddr(hwp, 0x04);
if (xr80 & 0x80) {
@@ -300,17 +300,17 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
int y;
#endif
CURSOR_SYNC(pScrn);
CURSOR_SYNC(pScrn);
if (cPtr->cursorDelay) {
usleep(200000);
cPtr->cursorDelay = FALSE;
}
if (IS_Wingine(cPtr)) {
int i;
CARD32 *tmp = (CARD32 *)src;
outl(cPtr->PIOBase+DR(0x8),0x20);
for (i=0; i<64; i++) {
outl(cPtr->PIOBase+DR(0xC),*(CARD32 *)tmp);
@@ -325,7 +325,7 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
case 3:
#if 1
memcpy((unsigned char *)cPtr->FbBase + cAcl->CursorAddress,
src, cPtr->CursorInfoRec->MaxWidth *
src, cPtr->CursorInfoRec->MaxWidth *
cPtr->CursorInfoRec->MaxHeight / 4);
#else
for (y = 0; y < 64; y++) {
@@ -362,7 +362,7 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
}
#else
memcpy((unsigned char *)cPtr->FbBase + cAcl->CursorAddress,
src, cPtr->CursorInfoRec->MaxWidth *
src, cPtr->CursorInfoRec->MaxWidth *
cPtr->CursorInfoRec->MaxHeight / 4);
#endif
} else {
@@ -372,7 +372,7 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
*/
if (IS_HiQV(cPtr))
if (pScrn->bitsPerPixel < 8)
CHIPSHiQVSetReadWritePlanar(pScrn->pScreen,
CHIPSHiQVSetReadWritePlanar(pScrn->pScreen,
(int)(cAcl->CursorAddress >> 16));
else
CHIPSHiQVSetReadWrite(pScrn->pScreen,
@@ -385,7 +385,7 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
CHIPSSetWrite(pScrn->pScreen,
(int)(cAcl->CursorAddress >> 16));
memcpy((unsigned char *)cPtr->FbBase + (cAcl->CursorAddress &
0xFFFF), src, cPtr->CursorInfoRec->MaxWidth *
0xFFFF), src, cPtr->CursorInfoRec->MaxWidth *
cPtr->CursorInfoRec->MaxHeight / 4);
}
}
@@ -394,7 +394,7 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
if (IS_HiQV(cPtr)) {
cPtr->writeXR(cPtr, 0xA2, (cAcl->CursorAddress >> 8) & 0xFF);
cPtr->writeXR(cPtr, 0xA3, (cAcl->CursorAddress >> 16) & 0x3F);
if (cPtr->UseDualChannel &&
if (cPtr->UseDualChannel &&
(! xf86IsEntityShared(pScrn->entityList[0]))) {
unsigned int IOSS, MSS;
IOSS = cPtr->readIOSS(cPtr);
@@ -424,7 +424,7 @@ CHIPSUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
return (((cPtr->Flags & ChipsHWCursor) != 0)
&& !(pScrn->currentMode->Flags & V_DBLSCAN));
}
@@ -456,7 +456,7 @@ CHIPSCursorInit(ScreenPtr pScreen)
} else if (IS_Wingine(cPtr)) {
infoPtr->Flags |= HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
infoPtr->MaxHeight = 32;
infoPtr->MaxWidth = 32;
infoPtr->MaxWidth = 32;
} else {
infoPtr->Flags |= HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8;
infoPtr->MaxHeight = 32;

View File

@@ -24,7 +24,7 @@ chips_ddc1Read(ScrnInfoPtr pScrn)
unsigned char ddc_mask = ((CHIPSPtr)pScrn->driverPrivate)->ddc_mask;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
register unsigned int tmp;
while ((hwp->readST01(hwp)) & 0x08){};
@@ -46,9 +46,9 @@ chips_ddc1(ScrnInfoPtr pScrn)
unsigned char mask_c = 0x00;
unsigned char val, tmp_val = 0;
int i;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing for DDC1\n");
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Probing for DDC1\n");
FR0C = cPtr->readFR(cPtr, 0x0C);
XR62 = cPtr->readXR(cPtr, 0x62);
@@ -57,7 +57,7 @@ chips_ddc1(ScrnInfoPtr pScrn)
cPtr->ddc_mask = 0x1F; /* GPIO 0-4 */
FR0B = cPtr->readFR(cPtr, 0x0B);
if (!(FR0B & 0x10)) /* GPIO 2 is used as 32 kHz input */
cPtr->ddc_mask &= 0xFB;
cPtr->ddc_mask &= 0xFB;
if (cPtr->Bus == ChipsVLB) /* GPIO 3-7 are used as address bits */
cPtr->ddc_mask &= 0x07;
break;
@@ -96,7 +96,7 @@ chips_ddc1(ScrnInfoPtr pScrn)
}
cPtr->ddc_mask = val ^ tmp_val;
if (cPtr->ddc_mask)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DDC1 found\n");
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DDC1 found\n");
else return;
xf86PrintEDID(xf86DoEDID_DDC1(XF86_SCRN_ARG(pScrn), chips_ddc1SetSpeed,
@@ -108,9 +108,9 @@ chips_ddc1(ScrnInfoPtr pScrn)
}
static void
chips_I2CGetBits(I2CBusPtr b, int *clock, int *data)
chips_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
unsigned char FR0C, XR62, val;
FR0C = pI2C_c->cPtr->readFR(pI2C_c->cPtr, 0x0C);
@@ -130,7 +130,7 @@ chips_I2CGetBits(I2CBusPtr b, int *clock, int *data)
static void
chips_I2CPutBits(I2CBusPtr b, int clock, int data)
{
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
unsigned char FR0C, XR62, val;
FR0C = pI2C_c->cPtr->readFR(pI2C_c->cPtr, 0x0C);
@@ -175,10 +175,10 @@ chips_i2cInit(ScrnInfoPtr pScrn)
I2CPtr->I2CGetBits = chips_I2CGetBits;
I2CPtr->DriverPrivate.ptr = malloc(sizeof(CHIPSI2CRec));
((CHIPSI2CPtr)(I2CPtr->DriverPrivate.ptr))->cPtr = cPtr;
if (!xf86I2CBusInit(I2CPtr))
return FALSE;
if (!chips_setI2CBits(I2CPtr, pScrn))
return FALSE;
@@ -188,8 +188,8 @@ chips_i2cInit(ScrnInfoPtr pScrn)
static Bool
chips_setI2CBits(I2CBusPtr b, ScrnInfoPtr pScrn)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSI2CPtr pI2C_c = (CHIPSI2CPtr) (b->DriverPrivate.ptr);
unsigned char FR0B, FR0C;
unsigned char bits, data_bits, clock_bits;
int i,j;
@@ -200,7 +200,7 @@ chips_setI2CBits(I2CBusPtr b, ScrnInfoPtr pScrn)
bits = 0x1F; /* GPIO 0-4 */
FR0B = cPtr->readFR(cPtr, 0x0B);
if (!(FR0B & 0x10)) /* GPIO 2 is used as 32 kHz input */
bits &= 0xFB;
bits &= 0xFB;
pI2C_c->i2cDataBit = 0x01;
pI2C_c->i2cClockBit = 0x02;
if (cPtr->Bus == ChipsVLB) /* GPIO 3-7 are used as address bits */
@@ -257,7 +257,7 @@ chips_setI2CBits(I2CBusPtr b, ScrnInfoPtr pScrn)
data_bits >>= 1;
pI2C_c->i2cDataBit <<= 1;
}
/*
/*
* We haven't found a valid clock/data line combination - that
* doesn't mean there aren't any. We just haven't received an
* answer from the relevant DDC I2C addresses. We'll have to wait

View File

@@ -10,7 +10,7 @@
#include "dgaproc.h"
static Bool CHIPS_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool CHIPS_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
static Bool CHIPS_SetMode(ScrnInfoPtr, DGAModePtr);
static int CHIPS_GetViewport(ScrnInfoPtr);
@@ -49,7 +49,7 @@ DGAFunctionRec CHIPS_HiQVDGAFuncs = {
Bool
CHIPSDGAInit(ScreenPtr pScreen)
{
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
DGAModePtr modes = NULL, newmodes = NULL, currentMode;
@@ -110,7 +110,7 @@ SECOND_PASS:
currentMode->imageHeight = imlines;
currentMode->pixmapWidth = currentMode->imageWidth;
currentMode->pixmapHeight = currentMode->imageHeight;
currentMode->maxViewportX = currentMode->imageWidth -
currentMode->maxViewportX = currentMode->imageWidth -
currentMode->viewportWidth;
/* this might need to get clamped to some maximum */
currentMode->maxViewportY = currentMode->imageHeight -
@@ -118,18 +118,18 @@ SECOND_PASS:
oneMore = FALSE;
goto SECOND_PASS;
} else {
currentMode->bytesPerScanline =
currentMode->bytesPerScanline =
((pScrn->displayWidth * Bpp) + 3) & ~3L;
currentMode->imageWidth = pScrn->displayWidth;
currentMode->imageHeight = imlines;
currentMode->pixmapWidth = currentMode->imageWidth;
currentMode->pixmapHeight = currentMode->imageHeight;
currentMode->maxViewportX = currentMode->imageWidth -
currentMode->maxViewportX = currentMode->imageWidth -
currentMode->viewportWidth;
/* this might need to get clamped to some maximum */
currentMode->maxViewportY = currentMode->imageHeight -
currentMode->viewportHeight;
}
}
pMode = pMode->next;
if(pMode == firstMode)
@@ -140,12 +140,12 @@ SECOND_PASS:
cPtr->DGAModes = modes;
if (IS_HiQV(cPtr)) {
return DGAInit(pScreen, &CHIPS_HiQVDGAFuncs, modes, num);
return DGAInit(pScreen, &CHIPS_HiQVDGAFuncs, modes, num);
} else {
if(!cPtr->UseMMIO) {
return DGAInit(pScreen, &CHIPS_DGAFuncs, modes, num);
return DGAInit(pScreen, &CHIPS_DGAFuncs, modes, num);
} else {
return DGAInit(pScreen, &CHIPS_MMIODGAFuncs, modes, num);
return DGAInit(pScreen, &CHIPS_MMIODGAFuncs, modes, num);
}
}
}
@@ -176,18 +176,18 @@ CHIPS_SetMode(
cPtr->DGAactive = TRUE;
}
pScrn->displayWidth = pMode->bytesPerScanline /
pScrn->displayWidth = pMode->bytesPerScanline /
(pMode->bitsPerPixel >> 3);
CHIPSSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode));
}
return TRUE;
}
static int
static int
CHIPS_GetViewport(
ScrnInfoPtr pScrn
){
@@ -196,15 +196,15 @@ CHIPS_GetViewport(
return cPtr->DGAViewportStatus;
}
static void
static void
CHIPS_SetViewport(
ScrnInfoPtr pScrn,
int x, int y,
ScrnInfoPtr pScrn,
int x, int y,
int flags
){
vgaHWPtr hwp = VGAHWPTR(pScrn);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
if (flags & DGA_FLIP_RETRACE) {
while ((hwp->readST01(hwp)) & 0x08){};
while (!((hwp->readST01(hwp)) & 0x08)){};
@@ -214,9 +214,9 @@ CHIPS_SetViewport(
cPtr->DGAViewportStatus = 0; /* CHIPSAdjustFrame loops until finished */
}
static Bool
static Bool
CHIPS_OpenFramebuffer(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
char **name,
unsigned char **mem,
int *size,

File diff suppressed because it is too large Load Diff

View File

@@ -192,7 +192,7 @@ typedef struct {
/* Some variables needed in the XAA acceleration */
typedef struct {
/* General variable */
/* General variable */
unsigned int CommandFlags;
unsigned int BytesPerPixel;
unsigned int BitsPerPixel;
@@ -294,7 +294,7 @@ typedef struct _CHIPSRec {
int Rotate;
void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
int FbOffset16;
int FbSize16;
int FbSize16;
OptionInfoPtr Options;
CHIPSPanelSizeRec PanelSize;
int FrameBufferSize;
@@ -555,11 +555,11 @@ void chipsPointerMoved(SCRN_ARG_TYPE arg, int x, int y);
/* To aid debugging of 32 bit register access we make the following defines */
/*
#define DEBUG
#define CT_HW_DEBUG
#define CT_HW_DEBUG
*/
#if defined(DEBUG) & defined(CT_HW_DEBUG)
#define HW_DEBUG(x) {usleep(500000); ErrorF("Register/Address: 0x%X\n",x);}
#else
#define HW_DEBUG(x)
#define HW_DEBUG(x)
#endif
#endif

View File

@@ -1,5 +1,5 @@
/*
* EXA acceleration for now ct65550 only, for lack of other hardware
* EXA acceleration for now ct65550 only, for lack of other hardware
*
* Copyright (C) 2016 Michael Lorenz
*
@@ -296,9 +296,9 @@ CHIPSInitEXA(ScreenPtr pScreen)
/*
* Contrary to the manual, the blitter needs 8 byte pitch alignment or it
* will lock up. Probably shouldn't be surprised, there are hidden 64bit
* will lock up. Probably shouldn't be surprised, there are hidden 64bit
* alignment requirements all over the place.
*/
*/
pExa->pixmapOffsetAlign = 8;
pExa->pixmapPitchAlign = 8;

View File

@@ -31,7 +31,7 @@
enum region_type {
REGION_MEM,
REGION_IO
REGION_IO
};
#ifndef XSERVER_LIBPCIACCESS

View File

@@ -43,7 +43,7 @@
* ISA has no method to disable I/O access to a card ISA multihead will
* never be supported.
*
* 2) ct_Blitter.h, ct_BlitMM.h and ct_BltHiQV.h, where speed is crucial and
* 2) ct_Blitter.h, ct_BlitMM.h and ct_BltHiQV.h, where speed is crucial and
* we know exactly whether we are using MMIO or PIO.
*
* 3) The 6554x 32bit DRxx in ct_cursor.c where the choice between MMIO and
@@ -471,7 +471,7 @@ chipsMmioReadST01(vgaHWPtr hwp)
return minb(CHIPS_MMIO_COLOR_STAT_1);
}
static CARD8
static CARD8
chipsMmioReadFCR(vgaHWPtr hwp)
{
return minb(CHIPS_MMIO_FEATURE_R);

View File

@@ -16,14 +16,14 @@ chipsRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
CHIPSPtr cPtr = CHIPSPTR(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 = cPtr->ShadowPtr + (pbox->y1 * cPtr->ShadowPitch) +
src = cPtr->ShadowPtr + (pbox->y1 * cPtr->ShadowPitch) +
(pbox->x1 * Bpp);
dst = cPtr->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
@@ -32,10 +32,10 @@ chipsRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
dst += FBPitch;
src += cPtr->ShadowPitch;
}
pbox++;
}
}
}
void
chipsPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
@@ -43,7 +43,7 @@ chipsPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
SCRN_INFO_PTR(arg);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
int newX, newY;
if(cPtr->Rotate == 1) {
newX = pScrn->pScreen->height - y - 1;
newY = x;
@@ -73,11 +73,11 @@ chipsRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = (y2 - y1) >> 2; /* in dwords */
if(cPtr->Rotate == 1) {
dstPtr = cPtr->FbBase +
dstPtr = cPtr->FbBase +
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
srcPtr = cPtr->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
} else {
dstPtr = cPtr->FbBase +
dstPtr = cPtr->FbBase +
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
srcPtr = cPtr->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
}
@@ -87,8 +87,8 @@ chipsRefreshArea8(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;
}
@@ -98,7 +98,7 @@ chipsRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
pbox++;
}
}
}
void
@@ -117,16 +117,16 @@ chipsRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
y1 = pbox->y1 & ~1;
y2 = (pbox->y2 + 1) & ~1;
height = (y2 - y1) >> 1; /* in dwords */
if(cPtr->Rotate == 1) {
dstPtr = (CARD16*)cPtr->FbBase +
dstPtr = (CARD16*)cPtr->FbBase +
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
srcPtr = (CARD16*)cPtr->ShadowPtr +
srcPtr = (CARD16*)cPtr->ShadowPtr +
((1 - y2) * srcPitch) + pbox->x1;
} else {
dstPtr = (CARD16*)cPtr->FbBase +
dstPtr = (CARD16*)cPtr->FbBase +
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
srcPtr = (CARD16*)cPtr->ShadowPtr +
srcPtr = (CARD16*)cPtr->ShadowPtr +
(y1 * srcPitch) + pbox->x2 - 1;
/* ErrorF("dst: %x base: %x\n",dstPtr,cPtr->FbBase);*/
}
@@ -167,11 +167,11 @@ chipsRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = (y2 - y1) >> 2; /* blocks of 3 dwords */
if(cPtr->Rotate == 1) {
dstPtr = cPtr->FbBase +
dstPtr = cPtr->FbBase +
(pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3);
srcPtr = cPtr->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3);
} else {
dstPtr = cPtr->FbBase +
dstPtr = cPtr->FbBase +
((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3);
srcPtr = cPtr->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3;
}
@@ -182,18 +182,18 @@ chipsRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
count = height;
while(count--) {
dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
(src[srcPitch] << 24);
(src[srcPitch] << 24);
dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
(src[srcPitch * 2] << 16) |
(src[(srcPitch * 2) + 1] << 24);
(src[(srcPitch * 2) + 1] << 24);
dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
(src[(srcPitch * 3) + 1] << 16) |
(src[(srcPitch * 3) + 2] << 24);
(src[(srcPitch * 3) + 2] << 24);
dst += 3;
src += srcPitch * 4;
}
srcPtr += cPtr->Rotate * 3;
dstPtr += dstPitch;
dstPtr += dstPitch;
}
pbox++;
@@ -215,14 +215,14 @@ chipsRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = pbox->y2 - pbox->y1;
if(cPtr->Rotate == 1) {
dstPtr = (CARD32*)cPtr->FbBase +
dstPtr = (CARD32*)cPtr->FbBase +
(pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
srcPtr = (CARD32*)cPtr->ShadowPtr +
srcPtr = (CARD32*)cPtr->ShadowPtr +
((1 - pbox->y2) * srcPitch) + pbox->x1;
} else {
dstPtr = (CARD32*)cPtr->FbBase +
dstPtr = (CARD32*)cPtr->FbBase +
((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
srcPtr = (CARD32*)cPtr->ShadowPtr +
srcPtr = (CARD32*)cPtr->ShadowPtr +
(pbox->y1 * srcPitch) + pbox->x2 - 1;
}

View File

@@ -31,11 +31,11 @@ static int CHIPSSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
static int CHIPSGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
static void CHIPSQueryBestSize(ScrnInfoPtr, Bool,
short, short, short, short, unsigned int *, unsigned int *, pointer);
static int CHIPSPutImage( ScrnInfoPtr,
static int CHIPSPutImage( ScrnInfoPtr,
short, short, short, short, short, short, short, short,
int, unsigned char*, short, short, Bool, RegionPtr, pointer,
DrawablePtr);
static int CHIPSQueryImageAttributes(ScrnInfoPtr,
static int CHIPSQueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
static void CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
@@ -44,7 +44,7 @@ static void CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time);
static Atom xvColorKey;
void
void
CHIPSInitVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -52,7 +52,7 @@ CHIPSInitVideo(ScreenPtr pScreen)
XF86VideoAdaptorPtr newAdaptor = NULL;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
int num_adaptors;
if ((cPtr->Flags & ChipsVideoSupport)) {
newAdaptor = CHIPSSetupImageVideo(pScreen);
CHIPSInitOffscreenImages(pScreen);
@@ -68,7 +68,7 @@ CHIPSInitVideo(ScreenPtr pScreen)
newAdaptors = /* need to free this someplace */
malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
if(newAdaptors) {
memcpy(newAdaptors, adaptors, num_adaptors *
memcpy(newAdaptors, adaptors, num_adaptors *
sizeof(XF86VideoAdaptorPtr));
newAdaptors[num_adaptors] = newAdaptor;
adaptors = newAdaptors;
@@ -84,7 +84,7 @@ CHIPSInitVideo(ScreenPtr pScreen)
}
/* client libraries expect an encoding */
static
static
XF86VideoEncodingRec DummyEncoding[1] =
{
{
@@ -97,7 +97,7 @@ XF86VideoEncodingRec DummyEncoding[1] =
#define NUM_FORMATS 4
static XF86VideoFormatRec Formats[NUM_FORMATS] =
static XF86VideoFormatRec Formats[NUM_FORMATS] =
{
{8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
};
@@ -167,8 +167,8 @@ typedef struct {
#define GET_PORT_PRIVATE(pScrn) \
(CHIPSPortPrivPtr)((CHIPSPTR(pScrn))->adaptor->pPortPrivates[0].ptr)
void
CHIPSResetVideo(ScrnInfoPtr pScrn)
void
CHIPSResetVideo(ScrnInfoPtr pScrn)
{
CHIPSPtr cPtr = CHIPSPTR(pScrn);
CHIPSPortPrivPtr pPriv = cPtr->adaptor->pPortPrivates[0].ptr;
@@ -216,12 +216,12 @@ CHIPSResetVideo(ScrnInfoPtr pScrn)
cPtr->writeMR(cPtr, 0x41, 0x00);
cPtr->writeMR(cPtr, 0x42, 0x00);
break;
}
}
}
}
}
static XF86VideoAdaptorPtr
static XF86VideoAdaptorPtr
CHIPSSetupImageVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -278,14 +278,14 @@ CHIPSSetupImageVideo(ScreenPtr pScreen)
}
static void
static void
CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shadow)
{
CHIPSPortPrivPtr pPriv = (CHIPSPortPrivPtr)data;
CHIPSPtr cPtr = CHIPSPTR(pScrn);
unsigned char mr3c, tmp;
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
if(shadow) {
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
mr3c = cPtr->readMR(cPtr, 0x3C);
@@ -301,17 +301,17 @@ CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shadow)
} else {
if(pPriv->videoStatus & CLIENT_VIDEO_ON) {
pPriv->videoStatus |= OFF_TIMER;
pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
pPriv->offTime = currentTime.milliseconds + OFF_DELAY;
cPtr->VideoTimerCallback = CHIPSVideoTimerCallback;
}
}
}
static int
static int
CHIPSSetPortAttribute(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Atom attribute,
INT32 value,
INT32 value,
pointer data
){
CHIPSPortPrivPtr pPriv = (CHIPSPortPrivPtr)data;
@@ -346,19 +346,19 @@ CHIPSSetPortAttribute(
cPtr->writeMR(cPtr, 0x3E, green);
cPtr->writeMR(cPtr, 0x3F, blue);
break;
}
}
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
}
}
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
} else return BadMatch;
return Success;
}
static int
static int
CHIPSGetPortAttribute(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Atom attribute,
INT32 *value,
INT32 *value,
pointer data
){
CHIPSPortPrivPtr pPriv = (CHIPSPortPrivPtr)data;
@@ -370,17 +370,17 @@ CHIPSGetPortAttribute(
return Success;
}
static void
static void
CHIPSQueryBestSize(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Bool motion,
short vid_w, short vid_h,
short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h,
short vid_w, short vid_h,
short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h,
pointer data
){
*p_w = drw_w;
*p_h = drw_h;
*p_h = drw_h;
if(*p_w > 16384) *p_w = 16384;
}
@@ -445,9 +445,9 @@ CHIPSAllocateMemory(
FBLinearPtr new_linear;
if(linear) {
if(linear->size >= size)
if(linear->size >= size)
return linear;
if(xf86ResizeOffscreenLinear(linear, size))
return linear;
@@ -456,30 +456,30 @@ CHIPSAllocateMemory(
pScreen = xf86ScrnToScreen(pScrn);
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
NULL, NULL, NULL);
if(!new_linear) {
int max_size;
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8,
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8,
PRIORITY_EXTREME);
if(max_size < size)
return NULL;
xf86PurgeUnlockedOffscreenAreas(pScreen);
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8,
NULL, NULL, NULL);
}
return new_linear;
}
static int
CHIPSSetCurrentPlaybackBuffer(CHIPSPtr cPtr, int n)
{
CARD8 mr20;
mr20 = cPtr->readMR(cPtr, 0x20);
mr20 &= ~0x1B;
@@ -493,11 +493,11 @@ CHIPSWaitGetNextFrame(CHIPSPtr cPtr)
{
volatile CARD8 mr20;
volatile CARD8 mr21;
mr20 = cPtr->readMR(cPtr, 0x20);
while (1) {
mr21 = cPtr->readMR(cPtr, 0x21);
if (!(mr20 & (1 << 5)) || !(mr21 & 1))
if (!(mr20 & (1 << 5)) || !(mr21 & 1))
break;
}
mr20 &= ~0x4;
@@ -511,7 +511,7 @@ CHIPSDisplayVideo(
int id,
int offset,
short width, short height,
int pitch,
int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -525,14 +525,14 @@ CHIPSDisplayVideo(
int buffer = pPriv->currentBuffer;
Bool dblscan = (pScrn->currentMode->Flags & V_DBLSCAN) == V_DBLSCAN;
int val;
tmp = cPtr->readXR(cPtr, 0xD0);
cPtr->writeXR(cPtr, 0xD0, (tmp | 0x10));
m1e = cPtr->readMR(cPtr, 0x1E);
m1e &= 0xE0; /* Set Zoom and Direction */
if ((!(cPtr->PanelType & ChipsLCD)) && (mode->Flags & V_INTERLACE))
if ((!(cPtr->PanelType & ChipsLCD)) && (mode->Flags & V_INTERLACE))
m1e |= 0x10;
m1f = cPtr->readMR(cPtr, 0x1F);
@@ -546,13 +546,13 @@ CHIPSDisplayVideo(
break;
case FOURCC_YV12: /* YV12 */
/* m1f |= 0x03 */
m1f |= 0x00;
m1f |= 0x00;
break;
case FOURCC_YUY2: /* YUY2 */
default:
m1f |= 0x00; /* Do nothing here */
break;
}
}
offset += (x1 >> 15) & ~0x01;
/* Setup Pointer 1 */
@@ -561,7 +561,7 @@ CHIPSDisplayVideo(
cPtr->writeMR(cPtr, 0x23, ((offset >> 8) & 0xFF));
cPtr->writeMR(cPtr, 0x24, ((offset >> 16) & 0xFF));
}
/* Setup Pointer 2 */
if ((buffer && !pPriv->manualDoubleBuffer) || !pPriv->doubleBuffer) {
cPtr->writeMR(cPtr, 0x25, (offset & 0xF8));
@@ -577,11 +577,11 @@ CHIPSDisplayVideo(
tmp = cPtr->readMR(cPtr, 0x20);
tmp &= 0xC3;
if (pPriv->doubleBuffer && !pPriv->manualDoubleBuffer && triggerBufSwitch)
if (pPriv->doubleBuffer && !pPriv->manualDoubleBuffer && triggerBufSwitch)
tmp |= ((1 << 2 | 1 << 5) | ((buffer) ? (1 << 4) : 0));
cPtr->writeMR(cPtr, 0x20, tmp);
cPtr->writeMR(cPtr, 0x28, ((width >> 2) - 1)); /* Width */
cPtr->writeMR(cPtr, 0x28, ((width >> 2) - 1)); /* Width */
cPtr->writeMR(cPtr, 0x34, ((width >> 2) - 1));
/* Left Edge of Overlay */
@@ -590,7 +590,7 @@ CHIPSDisplayVideo(
tmp = (tmp & 0xF8) + (((cPtr->OverlaySkewX + dstBox->x1) >> 8) & 0x07);
cPtr->writeMR(cPtr, 0x2B, tmp);
/* Right Edge of Overlay */
cPtr->writeMR(cPtr, 0x2C, ((cPtr->OverlaySkewX + dstBox->x2 -1)
cPtr->writeMR(cPtr, 0x2C, ((cPtr->OverlaySkewX + dstBox->x2 -1)
& 0xFF));
tmp = cPtr->readMR(cPtr, 0x2D);
tmp = (tmp & 0xF8) + (((cPtr->OverlaySkewX + dstBox->x2 - 1) >> 8) & 0x07);
@@ -620,28 +620,28 @@ CHIPSDisplayVideo(
if (drw_h > src_h || dblscan) {
m1f = m1f | 0x80; /* set V-interpolation */
m1e = m1e | 0x08;
if (dblscan)
if (dblscan)
tmp = cPtr->VideoZoomMax >> 1;
if (drw_h > src_h)
tmp = 256 * src_h / drw_h;
cPtr->writeMR(cPtr, 0x33, tmp & 0xFC);
}
cPtr->writeMR(cPtr, 0x1F, m1f);
cPtr->writeMR(cPtr, 0x1F, m1f);
cPtr->writeMR(cPtr, 0x1E, m1e);
tmp = cPtr->readMR(cPtr, 0x3C);
cPtr->writeMR(cPtr, 0x3C, (tmp | 0x7));
}
static int
CHIPSPutImage(
ScrnInfoPtr pScrn,
short src_x, short src_y,
static int
CHIPSPutImage(
ScrnInfoPtr pScrn,
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,
int id, unsigned char* buf,
short width, short height,
int id, unsigned char* buf,
short width, short height,
Bool sync,
RegionPtr clipBoxes, pointer data,
DrawablePtr pDraw
@@ -686,7 +686,7 @@ CHIPSPutImage(
pPriv->doubleBuffer = (pScrn->currentMode->Flags & V_DBLSCAN) != V_DBLSCAN;
if (pPriv->doubleBuffer)
new_size <<= 1;
new_size <<= 1;
switch(id) {
case FOURCC_YV12: /* YV12 */
@@ -698,15 +698,15 @@ CHIPSPutImage(
default: /* RGB15, RGB16, YUY2 */
srcPitch = (width << 1);
break;
}
}
if(!(pPriv->linear = CHIPSAllocateMemory(pScrn, pPriv->linear, new_size))) {
if (pPriv->doubleBuffer
&& (pPriv->linear = CHIPSAllocateMemory(pScrn, pPriv->linear,
&& (pPriv->linear = CHIPSAllocateMemory(pScrn, pPriv->linear,
new_size >> 1))) {
new_size >>= 1;
pPriv->doubleBuffer = FALSE;
} else
} else
return BadAlloc;
}
@@ -719,7 +719,7 @@ CHIPSPutImage(
offset = pPriv->linear->offset * bpp;
if (!pPriv->manualDoubleBuffer)
pPriv->currentBuffer = CHIPSWaitGetNextFrame(cPtr);
if(pPriv->doubleBuffer && pPriv->currentBuffer)
if(pPriv->doubleBuffer && pPriv->currentBuffer)
offset += (new_size * bpp) >> 1;
dst_start = cPtr->FbBase + offset + left + (top * dstPitch);
@@ -729,9 +729,9 @@ CHIPSPutImage(
top &= ~1;
tmp = ((top >> 1) * srcPitch2) + (left >> 2);
offset2 += tmp;
offset3 += tmp;
offset3 += tmp;
nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
CHIPSCopyMungedData(buf + (top * srcPitch) + (left >> 1),
CHIPSCopyMungedData(buf + (top * srcPitch) + (left >> 1),
buf + offset2, buf + offset3, dst_start,
srcPitch, srcPitch2, dstPitch, nlines, npixels);
break;
@@ -740,7 +740,7 @@ CHIPSPutImage(
nlines = ((y2 + 0xffff) >> 16) - top;
CHIPSCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
break;
}
}
/* update cliplist */
if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
@@ -748,23 +748,23 @@ CHIPSPutImage(
xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
}
offset += top * dstPitch;
offset += top * dstPitch;
CHIPSDisplayVideo(pScrn, id, offset, width, height, dstPitch,
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h, TRUE);
pPriv->videoStatus = CLIENT_VIDEO_ON;
if (pPriv->manualDoubleBuffer)
pPriv->currentBuffer ^= 1;
pPriv->currentBuffer ^= 1;
return Success;
}
static int
static int
CHIPSQueryImageAttributes(
ScrnInfoPtr pScrn,
int id,
unsigned short *w, unsigned short *h,
ScrnInfoPtr pScrn,
int id,
unsigned short *w, unsigned short *h,
int *pitches, int *offsets
){
int size, tmp;
@@ -837,11 +837,11 @@ typedef struct {
Bool isOn;
} OffscreenPrivRec, * OffscreenPrivPtr;
static int
static int
CHIPSAllocateSurface(
ScrnInfoPtr pScrn,
int id,
unsigned short w,
unsigned short w,
unsigned short h,
XF86SurfacePtr surface
){
@@ -883,7 +883,7 @@ CHIPSAllocateSurface(
pPriv->isOn = FALSE;
surface->pScrn = pScrn;
surface->id = id;
surface->id = id;
surface->pitches[0] = pitch;
surface->offsets[0] = linear->offset * bpp;
surface->devPrivate.ptr = (pointer)pPriv;
@@ -891,7 +891,7 @@ CHIPSAllocateSurface(
return Success;
}
static int
static int
CHIPSStopSurface(
XF86SurfacePtr surface
){
@@ -911,7 +911,7 @@ CHIPSStopSurface(
}
static int
static int
CHIPSFreeSurface(
XF86SurfacePtr surface
){
@@ -933,7 +933,7 @@ CHIPSGetSurfaceAttribute(
Atom attribute,
INT32 *value
){
return CHIPSGetPortAttribute(pScrn, attribute, value,
return CHIPSGetPortAttribute(pScrn, attribute, value,
(pointer)(GET_PORT_PRIVATE(pScrn)));
}
@@ -943,17 +943,17 @@ CHIPSSetSurfaceAttribute(
Atom attribute,
INT32 value
){
return CHIPSSetPortAttribute(pScrn, attribute, value,
return CHIPSSetPortAttribute(pScrn, attribute, value,
(pointer)(GET_PORT_PRIVATE(pScrn)));
}
static int
static int
CHIPSDisplaySurface(
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
){
@@ -974,7 +974,7 @@ CHIPSDisplaySurface(
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes,
if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes,
surface->width, surface->height))
return Success;
@@ -985,17 +985,17 @@ CHIPSDisplaySurface(
if (portPriv->doubleBuffer)
portPriv->currentBuffer = CHIPSSetCurrentPlaybackBuffer(cPtr,0);
else
else
portPriv->currentBuffer = 0;
CHIPSDisplayVideo(pScrn, surface->id, surface->offsets[0],
CHIPSDisplayVideo(pScrn, surface->id, surface->offsets[0],
surface->width, surface->height, surface->pitches[0],
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h, FALSE);
xf86XVFillKeyHelper(pScrn->pScreen, portPriv->colorKey, clipBoxes);
pPriv->isOn = TRUE;
if(portPriv->videoStatus & CLIENT_VIDEO_ON) {
REGION_EMPTY(pScrn->pScreen, &portPriv->clip);
REGION_EMPTY(pScrn->pScreen, &portPriv->clip);
UpdateCurrentTime();
portPriv->videoStatus = FREE_TIMER;
portPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
@@ -1006,7 +1006,7 @@ CHIPSDisplaySurface(
}
static void
static void
CHIPSInitOffscreenImages(ScreenPtr pScreen)
{
XF86OffscreenImagePtr offscreenImages;
@@ -1016,7 +1016,7 @@ CHIPSInitOffscreenImages(ScreenPtr pScreen)
return;
offscreenImages[0].image = &Images[0];
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
VIDEO_CLIP_TO_VIEWPORT;
offscreenImages[0].alloc_surface = CHIPSAllocateSurface;
offscreenImages[0].free_surface = CHIPSFreeSurface;
@@ -1028,6 +1028,6 @@ CHIPSInitOffscreenImages(ScreenPtr pScreen)
offscreenImages[0].max_height = 1024;
offscreenImages[0].num_attributes = NUM_ATTRIBUTES;
offscreenImages[0].attributes = Attributes;
xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1);
}

View File

@@ -1,24 +1,24 @@
/*
* (c) Copyright 1993,1994 by David Wexelblat <dwex@xfree86.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* Except as contained in this notice, the name of David Wexelblat shall not be
* used in advertising or otherwise to promote the sale, use or other dealings
* in this Software without prior written authorization from David Wexelblat.
@@ -27,32 +27,32 @@
/*
* Copyright 1997
* Digital Equipment Corporation. All rights reserved.
* This software is furnished under license and may be used and copied only in
* accordance with the following terms and conditions. Subject to these
* conditions, you may download, copy, install, use, modify and distribute
* this software in source and/or binary form. No title or ownership is
* This software is furnished under license and may be used and copied only in
* accordance with the following terms and conditions. Subject to these
* conditions, you may download, copy, install, use, modify and distribute
* this software in source and/or binary form. No title or ownership is
* transferred hereby.
*
* 1) Any source code used, modified or distributed must reproduce and retain
* 1) Any source code used, modified or distributed must reproduce and retain
* this copyright notice and list of conditions as they appear in the source
* file.
*
* 2) No right is granted to use any trade name, trademark, or logo of Digital
* Equipment Corporation. Neither the "Digital Equipment Corporation" name
* nor any trademark or logo of Digital Equipment Corporation may be used
* to endorse or promote products derived from this software without the
* 2) No right is granted to use any trade name, trademark, or logo of Digital
* Equipment Corporation. Neither the "Digital Equipment Corporation" name
* nor any trademark or logo of Digital Equipment Corporation may be used
* to endorse or promote products derived from this software without the
* prior written permission of Digital Equipment Corporation.
*
* 3) This software is provided "AS-IS" and any express or implied warranties,
* including but not limited to, any implied warranties of merchantability,
* fitness for a particular purpose, or non-infringement are disclaimed. In
* no event shall DIGITAL be liable for any damages whatsoever, and in
* particular, DIGITAL shall not be liable for special, indirect,
* consequential, or incidental damages or damages for
* lost profits, loss of revenue or loss of use, whether such damages arise
* in contract,
* negligence, tort, under statute, in equity, at law or otherwise, even if
* advised of the possibility of such damage.
* 3) This software is provided "AS-IS" and any express or implied warranties,
* including but not limited to, any implied warranties of merchantability,
* fitness for a particular purpose, or non-infringement are disclaimed. In
* no event shall DIGITAL be liable for any damages whatsoever, and in
* particular, DIGITAL shall not be liable for special, indirect,
* consequential, or incidental damages or damages for
* lost profits, loss of revenue or loss of use, whether such damages arise
* in contract,
* negligence, tort, under statute, in equity, at law or otherwise, even if
* advised of the possibility of such damage.
*
*/
@@ -292,7 +292,7 @@ inl(short port)
#define intr_disable()
#define intr_enable()
#else
#else
static __inline__ void
intr_disable(void)

View File

@@ -6,7 +6,7 @@
int main(void)
{
int i, HTotal, HDisplay, HSyncStart, HSyncEnd,
int i, HTotal, HDisplay, HSyncStart, HSyncEnd,
VTotal, VDisplay, VSyncStart, VSyncEnd;
unsigned char storeReg, bpp, shift, IOSS = 0, MSS = 0, again = 0;
unsigned short port;
@@ -14,7 +14,7 @@ int main(void)
int is69030 = 0;
SET_IOPL();
printf("0x3C6\t0x%X\n",inw(0x3C6));
/* Check to see if the Chip is HiQV */
@@ -41,7 +41,7 @@ int main(void)
printf("Pipeline A:\n");
}
}
again:
printf("port 0x3D6 (C&T)\n");
storeReg = inb(0x3D6);
@@ -57,7 +57,7 @@ int main(void)
}
outb(0x3D6,0xE2);
bpp = inb(0x3D7)&0xF0;
} else {
} else {
outb(0x3D6, 0x70);
outw(0x3D6, (inw(0x3D6) | 0x8070));
outw(0x46E8,0x0016); /*setup mode*/
@@ -76,7 +76,7 @@ int main(void)
outb(0x3D6,0x2B);
bpp = inb(0x3D7)&0xF0;
}
switch(bpp){
case 0x20:
bpp = 4;
@@ -118,14 +118,14 @@ int main(void)
printf("MR 0x%2.2X\t0x%2.2X\n",i,inb(0x3D3)&0xFF);
}
outb(0x3D3,storeReg);
} else {
} else {
for(i = 0;i < 0x40;i++){
outb(0x3D4,i);
printf("CR 0x%2.2X\t0x%2.2X\n",i,inb(0x3D5)&0xFF);
}
outb(0x3D4,storeReg);
}
printf("port 0x3CE (GC)\n");
storeReg = inb(0x3CE);
@@ -185,7 +185,7 @@ int main(void)
printf("0x102\t0x%8X\n",inl(0x102));
printf("0x103\t0x%8X\n",inl(0x103));
}
}
storeReg = inb(0x3D4);
{
@@ -200,7 +200,7 @@ int main(void)
outb(0x3D4,5);
HSyncEnd += HSyncStart >> shift;
HSyncEnd <<= shift;
outb(0x3D4,6);
VTotal = inb(0x3D5)&0xFF;
outb(0x3D4,7);
@@ -216,14 +216,14 @@ int main(void)
VDisplay += 1;
outb(0x3D4,0x10);
VSyncStart |= inb(0x3D5)&0xFF;
outb(0x3D4,0x11);
VSyncEnd = inb(0x3D5)&0xF;
VSyncEnd += VSyncStart;
}
outb(0x3D4,storeReg);
printf("\nModeLine with port 0x3D4 (CRTC) %d %d %d %d %d %d %d %d\n",
HDisplay, HSyncStart, HSyncEnd, HTotal,
VDisplay, VSyncStart, VSyncEnd, VTotal);

View File

@@ -27,7 +27,7 @@ int main(int argc, char** argv)
printf(" = Z|z write vv to MSR\n");
printf(" xx is in hexadecimal\n");
printf(" vv is in hexadecimal or '?' for query\n");
}
}
SET_IOPL();
@@ -98,11 +98,11 @@ int main(int argc, char** argv)
value = (value << 4) | (c - 'A'+10); /*ASCII assumed*/
else if(c >= 'a' && c < 'g')
value = (value << 4) | (c - 'a'+10); /*ASCII assumed*/
}
}
if ((cport != 'Z') && (cport != 'Y')) outb(port,value&0xFF);
if (query) {
if ((cport != 'Z') && (cport != 'Y'))
printf("%cR%X: 0x%X\n", cport, value & 0xFF,
if ((cport != 'Z') && (cport != 'Y'))
printf("%cR%X: 0x%X\n", cport, value & 0xFF,
inb(port+1)&0xFF);
else
if (cport == 'Z')
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
printf("FCR: 0x%X\n", inb(port1)&0xFF);
} else {
if ((cport != 'Z') && (cport != 'Y')) {
printf("%cR%X: 0x%X -> 0x%X\n", cport, value & 0xFF,
printf("%cR%X: 0x%X -> 0x%X\n", cport, value & 0xFF,
inb(port+1)&0xFF, (value&0xFF00)>>8);
outw(port, value);
outb(port, index &0xFF);

View File

@@ -79,7 +79,7 @@ static int compute_clock (
they should be set to 0 on the 65548, and left untouched on
earlier chips. */
for (PSNx = ((ChipType == CT69000) || (ChipType == CT69030)) ? 1 : 0;
for (PSNx = ((ChipType == CT69000) || (ChipType == CT69030)) ? 1 : 0;
PSNx <= 1; PSNx++) {
unsigned int low_N, high_N;
double Fref4PSN;
@@ -89,7 +89,7 @@ static int compute_clock (
low_N = 3;
high_N = ClkMaxN;
while (Fref / (PSN * low_N) > (((ChipType == CT69000) ||
while (Fref / (PSN * low_N) > (((ChipType == CT69000) ||
(ChipType == CT69030)) ? 5.0e6 : 2.0e6))
low_N++;
while (Fref / (PSN * high_N) < 150.0e3)
@@ -210,7 +210,7 @@ static int set_clock(
outb(0x3D6, 0x33);
tmp = inb(0x3D7);
if (IS_MemClk(ClockType)) {
outb(0x3D7, tmp | 0x20);
outb(0x3D7, tmp | 0x20);
} else {
outb(0x3D7, tmp & ~0x20);
}
@@ -295,13 +295,13 @@ static unsigned int probe_chip(void) {
if (temp == 0x0C) ChipType = CT69030;
}
}
RESET_IOPL();
if (ChipType == 0) { /* failure */
fprintf(stderr, "Not a Chips and Technologies Chipset\n");
}
return ChipType;
}
@@ -339,7 +339,7 @@ int main (int argc, char *argv[]) {
fprintf(stderr, "No programmable Clock!\n");
return 1;
}
if (IS_HiQV(ChipType)) {
if (! compute_clock(ChipType, target, Fref, 63, 127, &M, &N, &P, &PSN)) {
return set_clock(ChipType, ClockType, progclock, M, N, P, PSN);