completed TVout support concerning dualhead (clone) modes and custom modeflag for selecting TVout head on a per mode basis. NV11 is now fully functional (with supported encoders that is).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2005-11-03 18:25:16 +00:00
parent 05bd1efe5b
commit 3c71b494d6
4 changed files with 106 additions and 44 deletions

View File

@ -192,7 +192,8 @@ status_t INIT_ACCELERANT(int the_fd) {
/* ensure DPMS state */
si->dpms_flags = B_DPMS_ON;
/* ensure TVout state */
/* ensure TVout state:
* TVencoder is on head to be assigned primary, no dualhead switch mode active. */
//fixme: actually check on what CRTC TVout was active during boot (if any)...
si->dm.flags = TV_PRIMARY;

View File

@ -511,60 +511,82 @@ status_t SET_DPMS_MODE(uint32 dpms_flags)
/* CRTC used for TVout needs specific DPMS programming */
if (si->dm.flags & TV_BITS)
{
/* TV_PRIMARY tells us that the head to be used with TVout is the head that's
* actually assigned as being the primary head at powerup:
* so non dualhead-mode-dependant, and not 'fixed' CRTC1! */
if (si->dm.flags & TV_PRIMARY)
{
LOG(4,("SET_DPMS_MODE: tuning primary head DPMS settings for TVout compatibility\n"));
if (!(si->settings.vga_on_tv))
if ((si->dm.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
{
/* block VGA output on head displaying on TV */
/* Note:
* this specific sync setting is required: Vsync is used to keep TVout
* synchronized to the CRTC 'vertically' (otherwise 'rolling' occurs).
* This leaves Hsync only for shutting off the VGA screen. */
h1h = false;
h1v = true;
if (!(si->settings.vga_on_tv))
{
/* block VGA output on head displaying on TV */
/* Note:
* this specific sync setting is required: Vsync is used to keep TVout
* synchronized to the CRTC 'vertically' (otherwise 'rolling' occurs).
* This leaves Hsync only for shutting off the VGA screen. */
h1h = false;
h1v = true;
}
else
{
/* when concurrent VGA is used alongside TVout on a head, DPMS is safest
* applied this way: Vsync is needed for stopping TVout successfully when
* a (new) modeswitch occurs.
* (see routine BT_stop_tvout() in nv_brooktreetv.c) */
/* Note:
* applying 'normal' DPMS here and forcing Vsync on in the above mentioned
* routine seems to not always be enough: sometimes image generation will
* not resume in that case. */
h1h = display;
h1v = true;
}
}
else
{
/* when concurrent VGA is used alongside TVout on a head, DPMS is safest
* applied this way: Vsync is needed for stopping TVout successfully when
* a (new) modeswitch occurs.
* (see routine BT_stop_tvout() in nv_brooktreetv.c) */
/* Note:
* applying 'normal' DPMS here and forcing Vsync on in the above mentioned
* routine seems to not always be enough: sometimes image generation will
* not resume in that case. */
h1h = display;
h1v = true;
if (!(si->settings.vga_on_tv))
{
h2h = false;
h2v = true;
}
else
{
h2h = display;
h2v = true;
}
}
}
else
{
LOG(4,("SET_DPMS_MODE: tuning secondary head DPMS settings for TVout compatibility\n"));
if (!(si->settings.vga_on_tv))
if ((si->dm.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
{
/* block VGA output on head displaying on TV */
/* Note:
* this specific sync setting is required: Vsync is used to keep TVout
* synchronized to the CRTC 'vertically' (otherwise 'rolling' occurs).
* This leaves Hsync only for shutting off the VGA screen. */
h2h = false;
h2v = true;
if (!(si->settings.vga_on_tv))
{
h2h = false;
h2v = true;
}
else
{
h2h = display;
h2v = true;
}
}
else
{
/* when concurrent VGA is used alongside TVout on a head, DPMS is safest
* applied this way: Vsync is needed for stopping TVout successfully when
* a (new) modeswitch occurs.
* (see routine BT_stop_tvout() in nv_brooktreetv.c) */
/* Note:
* applying 'normal' DPMS here and forcing Vsync on in the above mentioned
* routine seems to not always be enough: sometimes image generation will
* not resume in that case. */
h2h = display;
h2v = true;
if (!(si->settings.vga_on_tv))
{
h1h = false;
h1v = true;
}
else
{
h1h = display;
h1v = true;
}
}
}
}

View File

@ -1580,10 +1580,23 @@ static status_t BT_update_mode_for_gpu(display_mode *target, uint8 tvmode)
* and ASUS V7100 GeForce2 MX200 AGP/32Mb (CH7007). */
static status_t BT_start_tvout(display_mode tv_target)
{
/* TV_PRIMARY tells us that the head to be used with TVout is the head that's
* actually assigned as being the primary head at powerup:
* so non dualhead-mode-dependant, and not 'fixed' CRTC1! */
if (tv_target.flags & TV_PRIMARY)
head1_start_tvout();
{
if ((tv_target.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head1_start_tvout();
else
head2_start_tvout();
}
else
head2_start_tvout();
{
if ((tv_target.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head2_start_tvout();
else
head1_start_tvout();
}
return B_OK;
}//end BT_start_tvout.
@ -1597,10 +1610,23 @@ status_t BT_stop_tvout(void)
/* prevent BT from being overclocked by VGA-only modes & black-out TV-out */
BT_killclk_blackout();
/* TV_PRIMARY tells us that the head to be used with TVout is the head that's
* actually assigned as being the primary head at powerup:
* so non dualhead-mode-dependant, and not 'fixed' CRTC1! */
if (si->dm.flags & TV_PRIMARY)
head1_stop_tvout();
{
if ((si->dm.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head1_stop_tvout();
else
head2_stop_tvout();
}
else
head2_stop_tvout();
{
if ((si->dm.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head2_stop_tvout();
else
head1_stop_tvout();
}
/* fixme if needed:
* a full encoder chip reset could be done here (so after decoupling crtc)... */
@ -1691,10 +1717,23 @@ status_t BT_setmode(display_mode target)
BT_update_mode_for_gpu(&tv_target, tvmode);
/* setup GPU CRTC timing */
/* TV_PRIMARY tells us that the head to be used with TVout is the head that's
* actually assigned as being the primary head at powerup:
* so non dualhead-mode-dependant, and not 'fixed' CRTC1! */
if (tv_target.flags & TV_PRIMARY)
head1_set_timing(tv_target);
{
if ((tv_target.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head1_set_timing(tv_target);
else
head2_set_timing(tv_target);
}
else
head2_set_timing(tv_target);
{
if ((tv_target.flags & DUALHEAD_BITS) != DUALHEAD_SWITCH)
head2_set_timing(tv_target);
else
head1_set_timing(tv_target);
}
//fixme: only testing older cards for now...
if (si->ps.secondary_head && (si->ps.card_type > NV15))

View File

@ -91,7 +91,7 @@ status_t nv_general_powerup()
{
status_t status;
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.60 running.\n"));
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.61 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)