* IsDoubleBuffered() was not correct - fModeList has nothing to do with the
back buffer. This fixes bug #1631. * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22971 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
* Michael Lotz <[email protected]>
|
* Michael Lotz <[email protected]>
|
||||||
* DarkWyrm <[email protected]>
|
* DarkWyrm <[email protected]>
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus <[email protected]>
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! Accelerant based HWInterface implementation */
|
/*! Accelerant based HWInterface implementation */
|
||||||
@@ -296,7 +297,8 @@ AccelerantHWInterface::_OpenAccelerant(int device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
init_accelerant initAccelerant;
|
init_accelerant initAccelerant;
|
||||||
initAccelerant = (init_accelerant)fAccelerantHook(B_INIT_ACCELERANT, NULL);
|
initAccelerant = (init_accelerant)fAccelerantHook(
|
||||||
|
B_INIT_ACCELERANT, NULL);
|
||||||
if (!initAccelerant || initAccelerant(device) != B_OK) {
|
if (!initAccelerant || initAccelerant(device) != B_OK) {
|
||||||
ATRACE(("InitAccelerant unsuccessful\n"));
|
ATRACE(("InitAccelerant unsuccessful\n"));
|
||||||
unload_add_on(fAccelerantImage);
|
unload_add_on(fAccelerantImage);
|
||||||
@@ -383,7 +385,8 @@ status_t
|
|||||||
AccelerantHWInterface::Shutdown()
|
AccelerantHWInterface::Shutdown()
|
||||||
{
|
{
|
||||||
if (fAccelerantHook) {
|
if (fAccelerantHook) {
|
||||||
uninit_accelerant UninitAccelerant = (uninit_accelerant)fAccelerantHook(B_UNINIT_ACCELERANT, NULL);
|
uninit_accelerant UninitAccelerant = (uninit_accelerant)
|
||||||
|
fAccelerantHook(B_UNINIT_ACCELERANT, NULL);
|
||||||
if (UninitAccelerant)
|
if (UninitAccelerant)
|
||||||
UninitAccelerant();
|
UninitAccelerant();
|
||||||
}
|
}
|
||||||
@@ -547,7 +550,8 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
|
|||||||
|
|
||||||
// Update the frame buffer used by the on-screen KDL
|
// Update the frame buffer used by the on-screen KDL
|
||||||
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||||
uint32 depth = (fFrameBufferConfig.bytes_per_row / fDisplayMode.virtual_width) << 3;
|
uint32 depth = (fFrameBufferConfig.bytes_per_row
|
||||||
|
/ fDisplayMode.virtual_width) << 3;
|
||||||
if (fDisplayMode.space == B_RGB15)
|
if (fDisplayMode.space == B_RGB15)
|
||||||
depth = 15;
|
depth = 15;
|
||||||
|
|
||||||
@@ -597,11 +601,12 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
|
|||||||
_SetGrayscalePalette();
|
_SetGrayscalePalette();
|
||||||
|
|
||||||
// update acceleration hooks
|
// update acceleration hooks
|
||||||
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE, (void *)&fDisplayMode);
|
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE,
|
||||||
|
(void *)&fDisplayMode);
|
||||||
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
|
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
|
||||||
(void *)&fDisplayMode);
|
(void *)&fDisplayMode);
|
||||||
fAccScreenBlit = (screen_to_screen_blit)fAccelerantHook(B_SCREEN_TO_SCREEN_BLIT,
|
fAccScreenBlit = (screen_to_screen_blit)fAccelerantHook(
|
||||||
(void *)&fDisplayMode);
|
B_SCREEN_TO_SCREEN_BLIT, (void *)&fDisplayMode);
|
||||||
|
|
||||||
_NotifyFrameBufferChanged();
|
_NotifyFrameBufferChanged();
|
||||||
|
|
||||||
@@ -657,7 +662,9 @@ AccelerantHWInterface::_UpdateFrameBufferConfig()
|
|||||||
status_t
|
status_t
|
||||||
AccelerantHWInterface::GetDeviceInfo(accelerant_device_info *info)
|
AccelerantHWInterface::GetDeviceInfo(accelerant_device_info *info)
|
||||||
{
|
{
|
||||||
get_accelerant_device_info GetAccelerantDeviceInfo = (get_accelerant_device_info)fAccelerantHook(B_GET_ACCELERANT_DEVICE_INFO, NULL);
|
get_accelerant_device_info GetAccelerantDeviceInfo
|
||||||
|
= (get_accelerant_device_info)fAccelerantHook(
|
||||||
|
B_GET_ACCELERANT_DEVICE_INFO, NULL);
|
||||||
if (!GetAccelerantDeviceInfo) {
|
if (!GetAccelerantDeviceInfo) {
|
||||||
ATRACE(("No B_GET_ACCELERANT_DEVICE_INFO hook found\n"));
|
ATRACE(("No B_GET_ACCELERANT_DEVICE_INFO hook found\n"));
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
@@ -779,11 +786,13 @@ AccelerantHWInterface::GetPreferredMode(display_mode* preferredMode)
|
|||||||
|
|
||||||
// find preferred mode from EDID info
|
// find preferred mode from EDID info
|
||||||
for (uint32 i = 0; i < EDID1_NUM_DETAILED_MONITOR_DESC; ++i) {
|
for (uint32 i = 0; i < EDID1_NUM_DETAILED_MONITOR_DESC; ++i) {
|
||||||
if (info.detailed_monitor[i].monitor_desc_type != EDID1_IS_DETAILED_TIMING)
|
if (info.detailed_monitor[i].monitor_desc_type
|
||||||
|
!= EDID1_IS_DETAILED_TIMING)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// construct basic mode and find it in the mode list
|
// construct basic mode and find it in the mode list
|
||||||
const edid1_detailed_timing& timing = info.detailed_monitor[i].data.detailed_timing;
|
const edid1_detailed_timing& timing
|
||||||
|
= info.detailed_monitor[i].data.detailed_timing;
|
||||||
if (timing.h_active < 640 || timing.v_active < 350)
|
if (timing.h_active < 640 || timing.v_active < 350)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -796,11 +805,13 @@ AccelerantHWInterface::GetPreferredMode(display_mode* preferredMode)
|
|||||||
mode.timing.pixel_clock = timing.pixel_clock * 10;
|
mode.timing.pixel_clock = timing.pixel_clock * 10;
|
||||||
mode.timing.h_display = timing.h_active;
|
mode.timing.h_display = timing.h_active;
|
||||||
mode.timing.h_sync_start = timing.h_active + timing.h_sync_off;
|
mode.timing.h_sync_start = timing.h_active + timing.h_sync_off;
|
||||||
mode.timing.h_sync_end = mode.timing.h_sync_start + timing.h_sync_width;
|
mode.timing.h_sync_end = mode.timing.h_sync_start
|
||||||
|
+ timing.h_sync_width;
|
||||||
mode.timing.h_total = timing.h_active + timing.h_blank;
|
mode.timing.h_total = timing.h_active + timing.h_blank;
|
||||||
mode.timing.v_display = timing.v_active;
|
mode.timing.v_display = timing.v_active;
|
||||||
mode.timing.v_sync_start = timing.v_active + timing.v_sync_off;
|
mode.timing.v_sync_start = timing.v_active + timing.v_sync_off;
|
||||||
mode.timing.v_sync_end = mode.timing.v_sync_start + timing.v_sync_width;
|
mode.timing.v_sync_end = mode.timing.v_sync_start
|
||||||
|
+ timing.v_sync_width;
|
||||||
mode.timing.v_total = timing.v_active + timing.v_blank;
|
mode.timing.v_total = timing.v_active + timing.v_blank;
|
||||||
mode.space = B_RGB32;
|
mode.space = B_RGB32;
|
||||||
mode.virtual_width = timing.h_active;
|
mode.virtual_width = timing.h_active;
|
||||||
@@ -905,7 +916,8 @@ sem_id
|
|||||||
AccelerantHWInterface::RetraceSemaphore()
|
AccelerantHWInterface::RetraceSemaphore()
|
||||||
{
|
{
|
||||||
accelerant_retrace_semaphore AccelerantRetraceSemaphore =
|
accelerant_retrace_semaphore AccelerantRetraceSemaphore =
|
||||||
(accelerant_retrace_semaphore)fAccelerantHook(B_ACCELERANT_RETRACE_SEMAPHORE, NULL);
|
(accelerant_retrace_semaphore)fAccelerantHook(
|
||||||
|
B_ACCELERANT_RETRACE_SEMAPHORE, NULL);
|
||||||
if (!AccelerantRetraceSemaphore)
|
if (!AccelerantRetraceSemaphore)
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
|
|
||||||
@@ -918,7 +930,9 @@ AccelerantHWInterface::WaitForRetrace(bigtime_t timeout)
|
|||||||
{
|
{
|
||||||
AutoReadLocker _(this);
|
AutoReadLocker _(this);
|
||||||
|
|
||||||
accelerant_retrace_semaphore AccelerantRetraceSemaphore = (accelerant_retrace_semaphore)fAccelerantHook(B_ACCELERANT_RETRACE_SEMAPHORE, NULL);
|
accelerant_retrace_semaphore AccelerantRetraceSemaphore
|
||||||
|
= (accelerant_retrace_semaphore)fAccelerantHook(
|
||||||
|
B_ACCELERANT_RETRACE_SEMAPHORE, NULL);
|
||||||
if (!AccelerantRetraceSemaphore)
|
if (!AccelerantRetraceSemaphore)
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
|
|
||||||
@@ -985,7 +999,8 @@ AccelerantHWInterface::GetDriverPath(BString &string)
|
|||||||
// all of our drivers)
|
// all of our drivers)
|
||||||
char path[B_PATH_NAME_LENGTH];
|
char path[B_PATH_NAME_LENGTH];
|
||||||
get_accelerant_clone_info getCloneInfo;
|
get_accelerant_clone_info getCloneInfo;
|
||||||
getCloneInfo = (get_accelerant_clone_info)fAccelerantHook(B_GET_ACCELERANT_CLONE_INFO, NULL);
|
getCloneInfo = (get_accelerant_clone_info)fAccelerantHook(
|
||||||
|
B_GET_ACCELERANT_CLONE_INFO, NULL);
|
||||||
|
|
||||||
if (getCloneInfo == NULL)
|
if (getCloneInfo == NULL)
|
||||||
return B_NOT_SUPPORTED;
|
return B_NOT_SUPPORTED;
|
||||||
@@ -1100,7 +1115,8 @@ AccelerantHWInterface::CheckOverlayRestrictions(int32 width, int32 height,
|
|||||||
|
|
||||||
|
|
||||||
const overlay_buffer*
|
const overlay_buffer*
|
||||||
AccelerantHWInterface::AllocateOverlayBuffer(int32 width, int32 height, color_space space)
|
AccelerantHWInterface::AllocateOverlayBuffer(int32 width, int32 height,
|
||||||
|
color_space space)
|
||||||
{
|
{
|
||||||
if (fAccAllocateOverlayBuffer == NULL)
|
if (fAccAllocateOverlayBuffer == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1133,7 +1149,8 @@ AccelerantHWInterface::ConfigureOverlay(Overlay* overlay)
|
|||||||
void
|
void
|
||||||
AccelerantHWInterface::HideOverlay(Overlay* overlay)
|
AccelerantHWInterface::HideOverlay(Overlay* overlay)
|
||||||
{
|
{
|
||||||
fAccConfigureOverlay(overlay->OverlayToken(), overlay->OverlayBuffer(), NULL, NULL);
|
fAccConfigureOverlay(overlay->OverlayToken(), overlay->OverlayBuffer(),
|
||||||
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1143,12 +1160,15 @@ AccelerantHWInterface::CopyRegion(const clipping_rect* sortedRectList,
|
|||||||
uint32 count, int32 xOffset, int32 yOffset)
|
uint32 count, int32 xOffset, int32 yOffset)
|
||||||
{
|
{
|
||||||
if (fAccScreenBlit && fAccAcquireEngine) {
|
if (fAccScreenBlit && fAccAcquireEngine) {
|
||||||
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken, &fEngineToken) >= B_OK) {
|
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken,
|
||||||
|
&fEngineToken) >= B_OK) {
|
||||||
// make sure the blit_params cache is large enough
|
// make sure the blit_params cache is large enough
|
||||||
if (fBlitParamsCount < count) {
|
if (fBlitParamsCount < count) {
|
||||||
fBlitParamsCount = (count / kDefaultParamsCount + 1) * kDefaultParamsCount;
|
fBlitParamsCount = (count / kDefaultParamsCount + 1)
|
||||||
|
* kDefaultParamsCount;
|
||||||
// NOTE: realloc() could be used instead...
|
// NOTE: realloc() could be used instead...
|
||||||
blit_params* params = new (nothrow) blit_params[fBlitParamsCount];
|
blit_params* params
|
||||||
|
= new (nothrow) blit_params[fBlitParamsCount];
|
||||||
if (params) {
|
if (params) {
|
||||||
delete[] fBlitParams;
|
delete[] fBlitParams;
|
||||||
fBlitParams = params;
|
fBlitParams = params;
|
||||||
@@ -1161,12 +1181,17 @@ AccelerantHWInterface::CopyRegion(const clipping_rect* sortedRectList,
|
|||||||
fBlitParams[i].src_left = (uint16)sortedRectList[i].left;
|
fBlitParams[i].src_left = (uint16)sortedRectList[i].left;
|
||||||
fBlitParams[i].src_top = (uint16)sortedRectList[i].top;
|
fBlitParams[i].src_top = (uint16)sortedRectList[i].top;
|
||||||
|
|
||||||
fBlitParams[i].dest_left = (uint16)sortedRectList[i].left + xOffset;
|
fBlitParams[i].dest_left = (uint16)sortedRectList[i].left
|
||||||
fBlitParams[i].dest_top = (uint16)sortedRectList[i].top + yOffset;
|
+ xOffset;
|
||||||
|
fBlitParams[i].dest_top = (uint16)sortedRectList[i].top
|
||||||
|
+ yOffset;
|
||||||
|
|
||||||
// NOTE: width and height are expressed as distance, not pixel count!
|
// NOTE: width and height are expressed as distance, not
|
||||||
fBlitParams[i].width = (uint16)(sortedRectList[i].right - sortedRectList[i].left);
|
// pixel count!
|
||||||
fBlitParams[i].height = (uint16)(sortedRectList[i].bottom - sortedRectList[i].top);
|
fBlitParams[i].width = (uint16)(sortedRectList[i].right
|
||||||
|
- sortedRectList[i].left);
|
||||||
|
fBlitParams[i].height = (uint16)(sortedRectList[i].bottom
|
||||||
|
- sortedRectList[i].top);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go
|
// go
|
||||||
@@ -1191,7 +1216,6 @@ AccelerantHWInterface::FillRegion(/*const*/ BRegion& region,
|
|||||||
if (fAccFillRect && fAccAcquireEngine) {
|
if (fAccFillRect && fAccAcquireEngine) {
|
||||||
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken,
|
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken,
|
||||||
&fEngineToken) >= B_OK) {
|
&fEngineToken) >= B_OK) {
|
||||||
|
|
||||||
// convert the region
|
// convert the region
|
||||||
uint32 count;
|
uint32 count;
|
||||||
_RegionToRectParams(®ion, &count);
|
_RegionToRectParams(®ion, &count);
|
||||||
@@ -1215,20 +1239,16 @@ void
|
|||||||
AccelerantHWInterface::InvertRegion(/*const*/ BRegion& region)
|
AccelerantHWInterface::InvertRegion(/*const*/ BRegion& region)
|
||||||
{
|
{
|
||||||
if (fAccInvertRect && fAccAcquireEngine) {
|
if (fAccInvertRect && fAccAcquireEngine) {
|
||||||
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken, &fEngineToken) >= B_OK) {
|
if (fAccAcquireEngine(B_2D_ACCELERATION, 0xff, &fSyncToken,
|
||||||
|
&fEngineToken) >= B_OK) {
|
||||||
// convert the region
|
// convert the region
|
||||||
uint32 count;
|
uint32 count;
|
||||||
_RegionToRectParams(®ion, &count);
|
_RegionToRectParams(®ion, &count);
|
||||||
|
|
||||||
// go
|
|
||||||
fAccInvertRect(fEngineToken, fRectParams, count);
|
fAccInvertRect(fEngineToken, fRectParams, count);
|
||||||
|
|
||||||
// done
|
|
||||||
if (fAccReleaseEngine)
|
if (fAccReleaseEngine)
|
||||||
fAccReleaseEngine(fEngineToken, &fSyncToken);
|
fAccReleaseEngine(fEngineToken, &fSyncToken);
|
||||||
|
|
||||||
// sync
|
|
||||||
if (fAccSyncToToken)
|
if (fAccSyncToToken)
|
||||||
fAccSyncToToken(&fSyncToken);
|
fAccSyncToToken(&fSyncToken);
|
||||||
}
|
}
|
||||||
@@ -1298,10 +1318,7 @@ AccelerantHWInterface::BackBuffer() const
|
|||||||
bool
|
bool
|
||||||
AccelerantHWInterface::IsDoubleBuffered() const
|
AccelerantHWInterface::IsDoubleBuffered() const
|
||||||
{
|
{
|
||||||
if (fModeList)
|
|
||||||
return fBackBuffer != NULL;
|
return fBackBuffer != NULL;
|
||||||
|
|
||||||
return HWInterface::IsDoubleBuffered();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// _DrawCursor
|
// _DrawCursor
|
||||||
@@ -1322,9 +1339,11 @@ AccelerantHWInterface::_RegionToRectParams(/*const*/ BRegion* region,
|
|||||||
{
|
{
|
||||||
*count = region->CountRects();
|
*count = region->CountRects();
|
||||||
if (fRectParamsCount < *count) {
|
if (fRectParamsCount < *count) {
|
||||||
fRectParamsCount = (*count / kDefaultParamsCount + 1) * kDefaultParamsCount;
|
fRectParamsCount = (*count / kDefaultParamsCount + 1)
|
||||||
|
* kDefaultParamsCount;
|
||||||
// NOTE: realloc() could be used instead...
|
// NOTE: realloc() could be used instead...
|
||||||
fill_rect_params* params = new (nothrow) fill_rect_params[fRectParamsCount];
|
fill_rect_params* params
|
||||||
|
= new (nothrow) fill_rect_params[fRectParamsCount];
|
||||||
if (params) {
|
if (params) {
|
||||||
delete[] fRectParams;
|
delete[] fRectParams;
|
||||||
fRectParams = params;
|
fRectParams = params;
|
||||||
@@ -1367,11 +1386,8 @@ AccelerantHWInterface::_NativeColor(const rgb_color& color) const
|
|||||||
case B_RGBA32_BIG:
|
case B_RGBA32_BIG:
|
||||||
case B_RGB32_LITTLE:
|
case B_RGB32_LITTLE:
|
||||||
case B_RGBA32_LITTLE: {
|
case B_RGBA32_LITTLE: {
|
||||||
uint32 native = (color.alpha << 24) |
|
return (uint32)((color.alpha << 24) | (color.red << 16)
|
||||||
(color.red << 16) |
|
| (color.green << 8) | color.blue);
|
||||||
(color.green << 8) |
|
|
||||||
(color.blue);
|
|
||||||
return native;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user