diff options
author | Zack Rusin <zackr@vmware.com> | 2020-11-04 05:05:05 +0300 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2021-01-14 20:12:10 +0300 |
commit | 31856c8c1ce4c3ceefe29bbb1f8838182eeb502d (patch) | |
tree | a5d910f631f946e1e2bf70e351c5f20d1ec5eae8 /drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |
parent | 93dd856192b972b9b0881dae68d09c7eff4134cb (diff) | |
download | linux-31856c8c1ce4c3ceefe29bbb1f8838182eeb502d.tar.xz |
drm/vmwgfx: Remove stealth mode
Before drm got helpers for removing conflicting pci framebuffer devices
we implemented something known as "stealth" mode which allowed vmwgfx
to run even if it couldn't reserve pci resources. We can just switch
to regular drm helpers instead of keeping the stealth mode alive as
it makes our code a lot cleaner.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Link: https://patchwork.freedesktop.org/patch/414043/?series=85516&rev=2
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_drv.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 1f3d67582c87..99bbc25fce31 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -32,6 +32,7 @@ #include <linux/mem_encrypt.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_ioctl.h> #include <drm/drm_sysfs.h> #include <drm/ttm/ttm_bo_driver.h> @@ -841,19 +842,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) dev->dev_private = dev_priv; ret = pci_request_regions(pdev, "vmwgfx probe"); - dev_priv->stealth = (ret != 0); - if (dev_priv->stealth) { - /** - * Request at least the mmio PCI resource. - */ - - DRM_INFO("It appears like vesafb is loaded. " - "Ignore above error if any.\n"); - ret = pci_request_region(pdev, 2, "vmwgfx stealth probe"); - if (unlikely(ret != 0)) { - DRM_ERROR("Failed reserving the SVGA MMIO resource.\n"); - goto out_no_device; - } + if (ret) { + DRM_ERROR("Failed reserving PCI regions.\n"); + goto out_no_device; } if (dev_priv->capabilities & SVGA_CAP_IRQMASK) { @@ -1002,10 +993,7 @@ out_no_fman: if (dev_priv->capabilities & SVGA_CAP_IRQMASK) vmw_irq_uninstall(dev_priv->dev); out_no_irq: - if (dev_priv->stealth) - pci_release_region(pdev, 2); - else - pci_release_regions(pdev); + pci_release_regions(pdev); out_no_device: ttm_object_device_release(&dev_priv->tdev); out_err4: @@ -1054,10 +1042,7 @@ static void vmw_driver_unload(struct drm_device *dev) vmw_fence_manager_takedown(dev_priv->fman); if (dev_priv->capabilities & SVGA_CAP_IRQMASK) vmw_irq_uninstall(dev_priv->dev); - if (dev_priv->stealth) - pci_release_region(pdev, 2); - else - pci_release_regions(pdev); + pci_release_regions(pdev); ttm_object_device_release(&dev_priv->tdev); memunmap(dev_priv->mmio_virt); @@ -1511,6 +1496,10 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct drm_device *dev; int ret; + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "svgadrmfb"); + if (ret) + return ret; + ret = pci_enable_device(pdev); if (ret) return ret; |