mirror of
https://github.com/X11Libre/xf86-video-apm.git
synced 2026-03-24 01:24:38 +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-apm/-/merge_requests/12>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,8 +71,8 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-video-apm
|
||||
# Add & Override patterns for xf86-video-apm
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ int ApmHWCursorInit(ScreenPtr pScreen)
|
||||
infoPtr->HideCursor = ApmHideCursor;
|
||||
infoPtr->ShowCursor = ApmShowCursor;
|
||||
infoPtr->UseHWCursor = ApmUseHWCursor;
|
||||
|
||||
|
||||
/* Set up the convert table for the input cursor data */
|
||||
for (i = 0; i < 256; i++)
|
||||
ConvertTable[i] = ((~i) & 0xAA) | (i & (i >> 1) & 0x55);
|
||||
@@ -92,8 +92,8 @@ int ApmHWCursorInit(ScreenPtr pScreen)
|
||||
return xf86InitCursor(pScreen, infoPtr);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
|
||||
static void
|
||||
ApmShowCursor(ScrnInfoPtr pScrn)
|
||||
{
|
||||
APMDECL(pScrn);
|
||||
@@ -152,7 +152,7 @@ ApmSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
|
||||
|
||||
static void
|
||||
ApmSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
{
|
||||
{
|
||||
APMDECL(pScrn);
|
||||
u16 packedcolfg, packedcolbg;
|
||||
|
||||
@@ -164,11 +164,11 @@ ApmSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
}
|
||||
else
|
||||
{
|
||||
packedcolfg =
|
||||
packedcolfg =
|
||||
((fg & 0xE00000) >> 16) |
|
||||
((fg & 0x00E000) >> 11) |
|
||||
((fg & 0x0000C0) >> 6);
|
||||
packedcolbg =
|
||||
packedcolbg =
|
||||
((bg & 0xE00000) >> 16) |
|
||||
((bg & 0x00E000) >> 11) |
|
||||
((bg & 0x0000C0) >> 6);
|
||||
@@ -179,7 +179,7 @@ ApmSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
ApmLoadCursorImage(ScrnInfoPtr pScrn, u8* data)
|
||||
{
|
||||
APMDECL(pScrn);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "dgaproc.h"
|
||||
|
||||
|
||||
static Bool ApmOpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
static Bool ApmOpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
int *, int *, int *);
|
||||
static Bool ApmSetMode(ScrnInfoPtr, DGAModePtr);
|
||||
static int ApmGetViewport(ScrnInfoPtr);
|
||||
@@ -92,7 +92,7 @@ SECOND_PASS:
|
||||
(size <= pScrn->videoRam * 1024 - pApm->OffscreenReserved)) {
|
||||
|
||||
if(secondPitch)
|
||||
pitch = secondPitch;
|
||||
pitch = secondPitch;
|
||||
|
||||
if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
break;
|
||||
@@ -131,7 +131,7 @@ SECOND_PASS:
|
||||
mode->bytesPerScanline = pitch * Bpp;
|
||||
mode->imageWidth = pitch;
|
||||
mode->imageHeight = (pScrn->videoRam * 1024 -
|
||||
pApm->OffscreenReserved) / mode->bytesPerScanline;
|
||||
pApm->OffscreenReserved) / mode->bytesPerScanline;
|
||||
mode->pixmapWidth = mode->imageWidth;
|
||||
mode->pixmapHeight = mode->imageHeight;
|
||||
mode->maxViewportX = mode->imageWidth - mode->viewportWidth;
|
||||
@@ -158,58 +158,58 @@ SECOND_PASS:
|
||||
|
||||
Bool
|
||||
ApmDGAInit(ScreenPtr pScreen)
|
||||
{
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
APMDECL(pScrn);
|
||||
DGAModePtr modes = NULL;
|
||||
int num = 0;
|
||||
|
||||
/* 8 */
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 8, 8,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->bitsPerPixel != 8) ? 0 : pScrn->displayWidth,
|
||||
0, 0, 0, PseudoColor);
|
||||
|
||||
/* 15 */
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
|
||||
0x7C00, 0x03E0, 0x001F, TrueColor);
|
||||
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 15,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
|
||||
0x7C00, 0x03E0, 0x001F, DirectColor);
|
||||
|
||||
/* 16 */
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->depth != 16) ? 0 : pScrn->displayWidth,
|
||||
0xF800, 0x07E0, 0x001F, TrueColor);
|
||||
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 16, 16,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->depth != 16) ? 0 : pScrn->displayWidth,
|
||||
0xF800, 0x07E0, 0x001F, DirectColor);
|
||||
|
||||
/* 24 */
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 24, 24,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 24, 24,
|
||||
(pScrn->bitsPerPixel == 24),
|
||||
(pScrn->bitsPerPixel != 24) ? 0 : pScrn->displayWidth,
|
||||
0xFF0000, 0x00FF00, 0x0000FF, TrueColor);
|
||||
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 24, 24,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 24, 24,
|
||||
(pScrn->bitsPerPixel == 24),
|
||||
(pScrn->bitsPerPixel != 24) ? 0 : pScrn->displayWidth,
|
||||
0xFF0000, 0x00FF00, 0x0000FF, DirectColor);
|
||||
|
||||
/* 32 */
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
|
||||
0xFF0000, 0x00FF00, 0x0000FF, TrueColor);
|
||||
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
modes = ApmSetupDGAMode (pScrn, modes, &num, 32, 24,
|
||||
(pScrn->bitsPerPixel != 24),
|
||||
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
|
||||
0xFF0000, 0x00FF00, 0x0000FF, DirectColor);
|
||||
@@ -217,7 +217,7 @@ ApmDGAInit(ScreenPtr pScreen)
|
||||
pApm->numDGAModes = num;
|
||||
pApm->DGAModes = modes;
|
||||
|
||||
return DGAInit(pScreen, &ApmDGAFuncs, modes, num);
|
||||
return DGAInit(pScreen, &ApmDGAFuncs, modes, num);
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ ApmSetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
|
||||
else
|
||||
pApm->DGAXAAInfo = XAACreateInfoRec();
|
||||
ApmSetupXAAInfo(pApm, pApm->DGAXAAInfo);
|
||||
/*
|
||||
/*
|
||||
* Let's hope this won't fail, that is reinitialize XAA for this
|
||||
* setup...
|
||||
*/
|
||||
@@ -281,7 +281,7 @@ ApmSetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
|
||||
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
ApmGetViewport(
|
||||
ScrnInfoPtr pScrn
|
||||
)
|
||||
@@ -289,10 +289,10 @@ ApmGetViewport(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
ApmSetViewport(
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
ScrnInfoPtr pScrn,
|
||||
int x, int y,
|
||||
int flags
|
||||
)
|
||||
{
|
||||
@@ -320,13 +320,13 @@ ApmSetViewport(
|
||||
else {
|
||||
/* Wait until vertical retrace is in progress. */
|
||||
while (inb(pApm->iobase + 0x3DA) & 0x08);
|
||||
while (!(inb(pApm->iobase + 0x3DA) & 0x08));
|
||||
while (!(inb(pApm->iobase + 0x3DA) & 0x08));
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
ApmOpenFramebuffer(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
char **name,
|
||||
unsigned char **mem,
|
||||
int *size,
|
||||
|
||||
@@ -276,7 +276,7 @@ ApmProbe(DriverPtr drv, int flags)
|
||||
foundScreen = TRUE;
|
||||
else for (i = 0; i < numUsed; i++) {
|
||||
ScrnInfoPtr pScrn;
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a ScrnInfoRec and claim the slot
|
||||
*/
|
||||
@@ -284,7 +284,7 @@ ApmProbe(DriverPtr drv, int flags)
|
||||
if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
|
||||
ApmPciChipsets, NULL,
|
||||
NULL,NULL,NULL,NULL))){
|
||||
|
||||
|
||||
/*
|
||||
* Fill in what we can of the ScrnInfoRec
|
||||
*/
|
||||
@@ -327,8 +327,8 @@ ddc1Read(ScrnInfoPtr pScrn)
|
||||
|
||||
tmp = RDXB_IOP(0xD0);
|
||||
WRXB_IOP(0xD0, tmp & 0x07);
|
||||
while (STATUS_IOP() & 0x800);
|
||||
while (!(STATUS_IOP() & 0x800));
|
||||
while (STATUS_IOP() & 0x800);
|
||||
while (!(STATUS_IOP() & 0x800));
|
||||
return (STATUS_IOP() & STATUS_SDA) != 0;
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pApm->LinMapSize,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
result);
|
||||
|
||||
|
||||
if (err)
|
||||
return FALSE;
|
||||
}
|
||||
@@ -836,9 +836,9 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
} else {
|
||||
switch(pApm->Chipset)
|
||||
{
|
||||
/* These values come from the Manual for AT24 and AT3D
|
||||
/* These values come from the Manual for AT24 and AT3D
|
||||
in the overview of various modes. I've taken the largest
|
||||
number for the different modes. Alliance wouldn't
|
||||
number for the different modes. Alliance wouldn't
|
||||
tell me what the maximum frequency was, so...
|
||||
*/
|
||||
case AT24:
|
||||
@@ -1045,8 +1045,8 @@ ApmMapMem(ScrnInfoPtr pScrn)
|
||||
PCI_DEV_MAP_FLAG_WRITABLE |
|
||||
PCI_DEV_MAP_FLAG_WRITE_COMBINE,
|
||||
result);
|
||||
|
||||
if (err)
|
||||
|
||||
if (err)
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
@@ -1243,7 +1243,7 @@ comp_lmn(ApmPtr pApm, long clock)
|
||||
double k, c;
|
||||
double fout_best = 0;
|
||||
unsigned int best = 0;
|
||||
|
||||
|
||||
if (pApm->Chipset >= AT3D)
|
||||
fmax = 370000.0;
|
||||
else
|
||||
@@ -1279,7 +1279,7 @@ comp_lmn(ApmPtr pApm, long clock)
|
||||
continue;
|
||||
}
|
||||
fout_best = fout;
|
||||
|
||||
|
||||
/* The following formula was empirically derived by
|
||||
matching a number of fvco values with acceptable
|
||||
values of f.
|
||||
@@ -1336,15 +1336,15 @@ comp_lmn(ApmPtr pApm, long clock)
|
||||
if (f > 7) f = 7;
|
||||
if (f < 0) f = 0;
|
||||
}
|
||||
|
||||
|
||||
best = (n << 16) | (m << 8) | (l << 2) | (f << 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (fout_best != 0)
|
||||
return best;
|
||||
|
||||
|
||||
xf86DrvMsg(pApm->scrnIndex, X_PROBED,
|
||||
"Cannot find register values for clock %6.2f MHz. "
|
||||
"Please use a (slightly) different clock.\n",
|
||||
@@ -1754,7 +1754,7 @@ ApmScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
/* must be after visual RGB order fixed */
|
||||
if (pScrn->bitsPerPixel > 4)
|
||||
fbPictureInit(pScreen, 0, 0);
|
||||
|
||||
|
||||
xf86SetBlackWhitePixels(pScreen);
|
||||
|
||||
if (!pApm->ShadowFB) { /* hardware cursor needs to wrap this layer */
|
||||
@@ -1848,7 +1848,7 @@ ApmLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
|
||||
else {
|
||||
for (i = 0; i < numColors; i++) {
|
||||
index = indices[i];
|
||||
if (index != last)
|
||||
if (index != last)
|
||||
outb(pApm->iobase + 0x3C8, index);
|
||||
last = index + 1;
|
||||
outb(pApm->iobase + 0x3C9, colors[index].red);
|
||||
|
||||
@@ -51,7 +51,7 @@ static void A(WriteBitmap)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
|
||||
unsigned char *src, int srcwidth, int skipleft,
|
||||
int fg, int bg, int rop, unsigned int planemask);
|
||||
static void A(TEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
|
||||
int skipleft, int startline,
|
||||
int skipleft, int startline,
|
||||
unsigned int **glyphs, int glyphWidth,
|
||||
int fg, int bg, int rop, unsigned planemask);
|
||||
static void A(SetupForMono8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
|
||||
@@ -482,7 +482,7 @@ A(WriteBitmap)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
|
||||
dstPtr = (CARD32 *)pApm->ScratchMemOffset;
|
||||
SETSOURCEOFF(pApm->ScratchMem);
|
||||
}
|
||||
pApm->ScratchMemPtr = ((memType)(dstPtr + wrd * nc) + 4)
|
||||
pApm->ScratchMemPtr = ((memType)(dstPtr + wrd * nc) + 4)
|
||||
& ~(memType)7;
|
||||
for (i = nc; i-- > 0; ) {
|
||||
for (j = wrd; j-- > 0; ) {
|
||||
@@ -685,7 +685,7 @@ A(WriteBitmap)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
|
||||
|
||||
static void
|
||||
A(TEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
|
||||
int skipleft, int startline,
|
||||
int skipleft, int startline,
|
||||
unsigned int **glyphs, int glyphWidth,
|
||||
int fg, int bg, int rop, unsigned planemask)
|
||||
{
|
||||
@@ -1339,7 +1339,7 @@ BAD_ALIGNMENT:
|
||||
SETCLIP_CTRL(0);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
A(FillImageWriteRects)(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
|
||||
int nBox, BoxPtr pBox, int xorg, int yorg,
|
||||
PixmapPtr pPix)
|
||||
@@ -1364,7 +1364,7 @@ A(FillImageWriteRects)(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
|
||||
if(phaseX < 0) phaseX += pWidth;
|
||||
height = pBox->y2 - pBox->y1;
|
||||
width = pBox->x2 - x;
|
||||
|
||||
|
||||
while(1) {
|
||||
int ch = height, cp = phaseY, cy = y;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ ApmI2CGetBits(I2CBusPtr b, int *clock, int *data)
|
||||
wrinx(pApm->xport, 0x10, 0);
|
||||
}
|
||||
|
||||
Bool
|
||||
Bool
|
||||
ApmI2CInit(ScrnInfoPtr pScrn)
|
||||
{
|
||||
APMDECL(pScrn);
|
||||
@@ -81,7 +81,7 @@ ApmI2CInit(ScrnInfoPtr pScrn)
|
||||
I2CPtr->I2CPutBits = ApmI2CPutBits;
|
||||
I2CPtr->I2CGetBits = ApmI2CGetBits;
|
||||
I2CPtr->DriverPrivate.ptr = pApm;
|
||||
|
||||
|
||||
if(!xf86I2CBusInit(I2CPtr))
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
enum region_type {
|
||||
REGION_MEM,
|
||||
REGION_IO
|
||||
REGION_IO
|
||||
};
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
#define DEC_DIR_Y_POS (0 << 7)
|
||||
#define DEC_MAJORAXIS_X (0 << 8) /* Looks like an error in the docs ...*/
|
||||
#define DEC_MAJORAXIS_Y (1 << 8)
|
||||
#define DEC_SOURCE_LINEAR (1 << 9)
|
||||
#define DEC_SOURCE_LINEAR (1 << 9)
|
||||
#define DEC_SOURCE_XY (0 << 9)
|
||||
#define DEC_SOURCE_CONTIG (1 << 11)
|
||||
#define DEC_SOURCE_RECTANGULAR (0 << 11)
|
||||
|
||||
Reference in New Issue
Block a user