centering update for external monitor only mode

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7670 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2004-05-29 12:19:22 +00:00
parent e3964db291
commit a38565b80b
4 changed files with 52 additions and 49 deletions
@@ -3,7 +3,7 @@
This file may be used under the terms of the Be Sample Code License. This file may be used under the terms of the Be Sample Code License.
Other authors: Other authors:
Rudolf Cornelissen 4/2003-4/2004 Rudolf Cornelissen 4/2003-5/2004
*/ */
#define MODULE_BIT 0x00200000 #define MODULE_BIT 0x00200000
@@ -127,7 +127,7 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
nm_crtc_set_timing(target, crt_only); nm_crtc_set_timing(target, crt_only);
/* always setup centering so a KB BIOS switch to flatpanel will go OK... */ /* always setup centering so a KB BIOS switch to flatpanel will go OK... */
nm_crtc_center(target); nm_crtc_center(target, crt_only);
} }
/* update driver's mode store */ /* update driver's mode store */
@@ -504,7 +504,7 @@ status_t nm_crtc_set_display_start(uint32 startadd,uint8 bpp)
} }
/* setup centering mode for current internal or simultaneous flatpanel mode */ /* setup centering mode for current internal or simultaneous flatpanel mode */
status_t nm_crtc_center(display_mode target) status_t nm_crtc_center(display_mode target, bool crt_only)
{ {
/* note: /* note:
* NM2070 apparantly doesn't support horizontal centering this way... */ * NM2070 apparantly doesn't support horizontal centering this way... */
@@ -521,6 +521,8 @@ status_t nm_crtc_center(display_mode target)
ctrl2 = ctrl3 = 0x00; ctrl2 = ctrl3 = 0x00;
/* calculate offsets for centering if prudent */ /* calculate offsets for centering if prudent */
if (!crt_only)
{
if (target.timing.h_display < si->ps.panel_width) if (target.timing.h_display < si->ps.panel_width)
{ {
hoffset = (si->ps.panel_width - target.timing.h_display); hoffset = (si->ps.panel_width - target.timing.h_display);
@@ -572,6 +574,7 @@ status_t nm_crtc_center(display_mode target)
//fixme?: block non-standard modes? for now: not centered. //fixme?: block non-standard modes? for now: not centered.
break; break;
} }
}
/* now program the card's registers */ /* now program the card's registers */
ISAGRPHW(PANELVCENT1, vcent1); ISAGRPHW(PANELVCENT1, vcent1);
@@ -47,7 +47,7 @@ status_t nm_general_powerup()
{ {
status_t status; status_t status;
LOG(1,("POWERUP: Neomagic (open)BeOS Accelerant 0.06-12 running.\n")); LOG(1,("POWERUP: Neomagic (open)BeOS Accelerant 0.06-13 running.\n"));
/* detect card type and power it up */ /* detect card type and power it up */
switch(CFGR(DEVID)) switch(CFGR(DEVID))
@@ -41,7 +41,7 @@ status_t nm_crtc_set_timing(display_mode target, bool crt_only);
status_t nm_crtc_depth(int mode); status_t nm_crtc_depth(int mode);
status_t nm_crtc_set_display_start(uint32 startadd,uint8 bpp); status_t nm_crtc_set_display_start(uint32 startadd,uint8 bpp);
status_t nm_crtc_set_display_pitch(void); status_t nm_crtc_set_display_pitch(void);
status_t nm_crtc_center(display_mode target); status_t nm_crtc_center(display_mode target, bool crt_only);
status_t nm_crtc_dpms(bool, bool, bool); status_t nm_crtc_dpms(bool, bool, bool);
status_t nm_crtc_dpms_fetch(bool*, bool*, bool*); status_t nm_crtc_dpms_fetch(bool*, bool*, bool*);