⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dalddc.h

📁 此代码为WCE5.0下显示器的源代码
💻 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    dalddc.h
*  Project        ATI Display Abstraction Layer
*
*  Description    DDC interface used by DAL, implemented in DAL
*
*  Copyright (c) 1997-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.
*
\****************************************************************************/

#ifndef _DALDDC_H_
#define _DALDDC_H_

#pragma pack(1)

  // HP monitors misreport 1.2 EDID version as boguos 2.1 version.
  // These definitions are used in the workaround.
  //
#define DDC_HP_ID_BYTE1       0x22
#define DDC_HP_ID_BYTE2       0xF0
#define DDC_HP_M50_ID_BYTE1   0x86
#define DDC_HP_M50_ID_BYTE2   0x4
#define DDC_HP_M50_ID2_BYTE1  0xEA
#define DDC_HP_M50_ID2_BYTE2  0x4

  // number of times to re-try a given operation if a monitor doesn't respond.
  //
#define DDC_RETRIES  10
#define DDC_NUM_BYTES 6

//maximum number of tries is DDC1 
#define MAX_DDC1_TRIES 400


  //
  // EDID format definitions
  //

#define EDID_VER_REVMASK      0x000000FF
#define EDID_VER_1_HDRLEN     8
#define EDID_VER_1_STDLEN     128
#define EDID_VER_2_STDLEN     256
#define EDID_VER_10           0x00000100
#define EDID_VER_11           0x00000101
#define EDID_VER_12           0x00000102
#define EDID_VER_13           0x00000103
#define EDID_VER_20           0x00000200
#define EDID_VER_SIMULATED    0xFFFFFFFF
#define EDID_DISPL_NAME_SIZE  20


// Define bits used in EDID established timings.
#define EDID_ESTABLISHED_640_60         0x20
#define EDID_ESTABLISHED_800_60         0x01
#define EDID_ESTABLISHED_1024_60        0x08

// Define values used in EDID standard timings.
#define EDID_STANDARD_ASPECT_4_X_3      0x40

  //
  // Define macros to stall execution for given number of milli or micro seconds.
  // Single call to VideoPortStallExecution() can be done for 100us max.
  //
#if 0

#define DDC_DELAY_MILLISECONDS(n)                       \
{                                                       \
    ULONG ulCount;                                      \
    ULONG ulTotal = 10 * (n);                           \
                                                        \
    for (ulCount = 0; ulCount < (n); ulCount++)         \
        STALLEXECUTION(100);                            \
}

#define DDC_DELAY_MICROSECONDS(n)                   \
{                                                   \
  ULONG ulCount = (n);                              \
                                                    \
  while (ulCount > 0)                               \
  {                                                 \
    if (ulCount >= 100)                             \
    {                                               \
        STALLEXECUTION(100);                        \
        ulCount -= 100;                             \
    }                                               \
    else                                            \
    {                                               \
        STALLEXECUTION(ulCount);                    \
        ulCount = 0;                                \
    }                                               \
  }                                                 \
}
#endif

#define DDC_DELAY_MILLISECONDS(n)  STALLEXECUTION_MS(n);
#define DDC_DELAY_MICROSECONDS(n)  STALLEXECUTION(n);


  // Define constants used by DDC2 I2C queries.
  //
#define DDC_I2C_MONITOR_ADDRESS_WRITE_A0    0xA0
#define DDC_I2C_MONITOR_ADDRESS_READ_A1     (DDC_I2C_MONITOR_ADDRESS_WRITE_A0 + 1)
#define DDC_I2C_MONITOR_ADDRESS_WRITE_A2    0xA2
#define DDC_I2C_MONITOR_ADDRESS_READ_A3     (DDC_I2C_MONITOR_ADDRESS_WRITE_A2 + 1)
#define DDC_I2C_MONITOR_ADDRESS_WRITE_A4    0xA4
#define DDC_I2C_MONITOR_ADDRESS_READ_A5     (DDC_I2C_MONITOR_ADDRESS_WRITE_A4 + 1)
#define DDC_I2C_EDID_START_ADDRESS     0x00
#define DDC_I2C_START_RETRIES          10          // Number of retries for I2C packet
#define DDC_I2C_SCL_READ_RETRIES       128         // 
#define DDC_I2C_DELAY()                DDC_DELAY_MICROSECONDS(10)
#define DDC_I2C_RETRIES                DDC_I2C_SCL_READ_RETRIES  

//
BOOL 
bUseDalBasedDdc(
  LPDEVGDO      lpDisplay);

BOOL 
bGetEdidData(
  LPHW_DAL_EXTENSION  lpHDE,
  LPDEVGDO      lpDisplay,
  LPEDID_BUFFER   lpEDIDBuf);

BOOL
bIsDisplayDDCPhysicallyConnected(
  LPHW_DAL_EXTENSION  lpHDE,
  LPDEVGDO      lpDisplay);

BOOL bFakeTvEdidData(
  LPDEVGDO       lpDisplay,
  LPDEVMODE_INFO lpDisplayMaxModeInfo, 
  LPEDID_BUFFER  lpEDIDBuf);

BOOL bLCDGetFakeEdid(
  LPDEVGDO       lpDisplay,
  LPDEVMODE_INFO lpDisplayMaxModeInfo, 
  LPEDID_BUFFER  lpEDIDBuf);

ULONG 
GetDisplayTypeFromEdid(
  LPEDID_BUFFER lpEDIDBuf);


ULONG 
GetStandardEdidLength(
  LPUCHAR lpucEdidDataBuf);

BOOL 
bDDCBlockAccess(
  LPHW_DAL_EXTENSION  lpHDE, 
  LPDEVGDO            lpDisplay,
  ULONG               ulFunction,
  ULONG               ulOption,
  ULONG               ulInputSize,
  LPUCHAR             lpInputBuf,
  LPULONG             lpulOutputSize,
  LPUCHAR             lpOutputBuf    );

VOID vDALTimingToDetailedTiming(
         LPDAL_CRTC_TIMING lpCrtcTiming,
         LPEDID_DETAILED_V1X lpEdidDetailedTiming);

#pragma pack()

#endif /*_DALDDC_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -