Index: vidix/drivers/mach64_vid.c =================================================================== RCS file: /cvsroot/mplayer/main/vidix/drivers/mach64_vid.c,v retrieving revision 1.26 diff -u -r1.26 mach64_vid.c --- vidix/drivers/mach64_vid.c 23 Apr 2002 01:31:01 -0000 1.26 +++ vidix/drivers/mach64_vid.c 21 Oct 2002 09:14:38 -0000 @@ -13,6 +13,8 @@ #include #include +#include "../../bswap.h" +#include "../../config.h" #include "../vidix.h" #include "../fourcc.h" #include "../../libdha/libdha.h" @@ -216,7 +218,12 @@ static uint32_t mach64_vid_get_dbpp( void ) { uint32_t dbpp,retval; - dbpp = (INREG(CRTC_GEN_CNTL)>>8)& 0x7; + dbpp = INREG(CRTC_GEN_CNTL); +#ifdef WORDS_BIGENDIAN + dbpp = dbpp>>16; +#else + dbpp = (dbpp>>8)& 0x7; +#endif switch(dbpp) { case 1: retval = 4; break; @@ -244,7 +251,11 @@ /* FIXME: currently we extract that from CRTC!!!*/ uint32_t xres,h_total; h_total = INREG(CRTC_H_TOTAL_DISP); +#ifdef WORDS_BIGENDIAN + xres = bswap_16(h_total); +#else xres = (h_total >> 16) & 0xffff; +#endif return (xres + 1)*8; } @@ -253,7 +264,11 @@ /* FIXME: currently we extract that from CRTC!!!*/ uint32_t yres,v_total; v_total = INREG(CRTC_V_TOTAL_DISP); +#ifdef WORDS_BIGENDIAN + yres = bswap_16(v_total); +#else yres = (v_total >> 16) & 0xffff; +#endif return yres + 1; } @@ -453,7 +468,7 @@ if((mach64_mmio_base = map_phys_mem(pci_info.base2,0x4000))==(void *)-1) return ENOMEM; mach64_wait_for_idle(); - mach64_ram_size = INREG(MEM_CNTL) & CTL_MEM_SIZEB; + mach64_ram_size = bswap_32(INREG(MEM_CNTL)) & CTL_MEM_SIZEB; if (mach64_ram_size < 8) mach64_ram_size = (mach64_ram_size + 1) * 512; else if (mach64_ram_size < 12) mach64_ram_size = (mach64_ram_size - 3) * 1024; else mach64_ram_size = (mach64_ram_size - 7) * 2048;