1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>MI_SendNDmaGXCommand</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">MI_SendNDmaGXCommand* <IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD><CODE>#include &lt;twl/mi.h&gt;</CODE><BR> <BR> <CODE>void MI_SendNDmaGXCommand( u32 ndmaNo, const void* src, u32 commandLength );<BR> <BR> void MI_SendNDmaGXCommandAsync( u32 ndmaNo, const void* src, u32 commandLength,<BR> MINDmaCallback callback, void* arg );</CODE>
15  <DD><CODE><BR> void MI_SendNDmaGXCommandAsyncFast( u32 ndmaNo, const void* src, u32 commandLength,<BR> MINDmaCallback callback, void* arg ); </CODE>
16</DL>
17<H2>Arguments</H2>
18<TABLE border="1" width="100%">
19  <TBODY>
20    <TR>
21      <TD width="13%"><EM><STRONG>ndmaNo</STRONG></EM></TD>
22      <TD width="87%">DMA channel used.</TD>
23    </TR>
24    <TR>
25      <TD width="13%"><EM><STRONG>src</STRONG></EM></TD>
26      <TD width="87%">The transfer source address.</TD>
27    </TR>
28    <TR>
29      <TD><EM><STRONG>commandLength</STRONG></EM></TD>
30      <TD>Transfer command size</TD>
31    </TR>
32    <TR>
33      <TD><EM><STRONG>callback</STRONG></EM></TD>
34      <TD>Callback when DMA ends.</TD>
35    </TR>
36    <TR>
37      <TD><EM><STRONG>arg</STRONG></EM></TD>
38      <TD>Callback argument when DMA ends.</TD>
39    </TR>
40  </TBODY>
41</TABLE>
42<H2>Return Values</H2>
43<P>None.</P>
44<H2>Description</H2>
45<P>This function uses DMA to send a display list (GX command string) to the command FIFO. The transfer source address must be 4-byte aligned.</P>
46<P>The synchronous version of the <code>MI_SendNDmaGXCommand</code> function waits for DMA to end inside the function. The asynchronous version of the <code>MI_SendNDmaGXCommandAsync</code> and <code>MI_SendNDmaGXCommandAsFast</code> functions call <code>callback</code> when DMA ends. The callback type is <code>MINDmaCallback</code> (a <code>void</code>&ndash;type function that takes one <code>void*</code> argument). <code>callback</code> is called from the system DMA interrupt handler and therefore is called even if interrupts are prohibited.</P>
47<P>The differences between the <code>MI_SendNDmaGXCommandAsync</code> and <code>MI_SendNDmaGXCommandAsyncFast</code> functions are as follows.<br /> The <code>MI_SendGXCommandAsync</code> function does not use the geometry transfer DMA but uses only the usual synchronous DMA. A small amount of DMA is performed by using the interrupt that is generated when GXFIFO is less than half. The <code>MI_SendGXCommandAsyncFast</code> function uses the geometry transfer DMA, so that DMA starts automatically when GXFIFO becomes low. Note that multiple automatic DMAs cannot be started simultaneously because of hardware restrictions. However, the hardware allows the simultaneous startup of multiple automatic DMAs of the same type.</P>
48<P>With TWL-SDK, the exclusive processing with the <code>MI_SendNDmaGXCommandAsync*</code> and other <code>G3_</code>-based functions is not performed because the execution speed of the graphics command has been prioritized. Therefore, we cannot guarantee correct operation if the GX command is written directly to the command FIFO by a <code>G3_</code> function while the GX command is being transferred by the <code>MI_SendNDmaGXCommandAsync*</code> function. It is strongly recommended that you pay particular attention in avoiding such an API call situation.</P>
49<H3><BR>About the DMA to be Used</H3>
50<P>Although this function uses a new DMA, the function that performs the same operation using the old DMA is <CODE><A href="../dma/MI_SendGXCommand.html">MI_SendGXCommand*</A></CODE>. The <CODE><A href="../dma/MI_SendGXCommand.html">MI_SendGXCommand*</A></CODE> and <CODE>MI_SendNDmaGXCommand*</CODE> functions cannot be used at the same time.</P>
51<H2>Internal Operation</H2>
52<P>Uses the new I/O DMA registers.</P>
53<H2>See Also</H2>
54<P><CODE><A href="MI_NDmaCopy.html">MI_NDmaCopy*</A><BR> <A href="../../gx/g3/G3_BeginMakeDL.html">G3_BeginMakeDL</A><BR> <A href="../../gx/g3/G3_EndMakeDL.html">G3_EndMakeDL</A></CODE><BR> <CODE><A href="../dma/MI_SendGXCommand.html">MI_SendGXCommand*</A></CODE></P>
55<H2>Revision History</H2>
56<P>2008/10/16 Initial version.</P>
57<hr><p>CONFIDENTIAL</p></body>
58</HTML>