From 356cc4497aa6a584a2fe3f52fb09042fea7444a8 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 7 Mar 2008 16:34:48 -0300 Subject: [PATCH] Compilation warning fixes. Added ifndef/endif to some header files to allow multiple inclusion (and the header files are clearly not intended for multiple inclusion, i.e. redefining macros and including again). The only non static function declared in a source file now is G80GetScrnInfoRec in g80_driver.c, as there isn't a clear header file to declare it, and including nv_proto.h could define/declare more things then is expected. --- src/g80_cursor.h | 6 ++++++ src/g80_display.h | 9 +++++++++ src/g80_dma.h | 5 +++++ src/g80_driver.c | 3 +++ src/g80_exa.c | 1 + src/g80_exa.h | 5 +++++ src/g80_output.h | 7 +++++++ src/g80_type.h | 5 +++++ src/g80_xaa.h | 5 +++++ src/nv_dma.h | 5 +++++ src/nv_driver.c | 13 ++++++------- src/riva_proto.h | 2 ++ 12 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/g80_cursor.h b/src/g80_cursor.h index 4d81d80..4f9ec8d 100644 --- a/src/g80_cursor.h +++ b/src/g80_cursor.h @@ -1,3 +1,7 @@ + +#ifndef _g80_cursor_h +#define _g80_cursor_h + Bool G80CursorInit(ScreenPtr); Bool G80CursorAcquire(ScrnInfoPtr); void G80CursorRelease(ScrnInfoPtr); @@ -5,3 +9,5 @@ void G80CursorRelease(ScrnInfoPtr); /* CRTC cursor functions */ void G80SetCursorPosition(xf86CrtcPtr crtc, int x, int y); void G80LoadCursorARGB(xf86CrtcPtr crtc, CARD32 *src); + +#endif /* _g80_cursor_h */ diff --git a/src/g80_display.h b/src/g80_display.h index 2031fed..30a6cab 100644 --- a/src/g80_display.h +++ b/src/g80_display.h @@ -1,3 +1,6 @@ +#ifndef _g80_display_h +#define _g80_display_h + enum G80ScaleMode { G80_SCALE_OFF, G80_SCALE_ASPECT, @@ -14,6 +17,10 @@ void G80DispCommand(ScrnInfoPtr, CARD32 addr, CARD32 data); Head G80CrtcGetHead(xf86CrtcPtr); +void G80CrtcDPMSSet(xf86CrtcPtr crtc, int mode); +void G80CrtcShowCursor(xf86CrtcPtr crtc); +void G80CrtcHideCursor(xf86CrtcPtr crtc); + void G80CrtcDoModeFixup(DisplayModePtr dst, const DisplayModePtr src); void G80CrtcBlankScreen(xf86CrtcPtr, Bool blank); void G80CrtcEnableCursor(xf86CrtcPtr, Bool update); @@ -24,3 +31,5 @@ void G80CrtcSetDither(xf86CrtcPtr, Bool dither, Bool update); void G80CrtcSetScale(xf86CrtcPtr, DisplayModePtr, enum G80ScaleMode); void G80DispCreateCrtcs(ScrnInfoPtr pScrn); + +#endif /* _g80_display_h */ diff --git a/src/g80_dma.h b/src/g80_dma.h index 52031da..7d41306 100644 --- a/src/g80_dma.h +++ b/src/g80_dma.h @@ -1,3 +1,6 @@ +#ifndef _g80_dma_h +#define _g80_dma_h + #define SKIPS 8 #define G80DmaNext(pNv, data) \ @@ -12,3 +15,5 @@ void G80DmaKickoff(G80Ptr pNv); void G80DmaWait(G80Ptr pNv, int size); + +#endif /* _g80_dma_h */ diff --git a/src/g80_driver.c b/src/g80_driver.c index 7223f56..ff92f7e 100644 --- a/src/g80_driver.c +++ b/src/g80_driver.c @@ -116,6 +116,9 @@ static const OptionInfoRec G80Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; +Bool G80GetScrnInfoRec(PciChipsets *chips, int chip); + + static Bool G80GetRec(ScrnInfoPtr pScrn) { diff --git a/src/g80_exa.c b/src/g80_exa.c index 96dbc21..1017284 100644 --- a/src/g80_exa.c +++ b/src/g80_exa.c @@ -29,6 +29,7 @@ #include "g80_type.h" #include "g80_dma.h" #include "g80_xaa.h" +#include "g80_exa.h" static void waitMarker(ScreenPtr pScreen, int marker) diff --git a/src/g80_exa.h b/src/g80_exa.h index 2f01af6..1601374 100644 --- a/src/g80_exa.h +++ b/src/g80_exa.h @@ -1 +1,6 @@ +#ifndef _g80_exa_h +#define _g80_exa_h + Bool G80ExaInit(ScreenPtr pScreen, ScrnInfoPtr pScrn); + +#endif /* _g80_exa_h */ diff --git a/src/g80_output.h b/src/g80_output.h index 33514c6..f2ee26e 100644 --- a/src/g80_output.h +++ b/src/g80_output.h @@ -1,3 +1,6 @@ +#ifndef _g80_output_h +#define _g80_output_h + typedef struct G80OutputPrivRec { ORType type; ORNum or; @@ -14,6 +17,8 @@ typedef struct G80OutputPrivRec { } G80OutputPrivRec, *G80OutputPrivPtr; void G80OutputSetPClk(xf86OutputPtr, int pclk); +Bool G80DacModeFixup(xf86OutputPtr output, DisplayModePtr mode, + DisplayModePtr adjusted_mode); int G80OutputModeValid(xf86OutputPtr, DisplayModePtr); void G80OutputPrepare(xf86OutputPtr); void G80OutputCommit(xf86OutputPtr); @@ -29,3 +34,5 @@ Bool G80DacLoadDetect(xf86OutputPtr); /* g80_sor.c */ xf86OutputPtr G80CreateSor(ScrnInfoPtr, ORNum, PanelType); + +#endif /* _g80_output_h */ diff --git a/src/g80_type.h b/src/g80_type.h index 5f4ee08..fd7fecc 100644 --- a/src/g80_type.h +++ b/src/g80_type.h @@ -1,3 +1,6 @@ +#ifndef _g80_types_h +#define _g80_types_h + #include #include #include @@ -89,3 +92,5 @@ typedef struct G80Rec { } G80Rec, *G80Ptr; #define G80PTR(p) ((G80Ptr)((p)->driverPrivate)) + +#endif /* _g80_types_h */ diff --git a/src/g80_xaa.h b/src/g80_xaa.h index 6c1d765..c2aaf54 100644 --- a/src/g80_xaa.h +++ b/src/g80_xaa.h @@ -1,6 +1,11 @@ +#ifndef _g80_xaa_h +#define _g80_xaa_h + void G80Sync(ScrnInfoPtr pScrn); void G80DMAKickoffCallback(ScrnInfoPtr pScrn); void G80SetPattern(G80Ptr pNv, int bg, int fg, int pat0, int pat1); void G80SetRopSolid(G80Ptr pNv, CARD32 rop, CARD32 planemask); void G80SetClip(G80Ptr pNv, int x, int y, int w, int h); Bool G80XAAInit(ScreenPtr); + +#endif /* _g80_xaa_h */ diff --git a/src/nv_dma.h b/src/nv_dma.h index 150918a..dd7529b 100644 --- a/src/nv_dma.h +++ b/src/nv_dma.h @@ -38,6 +38,9 @@ |* *| \***************************************************************************/ +#ifndef _NV_DMA_H +#define _NV_DMA_H + #define SURFACE_FORMAT 0x00000300 #define SURFACE_FORMAT_DEPTH8 0x00000001 #define SURFACE_FORMAT_DEPTH15 0x00000002 @@ -182,3 +185,5 @@ #define STRETCH_BLIT_SRC_POINT 0x0000E40C #define STRETCH_BLIT_SRC_POINT_U 15:0 #define STRETCH_BLIT_SRC_POINT_V 31:16 + +#endif /* _NV_DMA_H */ diff --git a/src/nv_driver.c b/src/nv_driver.c index e151bb4..2e60ee3 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -28,14 +28,11 @@ */ #include "nv_include.h" +#include "riva_proto.h" #include "xf86int10.h" #include "vbeModes.h" -const OptionInfoRec * RivaAvailableOptions(int chipid, int busid); -Bool RivaGetScrnInfoRec(PciChipsets *chips, int chip); -Bool G80GetScrnInfoRec(PciChipsets *chips, int chip); - /* * Forward definitions for the functions that make up the driver. */ @@ -76,6 +73,8 @@ static void NVRestore(ScrnInfoPtr pScrn); static Bool NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static Bool NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode); +static Bool NVSwitchModeVBE(int scrnIndex, DisplayModePtr mode, int flags); + #if XSERVER_LIBPCIACCESS /* For now, just match any NVIDIA PCI device and sort through them in the probe * routine */ @@ -821,11 +820,11 @@ NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data) if(name) xf86DrvMsg(0, X_WARNING, NV_NAME ": Ignoring unsupported device 0x%x (%s) at %2.2x@%2.2x:%2.2x:%1.1x\n", - id, name, dev->bus, dev->domain, dev->dev, dev->func); + (unsigned int)id, name, dev->bus, dev->domain, dev->dev, dev->func); else xf86DrvMsg(0, X_WARNING, NV_NAME ": Ignoring unsupported device 0x%x at %2.2x@%2.2x:%2.2x:%1.1x\n", - id, dev->bus, dev->domain, dev->dev, dev->func); + (unsigned int)id, dev->bus, dev->domain, dev->dev, dev->func); return FALSE; } @@ -952,7 +951,7 @@ NVSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) return NVModeInit(pScrn, mode); } -Bool +static Bool NVSwitchModeVBE(int scrnIndex, DisplayModePtr mode, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; diff --git a/src/riva_proto.h b/src/riva_proto.h index e9d7261..80afc7e 100644 --- a/src/riva_proto.h +++ b/src/riva_proto.h @@ -34,5 +34,7 @@ void RivaResetGraphics(ScrnInfoPtr pScrn); /* in riva_dga.c */ Bool RivaDGAInit(ScreenPtr pScreen); +/* in g80_driver.c */ +Bool G80GetScrnInfoRec(PciChipsets *chips, int chip); #endif /* __RIVA_PROTO_H__ */ -- 1.5.4.3