From 9e8d8489922d8b647b28de06045e8fddf0ffc62f Mon Sep 17 00:00:00 2001 From: "Y.C. Chen" Date: Tue, 22 Jun 2010 15:17:27 +0800 Subject: modified: autogen.sh modified: configure.ac modified: src/ast.h modified: src/ast_2dtool.c modified: src/ast_2dtool.h modified: src/ast_accel.c modified: src/ast_driver.c modified: src/ast_mode.c modified: src/ast_mode.h modified: src/ast_vgatool.c --- src/ast_2dtool.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 3 deletions(-) (limited to 'src/ast_2dtool.c') diff --git a/src/ast_2dtool.c b/src/ast_2dtool.c index 63a059d..61f549c 100644 --- a/src/ast_2dtool.c +++ b/src/ast_2dtool.c @@ -55,10 +55,12 @@ #include "ast.h" #ifdef Accel_2D +typedef Bool (*PFN_bENABLE_CMDQ)(ScrnInfoPtr , ASTRecPtr); /* Prototype type declaration */ Bool bInitCMDQInfo(ScrnInfoPtr pScrn, ASTRecPtr pAST); Bool bEnableCMDQ(ScrnInfoPtr pScrn, ASTRecPtr pAST); +Bool bEnableCMDQ2300(ScrnInfoPtr pScrn, ASTRecPtr pAST); Bool bEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST); void vDisable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST); void vWaitEngIdle(ScrnInfoPtr pScrn, ASTRecPtr pAST); @@ -184,17 +186,87 @@ bEnableCMDQ(ScrnInfoPtr pScrn, ASTRecPtr pAST) return (TRUE); } +Bool +bEnableCMDQ2300(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + ULONG ulVMCmdQBasePort = 0, ulNewModeData; + + vWaitEngIdle(pScrn, pAST); + + /* set DBG Select Info */ + if (pAST->DBGSelect) + { + *(ULONG *) (pAST->MMIOVirtualAddr + 0x804C) = (ULONG) (pAST->DBGSelect); + } + + /* set CMDQ base */ + switch (pAST->CMDQInfo.ulCMDQType) + { + case VM_CMD_QUEUE: + /* enable new CMDQ mode */ + ulNewModeData = 0xc00000f0; + /* set CMDQ Size */ + switch (pAST->CMDQInfo.ulCMDQSize) + { + case CMD_QUEUE_SIZE_256K: + ulNewModeData |= 0x00000000; + break; + + case CMD_QUEUE_SIZE_512K: + ulNewModeData |= 0x00000004; + break; + + case CMD_QUEUE_SIZE_1M: + ulNewModeData |= 0x00000008; + break; + + case CMD_QUEUE_SIZE_2M: + ulNewModeData |= 0x0000000C; + break; + + default: + return(FALSE); + break; + } + *(ULONG *) (pAST->MMIOVirtualAddr + 0x8060) = ulNewModeData; + + /* Set CMDQ Base */ + ulVMCmdQBasePort = (pAST->CMDQInfo.ulCMDQOffsetAddr - 0) >> 3; + *(ULONG *) (pAST->CMDQInfo.pjCmdQBasePort) = ulVMCmdQBasePort; + pAST->CMDQInfo.ulWritePointer = *(ULONG *) (pAST->CMDQInfo.pjWritePort) << 3; + break; + + case VM_CMD_MMIO: + /* enable new CMDQ mode */ + ulNewModeData = 0xc00000f2; + *(ULONG *) (pAST->MMIOVirtualAddr + 0x8060) = ulNewModeData; + break; + + default: + return (FALSE); + break; + } + + return (TRUE); + +} /* bEnableCMDQ2300 */ + Bool bEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) { ULONG ulData; - + PFN_bENABLE_CMDQ pfnEnableCMDQ = bEnableCMDQ; + + if (pAST->jChipType == AST2300) + pfnEnableCMDQ = bEnableCMDQ2300; + switch (pAST->jChipType) { case AST2100: case AST1100: case AST2200: - case AST2150: + case AST2150: + case AST2300: *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1; @@ -211,7 +283,7 @@ bEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) return (FALSE); } - if (!bEnableCMDQ(pScrn, pAST)) + if (!pfnEnableCMDQ(pScrn, pAST)) { vDisable2D(pScrn, pAST); return (FALSE); -- cgit v1.2.3