Skip to content

Commit

Permalink
drm/vmwgfx: Use fb handover mechanism instead of stealth mode.
Browse files Browse the repository at this point in the history
When the vmwgfx module is loaded on top of vesafb, it would operate in
stealth mode in parallel with vesafb, evicting VRAM on dropmaster.

Change that to use the vesafb handover mechanism, like other drmfb drivers.

Signed-off-by: Thomas Hellstrom <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
thomashvmw authored and airlied committed Feb 18, 2010
1 parent 01d4503 commit f2d12b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 33 deletions.
49 changes: 16 additions & 33 deletions drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,22 +348,19 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
*/

DRM_INFO("It appears like vesafb is loaded. "
"Ignore above error if any. Entering stealth mode.\n");
"Ignore above error if any.\n");
ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth probe");
if (unlikely(ret != 0)) {
DRM_ERROR("Failed reserving the SVGA MMIO resource.\n");
goto out_no_device;
}
vmw_kms_init(dev_priv);
vmw_overlay_init(dev_priv);
} else {
ret = vmw_request_device(dev_priv);
if (unlikely(ret != 0))
goto out_no_device;
vmw_kms_init(dev_priv);
vmw_overlay_init(dev_priv);
vmw_fb_init(dev_priv);
}
ret = vmw_request_device(dev_priv);
if (unlikely(ret != 0))
goto out_no_device;
vmw_kms_init(dev_priv);
vmw_overlay_init(dev_priv);
vmw_fb_init(dev_priv);

dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier;
register_pm_notifier(&dev_priv->pm_nb);
Expand Down Expand Up @@ -406,17 +403,15 @@ static int vmw_driver_unload(struct drm_device *dev)

unregister_pm_notifier(&dev_priv->pm_nb);

if (!dev_priv->stealth) {
vmw_fb_close(dev_priv);
vmw_kms_close(dev_priv);
vmw_overlay_close(dev_priv);
vmw_release_device(dev_priv);
pci_release_regions(dev->pdev);
} else {
vmw_kms_close(dev_priv);
vmw_overlay_close(dev_priv);
vmw_fb_close(dev_priv);
vmw_kms_close(dev_priv);
vmw_overlay_close(dev_priv);
vmw_release_device(dev_priv);
if (dev_priv->stealth)
pci_release_region(dev->pdev, 2);
}
else
pci_release_regions(dev->pdev);

if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
drm_irq_uninstall(dev_priv->dev);
if (dev->devname == vmw_devname)
Expand Down Expand Up @@ -585,11 +580,6 @@ static int vmw_master_set(struct drm_device *dev,
int ret = 0;

DRM_INFO("Master set.\n");
if (dev_priv->stealth) {
ret = vmw_request_device(dev_priv);
if (unlikely(ret != 0))
return ret;
}

if (active) {
BUG_ON(active != &dev_priv->fbdev_master);
Expand Down Expand Up @@ -649,18 +639,11 @@ static void vmw_master_drop(struct drm_device *dev,

ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);

if (dev_priv->stealth) {
ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM);
if (unlikely(ret != 0))
DRM_ERROR("Unable to clean VRAM on master drop.\n");
vmw_release_device(dev_priv);
}
dev_priv->active_master = &dev_priv->fbdev_master;
ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);
ttm_vt_unlock(&dev_priv->fbdev_master.lock);

if (!dev_priv->stealth)
vmw_fb_on(dev_priv);
vmw_fb_on(dev_priv);
}


Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
info->pixmap.scan_align = 1;
#endif

info->aperture_base = vmw_priv->vram_start;
info->aperture_size = vmw_priv->vram_size;

/*
* Dirty & Deferred IO
*/
Expand Down

0 comments on commit f2d12b8

Please sign in to comment.