summaryrefslogtreecommitdiffstats
path: root/tools/ddcprobe
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2004-12-15 16:09:45 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2004-12-15 16:09:45 +0000
commit276fbc764b2a574a7a85f8deffb49e1763da4b8f (patch)
tree822b7ae49c6172873a6bedbb5fe4c8ab246587f1 /tools/ddcprobe
parent2898f7dcae895ccd5b302f795c0a442a9d27b472 (diff)
downloaddrakx-276fbc764b2a574a7a85f8deffb49e1763da4b8f.tar
drakx-276fbc764b2a574a7a85f8deffb49e1763da4b8f.tar.gz
drakx-276fbc764b2a574a7a85f8deffb49e1763da4b8f.tar.bz2
drakx-276fbc764b2a574a7a85f8deffb49e1763da4b8f.tar.xz
drakx-276fbc764b2a574a7a85f8deffb49e1763da4b8f.zip
ppc & ppc64 fixes
Diffstat (limited to 'tools/ddcprobe')
-rw-r--r--tools/ddcprobe/Makefile3
-rw-r--r--tools/ddcprobe/ddcxinfos.c2
-rw-r--r--tools/ddcprobe/of.c3
-rw-r--r--tools/ddcprobe/vbe.h15
4 files changed, 21 insertions, 2 deletions
diff --git a/tools/ddcprobe/Makefile b/tools/ddcprobe/Makefile
index c558212f3..468d3464e 100644
--- a/tools/ddcprobe/Makefile
+++ b/tools/ddcprobe/Makefile
@@ -25,6 +25,9 @@ endif
ifeq (ppc,$(ARCH))
#OBJS = ddcxinfos.o of.o minifind.o vbe.o vesamode.o
endif
+ifeq (ppc64,$(ARCH))
+OBJS = ddcxinfos.o of.o minifind.o vbe.o vesamode.o
+endif
ifeq (,$(OBJS))
OBJS = not_handled.o
endif
diff --git a/tools/ddcprobe/ddcxinfos.c b/tools/ddcprobe/ddcxinfos.c
index ebfa32df9..e595d549c 100644
--- a/tools/ddcprobe/ddcxinfos.c
+++ b/tools/ddcprobe/ddcxinfos.c
@@ -63,8 +63,8 @@ int main(void)
known_vesa_modes[i].x,
known_vesa_modes[i].y
);
- printf("\n");
#endif
+ printf("\n");
/* Get EDID information */
if (vbe_get_edid_info(edid) == 0) {
diff --git a/tools/ddcprobe/of.c b/tools/ddcprobe/of.c
index aab0632f1..f8fdc30dd 100644
--- a/tools/ddcprobe/of.c
+++ b/tools/ddcprobe/of.c
@@ -138,6 +138,9 @@ int vbe_get_edid_info(struct vbe_edid1_info * ret)
man = ntohs(man);
memcpy(&ret->manufacturer_name, &man, 2);
+ /* byteswap to match the contents of MonitorsDB */
+ ret->product_code = ((ret->product_code >> 8) & 0xff) | ((ret->product_code & 0xff) << 8);
+
free(mem);
return 1;
}
diff --git a/tools/ddcprobe/vbe.h b/tools/ddcprobe/vbe.h
index 4dd7e70c5..ac555c011 100644
--- a/tools/ddcprobe/vbe.h
+++ b/tools/ddcprobe/vbe.h
@@ -120,11 +120,18 @@ struct vbe_edid1_info {
unsigned char header[8];
union {
u_int16_t p;
- struct {
+ struct __attribute__ ((packed)) {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t char3: 5;
u_int16_t char2: 5;
u_int16_t char1: 5;
u_int16_t zero: 1;
+#else /* __BIG_ENDIAN */
+ u_int16_t zero: 1;
+ u_int16_t char1: 5;
+ u_int16_t char2: 5;
+ u_int16_t char3: 5;
+#endif
} u;
} manufacturer_name;
u_int16_t product_code;
@@ -176,9 +183,15 @@ struct vbe_edid1_info {
unsigned char reserved: 7;
} manufacturer_timings __attribute__ ((packed));
struct {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t xresolution: 8;
u_int16_t vfreq: 6;
u_int16_t aspect: 2;
+#else /* __BIG_ENDIAN */
+ u_int16_t aspect: 2;
+ u_int16_t vfreq: 6;
+ u_int16_t xresolution: 8;
+#endif
} standard_timing[8] __attribute__ ((packed));
union {
struct vbe_edid_detailed_timing detailed_timing[4];