another modelist update regarding panels

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7373 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2004-05-03 14:21:01 +00:00
parent 5685273f87
commit 45a4e26e92
2 changed files with 41 additions and 26 deletions
@@ -456,25 +456,43 @@ status_t create_mode_list(void)
/* add flatpanel 1 native mode if it's found and when it's time */ /* add flatpanel 1 native mode if it's found and when it's time */
if (pan1 && !pan1_added) if (pan1 && !pan1_added)
{ {
/* place panel mode before same H-res mode from src list in dst list so /* only add modelines we don't already have (panels use VESA modelines) */
* widescreen panels are listed in order of total resolution (HxV) */ if ((src->timing.h_display == p1.timing.h_display) &&
if (src->timing.h_display >= p1.timing.h_display) (src->timing.v_display == p1.timing.v_display))
{ {
add_panel1_mode(p1, &dst);
pan1_added = true; pan1_added = true;
} }
else
{
/* place panel mode before same H-res mode from src list in dst list so
* widescreen panels are listed in order of total resolution (HxV) */
if (src->timing.h_display >= p1.timing.h_display)
{
add_panel1_mode(p1, &dst);
pan1_added = true;
}
}
} }
/* add flatpanel 2 native mode if it's found and when it's time */ /* add flatpanel 2 native mode if it's found and when it's time */
if (pan2 && !pan2_added) if (pan2 && !pan2_added)
{ {
/* place panel mode before same H-res mode from src list in dst list so /* only add modelines we don't already have (panels use VESA modelines) */
* widescreen panels are listed in order of total resolution (HxV) */ if ((src->timing.h_display == p2.timing.h_display) &&
if (src->timing.h_display >= p2.timing.h_display) (src->timing.v_display == p2.timing.v_display))
{ {
add_panel2_mode(p2, &dst);
pan2_added = true; pan2_added = true;
} }
else
{
/* place panel mode before same H-res mode from src list in dst list so
* widescreen panels are listed in order of total resolution (HxV) */
if (src->timing.h_display >= p2.timing.h_display)
{
add_panel2_mode(p2, &dst);
pan2_added = true;
}
}
} }
/* set ranges for acceptable values */ /* set ranges for acceptable values */
@@ -510,26 +528,23 @@ status_t create_mode_list(void)
/* advance to next mode */ /* advance to next mode */
src++; src++;
}
/* (sort and) add flatpanel native mode(s) that are not added while we did /* (sort and) add flatpanel native mode(s) that are not added while we did
* reach the end of the src list */ * reach the end of the src list */
if (i == (MODE_COUNT - 1)) if (pan1 && pan2 && !pan1_added && !pan2_added)
{
/* sort in total resolution order */
if ((p2.timing.h_display * p2.timing.v_display) <
(p1.timing.h_display * p1.timing.v_display))
{ {
if (pan1 && pan2 && !pan1_added && !pan2_added) display_mode temp = p1;
{ p1 = p2;
/* sort in total resolution order */ p2 = temp;
if ((p2.timing.h_display * p2.timing.v_display) <
(p1.timing.h_display * p1.timing.v_display))
{
display_mode temp = p1;
p1 = p2;
p2 = temp;
}
}
if (pan1 && !pan1_added) add_panel1_mode(p1, &dst);
if (pan2 && !pan2_added) add_panel2_mode(p2, &dst);
} }
} }
if (pan1 && !pan1_added) add_panel1_mode(p1, &dst);
if (pan2 && !pan2_added) add_panel2_mode(p2, &dst);
return B_OK; return B_OK;
} }
@@ -8,7 +8,7 @@
#include "nv_std.h" #include "nv_std.h"
status_t test_ram(void); static status_t test_ram(void);
static status_t nvxx_general_powerup (void); static status_t nvxx_general_powerup (void);
static status_t nv_general_bios_to_powergraphics(void); static status_t nv_general_bios_to_powergraphics(void);
@@ -603,7 +603,7 @@ status_t nv_general_powerup()
return status; return status;
} }
status_t test_ram() static status_t test_ram()
{ {
uint32 value, offset; uint32 value, offset;
status_t result = B_OK; status_t result = B_OK;