Copyright 1999, Be Incorporated. All Rights Reserved.
This file may be used under the terms of the Be Sample Code License.
other authors:
Mark Watson
Rudolf Cornelissen 3/2004
*/
#define MODULE_BIT 0x10000000
#include "acc_std.h"
static engine_token nm_engine_token = { 1, B_2D_ACCELERATION, NULL };
uint32 ACCELERANT_ENGINE_COUNT(void)
{
return 1;
}
status_t ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et)
{
AQUIRE_BEN(si->engine.lock)
if (st) SYNC_TO_TOKEN(st);
*et = &nm_engine_token;
return B_OK;
}
status_t RELEASE_ENGINE(engine_token *et, sync_token *st)
{
if (st) GET_SYNC_TOKEN(et,st);
RELEASE_BEN(si->engine.lock)
return B_OK;
}
void WAIT_ENGINE_IDLE(void)
{
nm_acc_wait_idle();
}
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st)
{
st->engine_id = et->engine_id;
st->counter = si->engine.count;
return B_OK;
}
status_t SYNC_TO_TOKEN(sync_token *st)
{
* AFAIK in order to be able to setup sync_to_token, we'd need a circular fifo
* buffer in (main) memory instead of directly programming the GPU fifo so we
* can tell (via a hardware maintained pointer into this circular fifo) where
* the acc engine is with executing commands! */
WAIT_ENGINE_IDLE();
return B_OK;
}