Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: change pipe order for platforms with big joiner
@ 2025-11-18  9:58 Jani Nikula
  2025-11-18 13:37 ` [PATCH v2] " Jani Nikula
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jani Nikula @ 2025-11-18  9:58 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: jani.nikula

When big joiner is enabled, it reserves the adjacent pipe as the
secondary pipe. This happens without the user space knowing, and
subsequent attempts at using the CRTC with that pipe will fail. If the
user space does not have a coping mechanism, i.e. trying another pipe,
this leads to a black screen.

If the platform allows joining A+B, map the CRTCs to pipes in order A,
C, B, and D to trick userspace to using pipes that are more likely to be
available for joining.

Although there are currently no platforms with more than four pipes, add
a fallback for initializing the rest of the pipes to not miss them.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Let's see what breaks...
---
 .../drm/i915/display/intel_display_driver.c   | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index 7e000ba3e08b..83aad727017b 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -452,6 +452,7 @@ bool intel_display_driver_check_access(struct intel_display *display)
 /* part #2: call after irq install, but before gem init */
 int intel_display_driver_probe_nogem(struct intel_display *display)
 {
+	u8 pipe_mask = U8_MAX;
 	enum pipe pipe;
 	int ret;
 
@@ -470,7 +471,30 @@ int intel_display_driver_probe_nogem(struct intel_display *display)
 		    INTEL_NUM_PIPES(display),
 		    INTEL_NUM_PIPES(display) > 1 ? "s" : "");
 
-	for_each_pipe(display, pipe) {
+	/*
+	 * If we have a joiner that can join A+B, expose the pipes in order A,
+	 * C, B, D to trick user space into using pipes that are more likely to
+	 * be available for both a) user space if pipe B has been reserved for
+	 * the joiner, and b) the joiner if pipe A doesn't need the joiner.
+	 *
+	 * Fall back to normal initialization for the remaining pipes, if any.
+	 */
+	if (HAS_BIGJOINER(display) && DISPLAY_VER(display) >= 12) {
+		enum pipe pipe_order[] = { PIPE_A, PIPE_C, PIPE_B, PIPE_D };
+		int i;
+
+		for (i = 0; i < ARRAY_SIZE(pipe_order); i++) {
+			pipe = pipe_order[i];
+
+			ret = intel_crtc_init(display, pipe);
+			if (ret)
+				goto err_mode_config;
+
+			pipe_mask &= ~BIT(pipe);
+		}
+	}
+
+	for_each_pipe_masked(display, pipe, pipe_mask) {
 		ret = intel_crtc_init(display, pipe);
 		if (ret)
 			goto err_mode_config;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-11-19 18:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18  9:58 [PATCH] drm/i915/display: change pipe order for platforms with big joiner Jani Nikula
2025-11-18 13:37 ` [PATCH v2] " Jani Nikula
2025-11-18 13:43   ` Jani Nikula
2025-11-18 17:40     ` Ville Syrjälä
2025-11-18 19:34       ` Ville Syrjälä
2025-11-19 13:09         ` Jani Nikula
2025-11-19 18:36           ` Ville Syrjälä
2025-11-18 15:44 ` ✓ CI.KUnit: success for drm/i915/display: change pipe order for platforms with big joiner (rev2) Patchwork
2025-11-19  8:05 ` Patchwork
2025-11-19  8:35 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-19  8:59 ` ✗ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox