xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Tue Mar 30 09:31:40 PDT 2010


 src/radeon_output.c |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

New commits:
commit 3a33b1a92c328b690bdc1aafa0011e4326109815
Author: Owain G. Ainsworth <zerooa at googlemail.com>
Date:   Tue Mar 30 17:14:02 2010 +0100

    Add support for MacModel autodetection on OpenBSD.
    
    This allows radeon-equipped macs to work without an xorg.conf on openbsd.
    Patch originally written by Mark Kettenis (kettenis at openbsd.org)

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 8648f27..3a0d1e9 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2616,6 +2616,11 @@ static void RADEONSetupGenericConnectors(ScrnInfoPtr pScrn)
 
 #if defined(__powerpc__)
 
+#ifdef __OpenBSD__
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
 /*
  * Returns RADEONMacModel or 0 based on lines 'detected as' and 'machine'
  * in /proc/cpuinfo (on Linux) */
@@ -2708,6 +2713,72 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
 
 #endif /* __linux */
 
+#ifdef __OpenBSD__
+    char model[32];
+    int mib[2];
+    size_t len;
+
+    mib[0] = CTL_HW;
+    mib[1] = HW_PRODUCT;
+    len = sizeof(model);
+    if (sysctl(mib, 2, model, &len, NULL, 0) >= 0) {
+	if (strcmp(model, "PowerBook5,1") == 0 ||
+	    strcmp(model, "PowerBook5,2") == 0 ||
+	    strcmp(model, "PowerBook5,3") == 0 ||
+	    strcmp(model, "PowerBook5,4") == 0 ||
+	    strcmp(model, "PowerBook5,5") == 0) {
+	    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* single link */
+	    info->ext_tmds_chip = RADEON_SIL_164; /* works on 5,2 */
+	}
+
+	if (strcmp(model, "PowerBook5,6") == 0) {
+	    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* dual or single link */
+	}
+
+	if (strcmp(model, "PowerBook5,7") ||
+	    strcmp(model, "PowerBook5,8") == 0 ||
+	    strcmp(model, "PowerBook5,9") == 0) {
+	    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* dual link */
+	    info->ext_tmds_chip = RADEON_SIL_1178; /* guess */
+	}
+
+	if (strcmp(model, "PowerBook3,3") == 0) {
+	    ret = RADEON_MAC_POWERBOOK_VGA; /* vga rather than dvi */
+	}
+
+	if (strcmp(model, "PowerMac10,1") == 0) {
+	    ret = RADEON_MAC_MINI_INTERNAL; /* internal tmds */
+	}
+
+	if (strcmp(model, "PowerMac10,2") == 0) {
+	    ret = RADEON_MAC_MINI_EXTERNAL; /* external tmds */
+	}
+
+	if (strcmp(model, "PowerBook2,1") == 0 ||
+	    strcmp(model, "PowerBook2,2") == 0 ||
+	    strcmp(model, "PowerBook4,1") == 0 ||
+	    strcmp(model, "PowerBook4,2") == 0 ||
+	    strcmp(model, "PowerBook4,3") == 0 ||
+	    strcmp(model, "PowerBook6,3") == 0 ||
+	    strcmp(model, "PowerBook6,5") == 0 ||
+	    strcmp(model, "PowerBook6,7") == 0) {
+	    ret = RADEON_MAC_IBOOK;
+	}
+
+	if (strcmp(model, "PowerBook1,1") == 0 ||
+	    strcmp(model, "PowerBook3,1") == 0 ||
+	    strcmp(model, "PowerBook3,2") == 0 ||
+	    strcmp(model, "PowerBook3,4") == 0 ||
+	    strcmp(model, "PowerBook3,5") == 0) {
+	    ret = RADEON_MAC_POWERBOOK_INTERNAL;
+	}
+
+	if (strcmp(model, "PowerMac12,1") == 0) {
+	    ret = RADEON_MAC_IMAC_G5_ISIGHT;
+	}
+    }
+#endif /* __OpenBSD__ */
+
     if (ret) {
 	xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Detected %s.\n",
 		   ret == RADEON_MAC_POWERBOOK_EXTERNAL ? "PowerBook with external DVI" :


More information about the xorg-commit mailing list