/** @file
Read EDID information and parse EDID information.
Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CirrusLogic5430.h"
#include "CirrusLogic5430I2c.h"
//
// EDID block
//
typedef struct {
} EDID_BLOCK;
typedef struct {
} EDID_TIMING;
typedef struct {
//
// Standard timing defined by VESA EDID
//
//
// Established Timing I
//
{800, 600, 60},
{800, 600, 56},
{640, 480, 75},
{640, 480, 72},
{640, 480, 67},
{640, 480, 60},
{720, 400, 88},
{720, 400, 70},
//
// Established Timing II
//
{1280, 1024, 75},
{1024, 768, 75},
{1024, 768, 70},
{1024, 768, 60},
{1024, 768, 87},
{832, 624, 75},
{800, 600, 75},
{800, 600, 72},
//
// Established Timing III
//
{1152, 870, 75}
};
/**
Read EDID information from I2C Bus on CirrusLogic.
@param Private Pointer to CIRRUS_LOGIC_5430_PRIVATE_DATA.
@param EdidDataBlock Pointer to EDID data block.
@param EdidSize Returned EDID block size.
@retval EFI_UNSUPPORTED
@retval EFI_SUCCESS
**/
)
{
}
//
// Search for the EDID signature
//
Signature = 0x00ffffffffffff00ull;
break;
}
}
if (Index == 256) {
//
// No EDID signature found
//
return EFI_UNSUPPORTED;
}
sizeof (EDID_BLOCK_SIZE),
);
if (*EdidDataBlock == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
// Currently only support EDID 1.x
//
return EFI_SUCCESS;
}
/**
Generate a search key for a specified timing data.
@param EdidTiming Pointer to EDID timing
@return The 32 bit unique key for search.
**/
)
{
//
// Be sure no conflicts for all standard timing defined by VESA.
//
return Key;
}
/**
Search a specified Timing in all the valid EDID timings.
@param ValidEdidTiming All valid EDID timing information.
@param EdidTiming The Timing to search for.
@retval TRUE Found.
@retval FALSE Not found.
**/
)
{
return TRUE;
}
}
return FALSE;
}
/**
Parse the Established Timing and Standard Timing in EDID data block.
@param EdidBuffer Pointer to EDID data block
@param ValidEdidTiming Valid EDID timing information
@retval TRUE The EDID data is valid.
@retval FALSE The EDID data is invalid.
**/
)
{
//
// Check the checksum of EDID data
//
CheckSum = 0;
}
if (CheckSum != 0) {
return FALSE;
}
ValidNumber = 0;
if ((EdidDataBlock->EstablishedTimings[0] != 0) ||
) {
//
// Established timing data
//
if (TimingBits & 0x1) {
ValidNumber ++;
}
}
} else {
//
// If no Established timing data, read the standard timing data
//
//
// A valid Standard Timing
//
switch (AspectRatio) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}
ValidNumber ++;
}
BufferIndex += 2;
}
}
return TRUE;
}
/**
Construct the valid video modes for CirrusLogic5430.
**/
)
{
//
// setup EDID information
//
EdidAttributes = 0xff;
EdidOverrideDataSize = 0;
EdidActiveDataSize = 0;
//
// Find EDID Override protocol firstly, this protocol is installed by platform if needed.
//
NULL,
(VOID **) &EdidOverride
);
//
// Allocate double size of VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE to avoid overflow
//
if (NULL == EdidOverrideDataBlock) {
goto Done;
}
(UINT8 **) &EdidOverrideDataBlock
);
EdidAttributes == 0 &&
EdidOverrideDataSize != 0) {
//
// Succeeded to get EDID Override Data
//
}
}
//
// If EDID Override data doesn't exist or EFI_EDID_OVERRIDE_DONT_OVERRIDE returned,
// read EDID information through I2C Bus
//
);
goto Done;
}
}
}
}
//
// Parse EDID data structure to retrieve modes supported by monitor
//
//
// Copy EDID Override Data to EDID Active Data
//
);
goto Done;
}
}
} else {
}
if (EdidFound) {
//
// Initialize the private mode data with the supported modes.
//
ValidModeCount = 0;
TimingMatch = TRUE;
//
// Check whether match with CirrusLogic5430 video mode
//
TimingMatch = FALSE;
}
//
// Not export Mode 0x0 as GOP mode, this is not defined in spec.
//
TimingMatch = FALSE;
}
if (TimingMatch) {
ModeData ++;
ValidModeCount ++;
}
VideoMode ++;
}
} else {
//
// If EDID information wasn't found
//
ModeData ++ ;
VideoMode ++;
}
}
if (EdidOverrideDataBlock != NULL) {
}
return EFI_SUCCESS;
Done:
if (EdidOverrideDataBlock != NULL) {
}
}
}
return EFI_DEVICE_ERROR;
}