drm/vmwgfx: Replace iowrite/ioread with volatile memory accesses
Now that we use memremap instead of ioremap, Use WRITE_ONCE / READ_ONCE instead of iowrite / ioread. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
This commit is contained in:
@@ -123,14 +123,14 @@ err_unreserve:
|
||||
void vmw_cursor_update_position(struct vmw_private *dev_priv,
|
||||
bool show, int x, int y)
|
||||
{
|
||||
u32 __iomem *fifo_mem = dev_priv->mmio_virt;
|
||||
u32 *fifo_mem = dev_priv->mmio_virt;
|
||||
uint32_t count;
|
||||
|
||||
iowrite32(show ? 1 : 0, fifo_mem + SVGA_FIFO_CURSOR_ON);
|
||||
iowrite32(x, fifo_mem + SVGA_FIFO_CURSOR_X);
|
||||
iowrite32(y, fifo_mem + SVGA_FIFO_CURSOR_Y);
|
||||
count = ioread32(fifo_mem + SVGA_FIFO_CURSOR_COUNT);
|
||||
iowrite32(++count, fifo_mem + SVGA_FIFO_CURSOR_COUNT);
|
||||
vmw_mmio_write(show ? 1 : 0, fifo_mem + SVGA_FIFO_CURSOR_ON);
|
||||
vmw_mmio_write(x, fifo_mem + SVGA_FIFO_CURSOR_X);
|
||||
vmw_mmio_write(y, fifo_mem + SVGA_FIFO_CURSOR_Y);
|
||||
count = vmw_mmio_read(fifo_mem + SVGA_FIFO_CURSOR_COUNT);
|
||||
vmw_mmio_write(++count, fifo_mem + SVGA_FIFO_CURSOR_COUNT);
|
||||
}
|
||||
|
||||
int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
|
||||
@@ -1155,7 +1155,8 @@ int vmw_kms_write_svga(struct vmw_private *vmw_priv,
|
||||
if (vmw_priv->capabilities & SVGA_CAP_PITCHLOCK)
|
||||
vmw_write(vmw_priv, SVGA_REG_PITCHLOCK, pitch);
|
||||
else if (vmw_fifo_have_pitchlock(vmw_priv))
|
||||
iowrite32(pitch, vmw_priv->mmio_virt + SVGA_FIFO_PITCHLOCK);
|
||||
vmw_mmio_write(pitch, vmw_priv->mmio_virt +
|
||||
SVGA_FIFO_PITCHLOCK);
|
||||
vmw_write(vmw_priv, SVGA_REG_WIDTH, width);
|
||||
vmw_write(vmw_priv, SVGA_REG_HEIGHT, height);
|
||||
vmw_write(vmw_priv, SVGA_REG_BITS_PER_PIXEL, bpp);
|
||||
@@ -1181,8 +1182,8 @@ int vmw_kms_save_vga(struct vmw_private *vmw_priv)
|
||||
vmw_priv->vga_pitchlock =
|
||||
vmw_read(vmw_priv, SVGA_REG_PITCHLOCK);
|
||||
else if (vmw_fifo_have_pitchlock(vmw_priv))
|
||||
vmw_priv->vga_pitchlock = ioread32(vmw_priv->mmio_virt +
|
||||
SVGA_FIFO_PITCHLOCK);
|
||||
vmw_priv->vga_pitchlock = vmw_mmio_read(vmw_priv->mmio_virt +
|
||||
SVGA_FIFO_PITCHLOCK);
|
||||
|
||||
if (!(vmw_priv->capabilities & SVGA_CAP_DISPLAY_TOPOLOGY))
|
||||
return 0;
|
||||
@@ -1230,8 +1231,8 @@ int vmw_kms_restore_vga(struct vmw_private *vmw_priv)
|
||||
vmw_write(vmw_priv, SVGA_REG_PITCHLOCK,
|
||||
vmw_priv->vga_pitchlock);
|
||||
else if (vmw_fifo_have_pitchlock(vmw_priv))
|
||||
iowrite32(vmw_priv->vga_pitchlock,
|
||||
vmw_priv->mmio_virt + SVGA_FIFO_PITCHLOCK);
|
||||
vmw_mmio_write(vmw_priv->vga_pitchlock,
|
||||
vmw_priv->mmio_virt + SVGA_FIFO_PITCHLOCK);
|
||||
|
||||
if (!(vmw_priv->capabilities & SVGA_CAP_DISPLAY_TOPOLOGY))
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user