UEFI-获取EDID信息

17 篇文章 1 订阅
本文介绍了EDID在显示设备中的作用,特别是在UEFI应用中如何通过EFI_EDID_DISCOVERED_PROTOCOL获取视频输出设备的EDID信息,包括数据结构和基本参数设置的重要性。
摘要由CSDN通过智能技术生成

        EDID,Extended display identification data,中文名称扩展显示器识别数据,是VESA在制定DDC显示器数据通道通信协议时,制定的有关显示器识别数据的标准。EDID存储在显示器中的DDC存储器中,当电脑主机与显示器连接后,电脑主机会通过DDC通道读取显示器DDC存储器中的存储的EDID。(参考百度百科)

        UEFI 应用中可以使用EFI_EDID_DISCOVERED_PROTOCOL  这个protocol 来获取一个视频输出设备的EDID信息。
typedef struct {
UINT32 SizeOfEdid;
UINT8 *Edid;
} EFI_EDID_DISCOVERED_PROTOCOL

SizeOfEdid:EDID 存储区大小,如果没有获取到EDID,则为0;否则最小为128bytes。

Edid:指向一组只读数据的指针,这组数据包含EDID信息。                                                            

UINT8 *EdidDataPtr = NULL
Status = gBS->LocateProtocol (
                  &EfiEdidDiscoveredProtocolGuid,
                  NULL,
                  &EdidDiscoveredProtocol
                  );
 EdidDataPtr=EdidDiscoveredProtocol->Edid;

       这样就找到了EDID数据存储区的起始地址,参考EDID spec,其数据结构如下

Table 3.1: EDID Structure Version 1, Revision 4

AddressBytesDescriptionFormat
00h8Header: = (00 FF FF FF FF FF FF 00)hSee Section 3.3
08h10Vendor & Product Identification:See Section 3.4
08h2ID Manufacturer NameISA 3-character ID Code
0Ah2ID Product CodeVendor assigned code
0Ch4ID Serial Number32-bit serial number
10h1Week of ManufactureWeek number or Model Year Flag
11h1Year of Manufacture or Model YearManufacture Year or Model Year
12h2EDID Structure Version & Revision:See Section 3.5
12h1Version Number: = 01hBinary
13h1Revision Number: = 04hBinary
14h5Basic Display Parameters & Features:See Section 3.6
14h1Video Input DefinitionSee Section 3.6.1
15h1Horizontal Screen Size or Aspect RatioListed in cm. → Aspect Ratio --- Landscape
16h1Vertical Screen Size or Aspect RatioListed in cm. → Aspect Ratio --- Portrait
17h1Display Transfer Characteristic (Gamma)Binary --- Factory Default Value
18h1Feature SupportSee Section 3.6.4
19h10Color Characteristics:See Section 3.7
19h1Red/Green: Low Order BitsRx1 Rx0 Ry1 Ry0 Gx1 Gx0 Gy1Gy0
1Ah1Blue/White: Low Order BitsBx1 Bx0 By1 By0 Wx1 Wx0 Wy1 Wy0
1Bh1Red-x: High Order BitsRed-x Bits 9 → 2
1Ch1Red-y: High Order BitsRed-y Bits 9 → 2
1Dh1Green-x: High Order BitsGreen-x Bits 9 → 2
1Eh1Green-y: High Order BitsGreen-y Bits 9 → 2
1Fh1Blue-x: High Order BitsBlue-x Bits 9 → 2
20h1Blue-y: High Order BitsBlue-y Bits 9 → 2
21h1White-x: High Order BitsWhite-x Bits 9 → 2
22h1White-y: High Order BitsWhite-y Bits 9 → 2
23h3Established TimingsSee Section 3.8
23h1Established Timings I
24h1Established Timings II
25h1Manufacturer's Reserved Timings
26h16Standard Timings: Identification 1 → 8See Section 3.9
36h7218 Byte Data BlocksSee Section 3.10
36h18Preferred Timing Mode
48h18Detailed Timing # 2 or Display Descriptor
5Ah18Detailed Timing # 3 or Display Descriptor
6Ch18Detailed Timing # 4 or Display Descriptor
7Eh1Extension Block Count N
If Block Maps are used then
00h ≤ N ≤ FEh and FFh is invalid.
If Block Maps are not used then
00h ≤ N ≤ FFh.
Number of (optional) 128-byte EDID
EXTENSION blocks to follow – if Block
Maps are used then 254 is the maximum
value of ‘N’. If Block Maps are not used
then 255 is the maximum value of ‘N’.
7Fh1Checksum C
00h ≤ C ≤ FFh
The 1-byte sum of all 128 bytes in this
EDID block shall equal zero

        offset 36h是4组18 bytes的Timing 数据结构,如Pixel clock,Horizontal Addressable Video,Horizontal Blanking等等,这里面数据都需要根据屏实际数据来设置正确,否则会影响屏工作。

        例如Pixel clock135MHz ,十进制表示13500 ,会以 BCh, 34h存值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值