Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4706407pxb; Tue, 5 Oct 2021 08:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHIwW2hXEsek2l/Dt2Ixo3rEjxCWD1SToVQlSiu4hVWphKQ7lGUIpj0l+3lzzTiqsRvvo7 X-Received: by 2002:a63:5264:: with SMTP id s36mr16118065pgl.147.1633448435915; Tue, 05 Oct 2021 08:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633448435; cv=none; d=google.com; s=arc-20160816; b=G4v8DYq8IIcFp5fsrZ3V0F6BuV5j0mmkAGo5RZ3+DiPkiGI11zyLyLY4qgpLB1Ik/l nZV6Hk8HOSmG9TxiEWUG/bwlDcU0OAJSdwU5mVkZ3EIeuMJkt4zqSx1lMVbOC8LVTKRN J7QK+68SNVsSGlnznNXxhjK1MaoV5XG+9gGjzCeTXVZ/u2nawfht9LynKbk/1SVfiXdz ywZ7+NliCtyqbDIFuL/sVtOj1au26azBRBnk/u0bpLGsgzSSMQob1TA46vCRt0w76q68 2Z7rrdV2HkitsRDDw8mdgKUAPZaOD0eACHFz5iAyS318j2nwxmGAIb7nJb0gw+jdRoJE igcQ== 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=Jn/8ah9SoyFj7/AW/wHvLR/E0NKkVYESoUG4F0G7wes=; b=Poe4AfMRO6YcXnfQr/qWRJg0MaTCHyqQbfpdxQicQHANi6q0YveDSGCZd/KlXbz9hE QmsFnsMO4gla6pOt2cdEftWb5hklFrUxy5opZ4qicj7Ew8Pmof/G3TgObtR18U/hlFVY K2wrlNIfj1HeXCXTEARWkRDWPR6W3T1KsWvvszkIpMLl2CgkZho3dr5tMgxjogAjSMm3 hhYX/RrdwyQjOoyv2Sh1llF0GPbO/ZWlBSlku0DwdqxrhN2IwcEohe4+KNJOfx29o0Hr 84qm4aZ381HjCwyK2W9wlYD/Seqfvlgr4fTCSDv5yGMDe9901OBe7hhczsH59rZux7d4 Pyiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=f9xqUyzR; 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 m8si25184496pfk.283.2021.10.05.08.40.23; Tue, 05 Oct 2021 08:40:35 -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=f9xqUyzR; 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 S236213AbhJEPl2 (ORCPT + 99 others); Tue, 5 Oct 2021 11:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235510AbhJEPl1 (ORCPT ); Tue, 5 Oct 2021 11:41:27 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58FC7C061749 for ; Tue, 5 Oct 2021 08:39:37 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id p68so199764iof.6 for ; Tue, 05 Oct 2021 08:39:37 -0700 (PDT) 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=Jn/8ah9SoyFj7/AW/wHvLR/E0NKkVYESoUG4F0G7wes=; b=f9xqUyzRkkv5jK2D9eJy++YNj6qTjlTkV8LNjYsHXR5hvKLfMpJp7XMAHvfc1LXbza fukG3CzYA7x41zb93VjrPWya2JERm8bljAH1iIC1Ex4rMw1onFVPtSEU722Laf/p58V5 wRh9Pwz/I9diTXBAUmMJfu2fjeu4HjskBTB1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jn/8ah9SoyFj7/AW/wHvLR/E0NKkVYESoUG4F0G7wes=; b=ShgFP6oEwTlSdKxjtK7L1ceOxQteGPdBk1PEvXZvl52vgZ35mN4CmlRZqABy/oazbC E9RLDvsjz/7SC18ZyaZRxcHE73UTFfolxoODFFuJ0u4piPTZ4OnuRGtFWIFrDwv2erR4 0N2nJ7nVOMgpgiiG/agLW0JJ+nDAsjdv1YeemIqCa0FMjxuAzk1xEhCz51FPUrMZEIJz cQmPX8iWwrTNPLDLejI0Hwf5DKyEppbimjn5/9lVRqT0qHaXv4sgdagkLutZmc5exo3A BzM8I6V6/12JXwsDdotQrq1Jqbc5JMBOHTb7TPOcc57A15giIhrDiz1sxTHmINyMI1PQ M+UQ== X-Gm-Message-State: AOAM533IZGTIMwbVfrho0i2rZ0CKHPI4bKfYUBhMjb70YPQIv8U/2QMs lw6gX0r2evOjzGPrGlj9LqJGwTf37UIjSA== X-Received: by 2002:a6b:7118:: with SMTP id q24mr2794190iog.103.1633448376459; Tue, 05 Oct 2021 08:39:36 -0700 (PDT) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id j20sm11177859ioo.35.2021.10.05.08.39.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 08:39:34 -0700 (PDT) Received: by mail-il1-f180.google.com with SMTP id y15so22234547ilu.12 for ; Tue, 05 Oct 2021 08:39:34 -0700 (PDT) X-Received: by 2002:a05:6e02:1989:: with SMTP id g9mr2013043ilf.165.1633448374264; Tue, 05 Oct 2021 08:39:34 -0700 (PDT) MIME-Version: 1.0 References: <20210726231351.655302-1-bjorn.andersson@linaro.org> In-Reply-To: From: Doug Anderson Date: Tue, 5 Oct 2021 08:39:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] drm/msm/dp: Allow attaching a drm_panel To: Bjorn Andersson Cc: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm , LKML , Abhinav Kumar , Stephen Boyd , Kuogee Hsieh , dri-devel , Vara Reddy , freedreno , Chandan Uddaraju Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Oct 4, 2021 at 6:09 PM Bjorn Andersson wrote: > > On Mon 04 Oct 17:36 PDT 2021, Doug Anderson wrote: > > > Hi, > > > > On Fri, Oct 1, 2021 at 2:00 PM Bjorn Andersson > > wrote: > > > > > > On Fri 27 Aug 13:52 PDT 2021, Doug Anderson wrote: > > > > > > > Hi, > > > > > > > > On Mon, Jul 26, 2021 at 4:15 PM Bjorn Andersson > > > > wrote: > > > > > > > > > > +static int dp_parser_find_panel(struct dp_parser *parser) > > > > > +{ > > > > > + struct device_node *np = parser->pdev->dev.of_node; > > > > > + int rc; > > > > > + > > > > > + rc = drm_of_find_panel_or_bridge(np, 2, 0, &parser->drm_panel, NULL); > > > > > > > > Why port 2? Shouldn't this just be port 1 always? The yaml says that > > > > port 1 is "Output endpoint of the controller". We should just use port > > > > 1 here, right? > > > > > > > > > > Finally got back to this, changed it to 1 and figured out why I left it > > > at 2. > > > > > > drm_of_find_panel_or_bridge() on a DP controller will find the of_graph > > > reference to the USB-C controller, scan through the registered panels > > > and conclude that the of_node of the USB-C controller isn't a registered > > > panel and return -EPROBE_DEFER. > > > > I'm confused, but maybe it would help if I could see something > > concrete. Is there a specific board this was happening on? > > > > Right, let's make this more concrete with a snippet from the actual > SC8180x DT. > > > Under the DP node in the device tree I expect: > > > > ports { > > port@1 { > > reg = <1>; > > edp_out: endpoint { > > remote-endpoint = <&edp_panel_in>; > > }; > > }; > > }; > > > > /* We got a panel */ > panel { > ... > ports { > port { > auo_b133han05_in: endpoint { > remote-endpoint = <&mdss_edp_out>; > }; > }; > }; > }; > > /* And a 2-port USB-C controller */ > type-c-controller { > ... > connector@0 { > ports { > port@0 { > reg = <0>; > ucsi_port_0_dp: endpoint { > remote-endpoint = <&dp0_mode>; > }; > }; > > port@1 { > reg = <1>; > ucsi_port_0_switch: endpoint { > remote-endpoint = <&primary_qmp_phy>; > }; > }; > }; > }; > > connector@1 { > ports { > port@0 { > reg = <0>; > ucsi_port_1_dp: endpoint { > remote-endpoint = <&dp1_mode>; > }; > }; > > port@1 { > reg = <1>; > ucsi_port_1_switch: endpoint { > remote-endpoint = <&second_qmp_phy>; > }; > }; > }; > }; > }; > > /* And then our 2 DP and single eDP controllers */ > &mdss_dp0 { > ports { > port@1 { > reg = <1>; > dp0_mode: endpoint { > remote-endpoint = <&ucsi_port_0_dp>; > }; > }; > }; > }; > > &mdss_dp1 { > ports { > port@1 { > reg = <1>; > dp1_mode: endpoint { > remote-endpoint = <&ucsi_port_1_dp>; > }; > }; > }; > }; > > &mdss_edp { > ports { > port@1 { > reg = <1>; > mdss_edp_out: endpoint { > remote-endpoint = <&auo_b133han05_in>; > }; > }; > }; > }; > > > If you have "port@1" pointing to a USB-C controller but this instance > > of the DP controller is actually hooked up straight to a panel then > > you should simply delete the "port@1" that points to the typeC and > > replace it with one that points to a panel, right? > > > > As you can see, port 1 on &mdss_dp0 and &mdss_dp1 points to the two UCSI > connectors and the eDP points to the panel, exactly like we agreed. > > So now I call: > drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL); > > which for the two DP nodes will pass respective UCSI connector to > drm_find_panel() and get EPROBE_DEFER back - because they are not on > panel_list. > > There's nothing indicating in the of_graph that the USB connectors > aren't panels (or bridges), so I don't see a way to distinguish the two > types remotes. As far as I can tell the way this would be solved would be to actually pass &bridge in and then make sure that a bridge would be in place for the DP connector. In the full DP case you'll get an -EPROBE_DEFER if the connector hasn't been probed but once it's probed then it should register as a bridge and thus give you the info you need (AKA that this isn't a panel). I haven't done the digging to see how all this works, but according to Laurent [1]: "Physical connectors are already handled as bridges, see drivers/gpu/drm/bridge/display-connector.c" So basically I think this is solvable in code and there's no reason to mess with the devicetree bindings to solve this problem. Does that sound right? [1] https://lore.kernel.org/r/YUvMv+Y8tFcWPEHd@pendragon.ideasonboard.com/