From: Hans de Goede <hdegoede@redhat.com>
To: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Rajat Jain" <rajatja@google.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
Lyude <lyude@redhat.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Mark Gross" <markgross@kernel.org>,
"Andy Shevchenko" <andy@infradead.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
Mario Limonciello <mario.limonciello@outlook.com>,
Mark Pearson <markpearson@lenovo.com>,
Sebastien Bacher <seb128@ubuntu.com>,
Marco Trevisan <marco.trevisan@canonical.com>,
Emil Velikov <emil.l.velikov@gmail.com>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel@lists.freedesktop.org,
platform-driver-x86@vger.kernel.org
Subject: [Intel-gfx] [PATCH 09/10] drm/i915: Add intel_modeset_probe_defer() helper
Date: Sat, 2 Oct 2021 18:36:17 +0200 [thread overview]
Message-ID: <20211002163618.99175-10-hdegoede@redhat.com> (raw)
In-Reply-To: <20211002163618.99175-1-hdegoede@redhat.com>
The upcoming privacy-screen support adds another check for
deferring probe till some other drivers have bound first.
Factor out the current vga_switcheroo_client_probe_defer() check
into an intel_modeset_probe_defer() helper, so that further
probe-deferral checks can be added there.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 13 +++++++++++++
drivers/gpu/drm/i915/display/intel_display.h | 1 +
drivers/gpu/drm/i915/i915_pci.c | 9 ++-------
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 60b2bc3ad011..e67f3207ba54 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/dma-resv.h>
#include <linux/slab.h>
+#include <linux/vga_switcheroo.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
@@ -12690,6 +12691,18 @@ void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915)
intel_bios_driver_remove(i915);
}
+bool intel_modeset_probe_defer(struct pci_dev *pdev)
+{
+ /*
+ * 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;
+
+ return false;
+}
+
void intel_display_driver_register(struct drm_i915_private *i915)
{
if (!HAS_DISPLAY(i915))
diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index 3028072c2cf3..d3d34acb6c08 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -633,6 +633,7 @@ void intel_display_driver_register(struct drm_i915_private *i915);
void intel_display_driver_unregister(struct drm_i915_private *i915);
/* modesetting */
+bool intel_modeset_probe_defer(struct pci_dev *pdev);
void intel_modeset_init_hw(struct drm_i915_private *i915);
int intel_modeset_init_noirq(struct drm_i915_private *i915);
int intel_modeset_init_nogem(struct drm_i915_private *i915);
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index d4a6a9dcf182..cf4ad648b742 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -22,8 +22,6 @@
*
*/
-#include <linux/vga_switcheroo.h>
-
#include <drm/drm_drv.h>
#include <drm/i915_pciids.h>
@@ -1187,11 +1185,8 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (PCI_FUNC(pdev->devfn))
return -ENODEV;
- /*
- * 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))
+ /* Detect if we need to wait for other drivers early on */
+ if (intel_modeset_probe_defer(pdev))
return -EPROBE_DEFER;
err = i915_driver_probe(pdev, ent);
--
2.31.1
next prev parent reply other threads:[~2021-10-02 16:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-02 16:36 [Intel-gfx] [PATCH 00/10] drm: Add privacy-screen class and connector properties Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 01/10] drm/connector: Add support for privacy-screen properties (v4) Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 02/10] drm: Add privacy-screen class (v4) Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 03/10] drm/privacy-screen: Add X86 specific arch init code Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 04/10] drm/privacy-screen: Add notifier support (v2) Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 05/10] drm/connector: Add a drm_connector privacy-screen helper functions (v2) Hans de Goede
2021-10-04 15:22 ` Ville Syrjälä
2021-10-04 15:40 ` Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 06/10] platform/x86: thinkpad_acpi: Add hotkey_notify_extended_hotkey() helper Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 07/10] platform/x86: thinkpad_acpi: Get privacy-screen / lcdshadow ACPI handles only once Hans de Goede
2021-10-02 16:36 ` [Intel-gfx] [PATCH 08/10] platform/x86: thinkpad_acpi: Register a privacy-screen device Hans de Goede
2021-10-02 16:36 ` Hans de Goede [this message]
2021-10-04 15:34 ` [Intel-gfx] [PATCH 09/10] drm/i915: Add intel_modeset_probe_defer() helper Ville Syrjälä
2021-10-02 16:36 ` [Intel-gfx] [PATCH 10/10] drm/i915: Add privacy-screen support (v2) Hans de Goede
2021-10-04 15:37 ` Ville Syrjälä
2021-10-04 16:02 ` Hans de Goede
2021-10-04 18:48 ` Ville Syrjälä
2021-10-02 17:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Add privacy-screen class and connector properties (rev5) Patchwork
2021-10-02 17:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-02 17:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-02 18:53 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2021-10-05 20:23 [Intel-gfx] [PATCH 00/10] drm: Add privacy-screen class and connector properties Hans de Goede
2021-10-05 20:23 ` [Intel-gfx] [PATCH 09/10] drm/i915: Add intel_modeset_probe_defer() helper Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211002163618.99175-10-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=airlied@linux.ie \
--cc=andy@infradead.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=lyude@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marco.trevisan@canonical.com \
--cc=mario.limonciello@outlook.com \
--cc=markgross@kernel.org \
--cc=markpearson@lenovo.com \
--cc=mripard@kernel.org \
--cc=pekka.paalanen@collabora.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rajatja@google.com \
--cc=rodrigo.vivi@intel.com \
--cc=seb128@ubuntu.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox