From patchwork Wed Feb 14 13:00:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10218759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FFDA601D7 for ; Wed, 14 Feb 2018 13:01:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83A442898B for ; Wed, 14 Feb 2018 13:01:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 780B428F81; Wed, 14 Feb 2018 13:01:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09E892898B for ; Wed, 14 Feb 2018 13:01:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1478D6E203; Wed, 14 Feb 2018 13:01:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3B2D6E203 for ; Wed, 14 Feb 2018 13:01:07 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id a204so29321970lfa.2 for ; Wed, 14 Feb 2018 05:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5dZ9bIUhEvJKc5X2P4PH8QstYrtiG3EPeCS4+LwmZVg=; b=O9wQlsuNgX0xFvD5kWHR9y4o149PjUoAWQ+o1GwTU/PQOn6IEiEnJ3/YWJjKrZ96jm YYSm0WGXnDwzS+2W4dLKWDt3kfRsyH87s82MgvWe4CM+WciMYaCUDXR7SkaBksnfaat0 wKSWk6bggEBnMA873QARIx87slsGnBXMRlAXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5dZ9bIUhEvJKc5X2P4PH8QstYrtiG3EPeCS4+LwmZVg=; b=hMGu8ADOUzAnd6wX57ClTlVJ6JlPhG5Qvhy19wjjpS4AHT+Ky28lN8sjuVu4UOkUTZ x/ef0mbKqQlmVcpj8v3fg1P5WP1E+Mpb0Q+Rv7aGV9SrNNyFtYss4CVdUcounn1vtE6s YeULMA7DpGkvXs4QsgxVGq9zTAm+M6ASfY/uoXP5H+7TkxAuCoxxj157bbcrRwFl5ElN J4lpFJV8Xs25BmeRylls3gUd0O9DnTaqw6WsuRfL2yN3hgWz3O2+5CyS7oXgp7YkwSe+ qoRrDrc14EdkLn4YxlVl/HpBT+bPMX/OScvCDhpffiGzPfhHa5X3jGQiiP8s/YLP+R6n hU/A== X-Gm-Message-State: APf1xPDP7PlBuDRY6RMi0Gxmisj+v2BhL6OyeMTtJF6yAc4VVuuChsPp cIflKAeMvZzGtLpLmVu0wCkDhMKrk/k= X-Google-Smtp-Source: AH8x225TQuRsXzmnexqCZ0jynUHgeBXCloEnjG05lvyVJQPXkc21/6HlcbH+jDNSI/M3NCl1l2LzAg== X-Received: by 10.25.142.72 with SMTP id q69mr3670065lfd.82.1518613266013; Wed, 14 Feb 2018 05:01:06 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id p70sm2516265lja.62.2018.02.14.05.01.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2018 05:01:04 -0800 (PST) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart Subject: [PATCH] drm/bridge: sii902x: Fall back to standard modes Date: Wed, 14 Feb 2018 14:00:59 +0100 Message-Id: <20180214130059.19052-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The following happens when connection a DVI output driven from the SiI9022 using a DVI-to-VGA adapter plug: i2c i2c-0: sendbytes: NAK bailout. i2c i2c-0: sendbytes: NAK bailout. Then no picture. Apparently the I2C engine inside the SiI9022 is not smart enough to try to fall back to DDC I2C. Or the vendor have not integrated the electronics properly. I don't know which one it is. By using standard modes as fallback, the bridge probes nicely with a minor warning and we get picture. This code is inspired by similar code in the dumb VGA bridge. Signed-off-by: Linus Walleij --- drivers/gpu/drm/bridge/sii902x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index b1ab4ab09532..4483095c4013 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -168,8 +168,19 @@ static int sii902x_get_modes(struct drm_connector *connector) return ret; edid = drm_get_edid(connector, sii902x->i2c->adapter); - drm_mode_connector_update_edid_property(connector, edid); - if (edid) { + if (!edid) { + /* + * This happens when using a simple DVI-to-VGA converter + * dongle for example: the I2C lines are not bridged over + * to VGA DDC. + */ + DRM_INFO("EDID readout failed, falling back to standard modes\n"); + ret = drm_add_modes_noedid(connector, 1920, 1080); + /* Set some standard resolution most monitors can handle */ + drm_set_preferred_mode(connector, 1024, 768); + } else { + /* Data from EDID readout */ + drm_mode_connector_update_edid_property(connector, edid); num = drm_add_edid_modes(connector, edid); kfree(edid); }