From 79297e797de3497773539eb9f89e8594797ee512 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 18 Sep 2008 18:16:21 -0300 Subject: Update for new smi_501 interfaces. This also adds some simplification for the driver code, by adding some function pointers to avoid the need to check the chipset everywhere. The new SMI_DetectMCLK function doesn't actually change pSmi->MCLK to avoid chances of it stoping working on non MSOC chipsets, as it previously not did set it, and for the MSOC, for the moment, default to whatever value is already set, i.e. doesn't reprogram it. Added new memory detection code for the MSOC, that better matches the documentation. --- src/smi_accel.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/smi_accel.c') diff --git a/src/smi_accel.c b/src/smi_accel.c index f894eff..a68a28f 100644 --- a/src/smi_accel.c +++ b/src/smi_accel.c @@ -80,22 +80,18 @@ SMI_AccelSync(ScrnInfoPtr pScrn) WaitIdleEmpty(); /* #161 */ if (IS_MSOC(pSmi)) { - int i, dwVal; + int i, status; for (i = 0x1000000; i > 0; i--) { - dwVal = SMI501_Read32(pSmi, CMD_INTPR_STATUS); - if (FIELD_GET(dwVal, CMD_INTPR_STATUS, - 2D_ENGINE) == CMD_INTPR_STATUS_2D_ENGINE_IDLE && - FIELD_GET(dwVal, CMD_INTPR_STATUS, - 2D_FIFO) == CMD_INTPR_STATUS_2D_FIFO_EMPTY && - FIELD_GET(dwVal, CMD_INTPR_STATUS, - 2D_SETUP) == CMD_INTPR_STATUS_2D_SETUP_IDLE && - FIELD_GET(dwVal, CMD_INTPR_STATUS, - CSC_STATUS) == CMD_INTPR_STATUS_CSC_STATUS_IDLE && - FIELD_GET(dwVal, CMD_INTPR_STATUS, - 2D_MEMORY_FIFO) == CMD_INTPR_STATUS_2D_MEMORY_FIFO_EMPTY && - FIELD_GET(dwVal, CMD_INTPR_STATUS, - COMMAND_FIFO) == CMD_INTPR_STATUS_COMMAND_FIFO_EMPTY) + status = READ_SCR(pSmi, CMD_STATUS); + /* bit 0: 2d engine idle if *not set* + * bit 1: 2d fifo empty if *set* + * bit 2: 2d setup idle if if *not set* + * bit 18: color conversion idle if *not set* + * bit 19: command fifo empty if *set* + * bit 20: 2d memory fifo empty idle if *set* + */ + if ((status & 0x1C0007) == 0x180002) break; } } -- cgit v1.2.3