added dualhead support in 8- and 16bit colordepth

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2004-01-26 16:46:54 +00:00
parent 4b47486ee5
commit bc5690ab74
2 changed files with 24 additions and 10 deletions

View File

@ -335,20 +335,14 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
/* set DUALHEAD_CAPABLE if suitable */
//fixme: update for independant secondary head use! (reserve fixed memory then)
if (si->ps.secondary_head &&
((target->space == B_RGB16_LITTLE) || (target->space == B_RGB32_LITTLE)) &&
(target->timing.pixel_clock <= (max_vclk * 1000)))
if (si->ps.secondary_head && (target->timing.pixel_clock <= (max_vclk * 1000)))
{
/* extra line for G400 MAVEN vblank design fault workaround needed! */
uint16 vblank_fix = 0;
if (si->ps.card_type == G550) vblank_fix = 1;
switch (target->flags & DUALHEAD_BITS)
{
case DUALHEAD_ON:
case DUALHEAD_SWITCH:
if ((((si->ps.memory_size * 1024 * 1024) - pointer_reservation) >=
(row_bytes * (target->virtual_height + vblank_fix))) &&
(row_bytes * target->virtual_height)) &&
((uint16)(row_bytes / bpp) >= (target->timing.h_display * 2)))
{
target->flags |= DUALHEAD_CAPABLE;
@ -356,14 +350,14 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
break;
case DUALHEAD_CLONE:
if (((si->ps.memory_size * 1024 * 1024) - pointer_reservation) >=
(row_bytes * (target->virtual_height + vblank_fix)))
(row_bytes * target->virtual_height))
{
target->flags |= DUALHEAD_CAPABLE;
}
break;
case DUALHEAD_OFF:
if (((si->ps.memory_size * 1024 * 1024) - pointer_reservation) >=
(row_bytes * (target->virtual_height + vblank_fix) * 2))
(row_bytes * target->virtual_height * 2))
{
target->flags |= DUALHEAD_CAPABLE;
}

View File

@ -124,6 +124,16 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/*set the colour depth for CRTC1 and the DAC */
switch(target.space)
{
case B_CMAP8:
colour_depth1 = 8;
nv_dac_mode(BPP8, 1.0);
nv_crtc_depth(BPP8);
break;
case B_RGB15_LITTLE:
colour_depth1 = 16;
nv_dac_mode(BPP15, 1.0);
nv_crtc_depth(BPP15);
break;
case B_RGB16_LITTLE:
colour_depth1 = 16;
nv_dac_mode(BPP16, 1.0);
@ -138,6 +148,16 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/*set the colour depth for CRTC2 and DAC2 */
switch(target2.space)
{
case B_CMAP8:
colour_depth2 = 8;
nv_dac2_mode(BPP8, 1.0);
nv_crtc2_depth(BPP8);
break;
case B_RGB15_LITTLE:
colour_depth2 = 16;
nv_dac2_mode(BPP15, 1.0);
nv_crtc2_depth(BPP15);
break;
case B_RGB16_LITTLE:
colour_depth2 = 16;
nv_dac2_mode(BPP16, 1.0);