Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc provide EDID blocks for hardware where we kn...



details:   https://anonhg.NetBSD.org/src/rev/bcd4b759a319
branches:  trunk
changeset: 767266:bcd4b759a319
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Jul 13 22:54:33 2011 +0000

description:
provide EDID blocks for hardware where we know the parameters but neither the
firmware nor DDC provide any. So far there's only a parameter block for the
PowerBook Pismo's built-in TFT, now Xorg works out of the box without config.
The same parameter block will probably do the right thing on Lombard, PDQ and
TFT-equipped Wallstreet PowerBooks.

diffstat:

 sys/arch/macppc/conf/files.macppc    |   3 +-
 sys/arch/macppc/macppc/machdep.c     |  15 ++++++++-
 sys/arch/macppc/macppc/static_edid.c |  57 ++++++++++++++++++++++++++++++++++++
 sys/arch/macppc/macppc/static_edid.h |  34 +++++++++++++++++++++
 4 files changed, 106 insertions(+), 3 deletions(-)

diffs (166 lines):

diff -r 603bc67ec41a -r bcd4b759a319 sys/arch/macppc/conf/files.macppc
--- a/sys/arch/macppc/conf/files.macppc Wed Jul 13 22:51:10 2011 +0000
+++ b/sys/arch/macppc/conf/files.macppc Wed Jul 13 22:54:33 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.macppc,v 1.97 2011/06/22 18:06:33 matt Exp $
+#      $NetBSD: files.macppc,v 1.98 2011/07/13 22:54:33 macallan Exp $
 #
 # macppc-specific configuration info
 
@@ -18,6 +18,7 @@
 file arch/powerpc/oea/ofwoea_machdep.c
 file arch/powerpc/oea/ofw_consinit.c
 file arch/macppc/macppc/machdep.c
+file arch/macppc/macppc/static_edid.c
 file arch/powerpc/oea/ofw_rascons.c
 file arch/macppc/dev/dbdma.c
 
diff -r 603bc67ec41a -r bcd4b759a319 sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c  Wed Jul 13 22:51:10 2011 +0000
+++ b/sys/arch/macppc/macppc/machdep.c  Wed Jul 13 22:54:33 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.160 2011/07/13 22:50:11 macallan Exp $   */
+/*     $NetBSD: machdep.c,v 1.161 2011/07/13 22:54:33 macallan Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.160 2011/07/13 22:50:11 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.161 2011/07/13 22:54:33 macallan Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -99,6 +99,8 @@
 #include <macppc/dev/pmuvar.h>
 #include <macppc/dev/cudavar.h>
 
+#include <macppc/macppc/static_edid.h>
+
 #include "ksyms.h"
 #include "pmu.h"
 #include "cuda.h"
@@ -364,6 +366,8 @@
 {
        const char *bl_rev_models[] = {
                "PowerBook4,3", "PowerBook6,3", "PowerBook6,5", NULL};
+       const char *pismo[] = {
+               "PowerBook3,1", NULL};
        int node;
 
        node = OF_finddevice("/");
@@ -371,6 +375,13 @@
        if (of_compatible(node, bl_rev_models) != -1) {
                prop_dictionary_set_bool(dict, "backlight_level_reverted", 1);
        }
+       if (of_compatible(node, pismo) != -1) {
+               prop_data_t edid;
+
+               edid = prop_data_create_data(edid_pismo, sizeof(edid_pismo));
+               prop_dictionary_set(dict, "EDID", edid);
+               prop_object_release(edid);
+       }
 }
 
 static void
diff -r 603bc67ec41a -r bcd4b759a319 sys/arch/macppc/macppc/static_edid.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/macppc/macppc/static_edid.c      Wed Jul 13 22:54:33 2011 +0000
@@ -0,0 +1,57 @@
+/*     $NetBSD: static_edid.c,v 1.1 2011/07/13 22:54:33 macallan Exp $ */
+
+/*-
+ * Copyright (c) 2011 Michael Lorenz
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: static_edid.c,v 1.1 2011/07/13 22:54:33 macallan Exp $");
+#include <sys/param.h>
+
+/* EDID blocks for some known hardware that doesn't provide its own */
+
+/*
+ * PowerBook Pismo, derived from iBook G4 which needs the same parameters
+ * should work on Lombard, PDQ and TFT Wallstreets as well
+ */
+uint8_t edid_pismo[128] = {
+/* 00 */       0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+/* 08 */       0x06, 0x10, 0x1f, 0x9c, 0x01, 0x01, 0x01, 0x01,
+/* 10 */       0x00, 0x0c, 0x01, 0x03, 0x80, 0x1c, 0x15, 0x78,
+/* 18 */       0x0a, 0xe7, 0xb5, 0x93, 0x56, 0x4f, 0x8d, 0x28,
+/* 20 */       0x1f, 0x50, 0x54, 0x00, 0x08, 0x00, 0x01, 0x01,
+/* 28 */       0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+/* 30 */       0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x64, 0x19,
+/* 38 */       0x00, 0x40, 0x41, 0x00, 0x26, 0x30, 0x18, 0x88,
+/* 40 */       0x36, 0x00, 0xf6, 0xb8, 0x00, 0x00, 0x00, 0x18,
+/* 48 */       0x00, 0x00, 0x00, 0xfe, 0x00, 0x49, 0x42, 0x4d,
+/* 50 */       0x2d, 0x49, 0x41, 0x58, 0x47, 0x30, 0x31, 0x41,
+/* 58 */       0x0a, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x49,
+/* 60 */       0x42, 0x4d, 0x2d, 0x49, 0x41, 0x58, 0x47, 0x30,
+/* 68 */       0x31, 0x41, 0x0a, 0x20, 0x00, 0x00, 0x00, 0xfc,
+/* 70 */       0x00, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x4c,
+/* 78 */       0x43, 0x44, 0x0a, 0x20, 0x20, 0x20, 0x00, 0x52
+};
+
diff -r 603bc67ec41a -r bcd4b759a319 sys/arch/macppc/macppc/static_edid.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/macppc/macppc/static_edid.h      Wed Jul 13 22:54:33 2011 +0000
@@ -0,0 +1,34 @@
+/*     $NetBSD: static_edid.h,v 1.1 2011/07/13 22:54:33 macallan Exp $ */
+
+/*-
+ * Copyright (c) 2011 Michael Lorenz
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef STATIC_EDID_H
+#define STATIC_EDID_H
+
+extern uint8_t edid_pismo[128];
+
+#endif /* STATIC_EDID_H */



Home | Main Index | Thread Index | Old Index