Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/omap If EDID is supplied, parse and print it. W...
details: https://anonhg.NetBSD.org/src/rev/8c984806ccb2
branches: trunk
changeset: 783633:8c984806ccb2
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Jan 01 23:22:44 2013 +0000
description:
If EDID is supplied, parse and print it. While here, try not to crash
if is_console is false.
diffstat:
sys/arch/arm/omap/files.omap2 | 4 ++--
sys/arch/arm/omap/omapfb.c | 28 +++++++++++++++++++++++++---
2 files changed, 27 insertions(+), 5 deletions(-)
diffs (91 lines):
diff -r b2639d25b67f -r 8c984806ccb2 sys/arch/arm/omap/files.omap2
--- a/sys/arch/arm/omap/files.omap2 Tue Jan 01 23:21:26 2013 +0000
+++ b/sys/arch/arm/omap/files.omap2 Tue Jan 01 23:22:44 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.omap2,v 1.20 2013/01/01 13:05:21 jmcneill Exp $
+# $NetBSD: files.omap2,v 1.21 2013/01/01 23:22:44 jmcneill Exp $
#
# Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
# Based on xscale/files.pxa2x0
@@ -125,7 +125,7 @@
attach ehci at obio with omap3_ehci
file arch/arm/omap/omap3_ehci.c omap3_ehci
-device omapfb: rasops16, rasops8, wsemuldisplaydev, vcons
+device omapfb: rasops16, rasops8, wsemuldisplaydev, vcons, edid
attach omapfb at obio
file arch/arm/omap/omapfb.c omapfb
diff -r b2639d25b67f -r 8c984806ccb2 sys/arch/arm/omap/omapfb.c
--- a/sys/arch/arm/omap/omapfb.c Tue Jan 01 23:21:26 2013 +0000
+++ b/sys/arch/arm/omap/omapfb.c Tue Jan 01 23:22:44 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omapfb.c,v 1.6 2012/12/11 22:47:40 matt Exp $ */
+/* $NetBSD: omapfb.c,v 1.7 2013/01/01 23:22:44 jmcneill Exp $ */
/*
* Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.6 2012/12/11 22:47:40 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.7 2013/01/01 23:22:44 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,6 +56,8 @@
#include <dev/rasops/rasops.h>
#include <dev/wscons/wsdisplay_vconsvar.h>
+#include <dev/videomode/edidvar.h>
+
struct omapfb_softc {
device_t sc_dev;
@@ -77,6 +79,9 @@
struct vcons_data vd;
int sc_mode;
uint8_t sc_cmap_red[256], sc_cmap_green[256], sc_cmap_blue[256];
+
+ uint8_t sc_edid_data[1024];
+ size_t sc_edid_size;
};
static int omapfb_match(device_t, cfdata_t, void *);
@@ -157,8 +162,9 @@
struct rasops_info *ri;
struct wsemuldisplaydev_attach_args aa;
prop_dictionary_t dict;
+ prop_data_t edid_data;
unsigned long defattr;
- bool is_console;
+ bool is_console = false;
uint32_t sz, reg;
int segs, i, j, adr;
@@ -208,8 +214,24 @@
#endif
dict = device_properties(self);
prop_dictionary_get_bool(dict, "is_console", &is_console);
+ edid_data = prop_dictionary_get(dict, "EDID");
//is_console = 1;
+ if (edid_data != NULL) {
+ struct edid_info ei;
+
+ sc->sc_edid_size = min(prop_data_size(edid_data), 1024);
+ memset(sc->sc_edid_data, 0, sizeof(sc->sc_edid_data));
+ memcpy(sc->sc_edid_data, prop_data_data_nocopy(edid_data),
+ sc->sc_edid_size);
+
+ edid_parse(sc->sc_edid_data, &ei);
+ edid_print(&ei);
+ }
+
+ if (!is_console)
+ return;
+
/* setup video DMA */
sc->sc_vramsize = (12 << 20) + 0x1000; /* 12MB + CLUT */
Home |
Main Index |
Thread Index |
Old Index