Screen was assuming setting a 800x600 mode would work anyway, but currently the Intel driver only supports the 'native' mode for laptop panels. Added a 'strict' parameter to SetBestMode which, if true, fails if it doesn't find any mode with the passed width. If false, and can't find any good mode, just uses the first mode in the list (could be improved). This fixes bug #2350
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27898 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
032ff97fbd
commit
0dcbaee24a
@ -124,7 +124,7 @@ Screen::SetMode(uint16 width, uint16 height, uint32 colorSpace,
|
||||
|
||||
status_t
|
||||
Screen::SetBestMode(uint16 width, uint16 height, uint32 colorSpace,
|
||||
float frequency)
|
||||
float frequency, bool strict)
|
||||
{
|
||||
// search for a matching mode
|
||||
display_mode* modes = NULL;
|
||||
@ -138,9 +138,14 @@ Screen::SetBestMode(uint16 width, uint16 height, uint32 colorSpace,
|
||||
int32 index = _FindBestMode(modes, count, width, height, colorSpace,
|
||||
frequency);
|
||||
if (index < 0) {
|
||||
debug_printf("Finding best mode failed");
|
||||
delete[] modes;
|
||||
return B_ERROR;
|
||||
if (strict) {
|
||||
debug_printf("Finding best mode failed");
|
||||
delete[] modes;
|
||||
return B_ERROR;
|
||||
} else {
|
||||
index = 0;
|
||||
// Just use the first mode in the list
|
||||
}
|
||||
}
|
||||
|
||||
display_mode mode = modes[index];
|
||||
|
Loading…
Reference in New Issue
Block a user