diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-06-19 14:54:20 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-06-19 14:54:20 +1000 |
commit | b24cae0bf5db6ece21439d4c6ff3668aed4c78d6 (patch) | |
tree | 246431dde70a5f1b7184cda2c2ce2287863a9d3b | |
parent | 07c26a0670dd2558acf8e1159f2f68989a7f753d (diff) | |
download | xorg-driver-xf86-video-nouveau-b24cae0bf5db6ece21439d4c6ff3668aed4c78d6.tar.gz |
dri2: move "is supported" checks out of nv_driver.c
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | src/nouveau_dri2.c | 8 | ||||
-rw-r--r-- | src/nv_driver.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index 3785956..12e7af3 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -777,6 +777,9 @@ nouveau_dri2_init(ScreenPtr pScreen) { "nouveau_vieux", "nouveau_vieux" } }; + if (pNv->AccelMethod != EXA) + return FALSE; + if (pNv->Architecture >= NV_ARCH_30) dri2.driverNames = drivernames[0]; else @@ -816,5 +819,8 @@ nouveau_dri2_init(ScreenPtr pScreen) void nouveau_dri2_fini(ScreenPtr pScreen) { - DRI2CloseScreen(pScreen); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + NVPtr pNv = NVPTR(pScrn); + if (pNv->AccelMethod == EXA) + DRI2CloseScreen(pScreen); } diff --git a/src/nv_driver.c b/src/nv_driver.c index ead8b8b..9b274ca 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -613,8 +613,7 @@ NVCloseScreen(CLOSE_SCREEN_ARGS_DECL) if (XF86_CRTC_CONFIG_PTR(pScrn)->num_crtc) drmmode_screen_fini(pScreen); - if (pNv->AccelMethod == EXA) - nouveau_dri2_fini(pScreen); + nouveau_dri2_fini(pScreen); if (pScrn->vtSema) { NVLeaveVT(VT_FUNC_ARGS(0)); @@ -1306,8 +1305,7 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL) } } - if (pNv->AccelMethod == EXA) - nouveau_dri2_init(pScreen); + nouveau_dri2_init(pScreen); /* Allocate and map memory areas we need */ if (!NVMapMem(pScrn)) |