1 /*****************************************************************************\
2 * Tseng Labs ET6000, ET6100 and ET6300 graphics driver for BeOS 5.
3 * Copyright (c) 2003-2004, Evgeniy Vladimirovich Bobkov.
4 \*****************************************************************************/
6 #include "GlobalData.h"
10 /*****************************************************************************/
11 static engine_token et6000EngineToken
= {1, B_2D_ACCELERATION
, NULL
};
12 /*****************************************************************************/
13 uint32
ACCELERANT_ENGINE_COUNT(void) {
16 /*****************************************************************************/
17 status_t
ACQUIRE_ENGINE(uint32 capabilities
,
22 /* acquire the shared benaphore */
23 AQUIRE_BEN(si
->engine
.lock
)
24 /* sync if required */
25 if (st
) SYNC_TO_TOKEN(st
);
27 /* return an engine token */
28 *et
= &et6000EngineToken
;
31 /*****************************************************************************/
32 status_t
RELEASE_ENGINE(engine_token
*et
, sync_token
*st
) {
33 /* update the sync token, if any */
35 st
->engine_id
= et
->engine_id
;
36 st
->counter
= si
->engine
.count
;
39 /* release the shared benaphore */
40 RELEASE_BEN(si
->engine
.lock
)
43 /*****************************************************************************/
44 void WAIT_ENGINE_IDLE(void) {
46 /* note our current possition */
47 si
->engine
.lastIdle
= si
->engine
.count
;
49 /*****************************************************************************/
50 status_t
GET_SYNC_TOKEN(engine_token
*et
, sync_token
*st
) {
51 st
->engine_id
= et
->engine_id
;
52 st
->counter
= si
->engine
.count
;
55 /*****************************************************************************/
56 status_t
SYNC_TO_TOKEN(sync_token
*st
) {
58 si
->engine
.lastIdle
= st
->counter
;
61 /*****************************************************************************/