Calling VideoPortXxx from HwVidFindAdapter
Certain VideoPortXxx functions should be called only from the miniport driver’s HwVidFindAdapter function(s). A HwVidFindAdapter function would never call all of the following, but every HwVidFindAdapter function must call some of the following VideoPortXxx:
·VideoPortGetBusData to get bus-type-specific configuration information about an adapter on a particular I/O bus
·VideoPortSetBusData to set bus-specific configuration data for an adapter on a dynamically configurable I/O bus with a published standard interface, such as a PCI bus, if necessary
·VideoPortGetDeviceData to get VIDEO_DEVICE_DATA_TYPE-specific information from the registry and call a miniport-supplied HwVidQueryDeviceCallback function to process the information, as described in HwVidQueryDeviceCallback Routine.
·VideoPortGetAccessRanges to get bus-relative access ranges addresses, and possibly other hardware configuration values, and to claim them in the registry for use by the driver of an adapter, usually one on a configurable I/O bus
·VideoPortVerifyAccessRanges to determine whether bus-relative video memory and/or I/O ports for the adapter can be claimed by the miniport driver; otherwise, a previously loaded driver has already claimed the resource in the registry and the HwVidFindAdapter function must try to claim other access ranges if possible or return control and propagate the status value returned by VideoPortVerifyAccessRanges
·VideoPortGetDeviceBase to map each successfully claimed bus-relative base address and range size, as described in each VIDEO_ACCESS_RANGE-type element for the adapter, to a system-space logical address range
Each such (bus-relative) physical address range must be mapped with VideoPortGetDeviceBase before it is used to access an adapter. With mapped logical range addresses, the driver can call the VideoPortReadXxx and VideoPortWriteXxx functions to read from or write to an adapter. For a mapped range in I/O space, the miniport driver calls the VideoPortReadPortXxx and VideoPortWritePortXxx functions. For a mapped range in memory, the miniport driver calls the VideoPortReadRegisterXxx and VideoPortWriteRegisterXxx functions.
·VideoPortFreeDeviceBase to release such a mapped range if the HwVidFindAdapter or HwVidQueryDeviceCallback function does not find an adapter it can support on a given I/O bus, as indicated by the VIDEO_PORT_CONFIG_INFO SystemIoBusNumber value
If this occurs, the miniport also must call VideoPortVerifyAccessRanges to release its claims in the registry on the bus-relative access ranges for that adapter.
·VideoPortScanRom to determine whether a specific signature matches that of the machine ROM; in effect, this determines whether the miniport finds a specific adapter with a video chip it can support.
A HwVidFindAdapter routine also can call the VideoPortGetRegistryParameters and VideoPortSetRegistryParameters functions to get and set configuration information in the registry. For example, HwVidFindAdapter might call VideoPortSetRegistryParameters to set up nonvolatile configuration information in the registry for the next boot. It might call VideoPortGetRegistryParameters to get adapter-specific, bus-relative configuration parameters written into the registry by an installation program.
The HwVidInitialize function, described later in HwVidInitialize Functionality, also can call VideoPortGetRegistryParameters or VideoPortSetRegistryParameters.