2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
7 Rudolf Cornelissen 3/2004
10 #define MODULE_BIT 0x10000000
15 static engine_token nm_engine_token
= { 1, B_2D_ACCELERATION
, NULL
};
17 uint32
ACCELERANT_ENGINE_COUNT(void)
19 /* we have one acceleration engine */
23 status_t
ACQUIRE_ENGINE(uint32 capabilities
, uint32 max_wait
, sync_token
*st
, engine_token
**et
)
25 /* acquire the shared benaphore */
26 AQUIRE_BEN(si
->engine
.lock
)
27 /* sync if required */
28 if (st
) SYNC_TO_TOKEN(st
);
30 /* return an engine token */
31 *et
= &nm_engine_token
;
35 status_t
RELEASE_ENGINE(engine_token
*et
, sync_token
*st
)
37 /* update the sync token, if any */
38 if (st
) GET_SYNC_TOKEN(et
,st
);
40 /* release the shared benaphore */
41 RELEASE_BEN(si
->engine
.lock
)
45 void WAIT_ENGINE_IDLE(void)
47 /*wait for the engine to be totally idle*/
51 status_t
GET_SYNC_TOKEN(engine_token
*et
, sync_token
*st
)
53 /* engine count will always be zero: we don't support syncing to token (yet) */
54 st
->engine_id
= et
->engine_id
;
55 st
->counter
= si
->engine
.count
;
59 status_t
SYNC_TO_TOKEN(sync_token
*st
)
61 /* wait until the engine is totally idle: we don't support syncing to token (yet) */
63 * AFAIK in order to be able to setup sync_to_token, we'd need a circular fifo
64 * buffer in (main) memory instead of directly programming the GPU fifo so we
65 * can tell (via a hardware maintained pointer into this circular fifo) where
66 * the acc engine is with executing commands! */