@@ -645,6 +645,15 @@ nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime)
disp->fini(dev, runtime, suspend);
}
+void
+nouveau_display_shutdown(struct drm_device *dev)
+{
+ if (drm_drv_uses_atomic_modeset(dev))
+ drm_atomic_helper_shutdown(dev);
+ else
+ drm_helper_force_disable_all(dev);
+}
+
static void
nouveau_display_create_properties(struct drm_device *dev)
{
@@ -47,6 +47,7 @@ void nouveau_display_destroy(struct drm_device *dev);
int nouveau_display_init(struct drm_device *dev, bool resume, bool runtime);
void nouveau_display_hpd_resume(struct drm_device *dev);
void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
+void nouveau_display_shutdown(struct drm_device *dev);
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
void nouveau_display_resume(struct drm_device *dev, bool runtime);
int nouveau_display_vblank_enable(struct drm_crtc *crtc);
@@ -894,6 +894,18 @@ nouveau_drm_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}
+void
+nouveau_drm_device_shutdown(struct drm_device *dev)
+{
+ nouveau_display_shutdown(dev);
+}
+
+static void
+nouveau_drm_shutdown(struct pci_dev *pdev)
+{
+ nouveau_drm_device_shutdown(pci_get_drvdata(pdev));
+}
+
static int
nouveau_do_suspend(struct drm_device *dev, bool runtime)
{
@@ -1361,6 +1373,7 @@ nouveau_drm_pci_driver = {
.id_table = nouveau_drm_pci_table,
.probe = nouveau_drm_probe,
.remove = nouveau_drm_remove,
+ .shutdown = nouveau_drm_shutdown,
.driver.pm = &nouveau_pm_ops,
};
@@ -327,6 +327,7 @@ struct drm_device *
nouveau_platform_device_create(const struct nvkm_device_tegra_func *,
struct platform_device *, struct nvkm_device **);
void nouveau_drm_device_remove(struct drm_device *dev);
+void nouveau_drm_device_shutdown(struct drm_device *dev);
#define NV_PRINTK(l,c,f,a...) do { \
struct nouveau_cli *_cli = (c); \
@@ -49,6 +49,11 @@ static void nouveau_platform_remove(struct platform_device *pdev)
nouveau_drm_device_remove(dev);
}
+static void nouveau_platform_shutdown(struct platform_device *pdev)
+{
+ nouveau_drm_device_shutdown(platform_get_drvdata(pdev));
+}
+
#if IS_ENABLED(CONFIG_OF)
static const struct nvkm_device_tegra_func gk20a_platform_data = {
.iommu_bit = 34,
@@ -93,4 +98,5 @@ struct platform_driver nouveau_platform_driver = {
},
.probe = nouveau_platform_probe,
.remove_new = nouveau_platform_remove,
+ .shutdown = nouveau_platform_shutdown,
};