[Mplayer-cvslog] CVS: main/vidix/drivers radeon_vid.c,1.3,1.4

Nick Kurshev nick at mplayer.dev.hu
Sun Jan 6 18:10:30 CET 2002


Update of /cvsroot/mplayer/main/vidix/drivers
In directory mplayer:/var/tmp.root/cvs-serv22657

Modified Files:
	radeon_vid.c 
Log Message:
IO space is memory mapped (no in(out)port required)

Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/radeon_vid.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- radeon_vid.c	6 Jan 2002 16:00:59 -0000	1.3
+++ radeon_vid.c	6 Jan 2002 17:10:27 -0000	1.4
@@ -198,10 +198,13 @@
 static int32_t radeon_overlay_off = 0;
 static uint32_t radeon_ram_size = 0;
 
-#define INREG8(addr)		INPORT8((uint32_t)(radeon_mmio_base)+addr)
-#define OUTREG8(addr,val)	OUTPORT8((uint32_t)(radeon_mmio_base)+addr,val)
-#define INREG(addr)		INPORT((uint32_t)(radeon_mmio_base)+addr)
-#define OUTREG(addr,val)	OUTPORT((uint32_t)(radeon_mmio_base)+addr,val)
+#define GETREG(TYPE,PTR,OFFZ)		(*((volatile TYPE*)((PTR)+(OFFZ))))
+#define SETREG(TYPE,PTR,OFFZ,VAL)	(*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
+
+#define INREG8(addr)		GETREG(uint8_t,(uint32_t)(radeon_mmio_base),addr)
+#define OUTREG8(addr,val)	SETREG(uint8_t,(uint32_t)(radeon_mmio_base),addr,val)
+#define INREG(addr)		GETREG(uint32_t,(uint32_t)(radeon_mmio_base),addr)
+#define OUTREG(addr,val)	SETREG(uint32_t,(uint32_t)(radeon_mmio_base),addr,val)
 #define OUTREGP(addr,val,mask)  					\
 	do {								\
 		unsigned int _tmp = INREG(addr);			\
@@ -660,8 +663,12 @@
 
 int vixInit( void )
 {
-  if(!probed) return EINTR;
-  if((radeon_mmio_base = map_phys_mem(pci_info.base2,0x7FFF))==(void *)-1) return ENOMEM;
+  if(!probed) 
+  {
+    printf(RADEON_MSG" Driver was not probed but is being initializing\n");
+    return EINTR;
+  }    
+  if((radeon_mmio_base = map_phys_mem(pci_info.base2,0xFFFF))==(void *)-1) return ENOMEM;
   radeon_ram_size = INREG(CONFIG_MEMSIZE);
   /* mem size is bits [28:0], mask off the rest. Range: from 1Mb up to 512 Mb */
   radeon_ram_size &=  CONFIG_MEMSIZE_MASK;




More information about the MPlayer-cvslog mailing list