From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A414BC4741F for ; Sun, 1 Nov 2020 19:21:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13628208E4 for ; Sun, 1 Nov 2020 19:21:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t/Zp8IWo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13628208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 224A46EB5C; Sun, 1 Nov 2020 19:21:22 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD2A96EB5C for ; Sun, 1 Nov 2020 19:21:20 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 73140240; Sun, 1 Nov 2020 20:21:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604258476; bh=snw4XAb7TzUZCyDePQfXmmHR6fn79B7kpxF3qwItluQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t/Zp8IWoNLPiCeKhor+jqn4VPm/PCN6AdYv1hgIu8ZusrURtfz56LT/pGC+Bpwwko jb6NLGYvqasxCW7/qEXUaF0JzuN0I2tN7xw3n5mTfVWeS9bGrKKInJRAvoMEdsAXlz hT1G/38xO+0BQe28D+6zD1HmihUoThlZmHTQwjJU= Date: Sun, 1 Nov 2020 21:20:27 +0200 From: Laurent Pinchart To: Stephen Boyd Subject: Re: [PATCH v2 3/4] drm/bridge: ti-sn65dsi86: Read EDID blob over DDC Message-ID: <20201101192027.GA7612@pendragon.ideasonboard.com> References: <20201030011738.2028313-1-swboyd@chromium.org> <20201030011738.2028313-4-swboyd@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201030011738.2028313-4-swboyd@chromium.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , Neil Armstrong , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Andrzej Hajda , Sean Paul Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Apart from that, Reviewed-by: Laurent Pinchart > + > + if (edid && drm_edid_is_valid(edid)) { > + ret = drm_connector_update_edid_property(connector, edid); > + if (!ret) { > + num = drm_add_edid_modes(connector, edid); > + if (num) > + return num; > + } > + } > > return drm_panel_get_modes(pdata->panel, connector); > } > @@ -1245,6 +1264,7 @@ static int ti_sn_bridge_remove(struct i2c_client *client) > if (!pdata) > return -EINVAL; > > + kfree(pdata->edid); > ti_sn_debugfs_remove(pdata); > > of_node_put(pdata->host_node); -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel