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: 128332 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp581838ljc; Wed, 14 Feb 2018 05:01:41 -0800 (PST) X-Google-Smtp-Source: AH8x226fsW2CYnwjO06ZPgdXHGxR1jU/imYf+1ee1XsSsjpHDhBMHYlCzGIb3Y3IUyf9KS2igZID X-Received: by 10.99.104.131 with SMTP id d125mr3889132pgc.125.1518613301156; Wed, 14 Feb 2018 05:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518613301; cv=none; d=google.com; s=arc-20160816; b=E5+obUovNe1knZHGks+5/Ph/LejAgbbl3rWnbuCPBOiDM+UbK+KPgZXDAus+BWhpy1 o0FA2UpJnEmyaBB7JKM0Nnw747X+m8heCYepTI28yhTeKGJEZhjZhQhP8yyMgtIlQKku xyZKb5TkhbF0TwaJLJbJ2/io+4FQrwAAIzJ63w1gaXU1mcX64609ur4loaVhavLtSCNz 86d0xU3S6ynCDNm2d3i1ADZ35NycLak21oTU0v6I/+aA9k3Vgy8hEpySv6RECgUJiCuu ud1e+HmmtvkAAcGgIdBdzWSZy1PpioUmSPiVBXcQm01hhB5ZuFw7jGvlW9s11ztBMpAU 0IFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=VvmplyZ+pBbfrcpAk06j+2frGLd1U4QPM3bNeuF2ppc=; b=mCF/pLEvCkQzf7sm9+X2F58h+RzUv5InF7GN1tVFBZXWxvy6fD02lO8ZcaQ7mFZc8+ rvNpisgeGKyMlZfPoy4HoyOcSr2iJC5wd6+K6SMXoaF92LAZqH2usBgMjdYzJ+6KOpp5 vfBH4lZVHnDf4RZoInrdcdgXff903IqvMxPOoxxlZvmt8arpFNQxMDtcsU9K/ovWfvBx Ki7QIt+7FmGjoAHSUXb1TOlbraRzrA+mNK23ouKHLQQergpOEFHKg4dvm4PUSdmjhQ/K xMxbI7C/m4BFfc9ka1s6ChoMXjyri8LH6DqleXVOUxSCL4noizuJsAgZJz3kOJmWLQ4v uVmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=O9wQlsuN; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id k12si967532pgn.655.2018.02.14.05.01.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2018 05:01:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=O9wQlsuN; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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" 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); }