📄 daldef.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/****************************************************************************\
*
* Module Name daldef.h
* Project ATI Display Abstraction Layer
* Device RageProPNP / Rage128 (Win95/98 & WinNT 4.0/5.0)
*
* Description private header file for Display Abstraction Layer
* containing definitions internal only to dal files.
*
* Copyright (c) 1998-2000 ATI Technologies Inc. (unpublished)
*
* All rights reserved. This notice is intended as a precaution against
* inadvertent publication and does not imply publication or any waiver
* of confidentiality. The year included in the foregoing notice is the
* year of creation of the work.
*
* Refer to DAL Developers Guide & Programming Reference Rev 0.84 for usage
*
\****************************************************************************/
#ifndef _DALDEF_H
#define _DALDEF_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined (_X86_)
#pragma pack(1)
#endif
#include "registry_DAL.h"
#include "cwddedi.h"
#include "atimcode.h"
/*****************************Private*Definition*****************************\
*
* PRIVATE DAL TYPE DEFINITIONS (INTERNAL ONLY)
*
\****************************************************************************/
// maximum number of modes supported by the DAL, where modes
// are a permutation of Height&Width * bpp * RefreshRate.
#define MAX_DAL_MODES 640
#define MAX_DETAILEDTIMING_NUM 4
// maximum size for a modes list from the registry
#define MAX_REGISTRY_MODE_ENTRIES 40
#define REGISTRY_MODE_SIZE_PER_ENTRY (sizeof(USHORT) * 4)
#define MAX_REGISTRY_MODE_ENTRY_PER_LINE 10
#define MAX_REGISTRY_MODE_LINES 10
#define MAX_REGISTRY_MODE_LIST (MAX_REGISTRY_MODE_ENTRIES * REGISTRY_MODE_SIZE_PER_ENTRY)
#define MAX_GDO_RESTRICTED_MODE_LIST (10 * REGISTRY_MODE_SIZE_PER_ENTRY)
// maximum number of detailed timing modes that can be cached
#define MAX_CACHEDDTM 16
// minimum x and y resolutions
#define MIN_X_RES 320
#define MIN_Y_RES 200
// maximum size for a data to be written to the registry
#define MAX_REGISTRY_BINARY_SIZE 1024
#define MAX_REGISTRY_LINE 10
#define MAX_REGISTRY_VALUENAME 256
//DFP bootup behavior, max device,driver combinations VG
#define MAX_OBJECT_MAP 128
#define MAX_PRIO_ELEM 10
#define DAL_MAX_PHISYCAL_HRES 4096
#define DAL_MAX_PHISYCAL_VRES 4096
#define DAL_MAX_GCO_ADJUSTMENTS 4
#define DAL_MAX_GDO_ADJUSTMENTS 32
#define DAL_MAX_GDO_PER_MODE_ADJUSTMENTS 6
typedef struct _HW_DAL_EXTENSION HW_DAL_EXTENSION;
typedef struct _DEVGCO DEVGCO;
typedef struct _DEVGDO DEVGDO;
typedef struct _DALMODE DALMODE;
typedef struct _DAL_OBJECT_MAP DAL_OBJECT_MAP;
typedef struct _DAL_DRIVER_MAP DAL_DRIVER_MAP;
typedef struct _CWDDEMODEENUM CWDDEMODEENUM;
typedef struct _DRIVERDATA DRIVERDATA;
typedef struct _REGDETAILTEDTIMINGINFO REGDETAILEDTIMINGINFO;
// Define number of overlay adjustments for DAL internal usages
#define DAL_OVERLAY_ADJUSTTYPE_BRIGHTNESS 0x00000000
#define DAL_OVERLAY_ADJUSTTYPE_CONTRAST 0x00000001
#define DAL_OVERLAY_ADJUSTTYPE_SATURATION 0x00000002
#define DAL_OVERLAY_ADJUSTTYPE_HUE 0x00000003
#define DAL_OVERLAY_ADJUSTTYPE_GAMMA 0x00000004
#define DAL_OVERLAY_ADJUSTTYPE_ALPHA 0x00000005
#define DAL_OVERLAY_MAX_NUM_ADJUSTMENTS 0x00000006
#define DAL_OVLADJUST_SUPPORTED_FLAG 0x00000001 // adjustment is supported
#define DAL_OVLADJUST_DISPDEVDEP_FLAG 0x00000002 // display combination dependent
#define DAL_OVLADJUST_RESETATALLOC_FLAG 0x00000004 // reset to default when overlay is allocated
#define DAL_OVLADJUST_SAVEREG_FLAG 0x00000008 // data is out of sync - need to write to registry
typedef struct _OVLADJUST
{
ULONG ulFlags;
ULONG ulDIIndex;
HW_ADJUSTMENT sGCODefault;
LPLONG lpDefault;
LPLONG lpAdjusts;
LPUCHAR lpRegName;
PFNGCOGETBLINKOVERLAY pfnGet;
PFNGCOSETBLINKOVERLAY pfnSet;
} OVLADJUST, FAR *LPOVLADJUST;
//
// DEVGCO is the DAL's device specific structure for the graphics controller
// object
//
#define GCO_ACTIVE 0x00000001L
#define GCO_VIEWSIZELOCKED 0x00000002L
#define GCO_PANLOCKED 0x00000004L
#define GCO_POWEREDDOWN 0x00000008L
#define GCO_EXPANSION 0x00000010L
#define GCO_SAVEDATA 0x00000020L
#define GCO_SAVEGAMMA 0x00000040L
#define GCO_MAPPED 0x00000080L
#define GCO_SAVEADJUSTMENTS 0x00000100L
#define GCO_INITADJUSTMENTS 0x00000200L
#define GCO_CALLDDLPPMODECHANGE 0x00000400L
#define GCO_OVERLAYTHEATERMODE 0x00000800L
//State change bit
#define GCO_EXPANSION_CHANGE 0x00000001L
typedef struct _DEVGCO
{
// 1 based index identifying this controller
ULONG ulController;
// flags describing the state of the controller
ULONG ulFlags;
// handle to the graphics controller object
HGCO hGCO;
// pointer to the structure describing the properties and function entry
// points for this graphics controller object.
LPHW_CONTROLLER_ENABLEDATA lpHWED;
// mode the controller is in, if it is active.
DEVMODE_INFO sModeInfo;
// mode the controller was last in in
DEVMODE_INFO sLastModeInfo;
ULONG ulPitch;
ULONG ulOffset;
// bit vector of displays which are currently attached to the controller
ULONG ulDisplays;
// bit flags specifying the display types active on the controller
ULONG ulDisplayTypes;
// Desktop size
SIZE siDesktop;
// Desktop size
SIZE siViewLock;
// View area for the controller in the surface
RECT rtView;
// Pan Locking rectangle for the surface
RECT rtPanLock;
// DAL passes detail timing information for each display type
// using this structure.
DAL_DISPLAY_TIMING_INFO sDisplayTimingInfo[MAX_NUMBER_DISPLAYS];
// array of all possible adjustment structures for a given controller
// storing the defaults
HW_ADJUSTMENT aAdjustment[DAL_MAX_GCO_ADJUSTMENTS];
// array of actual states for adjustments for this display
LONG alAdjustments[DAL_MAX_GCO_ADJUSTMENTS];
// Per controller flags
ULONG ulControllerFlags;
ULONG ulTempAdjustmentVectors; //Vectors for adjustment which does not need save in the registry.
ALLOCATED_BW sAllocatedBandwidth;
ALLOCATED_BW sAllocatedPeakBandwidth;
// indicate state change bits.
ULONG ulStateChangeFlags;
// DAL will save view position here when setting OverlayTheaterMode.
POINT sLastViewPosition;
// Pan Locking rectangle for the surface before OverlayTheaterMode
RECT rtLastPanLock;
} DEVGCO, FAR *LPDEVGCO;
//
// DEVGDO is the DAL's device specific structure for the graphics display
// object
//
#define GDO_ACTIVE 0x00000001L
#define GDO_DPMS_DISABLED 0x00000004L
#define GDO_PHYSICALLY_CONNECTED 0x00000008L
#define GDO_BLANKING_DISABLED 0x00000010L
#define GDO_MONITOR_INFO 0x00000020L
#define GDO_EDID 0x00000040L
#define GDO_SAVEDATA 0x00000080L
#define GDO_SAVEPERMODEADJUSTMENTS 0x00000100L
#define GDO_QUERYPERMODEADJUSTMENTS 0x00000200L
#define GDO_ADJUSTMENTSQUERIED 0x00000400L
#define GDO_USEATIMONITORINFO 0x00000800L
#define GDO_SETADJUSTMENTS 0x00001000L
#define GDO_USEOSMONITORINFO 0x00002000L
#define GDO_SAVEUSER_MONITOR_INFO 0x00004000L
#define GDO_UNKNOWNMONITOR 0x00008000L
#define GDO_OSMONITOR_INFO_AVAILABLE 0x00010000L
#define GDO_SAVE_MAX_MODE_INFO 0x00020000L
#define GDO_CONNECTOR_ESTABLISHED 0x00040000L
#define GDO_PM_LOWREFRESHRATE_SET 0x00080000L //Dynamic refresh rate state flag
#define GDO_PM_LOWREFRESHRATE_REQUESTED 0x00100000L //Dynamic refresh rate logic flag
#define GDO_EDID_REPORT_TO_OS_ONLY 0x00200000L
#define GDO_WITHOUT_CONTROLLER 0xFFFFFFFF
typedef struct _DEVGDO
{
// 1 based index identifying this graphics display object.
ULONG ulDisplay;
// flags describing the state of the display
ULONG ulFlags;
// handle to the GDO, programmed by DAL to a part of reserved in the
// HW_DAL_EXTENSION structure
HGDO hGDO;
// index used for processing CWDDE calls as the last position in the
// mode table returned in an ENUM REFRESH call
ULONG ulEnumRefreshIndex;
// enable data structure filled in by the GDO on GDOEnable
LPHW_DISPLAY_ENABLEDATA lpHWED;
// bit vector specifying the controller the display is connected to
ULONG ulController;
// maximum values for the various fields of a mode info structure
DEVMODE_INFO sMaxModeInfo;
// structure to contain raw information on the EDID
EDID_BUFFER sEDID;
// structure to contain derived information from EDID
DDC_INFO sDDCInfo;
// structure to contain infromation on the monitor max resolutiom
// and max refresh rate. (This is OS dependant)
MONITOR_INFO sMonitorInfo;
// structure to contain infromation on the monitor max resolutiom
// and max refresh rate. (This is set by user through Control Panel)
MONITOR_INFO sUserMonitorInfo;
// array of all possible adjustment structures for a given display
// storing the defaults and states for the given mode
HW_ADJUSTMENT aAdjustment[32];
// array of actual states for adjustments for this display
LONG alAdjustments[32];
// the requested low refresh rate which not set yet.
ULONG ulRequestedRefreshRate; //Set only by DALCWDDE_DISPLAYSETREFRESHRATE
ULONG ulCurrentRefreshRate; //Set by vSetDisplayPMRefreshRate(), and vControllerSetMode()
ULONG ulDefaultRefreshRate; //Initilized at Display Enable time.
// buffer for per-GDO restricted modes from registry
ULONG ulRestrictedModesCount;
UCHAR aRestrictedModes[MAX_GDO_RESTRICTED_MODE_LIST];
} DEVGDO, FAR *LPDEVGDO;
//
// DAL_MODEINFO is the DAL's structure to extend the properties of a mode
//
//
// todo - in what field do these flags go? [GG] 23/03/00
#define DALMODE_CRT_DTHASREADFROMREGISTRY 0x00000001
#define DALMODE_CRT_DTREGISTRYEXIST 0x00000002
#define DALMODE_DFP_DTHASREADFROMREGISTRY 0x00000004
#define DALMODE_DFP_DTREGISTRYEXIST 0x00000008
#define DALMODEFLAG_OSVIEWRESTRICTED 0x40000000
#define DALMODEFLAG_REQUIRESTIMINGS 0x80000000
typedef struct _DAL_MODEINFO
{
// structure containing height, width, bpp, and refresh rate for the mode
DEVMODE_INFO sDevModeInfo;
// bit vector specifying the displays that can be enabled in this mode
// on a specific graphics controller, referenced by index.
ULONG aulSupportedDisplays[MAX_NUMBER_CONTROLLERS];
// bit vector of controllers supporting this mode.
ULONG ulControllers;
// DAL mode flags
ULONG ulFlags;
} DAL_MODEINFO, FAR * LPDAL_MODEINFO;
typedef struct _CWDDEMODEENUM
{
// index of the last enumerated value in the call.
ULONG ulEnumIndex;
// filter to be used in the enumeration of the modes
ULONG ulFilter;
// controller used for the enumeration
ULONG ulController;
// driver whom is performing the enumeration
ULONG ulDriverID;
// pointer to the last valid enumeration location.
LPDAL_MODEINFO lpDalMode;
} CWDDEMODEENUM;
#define DRIVERDATA_SAVEDATA 0x00000001L
#define DRIVERDATA_SAVEGAMMARED 0x00000002L
#define DRIVERDATA_SAVEGAMMAGREEN 0x00000004L
#define DRIVERDATA_SAVEGAMMABLUE 0x00000008L
#define DRIVERDATA_SAVEGAMMA (DRIVERDATA_SAVEGAMMARED |\
DRIVERDATA_SAVEGAMMAGREEN |\
DRIVERDATA_SAVEGAMMABLUE)
#define DRIVERDATA_ENABLED 0x00000010L
#define DRIVERDATA_USEGAMEGAMMA 0x00000020L
#define DRIVERDATA_DDEXCLUSIVEMODE 0x00000040L
#define DRIVERDATA_REQUESTEDTO16BPP 0x00000080L
#define DRIVERDATA_FORCEDTO16BPP 0x00000100L
#define DRIVERDATA_ACTIVE 0x00000200L
typedef struct _DRIVERDATA
{
// bit flags indicating the state of the driver
ULONG ulFlags;
// flag to indicate that DAL should fail to validate and set subsiquent
// mode calls until a DALGetDefaultMode call is made.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -