added preliminary DPMS support for laptop panels (disabling/enabling backlight). Not for NV11 though, and only if no external DVI panel is connected to a supported laptop. Please note: this feature can possibly be extended for NV11 and external panels if enough feedback (logfile) gets to me. If the driver/screen nolonger works for someone please let me know as well. Bumped version to 0.66.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15051 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2005-11-20 20:46:17 +00:00
parent 8fe493128f
commit 84cbe0e39f
3 changed files with 133 additions and 71 deletions
@@ -570,7 +570,9 @@ status_t nv_crtc_dpms(bool display, bool h, bool v, bool do_panel)
/* end synchronous reset because display should be enabled */ /* end synchronous reset because display should be enabled */
SEQW(RESET, 0x03); SEQW(RESET, 0x03);
if (do_panel && si->ps.tmds1_active && !si->ps.laptop) if (do_panel && si->ps.tmds1_active)
{
if (!si->ps.laptop)
{ {
/* restore original panelsync and panel-enable */ /* restore original panelsync and panel-enable */
uint32 panelsync = 0x00000000; uint32 panelsync = 0x00000000;
@@ -594,6 +596,20 @@ status_t nv_crtc_dpms(bool display, bool h, bool v, bool do_panel)
sprintf(msg, "%s(panel-)", msg); sprintf(msg, "%s(panel-)", msg);
} }
else
{
//fixme? linux only does this on dualhead cards...
//fixme: see if LVDS head can be determined with two panels there...
if (!si->ps.tmds2_active && (si->ps.card_type != NV11))
{
/* b2 = 0 = enable laptop panel backlight */
/* note: this seems to be a write-only register. */
NV_REG32(NV32_LVDS_PWR) = 0x00000003;
sprintf(msg, "%s(panel-)", msg);
}
}
}
sprintf(msg, "%sdisplay on, ", msg); sprintf(msg, "%sdisplay on, ", msg);
} }
@@ -602,7 +618,9 @@ status_t nv_crtc_dpms(bool display, bool h, bool v, bool do_panel)
/* turn screen off */ /* turn screen off */
SEQW(CLKMODE, (temp | 0x20)); SEQW(CLKMODE, (temp | 0x20));
if (do_panel && si->ps.tmds1_active && !si->ps.laptop) if (do_panel && si->ps.tmds1_active)
{
if (!si->ps.laptop)
{ {
/* shutoff panelsync and disable panel */ /* shutoff panelsync and disable panel */
DACW(FP_TG_CTRL, ((DACR(FP_TG_CTRL) & 0xcfffffcc) | 0x20000022)); DACW(FP_TG_CTRL, ((DACR(FP_TG_CTRL) & 0xcfffffcc) | 0x20000022));
@@ -621,6 +639,20 @@ status_t nv_crtc_dpms(bool display, bool h, bool v, bool do_panel)
sprintf(msg, "%s(panel-)", msg); sprintf(msg, "%s(panel-)", msg);
} }
else
{
//fixme? linux only does this on dualhead cards...
//fixme: see if LVDS head can be determined with two panels there...
if (!si->ps.tmds2_active && (si->ps.card_type != NV11))
{
/* b2 = 1 = disable laptop panel backlight */
/* note: this seems to be a write-only register. */
NV_REG32(NV32_LVDS_PWR) = 0x00000007;
sprintf(msg, "%s(panel-)", msg);
}
}
}
sprintf(msg, "%sdisplay off, ", msg); sprintf(msg, "%sdisplay off, ", msg);
} }
@@ -553,7 +553,9 @@ status_t nv_crtc2_dpms(bool display, bool h, bool v, bool do_panel)
/* end synchronous reset because display should be enabled */ /* end synchronous reset because display should be enabled */
SEQW(RESET, 0x03); SEQW(RESET, 0x03);
if (do_panel && si->ps.tmds2_active && !si->ps.laptop) if (do_panel && si->ps.tmds2_active)
{
if (!si->ps.laptop)
{ {
/* restore original panelsync and panel-enable */ /* restore original panelsync and panel-enable */
uint32 panelsync = 0x00000000; uint32 panelsync = 0x00000000;
@@ -577,6 +579,19 @@ status_t nv_crtc2_dpms(bool display, bool h, bool v, bool do_panel)
sprintf(msg, "%s(panel-)", msg); sprintf(msg, "%s(panel-)", msg);
} }
else
{
//fixme: see if LVDS head can be determined with two panels there...
if (!si->ps.tmds1_active && (si->ps.card_type != NV11))
{
/* b2 = 0 = enable laptop panel backlight */
/* note: this seems to be a write-only register. */
NV_REG32(NV32_LVDS_PWR) = 0x00000003;
sprintf(msg, "%s(panel-)", msg);
}
}
}
sprintf(msg, "%sdisplay on, ", msg); sprintf(msg, "%sdisplay on, ", msg);
} }
@@ -585,7 +600,9 @@ status_t nv_crtc2_dpms(bool display, bool h, bool v, bool do_panel)
/* turn screen off */ /* turn screen off */
SEQW(CLKMODE, (temp | 0x20)); SEQW(CLKMODE, (temp | 0x20));
if (do_panel && si->ps.tmds2_active && !si->ps.laptop) if (do_panel && si->ps.tmds2_active)
{
if (!si->ps.laptop)
{ {
/* shutoff panelsync and disable panel */ /* shutoff panelsync and disable panel */
DAC2W(FP_TG_CTRL, ((DAC2R(FP_TG_CTRL) & 0xcfffffcc) | 0x20000022)); DAC2W(FP_TG_CTRL, ((DAC2R(FP_TG_CTRL) & 0xcfffffcc) | 0x20000022));
@@ -604,6 +621,19 @@ status_t nv_crtc2_dpms(bool display, bool h, bool v, bool do_panel)
sprintf(msg, "%s(panel-)", msg); sprintf(msg, "%s(panel-)", msg);
} }
else
{
//fixme: see if LVDS head can be determined with two panels there...
if (!si->ps.tmds1_active && (si->ps.card_type != NV11))
{
/* b2 = 1 = disable laptop panel backlight */
/* note: this seems to be a write-only register. */
NV_REG32(NV32_LVDS_PWR) = 0x00000007;
sprintf(msg, "%s(panel-)", msg);
}
}
}
sprintf(msg, "%sdisplay off, ", msg); sprintf(msg, "%sdisplay off, ", msg);
} }
@@ -91,7 +91,7 @@ status_t nv_general_powerup()
{ {
status_t status; status_t status;
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.65 running.\n")); LOG(1,("POWERUP: Haiku nVidia Accelerant 0.66 running.\n"));
/* log VBLANK INT usability status */ /* log VBLANK INT usability status */
if (si->ps.int_assigned) if (si->ps.int_assigned)