Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3410927pxx; Mon, 2 Nov 2020 08:11:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFGnE8ujpOGcHbhuszp/vAIg1w31sECr4Jhp+seQh0Rjqta+h7IK2elkYAaTNRJCtVLezm X-Received: by 2002:a17:906:2798:: with SMTP id j24mr15731553ejc.109.1604333463103; Mon, 02 Nov 2020 08:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604333463; cv=none; d=google.com; s=arc-20160816; b=V2P+DHTxxVZSBfz7Xpvzsq515GY1f/+BR1ZcQID7Z5CrDIzjRH+utghPfHT3vVcGGw Er4MXlq0TQ3VqJi7MVvDHYknh6+JDWKYTp2yfsvukdkSGAy9p1c+YnGojgLaAYQFZpKE LT/w/esaeUV3/D+GivhHlmGFyuZn5yC6e9j0IoeURYE1kty8Xf8x05bxpXWPHopqQnKX GIKbHAvVP9WX7Ho4r6EgmitdcqDc3cjqzSZose/hHt7+eiZuamRiCf4AlhAKDKQEEw57 ywHFuIQ0uKELE516DAa/URPK9NjeHqcx07wOmSNfdHO5iV7u67/RcUNB7575UWhGpQBP mmJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3EAJxrbNKb2UnVB4OFa3XW/KW/bAnXVvDS85XdhAgXY=; b=t1ZbslpegxAgaGKSxUvWcJdg0buC00GXfSwH+LgMmIc1VdIz+JRJrX+RqDfYjDjiAZ rP7N0FKvj3p+Pkryt41RWYdFUqS1J4a5/uENZvwRlkAsk1mZolM9chz3umWBwSqkFRRs hhiie0cNlyYcysa1iPrVmInJi3kBPPzFNtiC/Q3xacgnOcBEYKBbf1nVTA8EsE9N3G9u BvwBV67w9KJzZh8MyWZqKMP+hpAvLeSUL6UGqbKEeSNN8rSlPoXa9r3+oqLKWBGLNCRr E1ldYgkiBP1dDj0pSrxd60Qmz7ZdGJLL+Ys6FuWZd34CIYYaNQ82xdyKTKfXgeXSLecA BkkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kvaF0DVj; 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 n10si3448434ejr.7.2020.11.02.08.10.40; Mon, 02 Nov 2020 08:11:03 -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=kvaF0DVj; 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 S1727214AbgKBQGa (ORCPT + 99 others); Mon, 2 Nov 2020 11:06:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727256AbgKBQG3 (ORCPT ); Mon, 2 Nov 2020 11:06:29 -0500 Received: from mail-vk1-xa41.google.com (mail-vk1-xa41.google.com [IPv6:2607:f8b0:4864:20::a41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C49EC0617A6 for ; Mon, 2 Nov 2020 08:06:29 -0800 (PST) Received: by mail-vk1-xa41.google.com with SMTP id k125so3049967vka.11 for ; Mon, 02 Nov 2020 08:06:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3EAJxrbNKb2UnVB4OFa3XW/KW/bAnXVvDS85XdhAgXY=; b=kvaF0DVjznsslmC6N78FPbYUkt271nHsx8pzI2dwafQr+aWMtlTUXTa6XQF/UnTG7O v2m7iuSP5kYhINST9+HMHrHY96GvLZUaG+a7P/lEltBAhK4Cq1hSAal2iHde/HLUEona 2yTUb6XZgmuzBIIq+4WmnRD4XDGPCre7UdoCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3EAJxrbNKb2UnVB4OFa3XW/KW/bAnXVvDS85XdhAgXY=; b=WxPOgrqf1XJGQEq2cDnrnlIAk4rvd08tyMQOkP5aEvfZbKLic6644IRI+H5rzRCIDw Ec2ANMf7z0goAeLGxaBK6zpy+VANH7ATo+88Md//RRvIoSFVwiE3xImpSjN8naseZbWl PpeS0h4OwHMCzP/Nvt8YAm0qMmbBHNa6zQGrVVfufjAY3WUar0JPdm+X0myod6P4y4ae PxU+Fqd2x2giYvWEFZ3A0IW3hHvRo+/kZAPNJ0hHpTCyFIC3klcsKrnM6CXfN1WmiKG2 aQu6j67YohKwaTdQ6565tUpVjhWEsnOBRcpjAzGrgDOqd6+xl1hybUSPmrrieGKCx/dp ZM5w== X-Gm-Message-State: AOAM5307hW2RY8DQKmu77DPe/tw8N2T2aYhMfLqU8KW06EvfLc8npG8l lVOJWdC60+wOjWUZZ0ICHm0xBh4Vd0CGlw== X-Received: by 2002:a1f:cd07:: with SMTP id d7mr13989939vkg.10.1604333188134; Mon, 02 Nov 2020 08:06:28 -0800 (PST) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com. [209.85.217.52]) by smtp.gmail.com with ESMTPSA id u7sm1539696vsj.1.2020.11.02.08.06.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Nov 2020 08:06:27 -0800 (PST) Received: by mail-vs1-f52.google.com with SMTP id y78so7741530vsy.6 for ; Mon, 02 Nov 2020 08:06:27 -0800 (PST) X-Received: by 2002:a05:6102:309a:: with SMTP id l26mr2329294vsb.4.1604333186845; Mon, 02 Nov 2020 08:06:26 -0800 (PST) MIME-Version: 1.0 References: <20201030011738.2028313-1-swboyd@chromium.org> <20201030011738.2028313-4-swboyd@chromium.org> <20201101192027.GA7612@pendragon.ideasonboard.com> In-Reply-To: <20201101192027.GA7612@pendragon.ideasonboard.com> From: Doug Anderson Date: Mon, 2 Nov 2020 08:06:14 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/4] drm/bridge: ti-sn65dsi86: Read EDID blob over DDC To: Laurent Pinchart Cc: Stephen Boyd , Andrzej Hajda , Neil Armstrong , LKML , dri-devel , Jonas Karlman , Jernej Skrabec , Sean Paul Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sun, Nov 1, 2020 at 11:21 AM Laurent Pinchart wrote: > > Hi Stephen, > > Thank you for the patch. > > On Thu, Oct 29, 2020 at 06:17:37PM -0700, Stephen Boyd wrote: > > Use the DDC connection to read the EDID from the eDP panel instead of > > relying on the panel to tell us the modes. > > > > Reviewed-by: Douglas Anderson > > Cc: Laurent Pinchart > > Cc: Jonas Karlman > > Cc: Jernej Skrabec > > Cc: Sean Paul > > Signed-off-by: Stephen Boyd > > --- > > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > index c77f46a21aae..f86934fd6cc8 100644 > > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > > @@ -119,6 +119,7 @@ > > * @debugfs: Used for managing our debugfs. > > * @host_node: Remote DSI node. > > * @dsi: Our MIPI DSI source. > > + * @edid: Detected EDID of eDP panel. > > * @refclk: Our reference clock. > > * @panel: Our panel. > > * @enable_gpio: The GPIO we toggle to enable the bridge. > > @@ -144,6 +145,7 @@ struct ti_sn_bridge { > > struct drm_bridge bridge; > > struct drm_connector connector; > > struct dentry *debugfs; > > + struct edid *edid; > > struct device_node *host_node; > > struct mipi_dsi_device *dsi; > > struct clk *refclk; > > @@ -265,6 +267,23 @@ connector_to_ti_sn_bridge(struct drm_connector *connector) > > static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) > > { > > struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); > > + struct edid *edid = pdata->edid; > > + int num, ret; > > + > > + if (!edid) { > > + pm_runtime_get_sync(pdata->dev); > > + edid = pdata->edid = 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. 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, 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? -Doug