xf86-video-amdgpu: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 16 15:36:14 UTC 2022


 src/amdgpu_video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2ec854d48e0e44fc60c3955663f700cbefea3553
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date:   Fri Nov 11 02:18:07 2022 +0100

    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 at gmail.com>
    Fixes: e39a3ee07c9d ("Prefer crtc of primary output for synchronization when screen has to crtcs with the same coverage")

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];


More information about the xorg-commit mailing list