From 0188d8661ea5671a81f2d601167214df117277d2 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Thu, 26 May 2005 19:49:18 +0000 Subject: [PATCH] added shared_info flag to assess PCI or AGP mode. Engine (if in DMA mode) selects PCI or AGP transfers accordingly (pre-NV40 only for now). It seems the combination of the 1Mb cmd buffer size and it being in main mem makes it all fast. (1Mb in gfx card remains at same speed at 32kb.). Maybe we can even use AGP engine transfers for placing textures on the gfx card in the future: who knows. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12848 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/accelerants/nvidia/InitAccelerant.c | 2 +- src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c | 13 ++++++++++--- src/add-ons/accelerants/nvidia/engine/nv_agp.c | 7 ++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/add-ons/accelerants/nvidia/InitAccelerant.c b/src/add-ons/accelerants/nvidia/InitAccelerant.c index 330e19f6f9..01ff90df1c 100644 --- a/src/add-ons/accelerants/nvidia/InitAccelerant.c +++ b/src/add-ons/accelerants/nvidia/InitAccelerant.c @@ -4,7 +4,7 @@ Other authors: Mark Watson, - Rudolf Cornelissen 10/2002-4/2005. + Rudolf Cornelissen 10/2002-5/2005. */ #define MODULE_BIT 0x00800000 diff --git a/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c b/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c index 82385dcc5a..42632e0ba5 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c @@ -395,9 +395,16 @@ status_t nv_acc_init_dma() //main mem DMA buf test on pre-NV40 if (1)//si->ps.card_type == NV04) { - /* DMA target node is PCI */ - ACCW(PR_CTX0_A, 0x00023002); -// ACCW(PR_CTX0_A, 0x00033002);//AGP + if (si->engine.agp_mode) + { + /* DMA target node is AGP */ + ACCW(PR_CTX0_A, 0x00033002); + } + else + { + /* DMA target node is PCI */ + ACCW(PR_CTX0_A, 0x00023002); + } /* point at the DMA buffer via main system memory */ // ACCW(PR_CTX2_A, (ACCR(PR_CTX2_A) + // (((uint32)((uint8 *)(si->framebuffer_pci))) & 0xfffff000))); diff --git a/src/add-ons/accelerants/nvidia/engine/nv_agp.c b/src/add-ons/accelerants/nvidia/engine/nv_agp.c index d3ab459784..0cdedb26e9 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_agp.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_agp.c @@ -1,5 +1,5 @@ /* Author: - Rudolf Cornelissen 6/2004-9/2004 + Rudolf Cornelissen 6/2004-5/2005 */ #define MODULE_BIT 0x00000100 @@ -18,6 +18,9 @@ status_t nv_agp_setup(void) agp_info nv_ai; bool agp = false; + /* preset we are running in PCI mode: so acc engine may not use AGP transfers */ + si->engine.agp_mode = false; + /* first try to enable FW support on our card if user requested this * ('unsupported' tweak!) * This has no effect on PCI cards. */ @@ -122,6 +125,8 @@ status_t nv_agp_setup(void) /* ..but we do need to select the right speed scheme fetched from our card */ if (nv_ai.interface.agp_stat & AGP_rate_rev) nca.cmd |= AGP_rate_rev; ioctl(fd, NV_ENABLE_AGP, &nca, sizeof(nca)); + /* tell the engine in may use AGP transfers */ + si->engine.agp_mode = true; } /* list mode now activated,