UEFI-获取EDID信息

17 篇文章 1 订阅

        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存值

  • 18
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
BIOS / Legacy Boot of UEFI-only media问题可以通过以下方法解决。 首先,我们需要了解BIOS和UEFI之间的差异。BIOS(Basic Input/Output System)是计算机启动并加载操作系统之前的一段软件。它使用传统的启动方式来识别和引导存储设备。相反,UEFI(Unified Extensible Firmware Interface)是最新的固件接口标准,支持更多功能和更大的扩展性。 当我们使用遵循UEFI标准的媒体时,由于它们没有传统的MBR(Master Boot Record)分区表,就会出现BIOS / Legacy Boot无法引导的问题。为了解决这个问题,我们可以采取以下措施: 1. 更新BIOS:首先,确保计算机的BIOS是最新的版本。有时,旧版本的BIOS可能无法支持UEFI引导。您可以通过访问计算机制造商的官方网站来检查最新的BIOS版本并进行更新。 2. 启用UEFI模式:进入计算机的BIOS设置界面,并启用UEFI模式。这样,您的计算机将能够使用UEFI标准的引导方式。 3. 禁用Secure Boot:如果UEFI模式下的引导仍然失败,您可以尝试禁用Secure Boot安全引导功能。Secure Boot是一种安全特性,要求引导的操作系统必须由受信任的数字证书进行签名。禁用Secure Boot可能会允许计算机引导UEFI-only媒体。 4. 使用第三方工具:如果以上方法无效,您还可以尝试使用第三方工具。例如,可以使用一些特定的引导管理器软件来模拟UEFI环境,实现在BIOS / Legacy Boot下引导UEFI-only媒体。 总之,解决BIOS / Legacy Boot of UEFI-only media的问题可以通过更新BIOS、启用UEFI模式、禁用Secure Boot以及使用第三方工具来实现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值