summaryrefslogtreecommitdiff
path: root/hw/xfree86/ddc
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
commitadc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 (patch)
tree23eb7becc5360b2cbe16aa8d45529880067f3989 /hw/xfree86/ddc
parent90f1536dd315cd265bfc7ef35058761a65a01734 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'hw/xfree86/ddc')
-rw-r--r--hw/xfree86/ddc/ddcProperty.c12
-rw-r--r--hw/xfree86/ddc/print_edid.c4
-rw-r--r--hw/xfree86/ddc/print_vdif.c2
-rw-r--r--hw/xfree86/ddc/vdif.h7
-rw-r--r--hw/xfree86/ddc/xf86DDC.c39
5 files changed, 31 insertions, 33 deletions
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index d779834c2..666dfc632 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -3,7 +3,7 @@
*
* Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.9 2001/10/28 03:33:21 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.10 2003/11/03 05:11:04 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -100,10 +100,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID1Atom, XA_INTEGER, 8,
128, (unsigned char *)EDID1rawdata
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
-
}
if (makeEDID2prop) {
@@ -127,9 +125,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID2Atom, XA_INTEGER, 8,
256, (unsigned char *)EDID2rawdata
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
}
if (DDC->vdif) {
@@ -151,9 +148,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
strlen(VDIF_DUMMY_STRING),
VDIF_DUMMY_STRING
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
}
return TRUE;
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index 3451e52f6..064533800 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.15 2001/05/22 17:01:23 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.16 2003/09/24 02:43:17 dawes Exp $ */
/* print_edid.c: print out all information retrieved from display device
*
@@ -41,7 +41,7 @@ static void
print_vendor(int scrnIndex, struct vendor *c)
{
xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n",
- &c->name, c->prod_id, c->serial);
+ (char *)&c->name, c->prod_id, c->serial);
xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
}
diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c
index c65d1a0c9..fbb540e1d 100644
--- a/hw/xfree86/ddc/print_vdif.c
+++ b/hw/xfree86/ddc/print_vdif.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.3 2003/02/17 16:08:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#include "vdif.h"
#include "misc.h"
diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h
index 38026e56a..8d358613e 100644
--- a/hw/xfree86/ddc/vdif.h
+++ b/hw/xfree86/ddc/vdif.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.3 2000/04/14 12:16:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#ifndef _VDIF_H
#define _VDIF_H
@@ -24,7 +24,8 @@
#include "Xmd.h"
-#pragma pack(1)
+#undef CARD32
+#define CARD32 unsigned int /* ... on all supported platforms */
typedef struct _VDIF { /* Monitor Description: */
CARD8 VDIFId[4]; /* alway "VDIF" */
@@ -169,6 +170,6 @@ typedef struct _vdif {
char * strings;
} xf86vdif, *xf86vdifPtr;
-#pragma pack()
+#undef CARD32
#endif
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 736fb741b..496f3573f 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.23 2003/02/17 16:08:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.27 2003/10/30 17:48:19 tsi Exp $ */
/* xf86DDC.c
*
@@ -19,6 +19,7 @@ const char *i2cSymbols[] = {
"xf86CreateI2CDevRec",
"xf86I2CDevInit",
"xf86I2CWriteRead",
+ "xf86I2CFindDev",
"xf86DestroyI2CDevRec",
NULL
};
@@ -332,19 +333,22 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
int i;
xf86LoaderReqSymLists(i2cSymbols, NULL);
- dev = xf86CreateI2CDevRec();
- dev->DevName = "ddc2";
- dev->SlaveAddr = 0xA0;
- dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
- dev->StartTimeout = 550;
- dev->BitTimeout = 40;
- dev->ByteTimeout = 40;
- dev->AcknTimeout = 40;
-
- dev->pI2CBus = pBus;
- if (! xf86I2CDevInit(dev)) {
- xf86DrvMsg(X_PROBED,scrnIndex,"No DDC2 device\n");
- return NULL;
+
+ if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
+ dev = xf86CreateI2CDevRec();
+ dev->DevName = "ddc2";
+ dev->SlaveAddr = 0xA0;
+ dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
+ dev->StartTimeout = 550;
+ dev->BitTimeout = 40;
+ dev->ByteTimeout = 40;
+ dev->AcknTimeout = 40;
+
+ dev->pI2CBus = pBus;
+ if (!xf86I2CDevInit(dev)) {
+ xf86DrvMsg(scrnIndex, X_PROBED, "No DDC2 device\n");
+ return NULL;
+ }
}
if (start < 0x100) {
w_bytes = 1;
@@ -358,10 +362,9 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
* (len));
for (i=0; i<RETRIES; i++) {
if (xf86I2CWriteRead(dev, W_Buffer,w_bytes, R_Buffer,len)) {
- if (!DDC_checksum(R_Buffer,len)) {
- xf86DestroyI2CDevRec(dev,TRUE);
+ if (!DDC_checksum(R_Buffer,len))
return R_Buffer;
- }
+
#ifdef DEBUG
else ErrorF("Checksum error in EDID block\n");
#endif
@@ -375,5 +378,3 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
xfree(R_Buffer);
return NULL;
}
-
-