App Server: Style fixes to AccelerantHWInterface
This commit is contained in:
@@ -3,39 +3,39 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Michael Lotz <[email protected]>
|
* Stephan Aßmus, [email protected]
|
||||||
* DarkWyrm <[email protected]>
|
* DarkWyrm, [email protected]
|
||||||
* Stephan Aßmus <[email protected]>
|
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
|
* Michael Lotz, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! Accelerant based HWInterface implementation */
|
//! Accelerant based HWInterface implementation
|
||||||
|
|
||||||
|
|
||||||
#include "AccelerantHWInterface.h"
|
#include "AccelerantHWInterface.h"
|
||||||
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <edid.h>
|
||||||
|
#include <driver_settings.h>
|
||||||
|
#include <graphic_driver.h>
|
||||||
|
#include <image.h>
|
||||||
|
#include <safemode_defs.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <syscalls.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <Accelerant.h>
|
#include <Accelerant.h>
|
||||||
#include <Cursor.h>
|
#include <Cursor.h>
|
||||||
#include <driver_settings.h>
|
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <graphic_driver.h>
|
|
||||||
#include <image.h>
|
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include <edid.h>
|
|
||||||
#include <safemode_defs.h>
|
|
||||||
#include <syscalls.h>
|
|
||||||
|
|
||||||
#include "AccelerantBuffer.h"
|
#include "AccelerantBuffer.h"
|
||||||
#include "MallocBuffer.h"
|
#include "MallocBuffer.h"
|
||||||
#include "Overlay.h"
|
#include "Overlay.h"
|
||||||
@@ -91,7 +91,7 @@ use_fail_safe_video_mode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - AccelerantHWInterface
|
||||||
|
|
||||||
|
|
||||||
AccelerantHWInterface::AccelerantHWInterface()
|
AccelerantHWInterface::AccelerantHWInterface()
|
||||||
@@ -151,8 +151,8 @@ AccelerantHWInterface::AccelerantHWInterface()
|
|||||||
fDisplayMode.space = B_RGB32;
|
fDisplayMode.space = B_RGB32;
|
||||||
|
|
||||||
// NOTE: I have no clue what I'm doing here.
|
// NOTE: I have no clue what I'm doing here.
|
||||||
// fSyncToken.counter = 0;
|
//fSyncToken.counter = 0;
|
||||||
// fSyncToken.engine_id = 0;
|
//fSyncToken.engine_id = 0;
|
||||||
memset(&fSyncToken, 0, sizeof(sync_token));
|
memset(&fSyncToken, 0, sizeof(sync_token));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,8 @@ AccelerantHWInterface::~AccelerantHWInterface()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Opens the first available graphics device and initializes it
|
/*! Opens the first available graphics device and initializes it.
|
||||||
|
|
||||||
\return B_OK on success or an appropriate error message on failure.
|
\return B_OK on success or an appropriate error message on failure.
|
||||||
*/
|
*/
|
||||||
status_t
|
status_t
|
||||||
@@ -201,15 +202,19 @@ AccelerantHWInterface::Initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Opens a graphics device for read-write access
|
/*! Opens a graphics device for read-write access.
|
||||||
\param deviceNumber Number identifying which graphics card to open (1 for first card)
|
|
||||||
\return The file descriptor for the opened graphics device
|
|
||||||
|
|
||||||
The deviceNumber is relative to the number of graphics devices that can be successfully
|
The \a deviceNumber is relative to the number of graphics devices that can
|
||||||
opened. One represents the first card that can be successfully opened (not necessarily
|
be opened. One represents the first card that can be opened (not necessarily
|
||||||
the first one listed in the directory).
|
the first one listed in the directory).
|
||||||
|
|
||||||
Graphics drivers must be able to be opened more than once, so we really get
|
Graphics drivers must be able to be opened more than once, so we really get
|
||||||
the first working entry.
|
the first working entry.
|
||||||
|
|
||||||
|
\param deviceNumber Number identifying which graphics card to open
|
||||||
|
(1 for first card).
|
||||||
|
|
||||||
|
\return The file descriptor of the opened graphics device.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
AccelerantHWInterface::_OpenGraphicsDevice(int deviceNumber)
|
AccelerantHWInterface::_OpenGraphicsDevice(int deviceNumber)
|
||||||
@@ -266,8 +271,9 @@ AccelerantHWInterface::_OpenAccelerant(int device)
|
|||||||
{
|
{
|
||||||
char signature[1024];
|
char signature[1024];
|
||||||
if (ioctl(device, B_GET_ACCELERANT_SIGNATURE,
|
if (ioctl(device, B_GET_ACCELERANT_SIGNATURE,
|
||||||
&signature, sizeof(signature)) != B_OK)
|
&signature, sizeof(signature)) != B_OK) {
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
ATRACE(("accelerant signature is: %s\n", signature));
|
ATRACE(("accelerant signature is: %s\n", signature));
|
||||||
|
|
||||||
@@ -294,7 +300,7 @@ AccelerantHWInterface::_OpenAccelerant(int device)
|
|||||||
fAccelerantImage = load_add_on(path);
|
fAccelerantImage = load_add_on(path);
|
||||||
if (fAccelerantImage >= 0) {
|
if (fAccelerantImage >= 0) {
|
||||||
if (get_image_symbol(fAccelerantImage, B_ACCELERANT_ENTRY_POINT,
|
if (get_image_symbol(fAccelerantImage, B_ACCELERANT_ENTRY_POINT,
|
||||||
B_SYMBOL_TYPE_ANY, (void**)(&fAccelerantHook)) != B_OK ) {
|
B_SYMBOL_TYPE_ANY, (void**)(&fAccelerantHook)) != B_OK) {
|
||||||
ATRACE(("unable to get B_ACCELERANT_ENTRY_POINT\n"));
|
ATRACE(("unable to get B_ACCELERANT_ENTRY_POINT\n"));
|
||||||
unload_add_on(fAccelerantImage);
|
unload_add_on(fAccelerantImage);
|
||||||
fAccelerantImage = -1;
|
fAccelerantImage = -1;
|
||||||
@@ -434,7 +440,7 @@ AccelerantHWInterface::Shutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! Finds the mode in the mode list that is closest to the mode specified.
|
/*! Finds the mode in the mode list that is closest to the mode specified.
|
||||||
As long as the mode list is not empty, this method will always succeed.
|
As long as the mode list is not empty, this method will always succeed.
|
||||||
*/
|
*/
|
||||||
status_t
|
status_t
|
||||||
@@ -482,9 +488,11 @@ AccelerantHWInterface::_FindBestMode(const display_mode& compareMode,
|
|||||||
|
|
||||||
/*! This method is used for the initial mode set only - because that one
|
/*! This method is used for the initial mode set only - because that one
|
||||||
should really not fail.
|
should really not fail.
|
||||||
|
|
||||||
Basically we try to set all modes as found in the mode list the driver
|
Basically we try to set all modes as found in the mode list the driver
|
||||||
returned, but we start with the one that best fits the originally
|
returned, but we start with the one that best fits the originally
|
||||||
desired mode.
|
desired mode.
|
||||||
|
|
||||||
The mode list must have been retrieved already.
|
The mode list must have been retrieved already.
|
||||||
*/
|
*/
|
||||||
status_t
|
status_t
|
||||||
@@ -494,8 +502,9 @@ AccelerantHWInterface::_SetFallbackMode(display_mode& newMode) const
|
|||||||
// supported modes - if that fails, we just take one
|
// supported modes - if that fails, we just take one
|
||||||
|
|
||||||
if (_FindBestMode(newMode, 0, newMode) == B_OK
|
if (_FindBestMode(newMode, 0, newMode) == B_OK
|
||||||
&& fAccSetDisplayMode(&newMode) == B_OK)
|
&& fAccSetDisplayMode(&newMode) == B_OK) {
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
// That failed as well, this looks like a bug in the graphics
|
// That failed as well, this looks like a bug in the graphics
|
||||||
// driver, but we have to try to be as forgiving as possible
|
// driver, but we have to try to be as forgiving as possible
|
||||||
|
|||||||
Reference in New Issue
Block a user