summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_display_driver.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2023-04-14 12:41:55 +0300
committerJani Nikula <jani.nikula@intel.com>2023-04-17 11:16:58 +0300
commitff2c80be1a002ae268ee78e3cf183b89c1aef77c (patch)
tree58f3349c5ffa1c809a94d27e634d970a68c66bb4 /drivers/gpu/drm/i915/display/intel_display_driver.c
parent77316e7552137e1ed1ac3d719be844f36756eb1c (diff)
drm/i915/display: move intel_modeset_probe_defer() to intel_display_driver.[ch]
High level display functionality only called from driver top level code. Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/831ed4d0356b51526704269038a6d2d72739e779.1681465222.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_display_driver.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_display_driver.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index d4a1893e9218..1386f2001613 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -7,8 +7,10 @@
* details here.
*/
+#include <linux/vga_switcheroo.h>
#include <acpi/video.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_privacy_screen_consumer.h>
#include <drm/drm_probe_helper.h>
#include "i915_drv.h"
@@ -19,6 +21,27 @@
#include "intel_fbdev.h"
#include "intel_opregion.h"
+bool intel_modeset_probe_defer(struct pci_dev *pdev)
+{
+ struct drm_privacy_screen *privacy_screen;
+
+ /*
+ * apple-gmux is needed on dual GPU MacBook Pro
+ * to probe the panel if we're the inactive GPU.
+ */
+ if (vga_switcheroo_client_probe_defer(pdev))
+ return true;
+
+ /* If the LCD panel has a privacy-screen, wait for it */
+ privacy_screen = drm_privacy_screen_get(&pdev->dev, NULL);
+ if (IS_ERR(privacy_screen) && PTR_ERR(privacy_screen) == -EPROBE_DEFER)
+ return true;
+
+ drm_privacy_screen_put(privacy_screen);
+
+ return false;
+}
+
void intel_display_driver_register(struct drm_i915_private *i915)
{
if (!HAS_DISPLAY(i915))