Skip to content
Browse files

xv: don't try to init textured video without 3d engine object

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information...
1 parent fe7e042 commit ab7291d368ddc66ad21c5ad5caa0faeee42ccaf1 Ben Skeggs committed Mar 21, 2012
Showing with 23 additions and 11 deletions.
  1. +23 −11 src/nouveau_xv.c
View
34 src/nouveau_xv.c
@@ -2022,6 +2022,28 @@ NV50SetupTexturedVideo (ScreenPtr pScreen)
return adapt;
}
+void
+NVSetupTexturedVideo (ScreenPtr pScreen, XF86VideoAdaptorPtr *textureAdaptor)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ NVPtr pNv = NVPTR(pScrn);
+
+ if (!pNv->Nv3D)
+ return;
+
+ if (pNv->Architecture == NV_ARCH_30) {
+ textureAdaptor[0] = NV30SetupTexturedVideo(pScreen, FALSE);
+ textureAdaptor[1] = NV30SetupTexturedVideo(pScreen, TRUE);
+ } else
+ if (pNv->Architecture == NV_ARCH_40) {
+ textureAdaptor[0] = NV40SetupTexturedVideo(pScreen, FALSE);
+ textureAdaptor[1] = NV40SetupTexturedVideo(pScreen, TRUE);
+ } else
+ if (pNv->Architecture >= NV_ARCH_50) {
+ textureAdaptor[0] = NV50SetupTexturedVideo(pScreen);
+ }
+}
+
/**
* NVInitVideo
* tries to initialize the various supported adapters
@@ -2056,17 +2078,7 @@ NVInitVideo(ScreenPtr pScreen)
blitAdaptor = NVSetupBlitVideo(pScreen);
}
- if (pNv->Architecture == NV_ARCH_30) {
- textureAdaptor[0] = NV30SetupTexturedVideo(pScreen, FALSE);
- textureAdaptor[1] = NV30SetupTexturedVideo(pScreen, TRUE);
- } else
- if (pNv->Architecture == NV_ARCH_40) {
- textureAdaptor[0] = NV40SetupTexturedVideo(pScreen, FALSE);
- textureAdaptor[1] = NV40SetupTexturedVideo(pScreen, TRUE);
- } else
- if (pNv->Architecture >= NV_ARCH_50) {
- textureAdaptor[0] = NV50SetupTexturedVideo(pScreen);
- }
+ NVSetupTexturedVideo(pScreen, textureAdaptor);
}
num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);

0 comments on commit ab7291d

Please sign in to comment.
Something went wrong with that request. Please try again.