Commit a0e259f3 authored by Linus Torvalds's avatar Linus Torvalds

DRI CVS merge: memory barrier updates

parent 3c4f858a
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
#define DRM_READ32(map, offset) readl(((unsigned long)(map)->handle) + (offset)) #define DRM_READ32(map, offset) readl(((unsigned long)(map)->handle) + (offset))
#define DRM_WRITE8(map, offset, val) writeb(val, ((unsigned long)(map)->handle) + (offset)) #define DRM_WRITE8(map, offset, val) writeb(val, ((unsigned long)(map)->handle) + (offset))
#define DRM_WRITE32(map, offset, val) writel(val, ((unsigned long)(map)->handle) + (offset)) #define DRM_WRITE32(map, offset, val) writel(val, ((unsigned long)(map)->handle) + (offset))
#define DRM_READMEMORYBARRIER(map) mb() #define DRM_READMEMORYBARRIER() rmb()
#define DRM_WRITEMEMORYBARRIER(map) wmb() #define DRM_WRITEMEMORYBARRIER() wmb()
#define DRM_MEMORYBARRIER() mb()
#define DRM_DEVICE drm_file_t *priv = filp->private_data; \ #define DRM_DEVICE drm_file_t *priv = filp->private_data; \
drm_device_t *dev = priv->dev drm_device_t *dev = priv->dev
......
...@@ -131,7 +131,7 @@ extern int mga_getparam( DRM_IOCTL_ARGS ); ...@@ -131,7 +131,7 @@ extern int mga_getparam( DRM_IOCTL_ARGS );
extern int mga_warp_install_microcode( drm_mga_private_t *dev_priv ); extern int mga_warp_install_microcode( drm_mga_private_t *dev_priv );
extern int mga_warp_init( drm_mga_private_t *dev_priv ); extern int mga_warp_init( drm_mga_private_t *dev_priv );
#define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER(dev_priv->primary) #define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER()
#if defined(__linux__) && defined(__alpha__) #if defined(__linux__) && defined(__alpha__)
#define MGA_BASE( reg ) ((unsigned long)(dev_priv->mmio->handle)) #define MGA_BASE( reg ) ((unsigned long)(dev_priv->mmio->handle))
...@@ -142,12 +142,12 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv ); ...@@ -142,12 +142,12 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv );
#define MGA_READ( reg ) (_MGA_READ((u32 *)MGA_ADDR(reg))) #define MGA_READ( reg ) (_MGA_READ((u32 *)MGA_ADDR(reg)))
#define MGA_READ8( reg ) (_MGA_READ((u8 *)MGA_ADDR(reg))) #define MGA_READ8( reg ) (_MGA_READ((u8 *)MGA_ADDR(reg)))
#define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(dev_priv->mmio); MGA_DEREF( reg ) = val; } while (0) #define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF( reg ) = val; } while (0)
#define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(dev_priv->mmio); MGA_DEREF8( reg ) = val; } while (0) #define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF8( reg ) = val; } while (0)
static inline u32 _MGA_READ(u32 *addr) static inline u32 _MGA_READ(u32 *addr)
{ {
DRM_READMEMORYBARRIER(dev_priv->mmio); DRM_MEMORYBARRIER();
return *(volatile u32 *)addr; return *(volatile u32 *)addr;
} }
#else #else
......
...@@ -440,7 +440,7 @@ do { \ ...@@ -440,7 +440,7 @@ do { \
#if defined(__powerpc__) #if defined(__powerpc__)
#define r128_flush_write_combine() (void) GET_RING_HEAD( &dev_priv->ring ) #define r128_flush_write_combine() (void) GET_RING_HEAD( &dev_priv->ring )
#else #else
#define r128_flush_write_combine() DRM_WRITEMEMORYBARRIER(dev_priv->ring_rptr) #define r128_flush_write_combine() DRM_WRITEMEMORYBARRIER()
#endif #endif
......
...@@ -852,7 +852,7 @@ do { \ ...@@ -852,7 +852,7 @@ do { \
#define COMMIT_RING() do { \ #define COMMIT_RING() do { \
/* Flush writes to ring */ \ /* Flush writes to ring */ \
DRM_READMEMORYBARRIER( dev_priv->mmio ); \ DRM_MEMORYBARRIER(); \
GET_RING_HEAD( dev_priv ); \ GET_RING_HEAD( dev_priv ); \
RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \
/* read from PCI bus to ensure correct posting */ \ /* read from PCI bus to ensure correct posting */ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment