Perform a warnings sweep on hw/kdrive. A number of these were my fault, but

some come from others.
This commit is contained in:
Eric Anholt 2005-06-09 23:22:55 +00:00
parent e11e60b361
commit 75065f3a54
21 changed files with 108 additions and 101 deletions

View File

@ -1,3 +1,9 @@
2005-06-09 Eric Anholt <anholt@FreeBSD.org>
* ati_dri.c:
Perform a warnings sweep on hw/kdrive. A number of these were my fault,
but some come from others.
2005-06-09 Eric Anholt <anholt@FreeBSD.org>
* ati.c:

View File

@ -28,6 +28,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "ati.h"
#include "ati_reg.h"
#include "ati_dma.h"
@ -38,6 +39,7 @@
#include "ati_draw.h"
#include "r128_common.h"
#include "radeon_common.h"
#include "kaa.h"
/* ?? HACK - for now, put this here... */
/* ?? Alpha - this may need to be a variable to handle UP1x00 vs TITAN */

View File

@ -30,14 +30,10 @@
#undef CHIPS_DEBUG
Bool
static Bool
chipsCardInit (KdCardInfo *card)
{
int k;
char *pixels;
ChipsCardInfo *chipsc;
CARD8 r00, r01, r02;
CARD8 r39;
chipsc = (ChipsCardInfo *) xalloc (sizeof (ChipsCardInfo));
if (!chipsc)
@ -61,14 +57,11 @@ chipsCardInit (KdCardInfo *card)
return TRUE;
}
Bool
static Bool
chipsScreenInit (KdScreenInfo *screen)
{
ChipsCardInfo *chipsc = screen->card->driver;
ChipsScreenInfo *chipss;
int screen_size, memory;
CARD32 mmio_base;
CARD32 mmio_size;
chipss = (ChipsScreenInfo *) xalloc (sizeof (ChipsScreenInfo));
if (!chipss)
@ -126,7 +119,7 @@ chipsScreenInit (KdScreenInfo *screen)
return TRUE;
}
Bool
static Bool
chipsInitScreen (ScreenPtr pScreen)
{
return vesaInitScreen (pScreen);
@ -156,7 +149,7 @@ chipsRandRInit (ScreenPtr pScreen)
}
#endif
Bool
static Bool
chipsFinishInitScreen (ScreenPtr pScreen)
{
Bool ret;
@ -189,7 +182,8 @@ chipsWriteXR (ChipsScreenInfo *chipss, CARD8 index, CARD8 value)
outb (value, 0x3d7);
}
CARD8
#if 0
static CARD8
chipsReadFR (ChipsScreenInfo *chipss, CARD8 index)
{
CARD8 value;
@ -198,14 +192,14 @@ chipsReadFR (ChipsScreenInfo *chipss, CARD8 index)
return value;
}
void
static void
chipsWriteFR (ChipsScreenInfo *chipss, CARD8 index, CARD8 value)
{
outb (index, 0x3d0);
outb (value, 0x3d1);
}
CARD8
static CARD8
chipsReadSeq (ChipsScreenInfo *chipss, CARD8 index)
{
CARD8 value;
@ -214,31 +208,31 @@ chipsReadSeq (ChipsScreenInfo *chipss, CARD8 index)
return value;
}
void
static void
chipsWriteSeq (ChipsScreenInfo *chipss, CARD8 index, CARD8 value)
{
outb (index, 0x3c4);
outb (value, 0x3c5);
}
#endif
void
static void
chipsPreserve (KdCardInfo *card)
{
ChipsCardInfo *chipss = card->driver;
vesaPreserve(card);
}
void
static void
chipsSetMMIO (ChipsCardInfo *chipsc)
{
}
void
static void
chipsResetMMIO (ChipsCardInfo *chipsc)
{
}
Bool
static Bool
chipsEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
@ -250,7 +244,8 @@ chipsEnable (ScreenPtr pScreen)
return TRUE;
}
Bool
#if 0
static Bool
chipsDPMS (ScreenPtr pScreen, int mode)
{
KdScreenPriv(pScreen);
@ -264,14 +259,15 @@ chipsDPMS (ScreenPtr pScreen, int mode)
ErrorF ("flat panel XR52 0x%x\n", chipsReadXR (chipss, 0x52));
return TRUE;
}
#endif
void
static void
chipsDisable (ScreenPtr pScreen)
{
vesaDisable (pScreen);
}
void
static void
chipsRestore (KdCardInfo *card)
{
ChipsCardInfo *chipsc = card->driver;
@ -280,7 +276,7 @@ chipsRestore (KdCardInfo *card)
vesaRestore (card);
}
void
static void
chipsScreenFini (KdScreenInfo *screen)
{
ChipsScreenInfo *chipss = (ChipsScreenInfo *) screen->driver;
@ -297,11 +293,9 @@ chipsScreenFini (KdScreenInfo *screen)
screen->driver = 0;
}
void
static void
chipsCardFini (KdCardInfo *card)
{
ChipsCardInfo *chipsc = card->driver;
vesaCardFini (card);
}

