* The VESA accelerant now always makes sure that all supported resolutions are
added to the mode list (in 60 Hz, but that doesn't really matter). * It does this by iterating over the modes found, and computes the display_timings from them using the GTF code. * This should help with one of the problems of ticket #7751. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42421 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* Copyright 2005-2009, Axel Dörfler, [email protected].
|
||||
* Copyright 2005-2011, Axel Dörfler, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <compute_display_timing.h>
|
||||
#include <create_display_modes.h>
|
||||
|
||||
#include "accelerant_protos.h"
|
||||
@@ -74,11 +76,29 @@ create_mode_list(void)
|
||||
const color_space kVesaSpaces[] = {B_RGB32_LITTLE, B_RGB24_LITTLE,
|
||||
B_RGB16_LITTLE, B_RGB15_LITTLE, B_CMAP8};
|
||||
|
||||
// Create the initial list from the support mode list
|
||||
// TODO: filter by monitor timing constraints!
|
||||
display_mode* initialModes = (display_mode*)malloc(
|
||||
sizeof(display_mode) * gInfo->shared_info->vesa_mode_count);
|
||||
if (initialModes != NULL) {
|
||||
vesa_mode* vesaModes = gInfo->vesa_modes;
|
||||
|
||||
for (uint32 i = gInfo->shared_info->vesa_mode_count; i-- > 0;) {
|
||||
compute_display_timing(vesaModes[i].width, vesaModes[i].height, 60,
|
||||
false, &initialModes[i].timing);
|
||||
fill_display_mode(&initialModes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
gInfo->mode_list_area = create_display_modes("vesa modes",
|
||||
gInfo->shared_info->has_edid ? &gInfo->shared_info->edid_info : NULL,
|
||||
NULL, 0, kVesaSpaces, sizeof(kVesaSpaces) / sizeof(kVesaSpaces[0]),
|
||||
initialModes, gInfo->shared_info->vesa_mode_count,
|
||||
kVesaSpaces, sizeof(kVesaSpaces) / sizeof(kVesaSpaces[0]),
|
||||
is_mode_supported, &gInfo->mode_list, &gInfo->shared_info->mode_count);
|
||||
if (gInfo->mode_list_area < B_OK)
|
||||
|
||||
free(initialModes);
|
||||
|
||||
if (gInfo->mode_list_area < 0)
|
||||
return gInfo->mode_list_area;
|
||||
|
||||
gInfo->shared_info->mode_list_area = gInfo->mode_list_area;
|
||||
|
||||
Reference in New Issue
Block a user