drm/vmwgfx: Make fence sequences continous across a VT switch.
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 13 Jan 2010 21:28:38 +0000 (22:28 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 14 Jan 2010 02:18:02 +0000 (12:18 +1000)
A vt switch in stealth mode would take down the FIFO, and re-
initialize fence sequence numbers. This patch
saves the current state of the fence sequence when the FIFO is
disabled.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c

index 1db1ef30be2b2b87fbef3ee08df4f98c345421bb..70e4f5f0c1225f82d9495aa670037e1e88cfdbe3 100644 (file)
@@ -217,6 +217,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
 
        dev_priv->dev = dev;
        dev_priv->vmw_chipset = chipset;
+       dev_priv->last_read_sequence = (uint32_t) -100;
        mutex_init(&dev_priv->hw_mutex);
        mutex_init(&dev_priv->cmdbuf_mutex);
        rwlock_init(&dev_priv->resource_lock);
index 01feb48af3334af933c871852f1eb3787502731f..f7d5f70b52dd68c395d4eb0751a445a83b1901f8 100644 (file)
@@ -98,8 +98,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)
                 (unsigned int) min,
                 (unsigned int) fifo->capabilities);
 
-       dev_priv->fence_seq = (uint32_t) -100;
-       dev_priv->last_read_sequence = (uint32_t) -100;
+       dev_priv->fence_seq = dev_priv->last_read_sequence;
        iowrite32(dev_priv->last_read_sequence, fifo_mem + SVGA_FIFO_FENCE);
 
        return vmw_fifo_send_fence(dev_priv, &dummy);