drm/vmwgfx: Request SVGA version 2 and bail if not found
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>
This commit is contained in:
parent
8e19a95177
commit
c188660f6d
|
@ -209,6 +209,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
|
||||||
{
|
{
|
||||||
struct vmw_private *dev_priv;
|
struct vmw_private *dev_priv;
|
||||||
int ret;
|
int ret;
|
||||||
|
uint32_t svga_id;
|
||||||
|
|
||||||
dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
|
dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
|
||||||
if (unlikely(dev_priv == NULL)) {
|
if (unlikely(dev_priv == NULL)) {
|
||||||
|
@ -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);
|
dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
|
||||||
|
|
||||||
mutex_lock(&dev_priv->hw_mutex);
|
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);
|
dev_priv->capabilities = vmw_read(dev_priv, SVGA_REG_CAPABILITIES);
|
||||||
|
|
||||||
if (dev_priv->capabilities & SVGA_CAP_GMR) {
|
if (dev_priv->capabilities & SVGA_CAP_GMR) {
|
||||||
|
|
Loading…
Reference in New Issue