Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/pci/hdaudio Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/812834281c14
branches:  netbsd-7
changeset: 800322:812834281c14
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Sep 04 06:10:30 2017 +0000

description:
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.

diffstat:

 sys/dev/pci/hdaudio/hdafg.c    |  12 ++++++++++--
 sys/dev/pci/hdaudio/hdafg_dd.c |  16 ++++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diffs (136 lines):

diff -r d02b4e261cc1 -r 812834281c14 sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c       Mon Sep 04 06:04:06 2017 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c       Mon Sep 04 06:10:30 2017 +0000
@@ -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 <support%precedence.co.uk@localhost>
@@ -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 @@
                        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 @@
 
        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 @@
                }
                break;
        default:
+#ifdef HDAFG_HDMI_DEBUG
                hda_print(sc, "unsol: tag=%u\n", tag);
+#endif
                break;
        }
 
diff -r d02b4e261cc1 -r 812834281c14 sys/dev/pci/hdaudio/hdafg_dd.c
--- a/sys/dev/pci/hdaudio/hdafg_dd.c    Mon Sep 04 06:04:06 2017 +0000
+++ b/sys/dev/pci/hdaudio/hdafg_dd.c    Mon Sep 04 06:10:30 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        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 @@
 
        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 @@
        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 @@
        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 @@
                datalen -= sizeof(hdi->sad[i]);
        }
 
+#ifdef HDAFG_HDMI_DEBUG
        printf("datalen = %u\n", (unsigned int)datalen);
+#endif
        KASSERT(datalen == 0);
 
        return 0;



Home | Main Index | Thread Index | Old Index