diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-09 11:34:39 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-09 11:46:24 +0100 |
commit | b6b5c3f009585151eb772dfc2526843c7cee82b3 (patch) | |
tree | 63ab8d9eb0a2eb4864db92bc5250d3909fe76238 /src/sna/sna_display.c | |
parent | ab445c23079a76eaa2a7d499ec4755599012bd2f (diff) |
intel: Disable incompatible features whilst hosted
Start adding the infrastructure to disable direct hardware access if X
is being run under a system compositor (aka "hosted").
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 5dcf47fa..f86d93d5 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3151,11 +3151,22 @@ sna_crtc_config_notify(ScreenPtr screen) sna_mode_update(to_sna_from_screen(screen)); } +#if HAS_PIXMAP_SHARING +#define sna_setup_provider(scrn) xf86ProviderSetup(scrn, NULL, "Intel") +#else +#define sna_setup_provider(scrn) +#endif + bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna) { struct sna_mode *mode = &sna->mode; int i; + if (sna->flags & SNA_IS_HOSTED) { + sna_setup_provider(scrn); + return true; + } + mode->kmode = drmModeGetResources(sna->kgem.fd); if (mode->kmode) { xf86CrtcConfigInit(scrn, &sna_mode_funcs); @@ -3172,9 +3183,7 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna) if (!xf86IsEntityShared(scrn->entityList[0])) sna_mode_compute_possible_clones(scrn); -#if HAS_PIXMAP_SHARING - xf86ProviderSetup(scrn, NULL, "Intel"); -#endif + sna_setup_provider(scrn); } else { if (!sna_mode_fake_init(sna)) return false; @@ -3200,6 +3209,9 @@ sna_mode_close(struct sna *sna) while (sna_mode_has_pending_events(sna)) sna_mode_wakeup(sna); + if (sna->flags & SNA_IS_HOSTED) + return; + for (i = 0; i < xf86_config->num_crtc; i++) sna_crtc_disable_shadow(sna, to_sna_crtc(xf86_config->crtc[i])); } |