Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4045482pxf; Mon, 29 Mar 2021 19:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFHMflLBvTz8ih/ISBjHz5hzkG+EXQqEWyo5nfej5mUSKk4iUIC1JrYjSpfCdq0s+RoQRc X-Received: by 2002:a05:6402:4245:: with SMTP id g5mr31753055edb.306.1617073099314; Mon, 29 Mar 2021 19:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617073099; cv=none; d=google.com; s=arc-20160816; b=vL4Aw5Hrng5LO0hVtx1jD0pNde2jrI9eZ5S1CVsBNbrKIMnWAH/v/Tb5nrbprQSsXN g1x4wGdj9ntG43qb0cUosfbUiZy6iGcOQ4vJar5PMn2r4zRQYWLF3YruiLYuB8XSr6aQ C+x4NTdFyymxcGl4ZGwWkshQUlHZxQTAuyLYtURL7P7L379TT00QON0enqACQC2NEqH7 Q7dQb35/1Z3wsJnqDapFBh3B1Uniodts8ps47ktXZCHpSxVSrlOFeAexLs1fDfuidVab 4Z4vATjbHRgG2tvmU0N6G6iOquMgodQAl9ghrgT67t6POcSlPo6ms2wJeW+KlNZKw3GG Ce1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OznxYj+eRPVb4um1OhPEH9Y2bcONmP2iXcQsa3vKzmU=; b=t1w8NhVNMCyq0ZGYqT19CqBDCB9Vn/9sYH5PA4HXjOqFrQeA7fdydJOBu5WHfrITHI aB19+F6ayXt1WgqrUjb1xwy0Y+8YxmM+zx0Yyw44M5r77DzLkMHJO2+q/KpFN2Ys9wh0 SiPtqm/IOOiS2jGpCoVs0sEIehDBUJkh8Bb4vJppgxnVp6K6pKnTlnzmEq4WugaYugtN F9xgsiKkYFtUVXeljG8Zr3O3xWBu6rDYY3bD16d7CUE/Zwb1ttq3jlKipuJpjbyGfnYG vN1WSBH3wqb34yDSpJvK4n0f/649DIEbRL+sPooIKOPFLG99YUlzQcYSQflS17N+SB/Y uZfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UJOk7rBZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si16304447ejl.54.2021.03.29.19.57.57; Mon, 29 Mar 2021 19:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UJOk7rBZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231528AbhC3CzA (ORCPT + 99 others); Mon, 29 Mar 2021 22:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbhC3CyW (ORCPT ); Mon, 29 Mar 2021 22:54:22 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9075C061762 for ; Mon, 29 Mar 2021 19:54:21 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id nh23-20020a17090b3657b02900c0d5e235a8so6937117pjb.0 for ; Mon, 29 Mar 2021 19:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OznxYj+eRPVb4um1OhPEH9Y2bcONmP2iXcQsa3vKzmU=; b=UJOk7rBZBFF9I7lwYBJmw01yx2yHeWcw5z0zsYmSrIAxjHV4hx3YLLroFJWN0TA7m2 kx7hnYCBA3g6fJWfnrNU46vi6abv2rwjis0Lq4iRzRXn4GgWfff5PwW9SbAfzzAZg5oI p6jjD0bmPxC/qMblO48yxz/gnwV4iUqORCAwA= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=OznxYj+eRPVb4um1OhPEH9Y2bcONmP2iXcQsa3vKzmU=; b=FJNYySl9qXtLgqb7Kcsl3G4muJ6MJPWtGc03obCAKp5OXjY4HhISECqLl6w8phAQyg eirOqBFL5YEReLNcRIAcqFZndZZj3Po9W5qtmfp8fhzabxjDoq7EbWGrXa77voloQXSf EoJ8CZu1JBvEdNs71vs/H3nETOribhmtSWDUzFMiZiV7+aMvDGa+u7He2ZxtXFuHGZsH 66SgarsazJs+QgnH9BMFRxl4AJB/OAo4k8QPUb26s0SV1i9LqGjbGemPognP99JHiNxt c5zW8wOuV0GvE7cpQB20wpP0D77JmpenvLQwXMni3hSAdYDimuTAGxaVMAkgssFEldap auNA== X-Gm-Message-State: AOAM530/Mlpot4AoJqSm+GCM/mdODr1A3NHKqKJKSMrJxSxWSh22lE7y 5+bd0zqzEugmUxT9j8Ti0fHCPw== X-Received: by 2002:a17:902:bd45:b029:e7:1490:9db5 with SMTP id b5-20020a170902bd45b02900e714909db5mr25817051plx.45.1617072861413; Mon, 29 Mar 2021 19:54:21 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:f599:1ca7:742d:6b50]) by smtp.gmail.com with ESMTPSA id t17sm19152706pgk.25.2021.03.29.19.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 19:54:21 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg Cc: Bjorn Andersson , Stephen Boyd , Maarten Lankhorst , robdclark@chromium.org, Stanislav Lisovskiy , linux-arm-msm@vger.kernel.org, Steev Klimaszewski , Linus W , Douglas Anderson , Daniel Vetter , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/14] drm/bridge: ti-sn65dsi86: Read the EDID only if refclk was provided Date: Mon, 29 Mar 2021 19:53:43 -0700 Message-Id: <20210329195255.v2.12.I7a8708139ae993f30f51eec7d065a1906c31a4bc@changeid> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210330025345.3980086-1-dianders@chromium.org> References: <20210330025345.3980086-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Though I don't have access to any hardware that uses ti-sn65dsi86 and _doesn't_ provide a "refclk", I believe that we'll have trouble reading the EDID at bootup in that case. Specifically I believe that if there's no "refclk" we need the MIPI source clock to be active before we can successfully read the EDID. My evidence here is that, in testing, I couldn't read the EDID until I turned on the DPPLL in the bridge chip and that the DPPLL needs the input clock to be active. Since this is hard to support, let's punt trying to read the EDID if there's no "refclk". I don't believe there are any users of the ti-sn65dsi86 bridge chip that _don't_ use "refclk". The bridge chip is _very_ inflexible in that mode. The only time I've seen that mode used was for some really early prototype hardware that was thrown in the e-waste bin years ago when we realized how inflexible it was. Even if someone is using the bridge chip without the "refclk" they're in no worse shape than they were before the (fairly recent) commit 58074b08c04a ("drm/bridge: ti-sn65dsi86: Read EDID blob over DDC"). Signed-off-by: Douglas Anderson --- (no changes since v1) drivers/gpu/drm/bridge/ti-sn65dsi86.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 673c9f1c2d8e..92498900c58d 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -273,6 +273,18 @@ static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) bool was_enabled; int num = 0; + /* + * Don't try to read the EDID if no refclk. In theory it is possible + * to make this work but it's tricky. I believe that we need to get + * our upstream MIPI source to provide a pixel clock before we can + * do AUX transations but we need to be able to read the EDID before + * we've picked a display mode. The bridge is already super limited + * if you try to use it without a refclk so presumably limiting to + * the fixed modes our downstream panel reports is fine. + */ + if (!pdata->refclk) + goto exit; + /* * Try to get the EDID first without anything special. There are * three things that could happen with this call. @@ -306,6 +318,7 @@ static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) return num; } +exit: return drm_panel_get_modes(pdata->panel, connector); } -- 2.31.0.291.g576ba9dcdaf-goog