modified panel modelines to be placed sorted in list
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7350 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Other authors for NV driver:
|
Other authors for NV driver:
|
||||||
Mark Watson,
|
Mark Watson,
|
||||||
Rudolf Cornelissen 9/2002-4/2004
|
Rudolf Cornelissen 9/2002-5/2004
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x00400000
|
#define MODULE_BIT 0x00400000
|
||||||
@@ -430,6 +430,11 @@ status_t create_mode_list(void) {
|
|||||||
|
|
||||||
color_space spaces[4] = {B_RGB32_LITTLE,B_RGB16_LITTLE,B_RGB15_LITTLE,B_CMAP8};
|
color_space spaces[4] = {B_RGB32_LITTLE,B_RGB16_LITTLE,B_RGB15_LITTLE,B_CMAP8};
|
||||||
|
|
||||||
|
/* see if there are panels connected and get their native modelines */
|
||||||
|
bool pan1 = false, pan2 = false, pan1_added = false, pan2_added = false;
|
||||||
|
display_mode p1, p2;
|
||||||
|
get_panel_modelines(&p1, &p2, &pan1, &pan2);
|
||||||
|
|
||||||
/* figure out how big the list could be, and adjust up to nearest multiple of B_PAGE_SIZE */
|
/* figure out how big the list could be, and adjust up to nearest multiple of B_PAGE_SIZE */
|
||||||
/* note: two extra modes might be added for flatpanels */
|
/* note: two extra modes might be added for flatpanels */
|
||||||
max_size = ((((MODE_COUNT + 2) * 4) * sizeof(display_mode)) + (B_PAGE_SIZE-1)) & ~(B_PAGE_SIZE-1);
|
max_size = ((((MODE_COUNT + 2) * 4) * sizeof(display_mode)) + (B_PAGE_SIZE-1)) & ~(B_PAGE_SIZE-1);
|
||||||
@@ -473,83 +478,69 @@ status_t create_mode_list(void) {
|
|||||||
si->mode_count++;
|
si->mode_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* advance to next mode */
|
/* advance to next mode */
|
||||||
src++;
|
src++;
|
||||||
}
|
|
||||||
|
|
||||||
/* add flatpanel native modes if panel(s) found */
|
/* add flatpanel 1 native mode if it's found and when it's time */
|
||||||
{
|
if (pan1 && !pan1_added && (i < (MODE_COUNT - 1)))
|
||||||
bool pan1 = FALSE, pan2 = FALSE;
|
|
||||||
display_mode p1, p2;
|
|
||||||
get_panel_modelines(&p1, &p2, &pan1, &pan2);
|
|
||||||
|
|
||||||
if (pan1)
|
|
||||||
{
|
{
|
||||||
/* set ranges for acceptable values */
|
if (src->timing.h_display > p1.timing.h_display)
|
||||||
low = high = p1;
|
|
||||||
/* range is 6.25% of default clock: arbitrarily picked */
|
|
||||||
pix_clk_range = low.timing.pixel_clock >> 5;
|
|
||||||
low.timing.pixel_clock -= pix_clk_range;
|
|
||||||
high.timing.pixel_clock += pix_clk_range;
|
|
||||||
/* 'some cards need wider virtual widths for certain modes':
|
|
||||||
* Not true. They might need a wider pitch, but this is _not_ reflected in
|
|
||||||
* virtual_width, but in fbc.bytes_per_row. */
|
|
||||||
//So disable next line:
|
|
||||||
//high.virtual_width = 4096;
|
|
||||||
/* do it once for each depth we want to support */
|
|
||||||
for (j = 0; j < (sizeof(spaces) / sizeof(color_space)); j++)
|
|
||||||
{
|
{
|
||||||
/* set target values */
|
/* set ranges for acceptable values */
|
||||||
*dst = p1;
|
low = high = p1;
|
||||||
/* poke the specific space */
|
/* range is 6.25% of default clock: arbitrarily picked */
|
||||||
dst->space = low.space = high.space = spaces[j];
|
pix_clk_range = low.timing.pixel_clock >> 5;
|
||||||
/* ask for a compatible mode */
|
low.timing.pixel_clock -= pix_clk_range;
|
||||||
/* We have to check for B_OK, because otherwise the pix_clk_range
|
high.timing.pixel_clock += pix_clk_range;
|
||||||
* won't be taken into account!! */
|
/* do it once for each depth we want to support */
|
||||||
//So don't do this:
|
for (j = 0; j < (sizeof(spaces) / sizeof(color_space)); j++)
|
||||||
//if (PROPOSE_DISPLAY_MODE(dst, &low, &high) != B_ERROR) {
|
|
||||||
//Instead, do this:
|
|
||||||
if (PROPOSE_DISPLAY_MODE(dst, &low, &high) == B_OK)
|
|
||||||
{
|
{
|
||||||
/* count it, and move on to next mode */
|
/* set target values */
|
||||||
dst++;
|
*dst = p1;
|
||||||
si->mode_count++;
|
/* poke the specific space */
|
||||||
|
dst->space = low.space = high.space = spaces[j];
|
||||||
|
/* ask for a compatible mode */
|
||||||
|
if (PROPOSE_DISPLAY_MODE(dst, &low, &high) == B_OK)
|
||||||
|
{
|
||||||
|
/* count it, and move on to next mode */
|
||||||
|
dst++;
|
||||||
|
si->mode_count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
/* panel1 modeline has been added */
|
||||||
|
pan1_added = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pan2)
|
/* add flatpanel 2 native mode if it's found and when it's time */
|
||||||
|
if (pan2 && !pan2_added && (i < (MODE_COUNT - 1)))
|
||||||
{
|
{
|
||||||
/* set ranges for acceptable values */
|
if (src->timing.h_display > p2.timing.h_display)
|
||||||
low = high = p2;
|
|
||||||
/* range is 6.25% of default clock: arbitrarily picked */
|
|
||||||
pix_clk_range = low.timing.pixel_clock >> 5;
|
|
||||||
low.timing.pixel_clock -= pix_clk_range;
|
|
||||||
high.timing.pixel_clock += pix_clk_range;
|
|
||||||
/* 'some cards need wider virtual widths for certain modes':
|
|
||||||
* Not true. They might need a wider pitch, but this is _not_ reflected in
|
|
||||||
* virtual_width, but in fbc.bytes_per_row. */
|
|
||||||
//So disable next line:
|
|
||||||
//high.virtual_width = 4096;
|
|
||||||
/* do it once for each depth we want to support */
|
|
||||||
for (j = 0; j < (sizeof(spaces) / sizeof(color_space)); j++)
|
|
||||||
{
|
{
|
||||||
/* set target values */
|
/* set ranges for acceptable values */
|
||||||
*dst = p2;
|
low = high = p2;
|
||||||
/* poke the specific space */
|
/* range is 6.25% of default clock: arbitrarily picked */
|
||||||
dst->space = low.space = high.space = spaces[j];
|
pix_clk_range = low.timing.pixel_clock >> 5;
|
||||||
/* ask for a compatible mode */
|
low.timing.pixel_clock -= pix_clk_range;
|
||||||
/* We have to check for B_OK, because otherwise the pix_clk_range
|
high.timing.pixel_clock += pix_clk_range;
|
||||||
* won't be taken into account!! */
|
/* do it once for each depth we want to support */
|
||||||
//So don't do this:
|
for (j = 0; j < (sizeof(spaces) / sizeof(color_space)); j++)
|
||||||
//if (PROPOSE_DISPLAY_MODE(dst, &low, &high) != B_ERROR) {
|
|
||||||
//Instead, do this:
|
|
||||||
if (PROPOSE_DISPLAY_MODE(dst, &low, &high) == B_OK)
|
|
||||||
{
|
{
|
||||||
/* count it, and move on to next mode */
|
/* set target values */
|
||||||
dst++;
|
*dst = p2;
|
||||||
si->mode_count++;
|
/* poke the specific space */
|
||||||
|
dst->space = low.space = high.space = spaces[j];
|
||||||
|
/* ask for a compatible mode */
|
||||||
|
if (PROPOSE_DISPLAY_MODE(dst, &low, &high) == B_OK)
|
||||||
|
{
|
||||||
|
/* count it, and move on to next mode */
|
||||||
|
dst++;
|
||||||
|
si->mode_count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
/* panel2 modeline has been added */
|
||||||
|
pan2_added = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -712,10 +712,10 @@ void get_panel_modelines(display_mode *p1, display_mode *p2, bool *pan1, bool *p
|
|||||||
p1->h_display_start = 0;
|
p1->h_display_start = 0;
|
||||||
p1->v_display_start = 0;
|
p1->v_display_start = 0;
|
||||||
p1->flags = 0;
|
p1->flags = 0;
|
||||||
*pan1 = TRUE;
|
*pan1 = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*pan1 = FALSE;
|
*pan1 = false;
|
||||||
|
|
||||||
if (si->ps.tmds2_active)
|
if (si->ps.tmds2_active)
|
||||||
{
|
{
|
||||||
@@ -742,10 +742,10 @@ void get_panel_modelines(display_mode *p1, display_mode *p2, bool *pan1, bool *p
|
|||||||
p2->h_display_start = 0;
|
p2->h_display_start = 0;
|
||||||
p2->v_display_start = 0;
|
p2->v_display_start = 0;
|
||||||
p2->flags = 0;
|
p2->flags = 0;
|
||||||
*pan2 = TRUE;
|
*pan2 = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*pan2 = FALSE;
|
*pan2 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pinsnv4_fake(void)
|
static void pinsnv4_fake(void)
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ status_t
|
|||||||
init_hardware(void) {
|
init_hardware(void) {
|
||||||
long pci_index = 0;
|
long pci_index = 0;
|
||||||
pci_info pcii;
|
pci_info pcii;
|
||||||
bool found_one = FALSE;
|
bool found_one = false;
|
||||||
|
|
||||||
/* choke if we can't find the PCI bus */
|
/* choke if we can't find the PCI bus */
|
||||||
if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci_bus) != B_OK)
|
if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci_bus) != B_OK)
|
||||||
@@ -333,7 +333,7 @@ init_hardware(void) {
|
|||||||
/* if we match a supported device */
|
/* if we match a supported device */
|
||||||
if (*devices == pcii.device_id ) {
|
if (*devices == pcii.device_id ) {
|
||||||
|
|
||||||
found_one = TRUE;
|
found_one = true;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/* next supported device */
|
/* next supported device */
|
||||||
|
|||||||
Reference in New Issue
Block a user