[PATCH:xf86-video-s3] s3_bios.c: Simplify code for choosing between 16000 & 16000 for RefClock

Alan Coopersmith alan.coopersmith at oracle.com
Thu Mar 17 17:33:52 UTC 2016


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 src/s3_bios.c | 68 +----------------------------------------------------------
 1 file changed, 1 insertion(+), 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;
 }
-- 
2.6.1



More information about the xorg-devel mailing list