diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-05 11:05:28 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-05 11:11:08 +0100 |
commit | dff25e5ec4071a0404f82760e8deec3f99f4a0a9 (patch) | |
tree | b650cec01f7685d6214ff44116d99519c67b764c /src/sna/sna_driver.c | |
parent | 46981d01700c1159bfb6bc0aebc938ff1d447a0f (diff) |
sna: Drop master after discarding framebuffers
As Imre Deak pointed out in the previous patch, drmModeRmFB only works
when we hold the DRM master, therefore to prevent a leak of the
framebuffer across server reset we need to defer dropping master until
after we release our scanouts and modes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r-- | src/sna/sna_driver.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index a1936079..b814e1fd 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -701,15 +701,12 @@ static void sna_leave_vt(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); struct sna *sna = to_sna(scrn); - int ret; DBG(("%s\n", __FUNCTION__)); - xf86RotateFreeShadow(scrn); xf86_hide_cursors(scrn); - ret = drmDropMaster(sna->kgem.fd); - if (ret) + if (drmDropMaster(sna->kgem.fd)) xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmDropMaster failed: %s\n", strerror(errno)); } @@ -739,16 +736,14 @@ static Bool sna_early_close_screen(CLOSE_SCREEN_ARGS_DECL) if (sna_mode_has_pending_events(sna)) sna_mode_wakeup(sna); - if (scrn->vtSema == TRUE) { - sna_leave_vt(VT_FUNC_ARGS(0)); - scrn->vtSema = FALSE; - } - if (sna->dri_open) { sna_dri_close(sna, screen); sna->dri_open = false; } + xf86_hide_cursors(scrn); + scrn->vtSema = FALSE; + xf86_cursors_fini(screen); return TRUE; @@ -769,6 +764,7 @@ static Bool sna_late_close_screen(CLOSE_SCREEN_ARGS_DECL) } sna_accel_close(sna); + drmDropMaster(sna->kgem.fd); depths = screen->allowedDepths; for (d = 0; d < screen->numDepths; d++) |