GetClosestPixelClock

Finds the closest pixel clock to the requested pixel clock.

Declaration

N_uint32 NAPI GA_initFuncs::GetClosestPixelClock(
    N_int32 xRes,
    N_int32 yRes,
    N_int32 bitsPerPixel,
    N_uint32 pixelClock)

Prototype In

snap/graphics.h

Parameters

xRes

Physical X resolution for the display mode

yRes

Physical Y resolution for the display mode

bitsPerPixel

Color depth for the display mode

pixelClock

Requested pixel clock in units of Hz.

 

Return Value

Closest pixel clock in units of Hz.

Description

This function allows an application to determine if a particular pixel clock is available. When this function is called it will run the requested pixel clock through the internal PLL programming routines and return the actual pixel clock that will be programmed into the hardware. The process of running the PLL clock computation routines may cause the returned pixel clock to be rounded slightly up or down from the requested value, however the driver should implement the algorithms to attempt to find clocks that are the same as or higher than the requested value. Note that the calling application must also pass in the physical display resolution and color depth for the mode that will be using this pixel clock to this function. This information is necessary so that the driver can determine any necessary hardware limitations internally for the display mode before looking for the closest physical pixel clock.

If the driver implementation uses a table driven clock programming approach, it should always attempt to find the next highest pixel clock in the table to the requested clock. The exception to this is if there is a lower clock in the table that is within a tolerance of 1% of the requested clock in which case this clock should be returned (and the next highest pixel clock is not within 1% of the requested clock).

This pixel clock can then be used by the application to compute the exact GTF CRTC timing parameters for the mode. Note that for hardware that is not fully programmable, the returned pixel clock that is the closest the one desired may be substantially different (ie: you could get back 39Mhz when you request 35Mhz). It is up the calling application to determine if the clock is suitable and to attempt to choose a different clock if not suitable. The pixel clocks passed in and returned occupy 32-bits and represents the pixel clock in units of Hz (ie: a pixel clock of 25.18Mhz is represented with a value of 25180000).

See Also

SetVideoMode, SetCustomVideoMode, GetVideoModeInfo, GetCustomVideoModeInfo

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com