Index: theatre200.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/theatre200.c,v
retrieving revision 1.4
diff -u -3 -p -r1.4 theatre200.c
--- theatre200.c	28 Aug 2005 18:00:23 -0000	1.4
+++ theatre200.c	7 Nov 2005 05:51:49 -0000
@@ -138,11 +138,11 @@ static int microc_load (char* micro_path
 	{
 		if (xf86fread(microc_headp, sizeof(struct rt200_microc_head), 1, file) != 1)
 		{
-			ERROR("Cannot read header from file: %s\n", micro_path);
+			ERROR1("Cannot read header from file: %s\n", micro_path);
 			goto fail_exit;
 		}
 
-		DEBUG("Microcode: num_seg: %x\n", microc_headp->num_seg);
+		DEBUG1("Microcode: num_seg: %x\n", microc_headp->num_seg);
 
 		if (microc_headp->num_seg == 0)
 			goto fail_exit;
@@ -163,7 +163,7 @@ static int microc_load (char* micro_path
 			ret += xf86fread(&curr_seg->crc_val, 4, 1, file);
 			if (ret != 3)
 			{
-				ERROR("Cannot read segment from microcode file: %s\n", micro_path);
+				ERROR1("Cannot read segment from microcode file: %s\n", micro_path);
 				goto fail_exit;
 			}
 
@@ -174,10 +174,10 @@ static int microc_load (char* micro_path
 				goto fail_exit;
 			}
 
-			DEBUG("Microcode: segment number: %x\n", i);
-			DEBUG("Microcode: curr_seg->num_bytes: %x\n", curr_seg->num_bytes);
-			DEBUG("Microcode: curr_seg->download_dst: %x\n", curr_seg->download_dst);
-			DEBUG("Microcode: curr_seg->crc_val: %x\n", curr_seg->crc_val);
+			DEBUG1("Microcode: segment number: %x\n", i);
+			DEBUG1("Microcode: curr_seg->num_bytes: %x\n", curr_seg->num_bytes);
+			DEBUG1("Microcode: curr_seg->download_dst: %x\n", curr_seg->download_dst);
+			DEBUG1("Microcode: curr_seg->crc_val: %x\n", curr_seg->crc_val);
 
 			if (seg_list)
 			{
@@ -219,11 +219,11 @@ static int microc_load (char* micro_path
 		}
 		else
 		{
-			ERROR("Cannot read header from file: %s\n", micro_path);
+			ERROR1("Cannot read header from file: %s\n", micro_path);
 			goto fail_exit;
 		}
 
-		DEBUG("Microcode: num_seg: %x\n", microc_headp->num_seg);
+		DEBUG1("Microcode: num_seg: %x\n", microc_headp->num_seg);
 
 		if (microc_headp->num_seg == 0)
 			goto fail_exit;
@@ -247,7 +247,7 @@ static int microc_load (char* micro_path
 			}
 			else
 			{
-				ERROR("Cannot read segment from microcode file: %s\n", micro_path);
+				ERROR1("Cannot read segment from microcode file: %s\n", micro_path);
 				goto fail_exit;
 			}
 								
@@ -258,10 +258,10 @@ static int microc_load (char* micro_path
 				goto fail_exit;
 			}
 
-			DEBUG("Microcode: segment number: %x\n", i);
-			DEBUG("Microcode: curr_seg->num_bytes: %x\n", curr_seg->num_bytes);
-			DEBUG("Microcode: curr_seg->download_dst: %x\n", curr_seg->download_dst);
-			DEBUG("Microcode: curr_seg->crc_val: %x\n", curr_seg->crc_val);
+			DEBUG1("Microcode: segment number: %x\n", i);
+			DEBUG1("Microcode: curr_seg->num_bytes: %x\n", curr_seg->num_bytes);
+			DEBUG1("Microcode: curr_seg->download_dst: %x\n", curr_seg->download_dst);
+			DEBUG1("Microcode: curr_seg->crc_val: %x\n", curr_seg->crc_val);
 
 			if (seg_list)
 			{
@@ -295,7 +295,7 @@ static int microc_load (char* micro_path
 	}
 	else
 	{
-		ERROR("File type %s unknown\n", micro_type);
+		ERROR1("File type %s unknown\n", micro_type);
 	}
 
 	microc_datap->microc_seg_list = seg_list;
@@ -370,10 +370,10 @@ static int dsp_load(TheatrePtr t, struct
 	RADEONInfoPtr info = RADEONPTR(pScrn);
 	unsigned char *RADEONMMIO = info->MMIO;
 
-	DEBUG("Microcode: before everything: %x\n", data8);
+	DEBUG1("Microcode: before everything: %x\n", data8);
 
 	if (RT_fifor(0x000, &data8))
-		DEBUG("Microcode: FIFO status0: %x\n", data8);
+		DEBUG1("Microcode: FIFO status0: %x\n", data8);
 	else
 	{
 		ERROR("Microcode: error reading FIFO status0\n");
@@ -382,7 +382,7 @@ static int dsp_load(TheatrePtr t, struct
 
 
 	if (RT_fifor(0x100, &data8))
-		DEBUG("Microcode: FIFO status1: %x\n", data8);
+		DEBUG1("Microcode: FIFO status1: %x\n", data8);
 	else
 	{
 		ERROR("Microcode: error reading FIFO status1\n");
@@ -430,7 +430,7 @@ static int dsp_load(TheatrePtr t, struct
 		}
 
 		DEBUG("Microcode: dsp_load: checkpoint 1\n");
-		DEBUG("Microcode: TC_STATUS: %x\n", data);
+		DEBUG1("Microcode: TC_STATUS: %x\n", data);
 
 		/* transfer the code from program memory to data memory */
 		RT_regw(VIP_TC_SOURCE, 0x00000000);
@@ -449,7 +449,7 @@ static int dsp_load(TheatrePtr t, struct
 			return -1;
 		}
 		DEBUG("Microcode: dsp_load: checkpoint 2\n");
-		DEBUG("Microcode: TC_STATUS: %x\n", data);
+		DEBUG1("Microcode: TC_STATUS: %x\n", data);
 
 		/* Take DSP out from reset (0x0) */
 		data = 0;
@@ -458,7 +458,7 @@ static int dsp_load(TheatrePtr t, struct
 
 		RT_regr(VIP_TC_STATUS, &data);
 		DEBUG("Microcode: dsp_load: checkpoint 3\n");
-		DEBUG("Microcode: TC_STATUS: %x\n", data);
+		DEBUG1("Microcode: TC_STATUS: %x\n", data);
 
 		/* send dsp_download_check_CRC */
 		fb_scratch0 = ((seg_list->num_bytes << 16) & 0xffff0000) | ((seg_id << 8) & 0xff00) | (0xff & 193);
@@ -512,11 +512,11 @@ static int dsp_load(TheatrePtr t, struct
 
 		if (i >=10)
 		{
-			ERROR("Microcode: DSP failed to move seg: %x from data to code memory\n", seg_id);
+			ERROR1("Microcode: DSP failed to move seg: %x from data to code memory\n", seg_id);
 			return -1;
 		}
 
-		DEBUG("Microcode: segment: %x loaded\n", seg_id);
+		DEBUG1("Microcode: segment: %x loaded\n", seg_id);
 
 		/*
 		 * The segment is downloaded correctly to data memory. Now move it to code memory
@@ -530,7 +530,7 @@ static int dsp_load(TheatrePtr t, struct
 
 		if (result != DSP_OK)
 		{
-			ERROR("Microcode: DSP failed to move seg: %x from data to code memory\n", seg_id);
+			ERROR1("Microcode: DSP failed to move seg: %x from data to code memory\n", seg_id);
 			return -1;
 		}
 	}
@@ -614,7 +614,7 @@ static CARD32 dsp_set_video_input_connec
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_set_video_input_connector: %x, result: %x\n", connector, result);
+	DEBUG2("dsp_set_video_input_connector: %x, result: %x\n", connector, result);
 		  
 	 return result;
 }
@@ -629,8 +629,8 @@ static CARD32 dsp_reset(TheatrePtr t)
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_reset: %x\n", result);
-		  
+	DEBUG1("dsp_reset: %x\n", result);
+
 	return result;
 }
 
@@ -644,8 +644,8 @@ static CARD32 dsp_set_lowpowerstate(Thea
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_set_lowpowerstate: %x\n", result);
-		  
+	DEBUG1("dsp_set_lowpowerstate: %x\n", result);
+
 	return result;
 }
 static CARD32 dsp_set_video_standard(TheatrePtr t, CARD32 standard)
@@ -658,7 +658,7 @@ static CARD32 dsp_set_video_standard(The
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_set_video_standard: %x\n", result);
+	DEBUG1("dsp_set_video_standard: %x\n", result);
 		  
 	return result;
 }
@@ -673,7 +673,7 @@ static CARD32 dsp_set_videostreamformat(
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_set_videostreamformat: %x\n", result);
+	DEBUG1("dsp_set_videostreamformat: %x\n", result);
 		  
 	return result;
 }
@@ -688,7 +688,7 @@ static CARD32 dsp_video_standard_detecti
 
 	result = dsp_send_command(t, 0, fb_scratch0);
 
-	DEBUG("dsp_video_standard_detection: %x\n", result);
+	DEBUG1("dsp_video_standard_detection: %x\n", result);
 
 	return result;
 }
@@ -704,7 +704,7 @@ static CARD32 dsp_get_signallockstatus(T
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_get_signallockstatus: %x, h_pll: %x, v_pll: %x\n", \
+	DEBUG3("dsp_get_signallockstatus: %x, h_pll: %x, v_pll: %x\n", \
 		result, (result >> 8) & 0xff, (result >> 16) & 0xff);
 		  
 	return result;
@@ -721,7 +721,7 @@ static CARD32 dsp_get_signallinenumber(T
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_get_signallinenumber: %x, linenum: %x\n", \
+	DEBUG2("dsp_get_signallinenumber: %x, linenum: %x\n", \
 		result, (result >> 8) & 0xffff);
 		  
 	return result;
@@ -738,7 +738,7 @@ static CARD32 dsp_set_brightness(Theatre
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 	
-	DEBUG("dsp_set_brightness: %x\n", result);
+	DEBUG1("dsp_set_brightness: %x\n", result);
 		  
 	return result;
 }
@@ -754,7 +754,7 @@ static CARD32 dsp_set_contrast(TheatrePt
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_contrast: %x\n", result);
+	DEBUG1("dsp_set_contrast: %x\n", result);
   
 	return result;
 }
@@ -770,7 +770,7 @@ static CARD32 dsp_set_sharpness(TheatreP
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_sharpness: %x\n", result);
+	DEBUG1("dsp_set_sharpness: %x\n", result);
 		  
 	return result;
 }
@@ -786,7 +786,7 @@ static CARD32 dsp_set_tint(TheatrePtr t,
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_tint: %x\n", result);
+	DEBUG1("dsp_set_tint: %x\n", result);
 		  
 	return result;
 }
@@ -802,7 +802,7 @@ static CARD32 dsp_set_saturation(Theatre
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_saturation: %x\n", result);
+	DEBUG1("dsp_set_saturation: %x\n", result);
 		  
 	return result;
 }
@@ -819,7 +819,7 @@ static CARD32 dsp_set_video_scaler_horiz
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_video_scaler_horizontal: %x\n", result);
+	DEBUG1("dsp_set_video_scaler_horizontal: %x\n", result);
 		  
 	return result;
 }
@@ -836,7 +836,7 @@ static CARD32 dsp_set_video_scaler_verti
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_video_scaler_vertical: %x\n", result);
+	DEBUG1("dsp_set_video_scaler_vertical: %x\n", result);
 		  
 	return result;
 }
@@ -852,7 +852,7 @@ static CARD32 dsp_audio_mute(TheatrePtr 
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_audio_mute: %x\n", result);
+	DEBUG1("dsp_audio_mute: %x\n", result);
 		  
 	return result;
 }
@@ -868,7 +868,7 @@ static CARD32 dsp_set_audio_volume(Theat
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_set_audio_volume: %x\n", result);
+	DEBUG1("dsp_set_audio_volume: %x\n", result);
 		  
 	return result;
 }
@@ -884,7 +884,7 @@ static CARD32 dsp_audio_detection(Theatr
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_audio_detection: %x\n", result);
+	DEBUG1("dsp_audio_detection: %x\n", result);
 		  
 	return result;
 }
@@ -900,7 +900,7 @@ static CARD32 dsp_configure_i2s_port(The
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_configure_i2s_port: %x\n", result);
+	DEBUG1("dsp_configure_i2s_port: %x\n", result);
 		  
 	return result;
 }
@@ -916,7 +916,7 @@ static CARD32 dsp_configure_spdif_port(T
 
 	result = dsp_send_command(t, fb_scratch1, fb_scratch0);
 
-	DEBUG("dsp_configure_spdif_port: %x\n", result);
+	DEBUG1("dsp_configure_spdif_port: %x\n", result);
 		  
 	return result;
 }
Index: theatre200.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/theatre200.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 theatre200.h
--- theatre200.h	28 Aug 2005 18:00:23 -0000	1.3
+++ theatre200.h	7 Nov 2005 05:51:49 -0000
@@ -43,11 +43,23 @@
 /* #define ENABLE_DEBUG 1 */
 
 #ifdef ENABLE_DEBUG
-#define ERROR(str...) xf86DrvMsg(screen, X_ERROR, ##str)
-#define DEBUG(str...) xf86DrvMsg(screen, X_INFO, ##str) 
+#define ERROR(str) xf86DrvMsg(screen, X_ERROR, str)
+#define DEBUG(str) xf86DrvMsg(screen, X_INFO, str) 
+#define ERROR1(str,__1) xf86DrvMsg(screen, X_ERROR, str, __1)
+#define DEBUG1(str,__1) xf86DrvMsg(screen, X_INFO, str, __1) 
+#define ERROR2(str,__1,__2) xf86DrvMsg(screen, X_ERROR, str, __1,__2)
+#define DEBUG2(str,__1,__2) xf86DrvMsg(screen, X_INFO, str, __1,__2) 
+#define ERROR3(str,__1,__2,__3) xf86DrvMsg(screen, X_ERROR, str, __1,__2,__3)
+#define DEBUG3(str,__1,__2,__3) xf86DrvMsg(screen, X_INFO, str, __1,__2,__3) 
 #else
-#define ERROR(fmt,str...)
-#define DEBUG(fmt,str...)
+#define ERROR(str)
+#define DEBUG(str)
+#define ERROR1(str,__1)
+#define DEBUG1(str,__1)
+#define ERROR2(str,__1,__2)
+#define DEBUG2(str,__1,__2)
+#define ERROR3(str,__1,__2,__3)
+#define DEBUG3(str,__1,__2,__3)
 #endif
 
 
