diff options
author | Dave Airlie <airlied@linux.ie> | 2006-06-15 19:58:11 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-06-15 19:58:11 +1000 |
commit | 58c6aac0669101481ef6b8217e5cede4573ece42 (patch) | |
tree | 2bd460798145d334202cdee1e045d6a78f66de70 | |
parent | b7a3e4c9b33f72ae447f99c0c765f24fce988142 (diff) |
theatre: fix all -Wall warnings in theatre*
This fixes all the warnings, it doesn't clean up the horrible mess that is
theatre*.[ch].
-rw-r--r-- | src/theatre.c | 19 | ||||
-rw-r--r-- | src/theatre200.c | 54 | ||||
-rw-r--r-- | src/theatre200.h | 16 | ||||
-rw-r--r-- | src/theatre_detect.c | 18 |
4 files changed, 52 insertions, 55 deletions
diff --git a/src/theatre.c b/src/theatre.c index 7008ca3a..0a635fa7 100644 --- a/src/theatre.c +++ b/src/theatre.c @@ -2,6 +2,7 @@ #include "config.h" #endif +#include <unistd.h> #include "xf86.h" #include "generic_bus.h" #include "theatre.h" @@ -1795,7 +1796,7 @@ void RT_SetConnector (TheatrePtr t, CARD16 wConnector, int tunerFlag) counter++; } dwTempContrast = ReadRT_fld (fld_LP_CONTRAST); - if(counter>=10000)xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Rage Theatre: timeout waiting for line count (%d)\n", ReadRT_fld (fld_VS_LINE_COUNT)); + if(counter>=10000)xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Rage Theatre: timeout waiting for line count (%ld)\n", ReadRT_fld (fld_VS_LINE_COUNT)); WriteRT_fld (fld_LP_CONTRAST, 0x0); @@ -1850,7 +1851,7 @@ void RT_SetConnector (TheatrePtr t, CARD16 wConnector, int tunerFlag) counter++; } WriteRT_fld (fld_LP_CONTRAST, dwTempContrast); - if(counter>=10000)xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Rage Theatre: timeout waiting for line count (%d)\n", ReadRT_fld (fld_VS_LINE_COUNT)); + if(counter>=10000)xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Rage Theatre: timeout waiting for line count (%ld)\n", ReadRT_fld (fld_VS_LINE_COUNT)); @@ -1941,7 +1942,7 @@ void DumpRageTheatreRegs(TheatrePtr t) for(i=0;i<0x900;i+=4) { RT_regr(i, &data); - xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register 0x%04x is equal to 0x%08x\n", i, data); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register 0x%04x is equal to 0x%08lx\n", i, data); } } @@ -2141,21 +2142,18 @@ void DumpRageTheatreRegsByName(TheatrePtr t) { "Y_FALL_CNTL ", 0x01cc }, { "Y_RISE_CNTL ", 0x01d0 }, { "Y_SAW_TOOTH_CNTL ", 0x01d4 }, - {NULL, NULL} + {NULL, 0} }; for(i=0; rt_reg_list[i].name!=NULL;i++){ RT_regr(rt_reg_list[i].addr, &data); - xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register (0x%04x) %s is equal to 0x%08x\n", rt_reg_list[i].addr, rt_reg_list[i].name, data); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register (0x%04lx) %s is equal to 0x%08lx\n", rt_reg_list[i].addr, rt_reg_list[i].name, data); } } void ResetTheatreRegsForNoTVout(TheatrePtr t) { - int i; - CARD32 data; - RT_regw(VIP_CLKOUT_CNTL, 0x0); RT_regw(VIP_HCOUNT, 0x0); RT_regw(VIP_VCOUNT, 0x0); @@ -2170,9 +2168,6 @@ void ResetTheatreRegsForNoTVout(TheatrePtr t) void ResetTheatreRegsForTVout(TheatrePtr t) { - int i; - CARD32 data; - /* RT_regw(VIP_HW_DEBUG, 0x200); */ /* RT_regw(VIP_INT_CNTL, 0x0); RT_regw(VIP_GPIO_INOUT, 0x10090000); @@ -2187,7 +2182,7 @@ void ResetTheatreRegsForTVout(TheatrePtr t) RT_regw(VIP_VCOUNT, 0x151); #endif RT_regw(VIP_DFCOUNT, 0x01); -/* RT_regw(VIP_CLOCK_SEL_CNTL, 0xb7); /* versus 0x237 <-> 0x2b7 */ +/* RT_regw(VIP_CLOCK_SEL_CNTL, 0xb7); versus 0x237 <-> 0x2b7 */ RT_regw(VIP_CLOCK_SEL_CNTL, 0x2b7); /* versus 0x237 <-> 0x2b7 */ RT_regw(VIP_VIN_PLL_CNTL, 0x60a6039); /* RT_regw(VIP_PLL_CNTL1, 0xacacac74); */ diff --git a/src/theatre200.c b/src/theatre200.c index eb5139cb..4b648845 100644 --- a/src/theatre200.c +++ b/src/theatre200.c @@ -30,7 +30,7 @@ * wrapped libc symbols to use libc symbols directly. The xf86* * versions aren't supposed to be used directly. * - * * src/*.c: Drop libc wrapper; don't include xf86_ansic.h and add + * * src/ *.c: Drop libc wrapper; don't include xf86_ansic.h and add * includes now missing. * * Revision 1.4 2005/08/28 18:00:23 bogdand @@ -50,6 +50,7 @@ #endif #include <stdio.h> +#include <string.h> #include "xf86.h" #include "generic_bus.h" @@ -73,24 +74,24 @@ static int dsp_load(TheatrePtr t, struct rt200_microc_data* microc_datap); static CARD32 dsp_send_command(TheatrePtr t, CARD32 fb_scratch1, CARD32 fb_scratch0); static CARD32 dsp_set_video_input_connector(TheatrePtr t, CARD32 connector); -static CARD32 dsp_reset(TheatrePtr t); +//static CARD32 dsp_reset(TheatrePtr t); static CARD32 dsp_set_lowpowerstate(TheatrePtr t, CARD32 pstate); static CARD32 dsp_set_video_standard(TheatrePtr t, CARD32 standard); static CARD32 dsp_set_videostreamformat(TheatrePtr t, CARD32 format); static CARD32 dsp_video_standard_detection(TheatrePtr t); -static CARD32 dsp_get_signallockstatus(TheatrePtr t); -static CARD32 dsp_get_signallinenumber(TheatrePtr t); +//static CARD32 dsp_get_signallockstatus(TheatrePtr t); +//static CARD32 dsp_get_signallinenumber(TheatrePtr t); static CARD32 dsp_set_brightness(TheatrePtr t, CARD8 brightness); static CARD32 dsp_set_contrast(TheatrePtr t, CARD8 contrast); -static CARD32 dsp_set_sharpness(TheatrePtr t, int sharpness); +//static CARD32 dsp_set_sharpness(TheatrePtr t, int sharpness); static CARD32 dsp_set_tint(TheatrePtr t, CARD8 tint); static CARD32 dsp_set_saturation(TheatrePtr t, CARD8 saturation); static CARD32 dsp_set_video_scaler_horizontal(TheatrePtr t, CARD16 output_width, CARD16 horz_start, CARD16 horz_end); static CARD32 dsp_set_video_scaler_vertical(TheatrePtr t, CARD16 output_height, CARD16 vert_start, CARD16 vert_end); static CARD32 dsp_audio_mute(TheatrePtr t, CARD8 left, CARD8 right); static CARD32 dsp_set_audio_volume(TheatrePtr t, CARD8 left, CARD8 right, CARD8 auto_mute); -static CARD32 dsp_audio_detection(TheatrePtr t, CARD8 option); +//static CARD32 dsp_audio_detection(TheatrePtr t, CARD8 option); static CARD32 dsp_configure_i2s_port(TheatrePtr t, CARD8 tx_mode, CARD8 rx_mode, CARD8 clk_mode); static CARD32 dsp_configure_spdif_port(TheatrePtr t, CARD8 state); @@ -375,12 +376,8 @@ static int dsp_load(TheatrePtr t, struct rt200_microc_data* microc_datap) CARD32 tries = 0; CARD32 result = 0; CARD32 seg_id = 0; - int screen = t->VIP->scrnIndex; - ScrnInfoPtr pScrn = xf86Screens[t->VIP->scrnIndex]; - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - + DEBUG("Microcode: before everything: %x\n", data8); if (RT_fifor(0x000, &data8)) @@ -630,6 +627,7 @@ static CARD32 dsp_set_video_input_connector(TheatrePtr t, CARD32 connector) return result; } +#if 0 static CARD32 dsp_reset(TheatrePtr t) { CARD32 fb_scratch0 = 0; @@ -644,6 +642,7 @@ static CARD32 dsp_reset(TheatrePtr t) return result; } +#endif static CARD32 dsp_set_lowpowerstate(TheatrePtr t, CARD32 pstate) { @@ -704,6 +703,7 @@ static CARD32 dsp_video_standard_detection(TheatrePtr t) return result; } +#if 0 static CARD32 dsp_get_signallockstatus(TheatrePtr t) { CARD32 fb_scratch1 = 0; @@ -737,6 +737,7 @@ static CARD32 dsp_get_signallinenumber(TheatrePtr t) return result; } +#endif static CARD32 dsp_set_brightness(TheatrePtr t, CARD8 brightness) { @@ -770,6 +771,7 @@ static CARD32 dsp_set_contrast(TheatrePtr t, CARD8 contrast) return result; } +#if 0 static CARD32 dsp_set_sharpness(TheatrePtr t, int sharpness) { CARD32 fb_scratch1 = 0; @@ -785,6 +787,7 @@ static CARD32 dsp_set_sharpness(TheatrePtr t, int sharpness) return result; } +#endif static CARD32 dsp_set_tint(TheatrePtr t, CARD8 tint) { @@ -884,6 +887,7 @@ static CARD32 dsp_set_audio_volume(TheatrePtr t, CARD8 left, CARD8 right, CARD8 return result; } +#if 0 static CARD32 dsp_audio_detection(TheatrePtr t, CARD8 option) { CARD32 fb_scratch1 = 0; @@ -899,6 +903,7 @@ static CARD32 dsp_audio_detection(TheatrePtr t, CARD8 option) return result; } +#endif static CARD32 dsp_configure_i2s_port(TheatrePtr t, CARD8 tx_mode, CARD8 rx_mode, CARD8 clk_mode) { @@ -1452,6 +1457,7 @@ static void WriteRT_fld1 (TheatrePtr t, CARD32 dwReg, CARD32 dwData) } /* WriteRT_fld ()... */ +#if 0 /**************************************************************************** * ReadRT_fld (CARD32 dwReg) * * Function: Reads a register field within Rage Theatre * @@ -1475,8 +1481,10 @@ static CARD32 ReadRT_fld1 (TheatrePtr t,CARD32 dwReg) } /* ReadRT_fld ()... */ -#define WriteRT_fld(a,b) WriteRT_fld1(t, (a), (b)) #define ReadRT_fld(a) ReadRT_fld1(t,(a)) +#endif + +#define WriteRT_fld(a,b) WriteRT_fld1(t, (a), (b)) /**************************************************************************** @@ -1792,10 +1800,10 @@ void RT_SetConnector (TheatrePtr t, CARD16 wConnector, int tunerFlag) t->wConnector = wConnector; theatre_read(t, VIP_GPIO_CNTL, &data); - xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_CNTL: %x\n", data); + xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_CNTL: %lx\n", data); theatre_read(t, VIP_GPIO_INOUT, &data); - xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_INOUT: %x\n", data); + xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_INOUT: %lx\n", data); switch (wConnector) { @@ -1844,10 +1852,10 @@ void RT_SetConnector (TheatrePtr t, CARD16 wConnector, int tunerFlag) } theatre_read(t, VIP_GPIO_CNTL, &data); - xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_CNTL: %x\n", data); + xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_CNTL: %lx\n", data); theatre_read(t, VIP_GPIO_INOUT, &data); - xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_INOUT: %x\n", data); + xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"VIP_GPIO_INOUT: %lx\n", data); dsp_configure_i2s_port(t, 0, 0, 0); @@ -2000,7 +2008,7 @@ void DumpRageTheatreRegs(TheatrePtr t) for(i=0;i<0x900;i+=4) { RT_regr(i, &data); - xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register 0x%04x is equal to 0x%08x\n", i, data); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register 0x%04x is equal to 0x%08lx\n", i, data); } } @@ -2200,21 +2208,18 @@ void DumpRageTheatreRegsByName(TheatrePtr t) { "Y_FALL_CNTL ", 0x01cc }, { "Y_RISE_CNTL ", 0x01d0 }, { "Y_SAW_TOOTH_CNTL ", 0x01d4 }, - {NULL, NULL} + {NULL, 0} }; for(i=0; rt_reg_list[i].name!=NULL;i++){ RT_regr(rt_reg_list[i].addr, &data); - xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register (0x%04x) %s is equal to 0x%08x\n", rt_reg_list[i].addr, rt_reg_list[i].name, data); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "register (0x%04lx) %s is equal to 0x%08lx\n", rt_reg_list[i].addr, rt_reg_list[i].name, data); } } void ResetTheatreRegsForNoTVout(TheatrePtr t) { - int i; - CARD32 data; - RT_regw(VIP_CLKOUT_CNTL, 0x0); RT_regw(VIP_HCOUNT, 0x0); RT_regw(VIP_VCOUNT, 0x0); @@ -2229,9 +2234,6 @@ void ResetTheatreRegsForNoTVout(TheatrePtr t) void ResetTheatreRegsForTVout(TheatrePtr t) { - int i; - CARD32 data; - /* RT_regw(VIP_HW_DEBUG, 0x200); */ /* RT_regw(VIP_INT_CNTL, 0x0); RT_regw(VIP_GPIO_INOUT, 0x10090000); @@ -2246,7 +2248,7 @@ void ResetTheatreRegsForTVout(TheatrePtr t) RT_regw(VIP_VCOUNT, 0x151); #endif RT_regw(VIP_DFCOUNT, 0x01); -/* RT_regw(VIP_CLOCK_SEL_CNTL, 0xb7); /* versus 0x237 <-> 0x2b7 */ +/* RT_regw(VIP_CLOCK_SEL_CNTL, 0xb7); versus 0x237 <-> 0x2b7 */ RT_regw(VIP_CLOCK_SEL_CNTL, 0x2b7); /* versus 0x237 <-> 0x2b7 */ RT_regw(VIP_VIN_PLL_CNTL, 0x60a6039); /* RT_regw(VIP_PLL_CNTL1, 0xacacac74); */ diff --git a/src/theatre200.h b/src/theatre200.h index 9af18086..9602a159 100644 --- a/src/theatre200.h +++ b/src/theatre200.h @@ -62,14 +62,14 @@ #define ERROR_3(str,param1,param2,param3) xf86DrvMsg(screen, X_ERROR, str, param1, param2, param3) #define DEBUG_3(str,param1,param2,param3) xf86DrvMsg(screen, X_INFO, str, param1, param2, param3) #else -#define ERROR_0(str) -#define DEBUG_0(str) -#define ERROR(str,param1) -#define DEBUG(str,param1) -#define ERROR_2(str,param1,param2) -#define DEBUG_2(str,param1,param2) -#define ERROR_3(str,param1,param2,param3) -#define DEBUG_3(str,param1,param2,param3) +#define ERROR_0(str) (void)screen +#define DEBUG_0(str) (void)screen +#define ERROR(str,param1) (void)screen +#define DEBUG(str,param1) (void)screen +#define ERROR_2(str,param1,param2) (void)screen +#define DEBUG_2(str,param1,param2) (void)screen +#define ERROR_3(str,param1,param2,param3) (void)screen +#define DEBUG_3(str,param1,param2,param3) (void)screen #endif diff --git a/src/theatre_detect.c b/src/theatre_detect.c index 7d299848..4836db88 100644 --- a/src/theatre_detect.c +++ b/src/theatre_detect.c @@ -39,29 +39,29 @@ #include "config.h" #endif +#include <string.h> #include "xf86.h" #include "generic_bus.h" #include "theatre.h" #include "theatre_reg.h" -#undef read -#undef write -#undef ioctl - static Bool theatre_read(TheatrePtr t,CARD32 reg, CARD32 *data) { if(t->theatre_num<0)return FALSE; return t->VIP->read(t->VIP, ((t->theatre_num & 0x3)<<14) | reg,4, (CARD8 *) data); } +/* Unused code - reference */ +#if 0 static Bool theatre_write(TheatrePtr t,CARD32 reg, CARD32 data) { if(t->theatre_num<0)return FALSE; return t->VIP->write(t->VIP,((t->theatre_num & 0x03)<<14) | reg,4, (CARD8 *) &data); } +#define RT_regw(reg,data) theatre_write(t,(reg),(data)) +#endif #define RT_regr(reg,data) theatre_read(t,(reg),(data)) -#define RT_regw(reg,data) theatre_write(t,(reg),(data)) #define VIP_TYPE "ATI VIP BUS" @@ -89,7 +89,7 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b) { if(b->read(b, ((i & 0x03)<<14) | VIP_VIP_VENDOR_DEVICE_ID, 4, (CARD8 *)&val)) { - if(val)xf86DrvMsg(b->scrnIndex, X_INFO, "Device %d on VIP bus ids as 0x%08x\n",i,val); + if(val)xf86DrvMsg(b->scrnIndex, X_INFO, "Device %ld on VIP bus ids as 0x%08lx\n",i,val); if(t->theatre_num>=0)continue; /* already found one instance */ switch(val){ case RT100_ATI_ID: @@ -102,10 +102,10 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b) break; } } else { - xf86DrvMsg(b->scrnIndex, X_INFO, "No response from device %d on VIP bus\n",i); + xf86DrvMsg(b->scrnIndex, X_INFO, "No response from device %ld on VIP bus\n",i); } } - if(t->theatre_num>=0)xf86DrvMsg(b->scrnIndex, X_INFO, "Detected Rage Theatre as device %d on VIP bus with id 0x%08x\n",t->theatre_num,t->theatre_id); + if(t->theatre_num>=0)xf86DrvMsg(b->scrnIndex, X_INFO, "Detected Rage Theatre as device %d on VIP bus with id 0x%08lx\n",t->theatre_num,t->theatre_id); if(t->theatre_num < 0) { @@ -114,7 +114,7 @@ TheatrePtr DetectTheatre(GENERIC_BUS_Ptr b) } RT_regr(VIP_VIP_REVISION_ID, &val); - xf86DrvMsg(b->scrnIndex, X_INFO, "Detected Rage Theatre revision %8.8X\n", val); + xf86DrvMsg(b->scrnIndex, X_INFO, "Detected Rage Theatre revision %8.8lX\n", val); #if 0 DumpRageTheatreRegsByName(t); |