More non-DRI Linux fixes

This commit is contained in:
dborca
2003-10-11 09:24:18 +00:00
parent ff9b98e56f
commit f44571f658
5 changed files with 1329 additions and 43 deletions

View File

@@ -20,7 +20,6 @@
** $Revision$
** $Date$
*/
#include <conio.h>
#include <stddef.h>
/* [dBorca] */
@@ -29,6 +28,8 @@
#endif
#if defined(__WATCOMC__)
#include <conio.h>
#define _inp inp
#define _outp outp
@@ -40,6 +41,15 @@
#endif
#ifdef __linux__
#define _inp pioInByte
#define _outp pioOutByte
#define _inpw pioInWord
#define _outpw pioOutWord
#define _inpd pioInLong
#define _outpd pioOutLong
#endif
#define SSTIOADDR(regName) ((FxU16)offsetof(SstIORegs, regName))

View File

@@ -76,7 +76,6 @@
do { \
FILE *dbg = fopen("debug.txt","a"); \
fprintf x ; \
fflush(dbg); \
fclose(dbg); \
} while(0);
#endif
@@ -173,42 +172,7 @@ resetVideo( void )
} /* resetVideo */
#include <conio.h>
/* Snarfed from h3cinitdd.h */
#if defined(__WATCOMC__)
#define _inp inp
#define _outp outp
#define _inpw inpw
#define _outpw outpw
#define _inpd inpd
#define _outpd outpd
#endif
#define SSTIOADDR(regName) ((FxU16)offsetof(SstIORegs, regName))
#define ISET32(addr, value) _outpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))), value)
#define IGET32(addr) _inpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))))
#define ISET8PHYS(a,b) {\
FxU16 port = (FxU16) (regBase) + (FxU16) (a);\
GDBG_INFO(120, "OUT8: Port 0x%x Value 0x%x\n", port, b);\
_outp(port, (FxU8) (b));}
#define ISET16PHYS(a,b) {\
FxU16 port = (FxU16)(regBase) + (FxU16)(a);\
GDBG_INFO(120, "OUT16: Port 0x%x Value 0x%x\n", port, b);\
_outpw(port, (FxU16) (b));}
#define IGET8PHYS(a) _inp((FxU16) ((FxU16) (regBase) + (FxU16) (a)))
#define IGET16PHYS(a) _inpw((FxU16) ((FxU16) (regBase) + (FxU16)(a)))
#define CHECKFORROOM while (! (_inp((FxU16) regBase) & (FxU16)(0x3f)))
#include "h3cinitdd.h"
#define CFG_READ(_chip, _offset) \
hwcReadConfigRegister(bInfo, _chip, offsetof(SstPCIConfigRegs, _offset))

File diff suppressed because it is too large Load Diff

View File

@@ -1835,11 +1835,11 @@ hwcInit(FxU32 vID, FxU32 dID)
}
/* Evilness. Try to auto-detect how many chips we have by trying to
* read the vendor/deviceID register back from chips 1 through 3. */
* read the vendor/deviceID register back from chips 1 through 3.
* [dBorca] Hack alert: fails badly on bare Linux */
if(IS_NAPALM(hInfo.boardInfo[i].pciInfo.deviceID)) {
FxU32 device_vendor;
#if !(GLIDE_PLATFORM & GLIDE_OS_UNIX) /* [dBorca] Hack alert: TODO bare Linux SLI */
/* Detect two-chip board */
device_vendor = hwcReadConfigRegister(&hInfo.boardInfo[i], 1, offsetof(SstPCIConfigRegs, deviceID_vendorID));
if((device_vendor & 0xFFFF) == 0x121a && (IS_NAPALM((device_vendor >> 16)))) {
@@ -1866,7 +1866,6 @@ hwcInit(FxU32 vID, FxU32 dID)
hInfo.boardInfo[i].pciInfo.pciBaseAddr[(chip << 2) + 2] =
hwcReadConfigRegister(&hInfo.boardInfo[i], chip, offsetof(SstPCIConfigRegs, ioBaseAddr));
}
#endif
}
// Save realNumChips
@@ -6906,7 +6905,12 @@ FxU32 hwcAAReadRegion16(hwcBoardInfo *bInfo, FxU32 colBufNum,
/* Gamma table */
FxU32 gss_red[256], gss_green[256], gss_blue[256], gss_red_shifted[256];
/*ZZZ*/FxU32 _gss_red[256], _gss_green[256], _gss_blue[256], _gss_red_shifted[256];
#if (GLIDE_PLATFORM & GLIDE_OS_UNIX)
/* [dBorca] ZZZ
* ugly hack to allow bare Linux compilation. Revise this ASAP!!!
*/
FxU32 _gss_red[256], _gss_green[256], _gss_blue[256], _gss_red_shifted[256];
#endif
static void hwcCopyBuffer8888Flipped(hwcBoardInfo *bInfo, FxU16 *source, int w, int h, FxU8 *dst, int aaShift)
{

View File

@@ -331,6 +331,8 @@ fxbldno: $(FXBLDNO:.h=.c)
###############################################################################
clean:
-$(RM) $(FX_GLIDE_HW)/cinit/*.o
-$(RM) $(FX_GLIDE_HW)/cinit/*.lo
-$(RM) $(FX_GLIDE_HW)/glide3/src/*.o
-$(RM) $(FX_GLIDE_HW)/glide3/src/*.lo
-$(RM) $(FX_GLIDE_HW)/minihwc/*.o