diff --git a/drivers/gpu/drm/apple/apple_drv.c b/drivers/gpu/drm/apple/apple_drv.c index e5c6276b7a830..30d69a0b9b95b 100644 --- a/drivers/gpu/drm/apple/apple_drv.c +++ b/drivers/gpu/drm/apple/apple_drv.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "apple_boot_display.h" #include "apple_resume.h" @@ -1567,18 +1568,29 @@ static int apple_platform_probe(struct platform_device *pdev) { struct device *mdev = &pdev->dev; struct component_match *match = NULL; - int num_dcp; + int num_dcp, ret; /* add DCP components, handle less than 1 as probe error */ num_dcp = add_dcp_components(mdev, &match); if (num_dcp < 1) return -ENODEV; - return component_master_add_with_match(mdev, &apple_drm_ops, match); + ret = component_master_add_with_match(mdev, &apple_drm_ops, match); + if (ret) + return ret; + + /* + * The display restores its own state across system sleep, so the PM + * core need not switch to the text console first (which flashes the + * kernel log on screen on every suspend and resume). + */ + pm_vt_switch_required(mdev, false); + return 0; } static void apple_platform_remove(struct platform_device *pdev) { + pm_vt_switch_unregister(&pdev->dev); component_master_del(&pdev->dev, &apple_drm_ops); }