Compile problems with ATI theatre200.[ch]

Bogdan Diaconescu b_diaconescu at yahoo.com
Mon Nov 7 08:05:55 PST 2005


Hi Kean, I remember I had a patch applied regarding
the variadic macros. I'll check again to see what has
happened with the patch.

Regards,
Bogdan



--- Kean Johnston <kean at armory.com> wrote:

> Hi all,
> 
> Even on HEAD I am still having compile problems with
> the
> ATI theatre200 code. I mailed the author a few
> months back,
> and this list, and every agreed the solution I
> proposed was
> the right one. The code still hasn't changed. I am
> attaching
> a patch which I would like to commit please. Anyone
> have any
> issues with this?
> 
> The problem is simple: the code uses variadic
> macros, which
> are intrinsically non-portable. For any environment
> not
> using gcc or a c99 compiler (many platforms), thats
> an issue.
> The fix is pretty simple, as you can see from the
> patch.
> 
> TIA.
> 
> Kean
> -- 
> "I've seen things you people wouldn't believe...
> Attack Ships on fire off the shores of Orion.
> I've watched C-beams glitter in the dark off of
> Tanhauser Gate.
> All those moments will be lost in time...like tears,
> in rain.
> Time to die." -- "Roy Batty" - Bladerunner
> > 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);
>  
> 
=== message truncated ===



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs



More information about the xorg mailing list