Beispiel #1
0
/*
 * read EDID record , pass it to callback function to interpret.
 * callback function will store it for further use by calling
 * function; it will also decide if we need to reread it
 */
static unsigned char *
EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed,
              unsigned int (*read_DDC) (ScrnInfoPtr))
{
    unsigned char *EDID_block = NULL;
    int count = RETRIES;

    if (!read_DDC) {
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                   "chipset doesn't support DDC1\n");
        return NULL;
    };

    if (TestDDC1(pScrn, read_DDC) == -1) {
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "No DDC signal\n");
        return NULL;
    };

    if (DDCSpeed)
        DDCSpeed(pScrn, DDC_FAST);
    do {
        EDID_block = GetEDID_DDC1(FetchEDID_DDC1(pScrn, read_DDC));
        count--;
    } while (!EDID_block && count);
    if (DDCSpeed)
        DDCSpeed(pScrn, DDC_SLOW);

    return EDID_block;
}
/* 
 * read EDID record , pass it to callback function to interpret.
 * callback function will store it for further use by calling
 * function; it will also decide if we need to reread it 
 */
static unsigned char *
EDIDRead_DDC1(ScrnInfoPtr pScrn, void (*DDCSpeed)(ScrnInfoPtr,xf86ddcSpeed), 
              unsigned int (*read_DDC)(ScrnInfoPtr))
{
    unsigned char *EDID_block = NULL;
    int count = RETRIES;

    if (!read_DDC) { 
	LOG("chipset doesn't support DDC1\n");
	return NULL; 
    };

    if (TestDDC1(pScrn,read_DDC)==-1) { 
	LOG("No DDC signal\n"); 
	return NULL; 
    };

    if (DDCSpeed) DDCSpeed(pScrn,DDC_FAST);
    do {
	EDID_block = GetEDID_DDC1(FetchEDID_DDC1(pScrn,read_DDC)); 
	count --;
    } while (!EDID_block && count);
    if (DDCSpeed) DDCSpeed(pScrn,DDC_SLOW);

    return EDID_block;
}