diff options
Diffstat (limited to 'src/nouveau_xv.c')
-rw-r--r-- | src/nouveau_xv.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c index ee72848..cb950e4 100644 --- a/src/nouveau_xv.c +++ b/src/nouveau_xv.c | |||
@@ -285,12 +285,13 @@ NVFreeOverlayMemory(ScrnInfoPtr pScrn) | |||
285 | NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv); | 285 | NVPortPrivPtr pPriv = GET_OVERLAY_PRIVATE(pNv); |
286 | 286 | ||
287 | NVFreePortMemory(pScrn, pPriv); | 287 | NVFreePortMemory(pScrn, pPriv); |
288 | 288 | #if NVOVL_SUPPORT | |
289 | /* "power cycle" the overlay */ | 289 | /* "power cycle" the overlay */ |
290 | nvWriteMC(pNv, NV_PMC_ENABLE, | 290 | nvWriteMC(pNv, NV_PMC_ENABLE, |
291 | (nvReadMC(pNv, NV_PMC_ENABLE) & 0xEFFFFFFF)); | 291 | (nvReadMC(pNv, NV_PMC_ENABLE) & 0xEFFFFFFF)); |
292 | nvWriteMC(pNv, NV_PMC_ENABLE, | 292 | nvWriteMC(pNv, NV_PMC_ENABLE, |
293 | (nvReadMC(pNv, NV_PMC_ENABLE) | 0x10000000)); | 293 | (nvReadMC(pNv, NV_PMC_ENABLE) | 0x10000000)); |
294 | #endif | ||
294 | } | 295 | } |
295 | 296 | ||
296 | /** | 297 | /** |
@@ -805,6 +806,7 @@ NV_set_action_flags(ScrnInfoPtr pScrn, DrawablePtr pDraw, NVPortPrivPtr pPriv, | |||
805 | } | 806 | } |
806 | #endif | 807 | #endif |
807 | 808 | ||
809 | #ifdef NVOVL_SUPPORT | ||
808 | if (USING_OVERLAY) { | 810 | if (USING_OVERLAY) { |
809 | char crtc = nv_window_belongs_to_crtc(pScrn, drw_x, drw_y, | 811 | char crtc = nv_window_belongs_to_crtc(pScrn, drw_x, drw_y, |
810 | drw_w, drw_h); | 812 | drw_w, drw_h); |
@@ -845,6 +847,7 @@ NV_set_action_flags(ScrnInfoPtr pScrn, DrawablePtr pDraw, NVPortPrivPtr pPriv, | |||
845 | ->rotation != RR_Rotate_0) | 847 | ->rotation != RR_Rotate_0) |
846 | *action_flags &= ~USE_OVERLAY; | 848 | *action_flags &= ~USE_OVERLAY; |
847 | } | 849 | } |
850 | #endif | ||
848 | 851 | ||
849 | /* At this point the adapter we're going to use is _known_. | 852 | /* At this point the adapter we're going to use is _known_. |
850 | * You cannot change it now. | 853 | * You cannot change it now. |
@@ -991,6 +994,7 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, | |||
991 | 994 | ||
992 | /* The overlay supports hardware double buffering. We handle this here*/ | 995 | /* The overlay supports hardware double buffering. We handle this here*/ |
993 | offset = 0; | 996 | offset = 0; |
997 | #ifdef NVOVL_SUPPORT | ||
994 | if (pPriv->doubleBuffer) { | 998 | if (pPriv->doubleBuffer) { |
995 | int mask = 1 << (pPriv->currentBuffer << 2); | 999 | int mask = 1 << (pPriv->currentBuffer << 2); |
996 | 1000 | ||
@@ -1004,6 +1008,7 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, | |||
1004 | offset += newFBSize >> 1; | 1008 | offset += newFBSize >> 1; |
1005 | } | 1009 | } |
1006 | } | 1010 | } |
1011 | #endif | ||
1007 | 1012 | ||
1008 | /* Now we take a decision regarding the way we send the data to the | 1013 | /* Now we take a decision regarding the way we send the data to the |
1009 | * card. | 1014 | * card. |
@@ -1601,7 +1606,7 @@ NVSetupBlitVideo (ScreenPtr pScreen) | |||
1601 | for(i = 0; i < NUM_BLIT_PORTS; i++) | 1606 | for(i = 0; i < NUM_BLIT_PORTS; i++) |
1602 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); | 1607 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); |
1603 | 1608 | ||
1604 | if(pNv->WaitVSyncPossible) { | 1609 | if (pNv->NVArch >= 0x11) { |
1605 | adapt->pAttributes = NVBlitAttributes; | 1610 | adapt->pAttributes = NVBlitAttributes; |
1606 | adapt->nAttributes = NUM_BLIT_ATTRIBUTES; | 1611 | adapt->nAttributes = NUM_BLIT_ATTRIBUTES; |
1607 | } else { | 1612 | } else { |
@@ -1628,7 +1633,7 @@ NVSetupBlitVideo (ScreenPtr pScreen) | |||
1628 | pPriv->texture = FALSE; | 1633 | pPriv->texture = FALSE; |
1629 | pPriv->bicubic = FALSE; | 1634 | pPriv->bicubic = FALSE; |
1630 | pPriv->doubleBuffer = FALSE; | 1635 | pPriv->doubleBuffer = FALSE; |
1631 | pPriv->SyncToVBlank = pNv->WaitVSyncPossible; | 1636 | pPriv->SyncToVBlank = (pNv->NVArch >= 0x11); |
1632 | 1637 | ||
1633 | pNv->blitAdaptor = adapt; | 1638 | pNv->blitAdaptor = adapt; |
1634 | 1639 | ||
@@ -1771,7 +1776,7 @@ NVChipsetHasOverlay(NVPtr pNv) | |||
1771 | case NV_ARCH_30: | 1776 | case NV_ARCH_30: |
1772 | return TRUE; | 1777 | return TRUE; |
1773 | case NV_ARCH_40: | 1778 | case NV_ARCH_40: |
1774 | if ((pNv->Chipset & 0xfff0) == CHIPSET_NV40) | 1779 | if (pNv->NVArch == 0x40) |
1775 | return TRUE; | 1780 | return TRUE; |
1776 | break; | 1781 | break; |
1777 | default: | 1782 | default: |
@@ -1798,7 +1803,7 @@ NVSetupOverlayVideo(ScreenPtr pScreen) | |||
1798 | XF86VideoAdaptorPtr overlayAdaptor = NULL; | 1803 | XF86VideoAdaptorPtr overlayAdaptor = NULL; |
1799 | NVPtr pNv = NVPTR(pScrn); | 1804 | NVPtr pNv = NVPTR(pScrn); |
1800 | 1805 | ||
1801 | if (pNv->kms_enable || !NVChipsetHasOverlay(pNv)) | 1806 | if (1 /*pNv->kms_enable*/ || !NVChipsetHasOverlay(pNv)) |
1802 | return NULL; | 1807 | return NULL; |
1803 | 1808 | ||
1804 | overlayAdaptor = NVSetupOverlayVideoAdapter(pScreen); | 1809 | overlayAdaptor = NVSetupOverlayVideoAdapter(pScreen); |
@@ -1868,14 +1873,8 @@ NV30SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | |||
1868 | for(i = 0; i < NUM_TEXTURE_PORTS; i++) | 1873 | for(i = 0; i < NUM_TEXTURE_PORTS; i++) |
1869 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); | 1874 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); |
1870 | 1875 | ||
1871 | if (pNv->WaitVSyncPossible) { | 1876 | adapt->pAttributes = NVTexturedAttributes; |
1872 | adapt->pAttributes = NVTexturedAttributes; | 1877 | adapt->nAttributes = NUM_TEXTURED_ATTRIBUTES; |
1873 | adapt->nAttributes = NUM_TEXTURED_ATTRIBUTES; | ||
1874 | } else { | ||
1875 | adapt->pAttributes = NULL; | ||
1876 | adapt->nAttributes = 0; | ||
1877 | } | ||
1878 | |||
1879 | adapt->pImages = NV30TexturedImages; | 1878 | adapt->pImages = NV30TexturedImages; |
1880 | adapt->nImages = NUM_FORMAT_TEXTURED; | 1879 | adapt->nImages = NUM_FORMAT_TEXTURED; |
1881 | adapt->PutVideo = NULL; | 1880 | adapt->PutVideo = NULL; |
@@ -1895,7 +1894,7 @@ NV30SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | |||
1895 | pPriv->texture = TRUE; | 1894 | pPriv->texture = TRUE; |
1896 | pPriv->bicubic = bicubic; | 1895 | pPriv->bicubic = bicubic; |
1897 | pPriv->doubleBuffer = FALSE; | 1896 | pPriv->doubleBuffer = FALSE; |
1898 | pPriv->SyncToVBlank = pNv->WaitVSyncPossible; | 1897 | pPriv->SyncToVBlank = TRUE; |
1899 | 1898 | ||
1900 | if (bicubic) | 1899 | if (bicubic) |
1901 | pNv->textureAdaptor[1] = adapt; | 1900 | pNv->textureAdaptor[1] = adapt; |
@@ -1955,14 +1954,8 @@ NV40SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | |||
1955 | for(i = 0; i < NUM_TEXTURE_PORTS; i++) | 1954 | for(i = 0; i < NUM_TEXTURE_PORTS; i++) |
1956 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); | 1955 | adapt->pPortPrivates[i].ptr = (pointer)(pPriv); |
1957 | 1956 | ||
1958 | if(pNv->WaitVSyncPossible) { | 1957 | adapt->pAttributes = NVTexturedAttributes; |
1959 | adapt->pAttributes = NVTexturedAttributes; | 1958 | adapt->nAttributes = NUM_TEXTURED_ATTRIBUTES; |
1960 | adapt->nAttributes = NUM_TEXTURED_ATTRIBUTES; | ||
1961 | } else { | ||
1962 | adapt->pAttributes = NULL; | ||
1963 | adapt->nAttributes = 0; | ||
1964 | } | ||
1965 | |||
1966 | adapt->pImages = NV40TexturedImages; | 1959 | adapt->pImages = NV40TexturedImages; |
1967 | adapt->nImages = NUM_FORMAT_TEXTURED; | 1960 | adapt->nImages = NUM_FORMAT_TEXTURED; |
1968 | adapt->PutVideo = NULL; | 1961 | adapt->PutVideo = NULL; |
@@ -1982,7 +1975,7 @@ NV40SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic) | |||
1982 | pPriv->texture = TRUE; | 1975 | pPriv->texture = TRUE; |
1983 | pPriv->bicubic = bicubic; | 1976 | pPriv->bicubic = bicubic; |
1984 | pPriv->doubleBuffer = FALSE; | 1977 | pPriv->doubleBuffer = FALSE; |
1985 | pPriv->SyncToVBlank = pNv->WaitVSyncPossible; | 1978 | pPriv->SyncToVBlank = TRUE; |
1986 | 1979 | ||
1987 | if (bicubic) | 1980 | if (bicubic) |
1988 | pNv->textureAdaptor[1] = adapt; | 1981 | pNv->textureAdaptor[1] = adapt; |