[MPlayer-cvslog] r32664 - trunk/vidix/radeon_vid.c

Diego Biurrun diego at biurrun.de
Fri Dec 24 17:01:29 CET 2010


On Sun, Nov 28, 2010 at 04:25:15PM +0100, reimar wrote:
> 
> Log:
> Restore big-endian support removed in thoughtless upstream merge
> at r23062.
> 
> --- trunk/vidix/radeon_vid.c	Sun Nov 28 08:47:37 2010	(r32663)
> +++ trunk/vidix/radeon_vid.c	Sun Nov 28 16:25:15 2010	(r32664)
> @@ -1280,6 +1281,13 @@ static void save_regs( void )
> +#if HAVE_BIGENDIAN
> +#ifdef RAGE128
> +    savereg.config_cntl         = INREG(CONFIG_CNTL);
> +#else
> +    savereg.config_cntl         = INREG(RADEON_SURFACE_CNTL);
> +#endif
> +#endif
> @@ -1291,6 +1299,13 @@ static void restore_regs( void )
> +#if HAVE_BIGENDIAN
> +#ifdef RAGE128
> +    OUTREG(CONFIG_CNTL, savereg.config_cntl);
> +#else
> +    OUTREG(RADEON_SURFACE_CNTL, savereg.config_cntl);
> +#endif
> +#endif
> @@ -1352,6 +1367,18 @@ static int radeon_init(void)
>    save_regs();
> +  /* XXX: hack, but it works for me (tm) */
> +#if HAVE_BIGENDIAN
> +#ifdef RAGE128
> +   OUTREG(CONFIG_CNTL,
> +          savereg.config_cntl &
> +          ~(APER_0_BIG_ENDIAN_16BPP_SWAP | APER_0_BIG_ENDIAN_32BPP_SWAP));
> +#else
> +   OUTREG(RADEON_SURFACE_CNTL,
> +          savereg.config_cntl &
> +          ~(RADEON_NONSURF_AP0_SWP_32BPP | RADEON_NONSURF_AP0_SWP_16BPP));
> +#endif
> +#endif

Maybe a

#ifdef RAGE128
#define CONFIG_CNTL RADEON_SURFACE_CNTL
#endif

can save some of the code duplication and ifdeffery.

Diego


More information about the MPlayer-cvslog mailing list