drm/vmwgfx: Read bounding box memory from the appropriate register
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 21 Nov 2012 10:09:56 +0000 (11:09 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Fri, 17 Jan 2014 06:52:22 +0000 (07:52 +0100)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

index a7dc14a9e94b57e7a351dd11de5a022506f59112..eaffb052409259cd169455d6801a8ec947faeb01 100644 (file)
@@ -650,13 +650,18 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
                                 SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB);
 
                dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE;
-       }
+               dev_priv->prim_bb_mem =
+                       vmw_read(dev_priv,
+                                SVGA_REG_MAX_PRIMARY_BOUNDING_BOX_MEM);
+       } else
+               dev_priv->prim_bb_mem = dev_priv->vram_size;
 
        ret = vmw_dma_masks(dev_priv);
        if (unlikely(ret != 0))
                goto out_err0;
 
-       dev_priv->prim_bb_mem = dev_priv->vram_size;
+       if (unlikely(dev_priv->prim_bb_mem < dev_priv->vram_size))
+               dev_priv->prim_bb_mem = dev_priv->vram_size;
 
        mutex_unlock(&dev_priv->hw_mutex);