drm/vmwgfx: Save at least one screen layout
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 5 Oct 2010 10:43:08 +0000 (12:43 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 6 Oct 2010 01:30:05 +0000 (11:30 +1000)
Save at least one screen layout during vga save to avoid odd things
happening during restore.

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

index 5fb68f3981a2934ae6393515dd19e7aa1a1ead28..87c6e6156d7de8bc809a62bab06dbf64a7da512b 100644 (file)
@@ -1025,6 +1025,9 @@ int vmw_kms_save_vga(struct vmw_private *vmw_priv)
        vmw_priv->num_displays = vmw_read(vmw_priv,
                                          SVGA_REG_NUM_GUEST_DISPLAYS);
 
+       if (vmw_priv->num_displays == 0)
+               vmw_priv->num_displays = 1;
+
        for (i = 0; i < vmw_priv->num_displays; ++i) {
                save = &vmw_priv->vga_save[i];
                vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, i);