From ef64c4f43cda0037e837fe9210891627517705a0 Mon Sep 17 00:00:00 2001
From: Rouven Czerwinski <rouven@czerwinskis.de>
Date: Thu, 30 May 2024 07:23:29 +0200
Subject: [PATCH 1/2] backend/drm: constrain eDP displays to first CRTC

At least on intel hardware, only pipe A as the first CRTC is able to handle PSR/FBC to support lower
pc10 package states. This is a problem for situations where the internal display is disabled and
other monitors are connected, since the match logic will use another CRTC instead of the first one
to not enable/disable CRTCs unnecessarily.

Constrain internal eDP displays to the first CRTC.
---
 backend/drm/drm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 07880c47..e176f2ce 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1372,6 +1372,11 @@ static struct wlr_drm_connector *create_drm_connector(struct wlr_drm_backend *dr
 		wlr_drm_conn_log(wlr_conn, WLR_ERROR, "No CRTC possible");
 	}
 
+	// Constrain eDP displays to the first crtc
+	if (drm_conn->connector_type_id == DRM_MODE_CONNECTOR_eDP) {
+		wlr_conn->possible_crtcs = 1;
+	}
+
 	wlr_conn->crtc = connector_get_current_crtc(wlr_conn, drm_conn);
 
 	wl_list_insert(drm->connectors.prev, &wlr_conn->link);
-- 
2.44.1

