added DPMS support. Bumped version to 0.05.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f4a8c33b5c
commit
c46cb833bb
@ -51,7 +51,7 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
|
|||||||
uint8 colour_depth1 = 32;
|
uint8 colour_depth1 = 32;
|
||||||
// status_t result;
|
// status_t result;
|
||||||
uint32 startadd,startadd_right;
|
uint32 startadd,startadd_right;
|
||||||
// bool display, h, v;
|
bool display, h, v;
|
||||||
// bool crt1, crt2, cross;
|
// bool crt1, crt2, cross;
|
||||||
|
|
||||||
/* Adjust mode to valid one and fail if invalid */
|
/* Adjust mode to valid one and fail if invalid */
|
||||||
@ -81,8 +81,8 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
|
|||||||
interrupt_enable(false);
|
interrupt_enable(false);
|
||||||
|
|
||||||
/* find current DPMS state, then turn off screen(s) */
|
/* find current DPMS state, then turn off screen(s) */
|
||||||
// head1_dpms_fetch(&display, &h, &v);
|
head1_dpms_fetch(&display, &h, &v);
|
||||||
// head1_dpms(false, false, false);
|
head1_dpms(false, false, false);
|
||||||
// if (si->ps.secondary_head) head2_dpms(false, false, false);
|
// if (si->ps.secondary_head) head2_dpms(false, false, false);
|
||||||
|
|
||||||
/*where in framebuffer the screen is (should this be dependant on previous MOVEDISPLAY?)*/
|
/*where in framebuffer the screen is (should this be dependant on previous MOVEDISPLAY?)*/
|
||||||
@ -306,7 +306,7 @@ status = B_OK;
|
|||||||
si->dm = target;
|
si->dm = target;
|
||||||
|
|
||||||
/* turn screen one on */
|
/* turn screen one on */
|
||||||
// head1_dpms(display, h, v);
|
head1_dpms(display, h, v);
|
||||||
/* turn screen two on if a dualhead mode is active */
|
/* turn screen two on if a dualhead mode is active */
|
||||||
// if (target.flags & DUALHEAD_BITS) head2_dpms(display,h,v);
|
// if (target.flags & DUALHEAD_BITS) head2_dpms(display,h,v);
|
||||||
|
|
||||||
@ -447,19 +447,19 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) {
|
|||||||
switch(dpms_flags)
|
switch(dpms_flags)
|
||||||
{
|
{
|
||||||
case B_DPMS_ON: /* H: on, V: on, display on */
|
case B_DPMS_ON: /* H: on, V: on, display on */
|
||||||
// head1_dpms(true, true, true);
|
head1_dpms(true, true, true);
|
||||||
// if (si->ps.secondary_head) head2_dpms(true, true, true);
|
// if (si->ps.secondary_head) head2_dpms(true, true, true);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_STAND_BY:
|
case B_DPMS_STAND_BY:
|
||||||
// head1_dpms(false, false, true);
|
head1_dpms(false, false, true);
|
||||||
// if (si->ps.secondary_head) head2_dpms(false, false, true);
|
// if (si->ps.secondary_head) head2_dpms(false, false, true);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_SUSPEND:
|
case B_DPMS_SUSPEND:
|
||||||
// head1_dpms(false, true, false);
|
head1_dpms(false, true, false);
|
||||||
// if (si->ps.secondary_head) head2_dpms(false, true, false);
|
// if (si->ps.secondary_head) head2_dpms(false, true, false);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_OFF: /* H: off, V: off, display off */
|
case B_DPMS_OFF: /* H: off, V: off, display off */
|
||||||
// head1_dpms(false, false, false);
|
head1_dpms(false, false, false);
|
||||||
// if (si->ps.secondary_head) head2_dpms(false, false, false);
|
// if (si->ps.secondary_head) head2_dpms(false, false, false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -473,16 +473,16 @@ status_t SET_DPMS_MODE(uint32 dpms_flags) {
|
|||||||
switch(dpms_flags)
|
switch(dpms_flags)
|
||||||
{
|
{
|
||||||
case B_DPMS_ON: /* H: on, V: on, display on */
|
case B_DPMS_ON: /* H: on, V: on, display on */
|
||||||
// head1_dpms(true, true, true);
|
head1_dpms(true, true, true);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_STAND_BY:
|
case B_DPMS_STAND_BY:
|
||||||
// head1_dpms(false, false, true);
|
head1_dpms(false, false, true);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_SUSPEND:
|
case B_DPMS_SUSPEND:
|
||||||
// head1_dpms(false, true, false);
|
head1_dpms(false, true, false);
|
||||||
break;
|
break;
|
||||||
case B_DPMS_OFF: /* H: off, V: off, display off */
|
case B_DPMS_OFF: /* H: off, V: off, display off */
|
||||||
// head1_dpms(false, false, false);
|
head1_dpms(false, false, false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(8,("SET: Invalid DPMS settings (DH) 0x%08x\n", dpms_flags));
|
LOG(8,("SET: Invalid DPMS settings (DH) 0x%08x\n", dpms_flags));
|
||||||
@ -504,8 +504,7 @@ uint32 DPMS_MODE(void) {
|
|||||||
bool display, h, v;
|
bool display, h, v;
|
||||||
|
|
||||||
interrupt_enable(false);
|
interrupt_enable(false);
|
||||||
// head1_dpms_fetch(&display, &h, &v);
|
head1_dpms_fetch(&display, &h, &v);
|
||||||
display = h = v = true;
|
|
||||||
|
|
||||||
interrupt_enable(true);
|
interrupt_enable(true);
|
||||||
|
|
||||||
|
@ -473,9 +473,6 @@ status_t eng_crtc_dpms(bool display, bool h, bool v)
|
|||||||
|
|
||||||
LOG(4,("CRTC: setting DPMS: "));
|
LOG(4,("CRTC: setting DPMS: "));
|
||||||
|
|
||||||
/* enable access to primary head */
|
|
||||||
set_crtc_owner(0);
|
|
||||||
|
|
||||||
/* start synchronous reset: required before turning screen off! */
|
/* start synchronous reset: required before turning screen off! */
|
||||||
SEQW(RESET, 0x01);
|
SEQW(RESET, 0x01);
|
||||||
|
|
||||||
@ -529,22 +526,22 @@ status_t eng_crtc_dpms(bool display, bool h, bool v)
|
|||||||
|
|
||||||
if (h)
|
if (h)
|
||||||
{
|
{
|
||||||
CRTCW(REPAINT1, (CRTCR(REPAINT1) & 0x7f));
|
CRTCW(HTIMEXT2, (CRTCR(HTIMEXT2) & 0xef));
|
||||||
LOG(4,("hsync enabled, "));
|
LOG(4,("hsync enabled, "));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CRTCW(REPAINT1, (CRTCR(REPAINT1) | 0x80));
|
CRTCW(HTIMEXT2, (CRTCR(HTIMEXT2) | 0x10));
|
||||||
LOG(4,("hsync disabled, "));
|
LOG(4,("hsync disabled, "));
|
||||||
}
|
}
|
||||||
if (v)
|
if (v)
|
||||||
{
|
{
|
||||||
CRTCW(REPAINT1, (CRTCR(REPAINT1) & 0xbf));
|
CRTCW(HTIMEXT2, (CRTCR(HTIMEXT2) & 0xdf));
|
||||||
LOG(4,("vsync enabled\n"));
|
LOG(4,("vsync enabled\n"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CRTCW(REPAINT1, (CRTCR(REPAINT1) | 0x40));
|
CRTCW(HTIMEXT2, (CRTCR(HTIMEXT2) | 0x20));
|
||||||
LOG(4,("vsync disabled\n"));
|
LOG(4,("vsync disabled\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,12 +550,9 @@ status_t eng_crtc_dpms(bool display, bool h, bool v)
|
|||||||
|
|
||||||
status_t eng_crtc_dpms_fetch(bool *display, bool *h, bool *v)
|
status_t eng_crtc_dpms_fetch(bool *display, bool *h, bool *v)
|
||||||
{
|
{
|
||||||
/* enable access to primary head */
|
|
||||||
set_crtc_owner(0);
|
|
||||||
|
|
||||||
*display = !(SEQR(CLKMODE) & 0x20);
|
*display = !(SEQR(CLKMODE) & 0x20);
|
||||||
*h = !(CRTCR(REPAINT1) & 0x80);
|
*h = !(CRTCR(HTIMEXT2) & 0x10);
|
||||||
*v = !(CRTCR(REPAINT1) & 0x40);
|
*v = !(CRTCR(HTIMEXT2) & 0x20);
|
||||||
|
|
||||||
LOG(4,("CTRC: fetched DPMS state: "));
|
LOG(4,("CTRC: fetched DPMS state: "));
|
||||||
if (*display) LOG(4,("display on, "));
|
if (*display) LOG(4,("display on, "));
|
||||||
|
@ -90,7 +90,7 @@ status_t eng_general_powerup()
|
|||||||
{
|
{
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
LOG(1,("POWERUP: Haiku VIA Accelerant 0.04 running.\n"));
|
LOG(1,("POWERUP: Haiku VIA Accelerant 0.05 running.\n"));
|
||||||
|
|
||||||
/* preset no laptop */
|
/* preset no laptop */
|
||||||
si->ps.laptop = false;
|
si->ps.laptop = false;
|
||||||
@ -481,8 +481,8 @@ static status_t eng_general_bios_to_powergraphics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* turn off both displays and the hardcursors (also disables transfers) */
|
/* turn off both displays and the hardcursors (also disables transfers) */
|
||||||
// head1_dpms(false, false, false);
|
head1_dpms(false, false, false);
|
||||||
// head1_cursor_hide();
|
head1_cursor_hide();
|
||||||
// if (si->ps.secondary_head)
|
// if (si->ps.secondary_head)
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
@ -594,7 +594,7 @@ static status_t eng_general_bios_to_powergraphics()
|
|||||||
eng_agp_setup();
|
eng_agp_setup();
|
||||||
|
|
||||||
/* turn screen one on */
|
/* turn screen one on */
|
||||||
// head1_dpms(true, true, true);
|
head1_dpms(true, true, true);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user