From owner-svn-src-head@freebsd.org Sun Mar 13 01:47:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CEBACDF23; Sun, 13 Mar 2016 01:47:43 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B32BD1D; Sun, 13 Mar 2016 01:47:43 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2D1lgD6097398; Sun, 13 Mar 2016 01:47:42 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1lgQb097397; Sun, 13 Mar 2016 01:47:42 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603130147.u2D1lgQb097397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 13 Mar 2016 01:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296789 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:47:43 -0000 Author: jmcneill Date: Sun Mar 13 01:47:42 2016 New Revision: 296789 URL: https://svnweb.freebsd.org/changeset/base/296789 Log: Fix display output for non-HDMI display devices. Only set the display to HDMI mode if a CEA-861 extension block was found on the connected display. PR: 207912 Approved by: gonzo (mentor) Modified: head/sys/arm/allwinner/a10_hdmi.c Modified: head/sys/arm/allwinner/a10_hdmi.c ============================================================================== --- head/sys/arm/allwinner/a10_hdmi.c Sun Mar 13 01:20:20 2016 (r296788) +++ head/sys/arm/allwinner/a10_hdmi.c Sun Mar 13 01:47:42 2016 (r296789) @@ -203,6 +203,7 @@ struct a10hdmi_softc { uint8_t edid[EDID_LENGTH]; + int has_hdmi; int has_audio; }; @@ -371,27 +372,29 @@ a10hdmi_ddc_read(struct a10hdmi_softc *s return (0); } -static int -a10hdmi_detect_audio(struct a10hdmi_softc *sc) +static void +a10hdmi_detect_hdmi(struct a10hdmi_softc *sc, int *phdmi, int *paudio) { struct edid_info ei; uint8_t edid[EDID_LENGTH]; int block; + *phdmi = *paudio = 0; + if (edid_parse(sc->edid, &ei) != 0) - return (0); + return; /* Scan through extension blocks, looking for a CEA-861 block. */ for (block = 1; block <= ei.edid_ext_block_count; block++) { if (a10hdmi_ddc_read(sc, block, edid) != 0) - break; + return; - if (edid[EXT_TAG] == CEA_TAG_ID) - return ((edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0); + if (edid[EXT_TAG] == CEA_TAG_ID) { + *phdmi = 1; + *paudio = ((edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0); + return; + } } - - /* No CEA-861 block found */ - return (0); } static int @@ -426,9 +429,9 @@ a10hdmi_get_edid(device_t dev, uint8_t * } if (error == 0) - sc->has_audio = a10hdmi_detect_audio(sc); + a10hdmi_detect_hdmi(sc, &sc->has_hdmi, &sc->has_audio); else - sc->has_audio = 0; + sc->has_hdmi = sc->has_audio = 0; return (error); } @@ -515,7 +518,9 @@ a10hdmi_set_videomode(device_t dev, cons PLLCTRL0_VCO_S); /* Setup display settings */ - val = VID_CTRL_HDMI_MODE; + val = 0; + if (sc->has_hdmi) + val |= VID_CTRL_HDMI_MODE; if (mode->flags & VID_INTERLACE) val |= VID_CTRL_INTERLACE; if (mode->flags & VID_DBLSCAN)