Line 0
Link Here
|
|
|
1 |
From 82bd67a255fb45847d8a10811641bc0b203ba864 Mon Sep 17 00:00:00 2001 |
2 |
From: Alan Coopersmith <alan.coopersmith@oracle.com> |
3 |
Date: Thu, 17 Mar 2016 10:27:51 -0700 |
4 |
Subject: s3_bios.c: Simplify code for choosing between 16000 & 16000 for |
5 |
RefClock |
6 |
|
7 |
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> |
8 |
|
9 |
diff --git a/src/s3_bios.c b/src/s3_bios.c |
10 |
index 1c7c5fe..262d40a 100644 |
11 |
--- src/s3_bios.c |
12 |
+++ src/s3_bios.c |
13 |
@@ -29,75 +29,9 @@ |
14 |
#include "config.h" |
15 |
#endif |
16 |
|
17 |
-#include "xf86.h" |
18 |
-#include "xf86_OSproc.h" |
19 |
-#include "compiler.h" |
20 |
- |
21 |
#include "s3.h" |
22 |
|
23 |
- |
24 |
-static unsigned char *find_bios_string(ScrnInfoPtr pScrn, int BIOSbase, |
25 |
- char *match1, char *match2) |
26 |
-{ |
27 |
- static unsigned char *bios; |
28 |
- static int init=0; |
29 |
- int i, j, l1, l2, ret; |
30 |
- |
31 |
- S3Ptr pS3 = S3PTR(pScrn); |
32 |
- |
33 |
- bios = malloc(BIOS_BSIZE); |
34 |
- if (bios == NULL) |
35 |
- return NULL; |
36 |
- |
37 |
- if (!init) { |
38 |
- init = 1; |
39 |
-#ifndef XSERVER_LIBPCIACCESS |
40 |
- if (xf86ReadDomainMemory(pS3->PciTag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE) |
41 |
- goto error; |
42 |
-#else |
43 |
- ret = pci_device_read_rom(pS3->PciInfo, bios); |
44 |
- if (ret) { |
45 |
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, |
46 |
- "libpciaccess failed to read video BIOS: %s\n", |
47 |
- strerror(-ret)); |
48 |
- goto error; |
49 |
- } |
50 |
-#endif |
51 |
- if ((bios[0] != 0x55) || (bios[1] != 0xaa)) |
52 |
- goto error; |
53 |
- } |
54 |
- if (match1 == NULL) |
55 |
- goto error; |
56 |
- |
57 |
- l1 = strlen(match1); |
58 |
- if (match2 != NULL) |
59 |
- l2 = strlen(match2); |
60 |
- else |
61 |
- l2 = 0; |
62 |
- |
63 |
- for (i=0; i<BIOS_BSIZE; i++) |
64 |
- if (bios[i] == match1[0] && !memcmp(&bios[i], match1, l1)) { |
65 |
- if (match2 == NULL) |
66 |
- return &bios[i+l1]; |
67 |
- else |
68 |
- for(j=i+l1; (j<BIOS_BSIZE-l2) && bios[j]; j++) |
69 |
- if (bios[j] == match2[0] && |
70 |
- !memcmp(&bios[j], match2, l2)) |
71 |
- return &bios[j+l2]; |
72 |
- } |
73 |
-error: |
74 |
- free(bios); |
75 |
- return NULL; |
76 |
-} |
77 |
- |
78 |
- |
79 |
int S3GetRefClock(ScrnInfoPtr pScrn) |
80 |
{ |
81 |
- int RefClock = 16000; /* default */ |
82 |
- |
83 |
- if (find_bios_string(pScrn, BIOS_BASE, "Number Nine Visual Technology", |
84 |
- "Motion 771") != NULL) |
85 |
- RefClock = 16000; |
86 |
- |
87 |
- return RefClock; |
88 |
+ return 16000; |
89 |
} |
90 |
-- |
91 |
cgit v0.10.2 |
92 |
|