View File

@ -160,13 +160,6 @@ chipsSet (ScreenPtr pScreen)
pixelStride = pScreenPriv->screen->fb[0].pixelStride;
}
static void
chipsWaitMarker (ScreenPtr pScreen, int marker)
{
chipsSet (pScreen);
chipsWaitIdle ();
}
#ifdef HIQV
#define CHIPS_BR0 0x00 /* offset */
#define CHIPS_BR1 0x04 /* bg */
@ -312,6 +305,13 @@ chipsWaitIdle (void)
#endif
}
static void
chipsWaitMarker (ScreenPtr pScreen, int marker)
{
chipsSet (pScreen);
chipsWaitIdle ();
}
static Bool
chipsPrepareSolid (PixmapPtr pPixmap,
int alu,

View File

@ -186,7 +186,6 @@ KdCardFuncs ephyrFuncs = {
0, /* initAccel */
0, /* enableAccel */
0, /* syncAccel */
0, /* disableAccel */
0, /* finiAccel */

View File

@ -29,11 +29,11 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h> /* for memset */
#include <time.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
#include <time.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

View File

@ -56,18 +56,9 @@ fakeCardInit (KdCardInfo *card)
return TRUE;
}
static Bool
fakeModeSupported (KdScreenInfo *screen,
const KdMonitorTiming *t)
{
return TRUE;
}
Bool
fakeScreenInitialize (KdScreenInfo *screen, FakeScrPriv *scrpriv)
{
const KdMonitorTiming *t;
if (!screen->width || !screen->height)
{
screen->width = 1024;

View File

@ -87,7 +87,6 @@ KdCardFuncs fbdevFuncs = {
0, /* initAccel */
0, /* enableAccel */
0, /* syncAccel */
0, /* disableAccel */
0, /* finiAccel */

View File

@ -47,14 +47,13 @@ X Window System is a trademark of The Open Group */
#endif
#include "kdrive.h"
#include "kxv.h"
#include "klinux.h"
#include "i810.h"
#include "agp.h"
#include "i810draw.h"
Bool i810InitVideo(ScreenPtr pScreen);
#ifndef I810_DEBUG
int I810_DEBUG = (0
/* | DEBUG_ALWAYS_SYNC */
@ -137,8 +136,6 @@ i810CardInit (KdCardInfo *card)
{
unsigned long *p;
unsigned char *LinuxGetPciCfg(KdCardAttr *attr);
if (!(p= (unsigned long *) LinuxGetPciCfg(&card->attr)))
return FALSE;

View File

@ -435,6 +435,9 @@ i810PrintErrorState(i810CardInfo *i810c);
void
i810VGAGetIOBase(i810VGAPtr vgap);
Bool
i810InitVideo(ScreenPtr pScreen);
/*
* MMIO versions of the register access functions. These require
* hwp->MemBase to be set in such a way that when the standard VGA port

View File

@ -79,20 +79,23 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810.h"
#include "cursorstr.h"
#define SetupCursor(s) KdScreenPriv(s); \
#define SetupCursor(s) KdScreenPriv(pScreen); \
i810CardInfo(pScreenPriv); \
i810ScreenInfo(pScreenPriv); \
i810Cursor *pCurPriv = &i810s->cursor
static void
writeStandardMMIO(I810CardInfo *i810c, int addr, CARD8 val) {
writeStandardMMIO(I810CardInfo *i810c, int addr, CARD8 val)
{
moutb(addr, val);
}
void
_i810MoveCursor(ScreenPtr pScreen, int x, int y) {
SetupCursor(pScreen);
static void
_i810MoveCursor(ScreenPtr pScreen, int x, int y)
{
KdScreenPriv(pScreen);
i810CardInfo(pScreenPriv);
int flag;
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
@ -128,7 +131,9 @@ static void i810LoadCursor(ScreenPtr pScreen, int x, int y);
static void
i810MoveCursor (ScreenPtr pScreen, int x, int y)
{
SetupCursor (pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
if (!pCurPriv->has_cursor)
return;
@ -142,9 +147,11 @@ i810MoveCursor (ScreenPtr pScreen, int x, int y)
}
static void
_i810SetCursorColors(ScreenPtr pScreen) { /* int bg, int fg */
_i810SetCursorColors(ScreenPtr pScreen)
{
SetupCursor(pScreen);
KdScreenPriv(pScreen);
i810CardInfo(pScreenPriv);
int tmp;
int bg = 0xffffff;
@ -176,12 +183,11 @@ _i810SetCursorColors(ScreenPtr pScreen) { /* int bg, int fg */
v = ((v & 0x0f0f0f0f) << 4) | ((v >> 4) & 0x0f0f0f0f); \
}
static void i810LoadCursor(ScreenPtr pScreen, int x, int y) {
static void i810LoadCursor(ScreenPtr pScreen, int x, int y)
{
SetupCursor(pScreen);
int w, h;
unsigned short r;
int h;
unsigned int *msk, *mskLine, *src, *srcLine;
int i, j;
@ -219,7 +225,7 @@ static void i810LoadCursor(ScreenPtr pScreen, int x, int y) {
for (j = 0; j < I810_CURSOR_WIDTH / 32; j++) {
unsigned long m, s, b1, b2;
unsigned long m, s;
if (i < h && j < src_width)
{
@ -261,9 +267,10 @@ static void i810LoadCursor(ScreenPtr pScreen, int x, int y) {
}
static void
i810UnloadCursor(ScreenPtr pScreen) {
SetupCursor(pScreen);
i810UnloadCursor(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
i810CardInfo(pScreenPriv);
unsigned char tmp;
@ -276,7 +283,9 @@ i810UnloadCursor(ScreenPtr pScreen) {
static Bool
i810RealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
{
SetupCursor(pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
if (!pScreenPriv->enabled)
return TRUE;
@ -304,7 +313,9 @@ i810UnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
static void
i810SetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
SetupCursor(pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
pCurPriv->pCursor = pCursor;
@ -329,7 +340,9 @@ i810QueryBestSize (int class,
unsigned short *pwidth, unsigned short *pheight,
ScreenPtr pScreen)
{
SetupCursor (pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
switch (class)
{
@ -352,8 +365,10 @@ i810QueryBestSize (int class,
Bool
i810CursorInit(ScreenPtr pScreen)
{
SetupCursor(pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810CardInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
if (!i810c->CursorStart) {
pCurPriv->has_cursor = FALSE;
@ -375,7 +390,9 @@ i810CursorInit(ScreenPtr pScreen)
void
i810CursorEnable (ScreenPtr pScreen)
{
SetupCursor (pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
if (pCurPriv->has_cursor)
{
@ -394,7 +411,9 @@ i810CursorEnable (ScreenPtr pScreen)
void
i810CursorDisable (ScreenPtr pScreen)
{
SetupCursor (pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
if (!pScreenPriv->enabled)
return;
@ -411,7 +430,9 @@ i810CursorDisable (ScreenPtr pScreen)
void
i810CursorFini (ScreenPtr pScreen)
{
SetupCursor (pScreen);
KdScreenPriv(pScreen);
i810ScreenInfo(pScreenPriv);
i810Cursor *pCurPriv = &i810s->cursor;
pCurPriv->pCursor = NULL;
}

View File

@ -242,11 +242,13 @@ mgaDoneCopy (void)
mgaWaitIdle();
}
#if 0
static Bool
mgaUploadToScreen(PixmapPtr pDst, char *src, int src_pitch) {
/* fprintf(stderr,"Upload to Screen %p [%d]\n",src,src_pitch); */
return TRUE;
}
#endif
Bool
mgaDrawInit (ScreenPtr pScreen)

View File

@ -1,3 +1,10 @@
2005-06-09 Eric Anholt <anholt@FreeBSD.org>
* neo_draw.c:
* neomagic.c: (neoScreenInit):
Perform a warnings sweep on hw/kdrive. A number of these were my fault,
but some come from others.
2005-06-09 Eric Anholt <anholt@FreeBSD.org>
* neo_draw.c: (neoWaitMarker), (neoDrawInit):

View File

@ -79,10 +79,6 @@ static void neoWaitMarker (ScreenPtr pScreen, int marker)
neoWaitIdle(neoc);
}
static void neoWaitFifo(NeoCardInfo *neoc, int requested_fifo_space)
{
neoWaitIdle( neoc );
}
static Bool neoPrepareSolid(PixmapPtr pPixmap,
int alu,

View File

@ -85,7 +85,6 @@ static Bool
neoScreenInit(KdScreenInfo *screen)
{
NeoScreenInfo *neos;
neoCardInfo(screen);
int screen_size, memory;
neos = xcalloc(sizeof(NeoScreenInfo), 1);

View File

@ -26,6 +26,7 @@
#include <config.h>
#endif
#include "nvidia.h"
#include "kaa.h"
#include <sys/io.h>
static Bool

View File

@ -49,7 +49,7 @@ int partprodPermedia[] = {
-1, -1, -1, -1,
0};
Bool
static Bool
pmMapReg(KdCardInfo *card, PM2CardInfo *pm2c)
{
pm2c->reg_base = (CARD8 *)KdMapDevice(PM2_REG_BASE(card),
@ -64,7 +64,7 @@ pmMapReg(KdCardInfo *card, PM2CardInfo *pm2c)
return TRUE;
}
void
static void
pmUnmapReg(KdCardInfo *card, PM2CardInfo *pm2c)
{
if (pm2c->reg_base) {
@ -78,8 +78,6 @@ pmUnmapReg(KdCardInfo *card, PM2CardInfo *pm2c)
Bool
pmCardInit (KdCardInfo *card)
{
int i;
PM2CardInfo *pm2c;
pm2c = (PM2CardInfo *) xalloc (sizeof (PM2CardInfo));
@ -102,7 +100,7 @@ pmCardInit (KdCardInfo *card)
return TRUE;
}
void
static void
pmCardFini (KdCardInfo *card)
{
PM2CardInfo *pm2c = (PM2CardInfo *) card->driver;
@ -176,7 +174,7 @@ pmScreenInit (KdScreenInfo *screen)
return TRUE;
}
void
static void
pmScreenFini (KdScreenInfo *screen)
{
PM2ScreenInfo *pm2s = (PM2ScreenInfo *) screen->driver;
@ -186,7 +184,7 @@ pmScreenFini (KdScreenInfo *screen)
screen->driver = 0;
}
Bool
static Bool
pmInitScreen (ScreenPtr pScreen)
{
return vesaInitScreen (pScreen);
@ -216,7 +214,7 @@ pmRandRInit (ScreenPtr pScreen)
}
#endif
Bool
static Bool
pmFinishInitScreen (ScreenPtr pScreen)
{
Bool ret;
@ -227,7 +225,7 @@ pmFinishInitScreen (ScreenPtr pScreen)
return ret;
}
void
static void
pmPreserve(KdCardInfo *card)
{
vesaPreserve(card);
@ -236,17 +234,12 @@ pmPreserve(KdCardInfo *card)
static void
pmRestore(KdCardInfo *card)
{
PM2CardInfo *pm2c = card->driver;
vesaRestore (card);
}
Bool
static Bool
pmEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
PM2CardInfo *pm2c = pScreenPriv->card->driver;
if (!vesaEnable (pScreen))
return FALSE;
@ -257,12 +250,9 @@ pmEnable (ScreenPtr pScreen)
return TRUE;
}
void
static void
pmDisable(ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
PM2CardInfo *pm2c = pScreenPriv->card->driver;
#ifdef XV
KdXVDisable (pScreen);
#endif

View File

@ -2,6 +2,7 @@
#include <config.h>
#endif
#include "kdrive.h"
#include "klinux.h"
#include "pm2.h"
@ -16,8 +17,6 @@ InitCard (char *name)
KdCardAttr attr;
int i;
Bool LinuxFindPci(CARD16, CARD16, CARD32, KdCardAttr *);
for (i = 0; i < numPM2Cards; i++)
if (LinuxFindPci (0x3d3d, PM2Cards[i], 0, &attr))
KdCardInfoAdd (&PM2Funcs, &attr, (void *) PM2Cards[i]);

View File

@ -25,6 +25,7 @@
#include <config.h>
#endif
#include "smi.h"
#include "kaa.h"
#include <sys/io.h>
static Bool

View File

@ -38,6 +38,7 @@
#ifdef XV
#include "kxv.h"
#endif
#include "kaa.h"
#ifdef DPMSExtension
#include "dpmsproc.h"

View File

@ -48,7 +48,6 @@ const KdCardFuncs vesaFuncs = {
0, /* initAccel */
0, /* enableAccel */
0, /* syncAccel */
0, /* disableAccel */
0, /* finiAccel */