summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-11-30 16:21:28 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-11-30 16:21:28 +0900
commit082b6b8ca1878f4b7ab0b25d16b85ba40748ac57 (patch)
treeda26fa5bf34834a6280dba59580cd26831c65fa7 /src/drmmode_display.c
parent82729b1f3b9d57f3002ac2689bfbf37ece0bc3f2 (diff)
Take current scanout_id into account everywhere involved with TearFree
Fixes various potential issues with TearFree enabled, e.g. outputs freezing after display configuration changes. (Ported from radeon commit e543ef3a2fb304cbe3a965fb780632af2e4186f4) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 30a0f54..79c9390 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -663,6 +663,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ unsigned scanout_id = drmmode_crtc->scanout_id ^ info->tear_free;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
int saved_x, saved_y;
Rotation saved_rotation;
@@ -714,7 +715,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
fb_id = drmmode->fb_id;
#ifdef AMDGPU_PIXMAP_SHARING
if (crtc->randr_crtc && crtc->randr_crtc->scanout_pixmap) {
- fb_id = drmmode_crtc->scanout[0].fb_id;
+ fb_id = drmmode_crtc->scanout[scanout_id].fb_id;
x = y = 0;
} else
#endif
@@ -758,11 +759,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
pBox->x2 = max(pBox->x2, pScrn->virtualX);
pBox->y2 = max(pBox->y2, pScrn->virtualY);
- drmmode_crtc->scanout_id = 0;
- fb_id = drmmode_crtc->scanout[0].fb_id;
+ fb_id = drmmode_crtc->scanout[scanout_id].fb_id;
x = y = 0;
- amdgpu_scanout_update_handler(crtc, 0, 0, drmmode_crtc);
+ amdgpu_scanout_do_update(crtc, scanout_id);
amdgpu_glamor_finish(pScrn);
}
}
@@ -845,7 +845,7 @@ done:
} else {
crtc->active = TRUE;
- if (fb_id != drmmode_crtc->scanout[0].fb_id)
+ if (fb_id != drmmode_crtc->scanout[scanout_id].fb_id)
drmmode_crtc_scanout_free(drmmode_crtc);
}
@@ -1096,13 +1096,13 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t * red, uint16_t * green,
static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ unsigned scanout_id = drmmode_crtc->scanout_id;
AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
ScreenPtr screen = crtc->scrn->pScreen;
PixmapDirtyUpdatePtr dirty;
xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
- if (dirty->slave_dst !=
- drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
+ if (dirty->slave_dst != drmmode_crtc->scanout[scanout_id].pixmap)
continue;
PixmapStopDirtyTracking(dirty->src, dirty->slave_dst);
@@ -1127,13 +1127,13 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
}
#ifdef HAS_DIRTYTRACKING_ROTATION
- PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[0].pixmap,
+ PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[scanout_id].pixmap,
0, 0, 0, 0, RR_Rotate_0);
#elif defined(HAS_DIRTYTRACKING2)
- PixmapStartDirtyTracking2(ppix, drmmode_crtc->scanout[0].pixmap,
+ PixmapStartDirtyTracking2(ppix, drmmode_crtc->scanout[scanout_id].pixmap,
0, 0, 0, 0);
#else
- PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[0].pixmap, 0, 0);
+ PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[scanout_id].pixmap, 0, 0);
#endif
return TRUE;
}