📄 dalbase.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 dalbase.h
* Project ATI Display Abstraction Layer
* Device RageProPNP / Rage128 (Win95/98 & WinNT 4.0/5.0)
*
* Description base header file for Display Abstraction Layer 0.90
* containing common type definitions and defines
*
* Copyright (c) 1998-2002 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.90 for usage
*
*
\****************************************************************************/
#ifndef _DALBASE_H
#define _DALBASE_H
#if defined(_X86_)
#pragma pack(1)
#endif
#define DAL_REVISION_MAJOR 0x0000
#define DAL_REVISION_MINOR 0x9000
#define DAL_REVISION ((QS_REVISION_MAJOR << 16) | QS_REVISION_MINOR)
#define GDO_CAPS_ACTIVATE_BEFORE_DETECT 0x00000001L
#define GDO_CAPS_GDO_WITH_LID 0x00000002L
#define GDO_CAPS_RESERVED0 0x00000004L
#define GDO_CAPS_REPORT_ONLY_EDID 0x00000008L
#define MAX_NO_MONITOR_INFO_MODES 30
#define MAX_NUM_FIXEDDISPLAY_MODES 25
#define DEFAULT_DISPLAY_REFRESH_RATE 60
// These are return code for bValidateMonitorRangeMode() function
#define FEATURE_NOT_SUPPORTED 0x00000001L
#define RES_SUPPORTED 0x00000002L
#define RES_NOT_SUPPORTED 0x00000003L
// ++ These defines are obsolete, use the ones defined in DALDDC.H instead
#define EDID_VERSION_10 0x00000100
#define EDID_VERSION_11 0x00000101
#define EDID_VERSION_12 0x00000102
#define EDID_VERSION_13 0x00000103
#define EDID_VERSION_20 0x00000200
#define EDID_VERSION_SIMULATED 0xFFFFFFFF
// --
#define EDID_DISPLAY_NAME_SIZE 20
#define OVERLAY_FORMAT_YUY2 0x00000001 // 4-2-2 (16bits) format, packed
#define OVERLAY_FORMAT_UYVY 0x00000002 // 4-2-2 (16bits) format, packed
#define OVERLAY_FORMAT_YV12 0x00000003 // 4-2-0 (12bits) format, planar
#define OVERLAY_FORMAT_YVU9 0x00000004 // (9bits) ??, planar
#define OVERLAY_FORMAT_IF09 0x00000005 // (9bits) ??, planar
#define OVERLAY_FORMAT_RGB565 0x00000006 // 16 bits, packed
#define OVERLAY_FORMAT_RGB555 0x00000007 // 16 bits, packed
#define OVERLAY_FORMAT_RGB32 0x00000008 // 32 bits, packed
// These options are used in the bFindClosest mode
#define DAL_OPTIONS_DIRECTDRAWMODE 0x00000001
#define DAL_OPTIONS_EXACTFREQUENCY 0x00000002
#define DAL_OPTIONS_LOWRESMODE 0x00000004
#define DAL_OPTIONS_DONOTLOWERVIEW 0x00000008
// Return codes from ulSetPowerState Function
#define SETPOWERSTATE_OK 1
#define SETPOWERSTATE_FAILED_MULTIPLECONTROLLERSACTIVE 2
#define SETPOWERSTATE_FAILED_MULTIPLEDISPLAYSACTIVE 3
#define SETPOWERSTATE_FAILED_LCDPANELDNOTACTIVE 4
#define SETPOWERSTATE_FAILED_FEATUREDISABLEDINOPTION 5
#define SETPOWERSTATE_FAILED_CURRENTSTATESAMETOREQUESTED 6
#define SETPOWERSTATE_FAILED_NOBANDWIDTH 7
#define SETPOWERSTATE_FAILED_INVALIDPOWERSTATE 8
#define SETPOWERSTATE_FAILED_NOBWAT32BPPOKAT16BPP 9
#define SETPOWERSTATE_RETURNACTION_FORCEMODECHANGE 1
// This is used for ulMiscInfo parameter for UpdateBIOSDisplayInfo
#define GCO_UPDATE_CMOS 0x00000001L // Bit 0: Update CMOS
// Return codes from ulR6ValidateClockConfig
#define SETCLOCK_OK 1
#define SETCLOCK_FAILED_SKIPSAMESETTINGS 2
#define SETCLOCK_FAILED_ASICNOTSUPPORT 3
#define SETCLOCK_FAILED_CLOCKOUTOFRANGE 4
#define SETCLOCK_FAILED_NOBANDWIDTH 5
#define SETCLOCK_FAILED_WRONGCLOCKFLAG 6
//
// This is the CRTC timing structure to be used by all
// DAL components.
//
typedef struct _DAL_CRTC_TIMING
{
USHORT usFlags; // flags to indicate various conditions
USHORT usHorizontalTotal; // horizontal totol time
USHORT usHorizontalDisplay; // horizontal address time
USHORT usHorizontalSyncStart; // horizontal sync start
USHORT usHorizontalSyncWidth; // horizontal sync time
USHORT usVerticalTotal; // vertical total time
USHORT usVerticalDisplay; // vertical address time
USHORT usVerticalSyncStart; // vertical sync start
USHORT usVerticalSyncWidth; // vertical sync time
USHORT usPixelClock; // pixel clock frequency to use
USHORT usHorizontalOverscanRight; // right overscan width
USHORT usHorizontalOverscanLeft; // left overscan width
USHORT usVerticalOverscanBottom; // bottom overscan width
USHORT usVerticalOverscanTop; // top overscan width
USHORT usOverscan8B; // 8bpp and blue overscan color
USHORT usOverscanGR; // green and red overscan color
} DAL_CRTC_TIMING, FAR *LPDAL_CRTC_TIMING;
// DAL_DISPLAY_DETAIL_TIMING structure will be passed to GCO
// at set mode with detailed timing for GCO to set the mode.
typedef struct _DAL_DISPLAY_TIMING_INFO
{
ULONG ulDisplayID; // DAL display ID
ULONG ulDisplayType; // Display type (DFP, CRT, LCD)
ULONG ulEDIDManufacturerName; // Manufactureres name
ULONG ulEDIDDisplayProductID; // Product ID as per EDID
ULONG ulEDIDStructureVersion; // Edid structure version
DAL_CRTC_TIMING sDisplayDetailedTiming; // Detailed Timing obtained form EDID
} DAL_DISPLAY_TIMING_INFO, FAR *LPDAL_DISPLAY_TIMING_INFO;
// Flags used for manipulating the DAL_CRTC_TIMING structure.
//
#define CRTC_DOUBLE_SCAN 0x0001
#define CRTC_INTERLACED 0x0002
#define CRTC_H_SYNC_POLARITY 0x0004
#define CRTC_V_SYNC_POLARITY 0x0008
#define USE_DEFAULT_POLARITY 0x0010
#define CRTC_ONLY_DETAILED_TIMINGS_EXIST 0x0020
#define CRTC_NOT_RECOMMENDED_BY_DAL 0x0040
#define CRTC_PANEL_MODE 0x1000 // If this bit is set in flags field then it means
// resolution is panel specific e.g 1400x1050 etc.
#define DAL_GCO_MAX_POWERSTATE 6
#define DAL_POWERSTATE_NORMAL 1
#define DAL_GCOPOWERSTATE_FLAGS_MEMORYSHARESCORECLK 0x00000001L
#define DAL_GCOPOWERSTATE_FLAGS_CORESHARESMEMORYCLK 0x00000002L
#define DAL_GCOPOWERSTATE_FLAGS_LOWVOLTAGE 0x00000004L
#define DAL_GCOPOWERSTATE_FLAGS_LOWPANELREFRESHRATE 0x00000008L
#define DAL_GCOCLOCKINFO_FLAGS_MEMORYSHARESCORECLK 0x00000001L
#define DAL_GCOCLOCKINFO_FLAGS_CORESHARESMEMORYCLK 0x00000002L
typedef struct _DAL_GCOPOWERSTATE
{
ULONG ulFlags;
ULONG ulMemoryClock;
ULONG ulCoreClock;
ULONG ulRefreshRate;
ULONG ulReserved[4];
} DAL_GCOPOWERSTATE, FAR *LPDAL_GCOPOWERSTATE;
typedef struct _DAL_ADAPTERPOWERSTATES
{
DAL_GCOPOWERSTATE sGCOPowerState[DAL_GCO_MAX_POWERSTATE];
} DAL_ADAPTERPOWERSTATES, FAR *LPDAL_ADAPTERPOWERSTATES;
//ADJUSTMENT_PARAMETERS ulFlags:
# define ADJUSTMENT_PARAMETERS_DEFAULT_HORIZ_SIZE 0x00000001
# define ADJUSTMENT_PARAMETERS_DEFAULT_VERT_SIZE 0x00000002
# define ADJUSTMENT_PARAMETERS_DEFAULT_HORIZ_POSITION 0x00000004
# define ADJUSTMENT_PARAMETERS_DEFAULT_VERT_POSITION 0x00000008
# define ADJUSTMENT_PARAMETERS_DEFAULT_PANEL_REFRESH_RATE 0x00000010
typedef struct _DAL_GCOCLK_SETTING
{
ULONG ulDefaultClk;
ULONG ulCurrentClk;
ULONG ulMaxSetClk;
ULONG ulMinSetClk;
ULONG ulReserved[4];
} DAL_GCOCLK_SETTING, FAR *LPDAL_GCOCLK_SETTING;
typedef struct _DAL_ADAPTERCLOCK_INFO
{
ULONG ulSize;
ULONG ulFlag; //indicate clock related configuration flag.
DAL_GCOCLK_SETTING sMemoryClk;
DAL_GCOCLK_SETTING sCoreClk;
ULONG ulReserved[2];
} DAL_ADAPTERCLOCK_INFO, FAR *LPDAL_ADAPTERCLOCK_INFO;
typedef struct _DAL_GCOCLK_CONFIG
{
ULONG ulSize;
ULONG ulFlag;
ULONG ulMemClk;
ULONG ulCoreClk;
ULONG ulReserved[4];
} DAL_GCOCLK_CONFIG, FAR *LPDAL_GCOCLK_CONFIG;
typedef struct _ADJUSTMENT_PARAMETERS
{
//three options for this struture:
//1.) Timing adjustment
USHORT usCRTC_H_TOTAL; // Horizontal total (pixels * 8)
USHORT usCRTC_H_SYNC_START; // Horizontal sync start (pixels * 8)
USHORT usCRTC_V_TOTAL; // Vertical tatal
USHORT usCRTC_V_SYNC_START; // Vertical sync start
//PLL stuff 10 bit for extended PLL
//for secondary CRTC there is only extended
//2.) PLL adjustment.
USHORT usPLL_REF_DIV;
USHORT usPLL_FB_DIV; // This is for VClock (CRTC1 & CRTC2),
USHORT usPLL_FRAC_FB_DIV; // Set to 0 if fractional FB Div is not supported
UCHAR ucPLL_POST_DIV;
//3.) PixelClock adjustment (Used by DisplaySetRefreshRate, Make sure to set other options to zero when used.)
USHORT usPixelClock;
//4.) Default position /adjustment information
ULONG ulFlags;
} ADJUSTMENT_PARAMETERS, FAR *LPADJUSTMENT_PARAMETERS;
typedef struct _DEVCLUT
{
UCHAR ucRed;
UCHAR ucGreen;
UCHAR ucBlue;
UCHAR ucReserved;
} DEVCLUT, FAR *LPDEVCLUT;
typedef struct _DEVCLUT16
{
USHORT usRed;
USHORT usGreen;
USHORT usBlue;
USHORT usReserved;
} DEVCLUT16, FAR *LPDEVCLUT16;
#define DEVMODEFLAG_INTERLACED 0x00000001
#define DEVMODEFLAG_DIRECTDRAW 0x00000002
#define DEVMODEFLAG_LARGEDESKTOP 0x00000004
#define DEVMODEFLAG_VIEWRESTRICTED 0x00000008
#define DEVMODEFLAG_DEFAULTFREQUENCY 0x00000010
#define DEVMODEFLAG_OPTIMUMFREQUENCY 0x00000020
#define DEVMODEFLAG_DDMODEVALIDATE 0x00000040
#define DEVMODEFLAG_NONSTANDARDMODE 0x00000080
#define DEVMODEFLAG_CVMODE 0x00000100
#define DEVMODEFLAG_USE565 0x00000200
#define DEVMODEFLAG_DEFINEDFREQUENCY 0x00000400
#define DEVMODEFLAG_USE4444 0x00000800
#define DEVMODEFLAG_FORCEVIEWMODE 0x00001000
#define DEVMODEFLAG_DDEXCLUSIVEMODE 0x00002000
#define DEVMODEFLAG_DOUBLESCAN 0x00004000
#define DEVMODEFLAG_FIXEDDISPLAYMODE 0x00008000
#define DEVMODEFLAG_CUSTOMREFRESHRATE 0x00010000
#define DEVMODEFLAG_VIRTUALDESKTOP 0x00020000
typedef struct _DEVMODE_INFO
{
ULONG ulModeFlags;
ULONG ulPelsWidth;
ULONG ulPelsHeight;
ULONG ulBitsPerPixel;
ULONG ulDisplayFrequency;
} DEVMODE_INFO, FAR *LPDEVMODE_INFO;
enum
{
POWERSTATE_ON = 1,
POWERSTATE_STANDBY,
POWERSTATE_SUSPEND,
POWERSTATE_OFF
};
enum
{
ACPI_CM_POWERSTATE_D0 = 1,
ACPI_CM_POWERSTATE_D1 = 2,
ACPI_CM_POWERSTATE_D2 = 4,
ACPI_CM_POWERSTATE_D3 = 8
};
enum
{
GAMMAMODE_DESKTOP = 0,
GAMMAMODE_FULLSCREENGAMING
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -