提交 85b2331b 编写于 作者: D Daniel Vetter 提交者: Dave Airlie

drm: Kill DRM_*MEMORYBARRIER

The real linux interfaces are soooo much easier on the eyes ...
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 1d6ac185
...@@ -253,7 +253,7 @@ irqreturn_t psb_irq_handler(int irq, void *arg) ...@@ -253,7 +253,7 @@ irqreturn_t psb_irq_handler(int irq, void *arg)
PSB_WVDC32(vdc_stat, PSB_INT_IDENTITY_R); PSB_WVDC32(vdc_stat, PSB_INT_IDENTITY_R);
(void) PSB_RVDC32(PSB_INT_IDENTITY_R); (void) PSB_RVDC32(PSB_INT_IDENTITY_R);
DRM_READMEMORYBARRIER(); rmb();
if (!handled) if (!handled)
return IRQ_NONE; return IRQ_NONE;
......
...@@ -193,7 +193,7 @@ extern void mga_driver_irq_uninstall(struct drm_device *dev); ...@@ -193,7 +193,7 @@ extern void mga_driver_irq_uninstall(struct drm_device *dev);
extern long mga_compat_ioctl(struct file *filp, unsigned int cmd, extern long mga_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg); unsigned long arg);
#define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER() #define mga_flush_write_combine() wmb()
#define MGA_READ8(reg) DRM_READ8(dev_priv->mmio, (reg)) #define MGA_READ8(reg) DRM_READ8(dev_priv->mmio, (reg))
#define MGA_READ(reg) DRM_READ32(dev_priv->mmio, (reg)) #define MGA_READ(reg) DRM_READ32(dev_priv->mmio, (reg))
......
...@@ -100,7 +100,7 @@ nv50_dma_push(struct nouveau_channel *chan, struct nouveau_bo *bo, ...@@ -100,7 +100,7 @@ nv50_dma_push(struct nouveau_channel *chan, struct nouveau_bo *bo,
chan->dma.ib_put = (chan->dma.ib_put + 1) & chan->dma.ib_max; chan->dma.ib_put = (chan->dma.ib_put + 1) & chan->dma.ib_max;
DRM_MEMORYBARRIER(); mb();
/* Flush writes. */ /* Flush writes. */
nouveau_bo_rd32(pb, 0); nouveau_bo_rd32(pb, 0);
......
...@@ -155,7 +155,7 @@ BEGIN_IMC0(struct nouveau_channel *chan, int subc, int mthd, u16 data) ...@@ -155,7 +155,7 @@ BEGIN_IMC0(struct nouveau_channel *chan, int subc, int mthd, u16 data)
} }
#define WRITE_PUT(val) do { \ #define WRITE_PUT(val) do { \
DRM_MEMORYBARRIER(); \ mb(); \
nouveau_bo_rd32(chan->push.buffer, 0); \ nouveau_bo_rd32(chan->push.buffer, 0); \
nv_wo32(chan->object, chan->user_put, ((val) << 2) + chan->push.vma.offset); \ nv_wo32(chan->object, chan->user_put, ((val) << 2) + chan->push.vma.offset); \
} while (0) } while (0)
......
...@@ -514,7 +514,7 @@ do { \ ...@@ -514,7 +514,7 @@ do { \
if (R128_VERBOSE) \ if (R128_VERBOSE) \
DRM_INFO("COMMIT_RING() tail=0x%06x\n", \ DRM_INFO("COMMIT_RING() tail=0x%06x\n", \
dev_priv->ring.tail); \ dev_priv->ring.tail); \
DRM_MEMORYBARRIER(); \ mb(); \
R128_WRITE(R128_PM4_BUFFER_DL_WPTR, dev_priv->ring.tail); \ R128_WRITE(R128_PM4_BUFFER_DL_WPTR, dev_priv->ring.tail); \
R128_READ(R128_PM4_BUFFER_DL_WPTR); \ R128_READ(R128_PM4_BUFFER_DL_WPTR); \
} while (0) } while (0)
......
...@@ -2228,7 +2228,7 @@ void radeon_commit_ring(drm_radeon_private_t *dev_priv) ...@@ -2228,7 +2228,7 @@ void radeon_commit_ring(drm_radeon_private_t *dev_priv)
dev_priv->ring.tail &= dev_priv->ring.tail_mask; dev_priv->ring.tail &= dev_priv->ring.tail_mask;
DRM_MEMORYBARRIER(); mb();
GET_RING_HEAD( dev_priv ); GET_RING_HEAD( dev_priv );
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) {
......
...@@ -463,7 +463,7 @@ void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -463,7 +463,7 @@ void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring)
while (ring->wptr & ring->align_mask) { while (ring->wptr & ring->align_mask) {
radeon_ring_write(ring, ring->nop); radeon_ring_write(ring, ring->nop);
} }
DRM_MEMORYBARRIER(); mb();
radeon_ring_set_wptr(rdev, ring); radeon_ring_set_wptr(rdev, ring);
} }
......
...@@ -49,7 +49,7 @@ savage_bci_wait_fifo_shadow(drm_savage_private_t * dev_priv, unsigned int n) ...@@ -49,7 +49,7 @@ savage_bci_wait_fifo_shadow(drm_savage_private_t * dev_priv, unsigned int n)
#endif #endif
for (i = 0; i < SAVAGE_DEFAULT_USEC_TIMEOUT; i++) { for (i = 0; i < SAVAGE_DEFAULT_USEC_TIMEOUT; i++) {
DRM_MEMORYBARRIER(); mb();
status = dev_priv->status_ptr[0]; status = dev_priv->status_ptr[0];
if ((status & mask) < threshold) if ((status & mask) < threshold)
return 0; return 0;
...@@ -123,7 +123,7 @@ savage_bci_wait_event_shadow(drm_savage_private_t * dev_priv, uint16_t e) ...@@ -123,7 +123,7 @@ savage_bci_wait_event_shadow(drm_savage_private_t * dev_priv, uint16_t e)
int i; int i;
for (i = 0; i < SAVAGE_EVENT_USEC_TIMEOUT; i++) { for (i = 0; i < SAVAGE_EVENT_USEC_TIMEOUT; i++) {
DRM_MEMORYBARRIER(); mb();
status = dev_priv->status_ptr[1]; status = dev_priv->status_ptr[1];
if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff || if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff ||
(status & 0xffff) == 0) (status & 0xffff) == 0)
...@@ -449,7 +449,7 @@ static void savage_dma_flush(drm_savage_private_t * dev_priv) ...@@ -449,7 +449,7 @@ static void savage_dma_flush(drm_savage_private_t * dev_priv)
} }
} }
DRM_MEMORYBARRIER(); mb();
/* do flush ... */ /* do flush ... */
phys_addr = dev_priv->cmd_dma->offset + phys_addr = dev_priv->cmd_dma->offset +
......
...@@ -1032,7 +1032,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ ...@@ -1032,7 +1032,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
/* Make sure writes to DMA buffers are finished before sending /* Make sure writes to DMA buffers are finished before sending
* DMA commands to the graphics hardware. */ * DMA commands to the graphics hardware. */
DRM_MEMORYBARRIER(); mb();
/* Coming from user space. Don't know if the Xserver has /* Coming from user space. Don't know if the Xserver has
* emitted wait commands. Assuming the worst. */ * emitted wait commands. Assuming the worst. */
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
dev_priv->dma_low += 8; \ dev_priv->dma_low += 8; \
} }
#define via_flush_write_combine() DRM_MEMORYBARRIER() #define via_flush_write_combine() mb()
#define VIA_OUT_RING_QW(w1, w2) do { \ #define VIA_OUT_RING_QW(w1, w2) do { \
*vb++ = (w1); \ *vb++ = (w1); \
...@@ -543,7 +543,7 @@ static void via_cmdbuf_start(drm_via_private_t *dev_priv) ...@@ -543,7 +543,7 @@ static void via_cmdbuf_start(drm_via_private_t *dev_priv)
VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_hi); VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_hi);
VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_lo); VIA_WRITE(VIA_REG_TRANSPACE, pause_addr_lo);
DRM_WRITEMEMORYBARRIER(); wmb();
VIA_WRITE(VIA_REG_TRANSPACE, command | HC_HAGPCMNT_MASK); VIA_WRITE(VIA_REG_TRANSPACE, command | HC_HAGPCMNT_MASK);
VIA_READ(VIA_REG_TRANSPACE); VIA_READ(VIA_REG_TRANSPACE);
......
...@@ -217,7 +217,7 @@ via_fire_dmablit(struct drm_device *dev, drm_via_sg_info_t *vsg, int engine) ...@@ -217,7 +217,7 @@ via_fire_dmablit(struct drm_device *dev, drm_via_sg_info_t *vsg, int engine)
VIA_WRITE(VIA_PCI_DMA_MR0 + engine*0x04, VIA_DMA_MR_CM | VIA_DMA_MR_TDIE); VIA_WRITE(VIA_PCI_DMA_MR0 + engine*0x04, VIA_DMA_MR_CM | VIA_DMA_MR_TDIE);
VIA_WRITE(VIA_PCI_DMA_BCR0 + engine*0x10, 0); VIA_WRITE(VIA_PCI_DMA_BCR0 + engine*0x10, 0);
VIA_WRITE(VIA_PCI_DMA_DPR0 + engine*0x10, vsg->chain_start); VIA_WRITE(VIA_PCI_DMA_DPR0 + engine*0x10, vsg->chain_start);
DRM_WRITEMEMORYBARRIER(); wmb();
VIA_WRITE(VIA_PCI_DMA_CSR0 + engine*0x04, VIA_DMA_CSR_DE | VIA_DMA_CSR_TS); VIA_WRITE(VIA_PCI_DMA_CSR0 + engine*0x04, VIA_DMA_CSR_DE | VIA_DMA_CSR_TS);
VIA_READ(VIA_PCI_DMA_CSR0 + engine*0x04); VIA_READ(VIA_PCI_DMA_CSR0 + engine*0x04);
} }
......
...@@ -35,19 +35,12 @@ static inline void writeq(u64 val, void __iomem *reg) ...@@ -35,19 +35,12 @@ static inline void writeq(u64 val, void __iomem *reg)
#define DRM_WRITE16(map, offset, val) writew(val, ((void __iomem *)(map)->handle) + (offset)) #define DRM_WRITE16(map, offset, val) writew(val, ((void __iomem *)(map)->handle) + (offset))
/** Write a dword into a MMIO region */ /** Write a dword into a MMIO region */
#define DRM_WRITE32(map, offset, val) writel(val, ((void __iomem *)(map)->handle) + (offset)) #define DRM_WRITE32(map, offset, val) writel(val, ((void __iomem *)(map)->handle) + (offset))
/** Read memory barrier */
/** Read a qword from a MMIO region - be careful using these unless you really understand them */ /** Read a qword from a MMIO region - be careful using these unless you really understand them */
#define DRM_READ64(map, offset) readq(((void __iomem *)(map)->handle) + (offset)) #define DRM_READ64(map, offset) readq(((void __iomem *)(map)->handle) + (offset))
/** Write a qword into a MMIO region */ /** Write a qword into a MMIO region */
#define DRM_WRITE64(map, offset, val) writeq(val, ((void __iomem *)(map)->handle) + (offset)) #define DRM_WRITE64(map, offset, val) writeq(val, ((void __iomem *)(map)->handle) + (offset))
#define DRM_READMEMORYBARRIER() rmb()
/** Write memory barrier */
#define DRM_WRITEMEMORYBARRIER() wmb()
/** Read/write memory barrier */
#define DRM_MEMORYBARRIER() mb()
#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ #define DRM_WAIT_ON( ret, queue, timeout, condition ) \
do { \ do { \
DECLARE_WAITQUEUE(entry, current); \ DECLARE_WAITQUEUE(entry, current); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册