From patchwork Tue Nov 7 11:27:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 835239 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kkbCpksj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="wdT9Wc/K"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="p1U4v3tP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yWS0J74SGz9s3w for ; Tue, 7 Nov 2017 22:30:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wTAZk1yArl0CitlXMPpdQw2vs8FgPvv1HID6KguiShk=; b=kkbCpksjGpEn7x feneh+A397l8suI2AvuFoYV1op5cZgoi8IvOdqCV68q+zerNE2c1x2i7DQDETOsjW9thnBn29+O2/ kTXuqMEcaOQ+QCPLAgP+EPWxCCWwdCGzgYTHgCYmreYoWvk51h+EejQSxnAwj0NT+KVXj2PyhR6Zh yYD7PbHQs3G8MhJxV7F5jNXsIFqgSsQp3KUqlS5mH9FtTPYH0aUEI45tBwZk6XZOQ70Pn5UXq0fqV 82aFT/1N5fRpFgRnFdiXYV+On+dnXlFVywD8p/lsjKKgZxy5sdcMP5QRQU0TXMJwyZhXAsrlyGXwo rpD+QTFapbeBxBsT1sAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eC259-0008HG-FB; Tue, 07 Nov 2017 11:30:15 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eC257-00086g-0w for linux-arm-kernel@bombadil.infradead.org; Tue, 07 Nov 2017 11:30:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r4zoavTOM5prgNbkzDUbnc1HQAJ4vKGno+IhMjw9BvY=; b=wdT9Wc/KgdRojQgKnp0OuEI2xu L/P/21/8Cwl2VsBG9VHfQQVn0Qwg2w1wb34++chPF7noI9rsdsvv18+HjsjAJ63Fn//1Hv14f9A7x 0+FuFCpl2QZk7oTB6HEEGpJhCCrwdRAFit9IkKclURMeQVpepn7WyZKVcSQzRLUrkrqkECbghoS2z HfBm6A74o65dH25GJ5Ecs7FYq5j0kVqjZdKgZX9X5wDQCys31VJk3LbvV74DqIV5eTNq606y5QPE0 d3CP3kOVrq5Aqe4j1yupULIQi+MilPghj5OAu+5qEm7We8Q/Czf42Ta4dDjglj1pZUbKIacbD9Ua1 /Uucsnew==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eC252-0006AS-Sz for linux-arm-kernel@lists.infradead.org; Tue, 07 Nov 2017 11:30:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc:To:From; bh=r4zoavTOM5prgNbkzDUbnc1HQAJ4vKGno+IhMjw9BvY=; b=p1U4v3tP0E6zBuMDyvMQV1aEsvJJ5oPT9OXdkTZT1c89gebaJZFLXkt+sXt3ozMmH87sX+/9oXm2Z3Bh7u3d9jW4C3FzFrsciaK87HSXZM2Fn1RvgbgnwWXZsb0CT0Dz5ZofzDp04zZPl3norqz/gajdY1pqGT8Te5TtODLiRAY=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:49778 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eC22M-0002Lr-VL; Tue, 07 Nov 2017 11:27:23 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eC22L-0003sN-Dw; Tue, 07 Nov 2017 11:27:21 +0000 From: Russell King To: Andrzej Hajda , Archit Taneja , David Airlie , dri-devel@lists.freedesktop.org, Laurent Pinchart Subject: [PATCH] drm/bridge: dw-hdmi: fix EDID parsing MIME-Version: 1.0 MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 07 Nov 2017 11:27:21 +0000 X-MIME-Error: demime acl condition: double headers (content-type, content-disposition or content-transfer-encoding) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.3 (----) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-4.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [2001:4d48:ad52:3201:214:fdff:fe10:1be6 listed in] [list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lu??s Mendes , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Parsing the EDID for HDMI and audio information in the get_modes() callback is incorrect - this only parses the EDID read from the connector, not any override or firmware provided EDID. The correct place to parse the EDID for these parameters is the fill_modes() callback, after we've called the helper. Move the parsing there. This caused problems for Luís Mendes. Cc: Reported-by: Luís Mendes Tested-by: Luís Mendes Signed-off-by: Russell King --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 9fe407f49986..2516a1c18a10 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1905,10 +1905,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n", edid->width_cm, edid->height_cm); - hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid); - hdmi->sink_has_audio = drm_detect_monitor_audio(edid); drm_mode_connector_update_edid_property(connector, edid); - cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid); ret = drm_add_edid_modes(connector, edid); /* Store the ELD */ drm_edid_to_eld(connector, edid); @@ -1920,6 +1917,29 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) return ret; } +static int dw_hdmi_connector_fill_modes(struct drm_connector *connector, + uint32_t maxX, uint32_t maxY) +{ + struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, + connector); + int ret; + + ret = drm_helper_probe_single_connector_modes(connector, maxX, maxY); + + if (connector->edid_blob_ptr) { + struct edid *edid = (void *)connector->edid_blob_ptr->data; + + hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid); + hdmi->sink_has_audio = drm_detect_monitor_audio(edid); + cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid); + } else { + hdmi->sink_is_hdmi = false; + hdmi->sink_has_audio = false; + } + + return ret; +} + static void dw_hdmi_connector_force(struct drm_connector *connector) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, @@ -1933,7 +1953,7 @@ static void dw_hdmi_connector_force(struct drm_connector *connector) } static const struct drm_connector_funcs dw_hdmi_connector_funcs = { - .fill_modes = drm_helper_probe_single_connector_modes, + .fill_modes = dw_hdmi_connector_fill_modes, .detect = dw_hdmi_connector_detect, .destroy = drm_connector_cleanup, .force = dw_hdmi_connector_force,