Module Name:    src
Committed By:   snj
Date:           Mon Sep  4 06:10:30 UTC 2017

Modified Files:
        src/sys/dev/pci/hdaudio [netbsd-7]: hdafg.c hdafg_dd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1492):
        sys/dev/hdaudio/hdafg.c: revision 1.13 (s,hdaudio,pci/hdaudio,)
        sys/dev/hdaudio/hdafg_dd.c: revision 1.2 (s,hdaudio,pci/hdaudio,)
put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
this silences a frequent and largely useless series of messages
in my dmesg.  ok jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.21.2.1 -r1.21.2.2 src/sys/dev/pci/hdaudio/hdafg.c
cvs rdiff -u -r1.2 -r1.2.14.1 src/sys/dev/pci/hdaudio/hdafg_dd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdafg.c
diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.1 src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.2
--- src/sys/dev/pci/hdaudio/hdafg.c:1.21.2.1	Fri Sep  4 15:07:08 2015
+++ src/sys/dev/pci/hdaudio/hdafg.c	Mon Sep  4 06:10:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $ */
+/* $NetBSD: hdafg.c,v 1.21.2.2 2017/09/04 06:10:30 snj Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <supp...@precedence.co.uk>
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21.2.1 2015/09/04 15:07:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21.2.2 2017/09/04 06:10:30 snj Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -874,15 +874,19 @@ hdafg_assoc_dump_dd(struct hdafg_softc *
 			res = (*cmd)(sc->sc_codec, as->as_pins[pin],
 			    CORB_GET_HDMI_ELD_DATA, i);
 			if (!(res & COP_ELD_VALID)) {
+#ifdef HDAFG_HDMI_DEBUG
 				hda_error(sc, "bad ELD size (%u/%u)\n",
 				    i, elddatalen);
+#endif
 				break;
 			}
 			elddata[i] = COP_ELD_DATA(res);
 		}
 
 		if (hdafg_dd_parse_info(elddata, elddatalen, &hdi) != 0) {
+#ifdef HDAFG_HDMI_DEBUG
 			hda_error(sc, "failed to parse ELD data\n");
+#endif
 			return;
 		}
 
@@ -4260,7 +4264,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 
 	switch (tag) {
 	case HDAUDIO_UNSOLTAG_EVENT_DD:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: display device hotplug\n");
+#endif
 		for (i = 0; i < sc->sc_nassocs; i++) {
 			if (as[i].as_displaydev == false)
 				continue;
@@ -4272,7 +4278,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 		}
 		break;
 	default:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: tag=%u\n", tag);
+#endif
 		break;
 	}
 

Index: src/sys/dev/pci/hdaudio/hdafg_dd.c
diff -u src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2 src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2.14.1
--- src/sys/dev/pci/hdaudio/hdafg_dd.c:1.2	Wed Aug 29 18:52:31 2012
+++ src/sys/dev/pci/hdaudio/hdafg_dd.c	Mon Sep  4 06:10:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg_dd.c,v 1.2 2012/08/29 18:52:31 dholland Exp $ */
+/* $NetBSD: hdafg_dd.c,v 1.2.14.1 2017/09/04 06:10:30 snj Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill <jmcne...@invisible.ca>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2012/08/29 18:52:31 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2.14.1 2017/09/04 06:10:30 snj Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -51,12 +51,16 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	struct eld_baseline_block *block = &hdi->eld;
 	unsigned int i;
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("hdafg_dd_parse_info: datalen=%u\n", (unsigned int)datalen);
+#endif
 
 	memset(hdi, 0, sizeof(*hdi));
 
 	if (datalen < sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" no room for header\n");
+#endif
 		return EINVAL;
 	}
 
@@ -66,7 +70,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 
 	if (datalen < block->header.baseline_eld_len * 4 ||
 	    datalen < sizeof(*block) - sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" ack!\n");
+#endif
 		return EINVAL;
 	}
 
@@ -77,7 +83,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= sizeof(*block) - sizeof(block->header);
 
 	if (datalen < ELD_MNL(block)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" MNL=%u\n", ELD_MNL(block));
+#endif
 		return EINVAL;
 	}
 
@@ -86,10 +94,12 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= ELD_MNL(block);
 
 	if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" datalen %u sadcount %u sizeof sad %u\n",
 		    (unsigned int)datalen,
 		    ELD_SAD_COUNT(block),
 		    (unsigned int)sizeof(hdi->sad[0]));
+#endif
 		return EINVAL;
 	}
 	hdi->nsad = ELD_SAD_COUNT(block);
@@ -99,7 +109,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 		datalen -= sizeof(hdi->sad[i]);
 	}
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("datalen = %u\n", (unsigned int)datalen);
+#endif
 	KASSERT(datalen == 0);
 
 	return 0;

Reply via email to