Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3469441pxx; Mon, 2 Nov 2020 09:39:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnsMAnNsPFp3S4Xdv/z2yPQ07IfV0K6QFJ6X4KvUHjA+fW2Kc1Q8LT2pNW9AUbSidfnnt1 X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr15786825ejb.126.1604338797287; Mon, 02 Nov 2020 09:39:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604338797; cv=none; d=google.com; s=arc-20160816; b=r/31WQr/hYaDryvIVJeWSjRW4+0WuIsn0DJv/jQ4wxm0So3OCRnEgNTZhMb2E6Wqvm ZrLuqT42GilWfGkEwdbAqtnm9PcrmqvqScCdwohXtf6rD1LPjJO/bRQBCO2j5Gj5Lbpt FfHE/E+Qg5TOadDS5JZLxLNLMQb2U5RgPX/h6ltXbnXHDmpt4JpUTZK+JvnuyhKM0VfF 81Mju094U2tsVPM66rMbIV/m+5FF7iruW24ZG/iFMd2dtF2iP0Nt9TsZiIDt+7RRj4hS NZ0n0DGVUuYWhxpQYsS0yrq2Of3ButyzhcNtwEcbMFCKLLP0xr3IOn8Rps6azF59G0Mx ZjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=8TTac8powIKxnrBZ37Qjfao9bhPKPpAxX0Xh5E4KL5E=; b=Ie4y5n2VxCFeXICkYn2STpTDPn8wxpL3aVmoJAFpDq6jRv18fml+9g2rrmCR+O7im3 SukHBvzjvKRHIHuNywMcmCcUMReq8s+ug6TSHfDp1zWjPKjGIidHp7qfMYGEh7AKNz7g 6hytLEObxeJJm7nefXptjUdJLna2/72ckzrgeBdEu7x5261Wb9HSpEo1YfVlJ5ekZn1f cthDN5XWWUvZPjPgj/cqhP+nurDrC84x1sBKHpU6jQE1q3gA6KWphhlUeMwca72KI6BN WxTeoGi9zr7Ly02reIqcdHDfo46xugixE5vD0YrZi3HuDvwhV8tfV+hAxS8+/HUkk07t xgcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jK3ykP36; 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 u23si11035112ejj.163.2020.11.02.09.39.34; Mon, 02 Nov 2020 09:39:57 -0800 (PST) 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=jK3ykP36; 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 S1727927AbgKBRiQ (ORCPT + 99 others); Mon, 2 Nov 2020 12:38:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbgKBRiQ (ORCPT ); Mon, 2 Nov 2020 12:38:16 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD494C0617A6 for ; Mon, 2 Nov 2020 09:38:14 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id x13so11712039pfa.9 for ; Mon, 02 Nov 2020 09:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=8TTac8powIKxnrBZ37Qjfao9bhPKPpAxX0Xh5E4KL5E=; b=jK3ykP36tExYCAPVVAm2YTynBYGQPqQPtkKu+VT/+wxZypJUrIf06+iHJXRt7rvc7f eZvXoF2Gy3WcpC9qxFhN8Rqk1L8vuWPTngdn0V2yrmvRnruxfJ6A7F0M3TxZ+h1KHdvo tLkwUBvMmGO7zlP0m8dd8dceaXDiHrbBxsy/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=8TTac8powIKxnrBZ37Qjfao9bhPKPpAxX0Xh5E4KL5E=; b=aqFgz3FpyJdFlWMtVMPMocDCMrJPsTqDrGLY26Nw7YXKcNPUUEeUcON3nHBE/Pljxc enEQxYJoIW52DRSjctwJWUMSlvNGMr7e90xlB2lKTVfIhuHVmBDD0l947PyLfqxta31I GxAwJG9RH67JZRTuoy6AKpK7gxk5ixSTm5t7xy3H2/VmOL9m2JMYQtY4klvkX0WwLT5U +BO+aPKqp/kpT/FU3Otkxe3nz6scN0gRQQjkSpGAeYA6FzGxvUuSrOsemYbqHSUKs/tQ LJ3SduPDh8VHIlhF+3kGkN5vRSpSiRW3UYHwDMm3MMlTutiFKzAoHbAro/P8ZsElcven Zawg== X-Gm-Message-State: AOAM531qiyL9X1AAZ1oQs8oPKQm1fXFBel4a+qrzwyo0OINLWnp9ANnH 4spDdHz27nUWKGEGQxx2c6ICY0J5sS0RZQ== X-Received: by 2002:a17:90a:ec13:: with SMTP id l19mr19246817pjy.51.1604338694299; Mon, 02 Nov 2020 09:38:14 -0800 (PST) Received: from chromium.org ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id i25sm710301pfo.167.2020.11.02.09.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:38:13 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20201030011738.2028313-1-swboyd@chromium.org> <20201030011738.2028313-4-swboyd@chromium.org> <20201101192027.GA7612@pendragon.ideasonboard.com> Subject: Re: [PATCH v2 3/4] drm/bridge: ti-sn65dsi86: Read EDID blob over DDC From: Stephen Boyd Cc: Andrzej Hajda , Neil Armstrong , LKML , dri-devel , Jonas Karlman , Jernej Skrabec , Sean Paul To: Doug Anderson , Laurent Pinchart Date: Mon, 02 Nov 2020 09:38:12 -0800 Message-ID: <160433869233.884498.1989382962614280308@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Doug Anderson (2020-11-02 08:06:14) > On Sun, Nov 1, 2020 at 11:21 AM Laurent Pinchart > wrote: > > On Thu, Oct 29, 2020 at 06:17:37PM -0700, Stephen Boyd wrote: > > > @@ -265,6 +267,23 @@ connector_to_ti_sn_bridge(struct drm_connector *= connector) > > > static int ti_sn_bridge_connector_get_modes(struct drm_connector *co= nnector) > > > { > > > struct ti_sn_bridge *pdata =3D connector_to_ti_sn_bridge(connec= tor); > > > + struct edid *edid =3D pdata->edid; > > > + int num, ret; > > > + > > > + if (!edid) { > > > + pm_runtime_get_sync(pdata->dev); > > > + edid =3D pdata->edid =3D drm_get_edid(connector, &pdata= ->aux.ddc); > > > + pm_runtime_put(pdata->dev); > > > + } > > > > Do we need to cache the EDID ? It seems like something that should be > > done by the DRM core (well, caching modes in that case), not by > > individual bridge drivers. >=20 > I can take the blame for the fact that it does caching, since I > requested it in early reviews. In general boot speed is pretty > important to me and each read of the EDID take 20 ms. There are > definitely several calls to get the EDID during a normal bootup. > Stephen did a little more digging into exactly what was causing all > these calls and can chime in,=20 In ChromeOS we get modes a couple times and then whenever we connect or disconnect a DP cable for external display we also get modes. It seems that we also run modetest at boot but I'm not sure why we do that. I think it is to gather diagnostic data for all the EDIDs on the device at boot so we know what all is connected. > but in general until we can eliminate > the extra calls it seems like it'd be nice to keep the caching? This > bridge chip is intended for use for eDP for internal panels, so there > should be no downside to caching. If we can later optimize the DRM > core, we can fix this and a pre-existing driver that does the same > type of caching (analogix-anx6345.c) at the same time? I'd like to add the caching somewhere in the core (maybe the bridge connector code?) but I don't know what the logic should be. Is it eDP and if not hpd notify then cache all the time and if it is eDP and hpd notify then cache once hpd notify says detected and drop cache when no longer detected? if (eDP) { if (!hpd) cache(); else if (hpd_detected()) { cache(); else if (!hpd_detected()) { drop_cache(); } } I thought that EDID could change and HPD can be pulsed to notify that it should be read again.