mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 17:44:45 +00:00
Prefer crtc of primary output for synchronization when screen has to crtcs with the same coverage
This is adjusting randr_crtc_covering_drawable to cover scenario fixed in 9151f3b1c2ebcc34e63195888ba696f2183ba5e2 Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com> Signed-off-by: Shashank Sharma <contactshashanksharma@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Shashank Sharma
parent
92fb43b8e9
commit
e39a3ee07c
@@ -172,13 +172,16 @@ static RRCrtcPtr
|
||||
amdgpu_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint)
|
||||
{
|
||||
rrScrPrivPtr pScrPriv;
|
||||
RRCrtcPtr crtc, best_crtc;
|
||||
RRCrtcPtr crtc, best_crtc, primary_crtc;
|
||||
int coverage, best_coverage;
|
||||
int c;
|
||||
BoxRec crtc_box, cover_box;
|
||||
RROutputPtr primary_output;
|
||||
|
||||
best_crtc = NULL;
|
||||
best_coverage = 0;
|
||||
primary_crtc = NULL;
|
||||
primary_output = NULL;
|
||||
|
||||
if (!dixPrivateKeyRegistered(rrPrivKey))
|
||||
return NULL;
|
||||
@@ -188,6 +191,10 @@ amdgpu_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint
|
||||
if (!pScrPriv)
|
||||
return NULL;
|
||||
|
||||
primary_output = RRFirstOutput(pScreen);
|
||||
if (primary_output && primary_output->crtc)
|
||||
primary_crtc = primary_output->crtc->devPrivate;
|
||||
|
||||
for (c = 0; c < pScrPriv->numCrtcs; c++) {
|
||||
crtc = pScrPriv->crtcs[c];
|
||||
|
||||
@@ -198,7 +205,8 @@ amdgpu_crtc_covering_box(ScreenPtr pScreen, BoxPtr box, Bool screen_is_xf86_hint
|
||||
amdgpu_crtc_box(crtc, &crtc_box);
|
||||
amdgpu_box_intersect(&cover_box, &crtc_box, box);
|
||||
coverage = amdgpu_box_area(&cover_box);
|
||||
if (coverage > best_coverage) {
|
||||
if (coverage > best_coverage ||
|
||||
(crtc == primary_crtc && coverage == best_coverage)) {
|
||||
best_crtc = crtc;
|
||||
best_coverage = coverage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user