diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-14 08:34:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-14 08:34:46 +0100 |
commit | 3d818c0a36919add462c05d01a64b297f693fa69 (patch) | |
tree | 9a52ca8e42071c6e576e74cf001dadbc2d0ab198 /src/sna | |
parent | 504b18b079e0a12a9d18b46418411805ef1d8377 (diff) |
sna: unwrap old modesetting API whilst hosted
If we are hosted, then we do not have our own modesetting backend and
calling it results in fireworks. So leave the old modesetting entry
points for the hosting midlayer to control.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_driver.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 7f2c0acc..c27deb6f 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -1080,6 +1080,15 @@ static Bool sna_pm_event(SCRN_ARG_TYPE arg, pmEvent event, Bool undo) return TRUE; } +static Bool sna_enter_vt__hosted(VT_FUNC_ARGS_DECL) +{ + return TRUE; +} + +static void sna_leave_vt__hosted(VT_FUNC_ARGS_DECL) +{ +} + Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) { DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); @@ -1110,13 +1119,18 @@ Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) scrn->PreInit = sna_pre_init; scrn->ScreenInit = sna_screen_init; - scrn->SwitchMode = sna_switch_mode; - scrn->AdjustFrame = sna_adjust_frame; - scrn->EnterVT = sna_enter_vt; - scrn->LeaveVT = sna_leave_vt; + if (!hosted()) { + scrn->SwitchMode = sna_switch_mode; + scrn->AdjustFrame = sna_adjust_frame; + scrn->EnterVT = sna_enter_vt; + scrn->LeaveVT = sna_leave_vt; + scrn->ValidMode = sna_valid_mode; + scrn->PMEvent = sna_pm_event; + } else { + scrn->EnterVT = sna_enter_vt__hosted; + scrn->LeaveVT = sna_leave_vt__hosted; + } scrn->FreeScreen = sna_free_screen; - scrn->ValidMode = sna_valid_mode; - scrn->PMEvent = sna_pm_event; xf86SetEntitySharable(entity_num); xf86SetEntityInstanceForScreen(scrn, entity_num, |