* improved getting the retrace semaphore, now the PrivateScreen
will not try to retrieve the retrace semaphore again and again if the graphics cards doesn't support it for some reason * disabled BScreen::WaitForRetarce() for now, since it will just hang on ATI Radeon at least git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17266 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -213,12 +213,19 @@ BPrivateScreen::GetNextID(screen_id& id)
|
|||||||
status_t
|
status_t
|
||||||
BPrivateScreen::WaitForRetrace(bigtime_t timeout)
|
BPrivateScreen::WaitForRetrace(bigtime_t timeout)
|
||||||
{
|
{
|
||||||
|
// TODO: remove when interrupts are enabled again in the ATI driver
|
||||||
|
return B_ERROR;
|
||||||
// Get the retrace semaphore if it's the first time
|
// Get the retrace semaphore if it's the first time
|
||||||
// we are called. Cache the value then.
|
// we are called. Cache the value then.
|
||||||
status_t status;
|
if (!fRetraceSemValid)
|
||||||
if (fRetraceSem < 0)
|
|
||||||
fRetraceSem = _RetraceSemaphore();
|
fRetraceSem = _RetraceSemaphore();
|
||||||
|
|
||||||
|
if (fRetraceSem < 0) {
|
||||||
|
// syncing to retrace is not supported by the accelerant
|
||||||
|
return fRetraceSem;
|
||||||
|
}
|
||||||
|
|
||||||
|
status_t status;
|
||||||
do {
|
do {
|
||||||
status = acquire_sem_etc(fRetraceSem, 1, B_RELATIVE_TIMEOUT, timeout);
|
status = acquire_sem_etc(fRetraceSem, 1, B_RELATIVE_TIMEOUT, timeout);
|
||||||
} while (status == B_INTERRUPTED);
|
} while (status == B_INTERRUPTED);
|
||||||
@@ -633,7 +640,11 @@ BPrivateScreen::_RetraceSemaphore()
|
|||||||
link.Attach<screen_id>(ID());
|
link.Attach<screen_id>(ID());
|
||||||
|
|
||||||
sem_id id = B_BAD_SEM_ID;
|
sem_id id = B_BAD_SEM_ID;
|
||||||
link.FlushWithReply(id);
|
status_t status = B_ERROR;
|
||||||
|
if (link.FlushWithReply(status) == B_OK && status == B_OK) {
|
||||||
|
link.Read<sem_id>(&id);
|
||||||
|
fRetraceSemValid = true;
|
||||||
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -661,6 +672,7 @@ BPrivateScreen::BPrivateScreen(screen_id id)
|
|||||||
fID(id),
|
fID(id),
|
||||||
fColorMap(NULL),
|
fColorMap(NULL),
|
||||||
fRetraceSem(-1),
|
fRetraceSem(-1),
|
||||||
|
fRetraceSemValid(false),
|
||||||
fOwnsColorMap(false),
|
fOwnsColorMap(false),
|
||||||
fFrame(0, 0, 0, 0),
|
fFrame(0, 0, 0, 0),
|
||||||
fLastUpdate(0)
|
fLastUpdate(0)
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class BPrivateScreen {
|
|||||||
int32 fRefCount;
|
int32 fRefCount;
|
||||||
color_map* fColorMap;
|
color_map* fColorMap;
|
||||||
sem_id fRetraceSem;
|
sem_id fRetraceSem;
|
||||||
|
bool fRetraceSemValid;
|
||||||
bool fOwnsColorMap;
|
bool fOwnsColorMap;
|
||||||
BRect fFrame;
|
BRect fFrame;
|
||||||
bigtime_t fLastUpdate;
|
bigtime_t fLastUpdate;
|
||||||
|
|||||||
@@ -2188,8 +2188,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
screen_id id;
|
screen_id id;
|
||||||
link.Read<screen_id>(&id);
|
link.Read<screen_id>(&id);
|
||||||
|
|
||||||
sem_id semaphore = fDesktop->HWInterface()->RetraceSemaphore();
|
fLink.StartMessage(B_OK);
|
||||||
fLink.StartMessage(semaphore);
|
fLink.Attach<sem_id>(fDesktop->HWInterface()->RetraceSemaphore());
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user