diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-03-18 18:47:10 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-03-23 18:59:20 +0900 |
commit | 6b930fb3285dea4a6440e31099c96f08da508d49 (patch) | |
tree | ec2584e0783105f63960a489a2fe0025c18e8cec | |
parent | 6889e091442b6ba1b9351e72bd067425e87d96e9 (diff) |
present: Clear drmmode->fb_id before calling set_mode_major for unflip
Without this, drmmode_set_mode_major may just re-set the FB for the
last flipped BO, in which case the display will probably freeze.
Reproduction recipe: Enable rotation while a fullscreen client is
flipping.
(Ported from radeon commit 40191d82370eb7e58bd34c44966cbf44c3703229)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/amdgpu_present.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index 5de1d19..c11a807 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -324,6 +324,7 @@ static void amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); AMDGPUInfoPtr info = AMDGPUPTR(scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); struct amdgpu_present_vblank_event *event; @@ -348,6 +349,12 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id) return; modeset: + /* info->drmmode.fb_id still points to the FB for the last flipped BO. + * Clear it, drmmode_set_mode_major will re-create it + */ + drmModeRmFB(pAMDGPUEnt->fd, info->drmmode.fb_id); + info->drmmode.fb_id = 0; + for (i = 0; i < config->num_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; |