On 29 jan 2010, at 07.57, Michel Dänzer wrote:
> On Thu, 2010-01-28 at 18:59 +0000, Jakob Bornecrantz wrote:
>> From: Peter Hanzel <hanzelpe...@gmail.com>
>>
>> This fixes the driver not loading on older versions of VMware.
>>
>> Signed-off-by: Peter Hanzel <hanzelpe...@gmail.com>
>> Signed-off-by: Jakob Bornecrantz <ja...@vmware.com>
>> ---
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |    8 ++++++++
>> 1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/ 
>> vmwgfx/vmwgfx_drv.c
>> index f47ff2c..8e68333 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>> @@ -209,6 +209,7 @@ static int vmw_driver_load(struct drm_device  
>> *dev, unsigned long chipset)
>> {
>>      struct vmw_private *dev_priv;
>>      int ret;
>> +    long svga_id;
>
> This should be uint32_t rather than long.

Ah right.

>
>
>> @@ -239,6 +240,13 @@ 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) {
>> +            DRM_INFO("We have SVGA ID 2\n");
>> +    }
>> +
>>      dev_priv->capabilities = vmw_read(dev_priv, SVGA_REG_CAPABILITIES);
>>
>>      if (dev_priv->capabilities & SVGA_CAP_GMR) {
>
>
> Shouldn't this be something like:
>
> 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) {
>               DRM_ERROR("Unsupported SVGA ID 0x%lx\n", svga_id);
>               /* Bail */
>       }


I guess its better to bail on old hardware that we haven't tested on.

I'll respin this patch.

Cheers Jakob.
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to