From 843f874484d09b9e492683a50f4707e584e3fcb6 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Lopez Perez Date: Tue, 12 Dec 2023 20:39:36 +0000 Subject: [PATCH] REGRESSION(47dee03): Broke DRM plugin on RPi4 (#614) find_crtc_for_encoder() should not only check the bitmask but also the ID of the CRTC. --- platform/drm/cog-platform-drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/drm/cog-platform-drm.c b/platform/drm/cog-platform-drm.c index bd47b1d9..86e8c5ae 100644 --- a/platform/drm/cog-platform-drm.c +++ b/platform/drm/cog-platform-drm.c @@ -358,7 +358,7 @@ find_crtc_for_encoder(const drmModeRes *resources, const drmModeEncoder *encoder for (int i = 0; i < resources->count_crtcs; i++) { const uint32_t crtc_mask = 1 << i; const uint32_t crtc_id = resources->crtcs[i]; - if (encoder->possible_crtcs & crtc_mask) { + if (encoder->possible_crtcs & crtc_mask && encoder->crtc_id == crtc_id) { return crtc_id; } }