app_server: turn DPMS on only after setting a valid mode
It's not allowed to enable the screen before having set a mode. At least in the case of the intel_extreme driver, this creates some problem. Move the call just a bit later in the init process, where the mode is already set. Change-Id: Iaa665f0edc15316890032f1a5928f33634dc8749 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4362 Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: François Revol <[email protected]> Reviewed-by: <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
afe7affb47
commit
1c88f77dcc
@@ -519,6 +519,8 @@ Desktop::Init()
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
HWInterface()->SetDPMSMode(B_DPMS_ON);
|
||||
|
||||
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
||||
if (brightness > 0)
|
||||
HWInterface()->SetBrightness(brightness);
|
||||
|
||||
@@ -74,11 +74,6 @@ Screen::Initialize()
|
||||
status = fHWInterface->Initialize();
|
||||
}
|
||||
|
||||
// Turn on screen if this is not yet done by BIOS
|
||||
if (status == B_OK)
|
||||
fHWInterface->SetDPMSMode(B_DPMS_ON);
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,8 +124,11 @@ VirtualScreen::AddScreen(Screen* screen, ScreenConfigurations& configurations)
|
||||
// we found settings for this screen, and try to apply them now
|
||||
status = screen->SetMode(mode);
|
||||
}
|
||||
|
||||
if (status != B_OK) {
|
||||
status_t status = screen->SetPreferredMode();
|
||||
// We found no configuration or it wasn't valid, try to fallback to
|
||||
// sane values
|
||||
status = screen->SetPreferredMode();
|
||||
if (status != B_OK)
|
||||
status = screen->SetBestMode(1024, 768, B_RGB32, 60.f);
|
||||
if (status != B_OK)
|
||||
@@ -133,6 +136,9 @@ VirtualScreen::AddScreen(Screen* screen, ScreenConfigurations& configurations)
|
||||
if (status != B_OK) {
|
||||
debug_printf("app_server: Failed to set mode: %s\n",
|
||||
strerror(status));
|
||||
|
||||
delete item;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user