PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

SetSync (csCode = 11)

The optional SetSync routine complements GetSync. It can be used to implement the VESA Device Power Management Standard (DPMS) as well as to enable a sync-on-green, sync-on-red, or sync-on-blue mode for a frame buffer.

enum {
    kDisableHorizontalSyncBit = 0,
    kDisableVerticalSyncBit = 1,
    kDisableCompositeSyncBit = 2,
    kEnableSyncOnBlue = 3,
    kEnableSyncOnGreen = 4,
    kEnableSyncOnRed = 5
}

The following illustrates a typical use of SetSync :

OSErr = Control(theDeviceRefNum, cscSetSync, &theVDSyncInfoRec);

Following is the information that the status routine must return in the fields of the VDSyncInfoRec record passed by SetSync :

--> csMode
Bit map of the sync bits that need to be disabled or enabled.
--> csFlag
A mask of the bits that are valid in the csMode field. In this manner, a 1 in bit 2 of csFlag indicates that bit 2 in the csMode field is valid and the driver should set or clear the hardware bit accordingly.

To preserve compatibility with the current Energy Saver control panel, the following special case should be implemented. If the csFlags parameter of a SetSync routine is 0, the routine should be interpreted as if the csFlags parameter were 0x3. This interpretation is necessary because the Energy Saver control panel sends a csMode value of 0 and a csFlags value of 0 in its parameter block when it wants the display to enable all the horizontal, vertical, and composite sync lines. With the new definition, this would have no effect; the result would be that the display would never come out of sleep mode.

The SetSync routine can be used to implement the VESA DPMS standard by disabling the horizontal or vertical sync lines, or both. The VESA DPMS standard specifies four software-controlled modes of operation: On, Standby, Suspend, and Off. Mode switches are accomplished by controlling the horizontal and vertical sync signals. Table 13-1 illustrates the relationship between modes and signals.

Table 13-1 Implementing VESA DPMS modes with SetSync

Mode

Horizontal
sync

Vertical sync

Video

Power savings

Recovery period

On Pulses Pulses Active None n.a.
Standby No pulses Pulses Blanked Minimal Short or immediate
Suspend Pulses No pulses Blanked Significant Substantial
Off No pulses No pulses Blanked Maximum System dependent

In the case of a display using only the composite sync line, only the On and Off modes are possible.


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)