@@ -89,6 +89,7 @@ struct nvkm_device_func {
struct nvkm_device_tegra *(*tegra)(struct nvkm_device *);
void *(*dtor)(struct nvkm_device *);
int (*preinit)(struct nvkm_device *);
+ int (*oneinit)(struct nvkm_device *);
int (*init)(struct nvkm_device *);
void (*fini)(struct nvkm_device *, bool suspend);
int (*irq)(struct nvkm_device *);
@@ -804,11 +804,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
device = pci_get_drvdata(pdev);
- /* Remove conflicting drivers (vesafb, efifb etc). */
- ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver_pci);
- if (ret)
- return ret;
-
pci_set_master(pdev);
if (nouveau_atomic)
@@ -2954,6 +2954,12 @@ nvkm_device_oneinit(struct nvkm_device *device)
#undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE
+ if (device->func->oneinit) {
+ ret = device->func->oneinit(device);
+ if (ret)
+ goto done;
+ }
+
ret = nvkm_intr_install(device);
done:
if (ret) {
@@ -26,6 +26,7 @@
#include "acpi.h"
#include "priv.h"
+#include <linux/aperture.h>
#include <linux/vga_switcheroo.h>
struct nvkm_device_pci_device {
@@ -1608,6 +1609,15 @@ nvkm_device_pci_preinit(struct nvkm_device *device)
return 0;
}
+static int
+nvkm_device_pci_oneinit(struct nvkm_device *device)
+{
+ struct nvkm_device_pci *pdev = nvkm_device_pci(device);
+
+ /* Remove conflicting drivers (vesafb, efifb etc). */
+ return aperture_remove_conflicting_pci_devices(pdev->pdev, "nvkm");
+}
+
static void *
nvkm_device_pci_dtor(struct nvkm_device *device)
{
@@ -1621,6 +1631,7 @@ nvkm_device_pci_func = {
.pci = nvkm_device_pci,
.dtor = nvkm_device_pci_dtor,
.preinit = nvkm_device_pci_preinit,
+ .oneinit = nvkm_device_pci_oneinit,
.fini = nvkm_device_pci_fini,
.irq = nvkm_device_pci_irq,
.resource_addr = nvkm_device_pci_resource_addr,
Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> --- drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 1 + drivers/gpu/drm/nouveau/nouveau_drm.c | 5 ----- drivers/gpu/drm/nouveau/nvkm/device/base.c | 6 ++++++ drivers/gpu/drm/nouveau/nvkm/device/pci.c | 11 +++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-)