freebsd-ports/x11-drivers/xf86-video-s3/files/patch-git_04_82bd67a
Baptiste Daroussin bcb8eeafb6 Import few patches from upstream to allow building with newer xorg
Note that those drivers are barely maintained and might disappear in the futur

PR:		216289
Submitted by:	matthew@reztek.cz
2017-01-23 22:53:53 +00:00

92 lines
2 KiB
Text

From 82bd67a255fb45847d8a10811641bc0b203ba864 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Thu, 17 Mar 2016 10:27:51 -0700
Subject: s3_bios.c: Simplify code for choosing between 16000 & 16000 for
RefClock
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/src/s3_bios.c b/src/s3_bios.c
index 1c7c5fe..262d40a 100644
--- src/s3_bios.c
+++ 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;
}
--
cgit v0.10.2