fixed engine management regarding sync_to_token

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6987 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2004-03-15 07:12:51 +00:00
parent a7b6bd943e
commit 599fbbf010
3 changed files with 30 additions and 28 deletions
@@ -2,7 +2,9 @@
Copyright 1999, Be Incorporated. All Rights Reserved. Copyright 1999, Be Incorporated. All Rights Reserved.
This file may be used under the terms of the Be Sample Code License. This file may be used under the terms of the Be Sample Code License.
modification to call G400 functions and mess-ups - Mark Watson other authors:
Mark Watson
Rudolf Cornelissen 3/2004
*/ */
#define MODULE_BIT 0x10000000 #define MODULE_BIT 0x10000000
@@ -12,11 +14,14 @@
static engine_token nv_engine_token = { 1, B_2D_ACCELERATION, NULL }; static engine_token nv_engine_token = { 1, B_2D_ACCELERATION, NULL };
uint32 ACCELERANT_ENGINE_COUNT(void) { uint32 ACCELERANT_ENGINE_COUNT(void)
{
/* we have one acceleration engine */
return 1; return 1;
} }
status_t ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et) { status_t ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et)
{
/* acquire the shared benaphore */ /* acquire the shared benaphore */
AQUIRE_BEN(si->engine.lock) AQUIRE_BEN(si->engine.lock)
/* sync if required */ /* sync if required */
@@ -27,41 +32,37 @@ status_t ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token *st, en
return B_OK; return B_OK;
} }
status_t RELEASE_ENGINE(engine_token *et, sync_token *st) { status_t RELEASE_ENGINE(engine_token *et, sync_token *st)
{
/* update the sync token, if any */ /* update the sync token, if any */
if (st) { if (st) GET_SYNC_TOKEN(et,st);
GET_SYNC_TOKEN(et,st);
}
/* release the shared benaphore */ /* release the shared benaphore */
RELEASE_BEN(si->engine.lock) RELEASE_BEN(si->engine.lock)
return B_OK; return B_OK;
} }
void WAIT_ENGINE_IDLE(void) { void WAIT_ENGINE_IDLE(void)
uint32 count; {
/*wait for the engine to be totally idle*/
count = si->engine.count;
nv_acc_wait_idle(); nv_acc_wait_idle();
si->engine.last_idle = count;
} }
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st) { status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st)
si->engine.count+=4; {
/* engine count will always be zero: we don't support syncing to token (yet) */
st->engine_id = et->engine_id; st->engine_id = et->engine_id;
st->counter = si->engine.count; st->counter = si->engine.count;
return B_OK; return B_OK;
} }
status_t SYNC_TO_TOKEN(sync_token *st) { status_t SYNC_TO_TOKEN(sync_token *st)
/* a quick out */ {
if (st->counter <= si->engine.last_idle) return B_OK; /* wait until the engine is totally idle: we don't support syncing to token (yet) */
/* note:
/* another quick out! */ * AFAIK in order to be able to setup sync_to_token, we'd need a circular fifo
if ((st->counter >0xFFFFFFF) && (si->engine.last_idle <0xFFFF)) return B_OK; /*for when counter wraps*/ * 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
/* If not we have to wait :-(*/ * the acc engine is with executing commands! */
WAIT_ENGINE_IDLE(); WAIT_ENGINE_IDLE();
return B_OK; return B_OK;
@@ -80,7 +80,7 @@ status_t nv_general_powerup()
{ {
status_t status; status_t status;
LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.10-5 running.\n")); LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.10-6 running.\n"));
/* preset no laptop */ /* preset no laptop */
si->ps.laptop = false; si->ps.laptop = false;
@@ -4,16 +4,17 @@
</head> </head>
<body> <body>
<p><h2>Changes done for each driverversion:</h2></p> <p><h2>Changes done for each driverversion:</h2></p>
<p><h1>head (0.10-5), (Rudolf)</h1></p> <p><h1>head (0.10-6), (Rudolf)</h1></p>
<ul> <ul>
<li>Implemented laptop internal flatpanel presence and native resolution detection; <li>Implemented laptop internal flatpanel presence and native resolution detection;
<li>Implemented external DVI flatpanel(s) presence and native resolution detection; <li>Implemented external DVI flatpanel(s) presence and native resolution detection;
<li>Added flatpanel(s) refreshrate protection: it(they) is(are) always kept at 60Hz refresh; <li>Added flatpanel(s) refreshrate protection: it(they) is(are) always kept at 60Hz refresh;
<li>Added flatpanel specific CRTC modeline and DFP modeline tuning: DVI connected panels work now on both heads (if applicable); <li>Added flatpanel specific CRTC modeline and DFP modeline tuning: DVI connected panels work now on both heads (if applicable);
<li>Fixed fullscreen overlay on DVI panels.<br> <li>Fixed fullscreen overlay on DVI panels;
NOTE:<br> <li>Fixed acceleration engine management regarding sync_to_token: no more updating glitches should occur now.
dualhead switch mode is not yet operational for flatpanels...
</ul> </ul>
NOTE:<br>
dualhead switch mode is not yet operational for flatpanels...
<p><h1>nv_driver 0.09, (Rudolf)</h1></p> <p><h1>nv_driver 0.09, (Rudolf)</h1></p>
<ul> <ul>
<li>Fixed NV11 trouble with repeating screen(s) on the right side of the monitor; <li>Fixed NV11 trouble with repeating screen(s) on the right side of the monitor;