From 2ec854d48e0e44fc60c3955663f700cbefea3553 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Fri, 11 Nov 2022 02:18:07 +0100 Subject: Fix primary output handling in amdgpu_crtc_covering_box(). Commit e39a3ee07c9dea73b0452b71b1ef633b6cd6f389 tries to reintroduce the RandR primary output as a tie breaker in amdgpu_crtc_covering_box(), but that function wrongly assigns a void* devPrivate, which is actually a xf86CrtcPtr, to the RRCrtcPtr primary_crtc, a pointer target type mismatch! This causes a later pointer comparison of primary_crtc with RRCrtcPtr crtc to always fail, so that the user selected primary output can not ever successfully act as a tie-breaker when multiple candidate crtcs cover the same box area, defeating the whole purpose of that commit! Not sure how this failure could have ever evaded any basic testing. Fix this trivially by assigning the right variable. Successfully tested on a multi-display setup, verifying that the primary output now works as tie breaker as intended. Signed-off-by: Mario Kleiner Fixes: e39a3ee07c9d ("Prefer crtc of primary output for synchronization when screen has to crtcs with the same coverage") --- src/amdgpu_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amdgpu_video.c b/src/amdgpu_video.c index 9cf8ea1..9ce8267 100644 --- a/src/amdgpu_video.c +++ b/src/amdgpu_video.c @@ -126,7 +126,7 @@ amdgpu_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint primary_output = RRFirstOutput(pScreen); if (primary_output && primary_output->crtc) - primary_crtc = primary_output->crtc->devPrivate; + primary_crtc = primary_output->crtc; for (c = 0; c < pScrPriv->numCrtcs; c++) { crtc = pScrPriv->crtcs[c]; -- cgit v1.2.3