summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2022-11-11 02:18:07 +0100
committerMario Kleiner <mario.kleiner.de@gmail.com>2022-11-11 03:15:29 +0100
commit2ec854d48e0e44fc60c3955663f700cbefea3553 (patch)
tree5f80b7eb7925a29f9d469ecea5a5f5c77d254702
parent9c959fac3af28d191105f63236096ad456dca614 (diff)
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 <mario.kleiner.de@gmail.com> Fixes: e39a3ee07c9d ("Prefer crtc of primary output for synchronization when screen has to crtcs with the same coverage")
-rw-r--r--src/amdgpu_video.c2
1 files changed, 1 insertions, 1 deletions
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];