Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp38934pxp; Thu, 10 Mar 2022 21:54:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhS4fa6p0EKhtfRbUuLq60O7dZ/+Br3iqA0oZorDsHYR5NUxxKmljXL3gI5SQE2KvXw7Ep X-Received: by 2002:a63:2316:0:b0:381:ac6:94a5 with SMTP id j22-20020a632316000000b003810ac694a5mr1349017pgj.501.1646978087706; Thu, 10 Mar 2022 21:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646978087; cv=none; d=google.com; s=arc-20160816; b=EWuBi/RpjCheHmRnTddCSjoJS7ARJcIfZx25tQRSdAjiuS3f9XN5bYGUGuFnMAGCo1 V9H0gqZXqjVyHejia96fxrQM2f2KxDj2eASh9IkzkaKhgqvT3XMylA4bmVRWU+mfdCZ+ 9FEXjAL5dmlLVM+vdQRvpg85OLyxtlIWpC62jNc6ub47UqdRlkDW+iqO7evzVbDXSoqY SsJdhNhImbMInXVMQXJS/Tm8/ghb90Kmuxha3coB7KAsj9ifjYDs4jUiLNl0rhBeJ5Be m9FMqYy7bGxgmD+lPlHID9O03aETvK8M9P0KKMOpN4FPV0tTYVvUrEXJgcf35jQTKbyw M98A== 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=lIPUskuy7q+FVSDZ5IJ+WNZAqAL7oh0D7Q9gwfa4Mko=; b=Y6nM2aljFwTqrcg+c/bGToHwqKGRmzSuWVY06dqgV9V0onwDj7Ep6JCngaJ5Lyc76i 5SqHDR2mb0eKE5ybxFkGuDGhSr0s7zGpnr/NWn/4P6MMScmuOTNx54JbfYzwMrwQPGWq lKvVmN4ZtjyU4fImQSTa7G+6FfhSJH7xOkrsE3VqRyOh0jXwjy2T2niKk4B1xCl8+1jF pQ/YUnyrAR87vS+C5w1fRTWlmaNSJNTE2caZh8WE0hfvju4w4ZpDBi4ViYuTh+rCKRop EUTqAyjc1/qlDHSQCuVsOMW93ZbAfGx7nkJ+x3U6hXuB6llb3A118r+GUZr7DFaS5Cqj KC+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Prk1g7j/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w6-20020a63f506000000b00372edd40f7asi7197589pgh.315.2022.03.10.21.54.31; Thu, 10 Mar 2022 21:54:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Prk1g7j/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238563AbiCJPYc (ORCPT + 99 others); Thu, 10 Mar 2022 10:24:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244334AbiCJPXt (ORCPT ); Thu, 10 Mar 2022 10:23:49 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 070ECB3E4C; Thu, 10 Mar 2022 07:22:37 -0800 (PST) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C1094739; Thu, 10 Mar 2022 16:22:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1646925752; bh=RrdHBYz4D3E4yivK8LdpnnoOUH8weh/Ii9LCIWkLgPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Prk1g7j/QMw1YnSwmnZxn8ayhXnEQXlh1TGQMlxpL6naS6K1RNwuA9otZ7Sw1ZT/G kOJ68CXnk5WHSMTteux06jqEUh9tr088spXn9+GD4qiKqbMACQVTUTtuWkEFN5brc9 gjJrPpENIuOPPDZitsRAh7h2JEmS7PjFya6eh2qE= From: Kieran Bingham To: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Sam Ravnborg , Douglas Anderson , linux-kernel@vger.kernel.org Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Laurent Pinchart , Kieran Bingham Subject: [PATCH v3 2/3] drm/bridge: ti-sn65dsi86: Implement bridge connector operations Date: Thu, 10 Mar 2022 15:22:26 +0000 Message-Id: <20220310152227.2122960-3-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220310152227.2122960-1-kieran.bingham+renesas@ideasonboard.com> References: <20220310152227.2122960-1-kieran.bingham+renesas@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurent Pinchart Implement the bridge connector-related .get_edid() operation, and report the related bridge capabilities and type. Signed-off-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- Changes since v1: - The connector .get_modes() operation doesn't rely on EDID anymore, __ti_sn_bridge_get_edid() and ti_sn_bridge_get_edid() got merged together - Fix on top of Sam Ravnborg's DRM_BRIDGE_STATE_OPS Changes since v2: [Kieran] - Only support EDID on DRM_MODE_CONNECTOR_DisplayPort modes. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 93b54fcba8ba..d581c820e5d8 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1135,10 +1135,24 @@ static void ti_sn_bridge_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(pdata->dev); } +static struct edid *ti_sn_bridge_get_edid(struct drm_bridge *bridge, + struct drm_connector *connector) +{ + struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); + struct edid *edid; + + pm_runtime_get_sync(pdata->dev); + edid = drm_get_edid(connector, &pdata->aux.ddc); + pm_runtime_put_autosuspend(pdata->dev); + + return edid; +} + static const struct drm_bridge_funcs ti_sn_bridge_funcs = { .attach = ti_sn_bridge_attach, .detach = ti_sn_bridge_detach, .mode_valid = ti_sn_bridge_mode_valid, + .get_edid = ti_sn_bridge_get_edid, .atomic_pre_enable = ti_sn_bridge_atomic_pre_enable, .atomic_enable = ti_sn_bridge_atomic_enable, .atomic_disable = ti_sn_bridge_atomic_disable, @@ -1233,6 +1247,9 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, pdata->bridge.type = pdata->next_bridge->type == DRM_MODE_CONNECTOR_DisplayPort ? DRM_MODE_CONNECTOR_DisplayPort : DRM_MODE_CONNECTOR_eDP; + if (pdata->bridge.type == DRM_MODE_CONNECTOR_DisplayPort) + pdata->bridge.ops = DRM_BRIDGE_OP_EDID; + drm_bridge_add(&pdata->bridge); ret = ti_sn_attach_host(pdata); -- 2.32.0