diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-09-18 18:16:21 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-09-18 18:16:21 -0300 |
commit | 79297e797de3497773539eb9f89e8594797ee512 (patch) | |
tree | b56ff130064c9a149f2f6f2cd45195e902dd2cd1 /src/smi_accel.c | |
parent | 95e312b712a1e4a476ef31c5302faf77c22915a9 (diff) |
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.
Diffstat (limited to 'src/smi_accel.c')
-rw-r--r-- | src/smi_accel.c | 24 |
1 files changed, 10 insertions, 14 deletions
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; } } |