Skip to content

Commit

Permalink
drm/vmwgfx: Request SVGA version 2 and bail if not found
Browse files Browse the repository at this point in the history
This fixes the driver not loading on older versions of VMware.

Signed-off-by: Peter Hanzel <hanzelpeter@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Peter Hanzel authored and Dave Airlie committed Feb 1, 2010
1 parent 8e19a95 commit c188660
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
{
struct vmw_private *dev_priv;
int ret;
uint32_t svga_id;

dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
if (unlikely(dev_priv == NULL)) {
Expand Down Expand Up @@ -239,6 +240,16 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);

mutex_lock(&dev_priv->hw_mutex);

vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2);
svga_id = vmw_read(dev_priv, SVGA_REG_ID);
if (svga_id != SVGA_ID_2) {
ret = -ENOSYS;
DRM_ERROR("Unsuported SVGA ID 0x%x\n", svga_id);
mutex_unlock(&dev_priv->hw_mutex);
goto out_err0;
}

dev_priv->capabilities = vmw_read(dev_priv, SVGA_REG_CAPABILITIES);

if (dev_priv->capabilities & SVGA_CAP_GMR) {
Expand Down

0 comments on commit c188660

Please sign in to comment.