diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2016-03-17 10:27:51 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2016-03-17 10:29:16 -0700 |
commit | 82bd67a255fb45847d8a10811641bc0b203ba864 (patch) | |
tree | 31ca9a2b3d5d0f3e7f4a05d3536d853aabdecbdb | |
parent | 7b454358082fc07985878fc92b902d7534144cae (diff) |
s3_bios.c: Simplify code for choosing between 16000 & 16000 for RefClock
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/s3_bios.c | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/src/s3_bios.c b/src/s3_bios.c index 1c7c5fe..262d40a 100644 --- a/src/s3_bios.c +++ b/src/s3_bios.c @@ -29,75 +29,9 @@ #include "config.h" #endif -#include "xf86.h" -#include "xf86_OSproc.h" -#include "compiler.h" - #include "s3.h" - -static unsigned char *find_bios_string(ScrnInfoPtr pScrn, int BIOSbase, - char *match1, char *match2) -{ - static unsigned char *bios; - static int init=0; - int i, j, l1, l2, ret; - - S3Ptr pS3 = S3PTR(pScrn); - - bios = malloc(BIOS_BSIZE); - if (bios == NULL) - return NULL; - - if (!init) { - init = 1; -#ifndef XSERVER_LIBPCIACCESS - if (xf86ReadDomainMemory(pS3->PciTag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) - goto error; -#else - ret = pci_device_read_rom(pS3->PciInfo, bios); - if (ret) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "libpciaccess failed to read video BIOS: %s\n", - strerror(-ret)); - goto error; - } -#endif - if ((bios[0] != 0x55) || (bios[1] != 0xaa)) - goto error; - } - if (match1 == NULL) - goto error; - - l1 = strlen(match1); - if (match2 != NULL) - l2 = strlen(match2); - else - l2 = 0; - - for (i=0; i<BIOS_BSIZE; i++) - if (bios[i] == match1[0] && !memcmp(&bios[i], match1, l1)) { - if (match2 == NULL) - return &bios[i+l1]; - else - for(j=i+l1; (j<BIOS_BSIZE-l2) && bios[j]; j++) - if (bios[j] == match2[0] && - !memcmp(&bios[j], match2, l2)) - return &bios[j+l2]; - } -error: - free(bios); - return NULL; -} - - int S3GetRefClock(ScrnInfoPtr pScrn) { - int RefClock = 16000; /* default */ - - if (find_bios_string(pScrn, BIOS_BASE, "Number Nine Visual Technology", - "Motion 771") != NULL) - RefClock = 16000; - - return RefClock; + return 16000; } |