* This lets the app_server respect the boot loader's fail-safe video mode

setting again. It still allows you to change the mode afterwards, though.
* This fixes bug #3419.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-08-07 11:08:31 +00:00
parent f7be7fea76
commit 2d332a4228
@@ -96,7 +96,8 @@ use_fail_safe_video_mode()
AccelerantHWInterface::AccelerantHWInterface() AccelerantHWInterface::AccelerantHWInterface()
: HWInterface(), :
HWInterface(),
fCardFD(-1), fCardFD(-1),
fAccelerantImage(-1), fAccelerantImage(-1),
fAccelerantHook(NULL), fAccelerantHook(NULL),
@@ -220,15 +221,14 @@ AccelerantHWInterface::_OpenGraphicsDevice(int deviceNumber)
int device = -1; int device = -1;
int count = 0; int count = 0;
if (!use_fail_safe_video_mode()) { if (!use_fail_safe_video_mode()) {
// ToDo: the former R5 "stub" driver is called "vesa" under Haiku; however, // TODO: We do not need to avoid the "vesa" driver this way once it has
// we do not need to avoid this driver this way when is has been ported // been ported to the new driver architecture - the special case here
// to the new driver architecture - the special case here can then be // can then be removed.
// removed.
struct dirent *entry; struct dirent *entry;
char path[PATH_MAX]; char path[PATH_MAX];
while (count < deviceNumber && (entry = readdir(directory)) != NULL) { while (count < deviceNumber && (entry = readdir(directory)) != NULL) {
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..") || if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")
!strcmp(entry->d_name, "stub") || !strcmp(entry->d_name, "vesa")) || !strcmp(entry->d_name, "vesa"))
continue; continue;
if (device >= 0) { if (device >= 0) {
@@ -518,7 +518,9 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
} }
#endif #endif
status_t status = fAccSetDisplayMode(&newMode); status_t status = B_ERROR;
if (!use_fail_safe_video_mode() || !fInitialModeSwitch)
status = fAccSetDisplayMode(&newMode);
if (status != B_OK) { if (status != B_OK) {
ATRACE(("setting display mode failed\n")); ATRACE(("setting display mode failed\n"));
if (!fInitialModeSwitch) if (!fInitialModeSwitch)
@@ -534,14 +536,15 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
if (fModeList == NULL) { if (fModeList == NULL) {
status = _UpdateModeList(); status = _UpdateModeList();
if (status < B_OK) if (status != B_OK)
return status; return status;
} }
// If this is the initial mode switch, we try a number of fallback // If this is the initial mode switch, we try a number of fallback
// modes first, before we have to fail // modes first, before we have to fail
status = _SetFallbackMode(newMode); status = use_fail_safe_video_mode()
? B_ERROR : _SetFallbackMode(newMode);
if (status != B_OK) { if (status != B_OK) {
// The driver doesn't allow us the mode switch - this usually // The driver doesn't allow us the mode switch - this usually
// means we have a driver that doesn't allow mode switches at // means we have a driver that doesn't allow mode switches at