Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4126138pxb; Mon, 4 Oct 2021 18:11:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxExrNvXkZMMz7qkTATJnm6P5UyRnWyDLkpHD3l+OEmjob1uPnxdRY3D9GQ6lgyWJXYXF0 X-Received: by 2002:a05:6402:1a23:: with SMTP id be3mr22419261edb.372.1633396271695; Mon, 04 Oct 2021 18:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633396271; cv=none; d=google.com; s=arc-20160816; b=nsveJQPWIP06YdOXmIq9YEXThji0VxLxS1KewSOJdQ1ODDNaVb9MDq9NYKaJxXezLF cbT+GZ/j8R/rjh/0Zem/lB1gQR8gPyFDJmvn9uqdsFeAcpyXHzETvzYX70sz3H92x6L9 b34q+vNYHAYWsN3wvGqAbN+aBKb7J+Bypaum6V4jdmDIGgxv9abvEbn5qk8uD5uwqunh QMsYdYKPAOsplItvYLKoMMgsVE1YXOfdXrqVTXosS6CHj/HZDoWE3W+ykzwfjC87ypAh u1V0Xgz8e/2ZRMVFo/Uw9vmSAUf1A6twQFqaziJqHVR5CTER8xtN5+dBNMRrIugIYcbU m+9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PfzHBiZhKUhn0s0eLjPcHLmx5o0gtPl/KN/s/msn4zM=; b=triPWKUxa6ejdgTSYJbgheVpij7VrwRvdMApj4klVyxveyRFIlKB6Fgzx4HFEpAJ0v IbVjUBK0hDm03qGadaF2/gj+VJFybrlptULUBhAo/hPmNxPj1t4ytdm61yoYiLB4/qqK 8M1wr5uASi2OyXN984PoTlbfkpbEVLGp7NN4OAB/x/vb9vuIVwrCfqpSf3XcTv1oY1Th mHf6I4dWoPRmPTBRoIYMlQ1ETalzQVDr9DzZ5Z4hZmAkUHoQqulv6dZ8QLD0aLkttv3G 33g40/qDYPhXAd92hDPqyuCinxaqqvSkxq7W1f8n81h98zPSCbrmnMC5fH9seCnokwl3 OtEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UPGDqOoP; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o4si22265297edc.451.2021.10.04.18.10.48; Mon, 04 Oct 2021 18:11:11 -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=@linaro.org header.s=google header.b=UPGDqOoP; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbhJEBLT (ORCPT + 99 others); Mon, 4 Oct 2021 21:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhJEBLS (ORCPT ); Mon, 4 Oct 2021 21:11:18 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52F5C061745 for ; Mon, 4 Oct 2021 18:09:28 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id s24so24014485oij.8 for ; Mon, 04 Oct 2021 18:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PfzHBiZhKUhn0s0eLjPcHLmx5o0gtPl/KN/s/msn4zM=; b=UPGDqOoPD5Eh60p491rq2NQMsh4XnIw1wAOTdP0paZzAaQv8En+zQ2zpU2+6CL4cTm Ex1LvjY7TUhB2wJtQxG8ueeaEIWMgl/+KV4Iuqn2dgTupDBZTzvEIko/CKojD7oY60T4 cbcK7ocjBLyoV2H2tWPyOfzoryyW3Z3wK1N0lKj7c7pc7hilvFJKGiBxn9Kk4sR9pwMb WU+1QjXcsofiJUSMlIXvNcnx0bxf+xVB1XaDn1+VfgZNwCagNff21+KeDI5TTbBZZi5O VBGPFITZXfuWe3hzR8rLLatoLKOvMg3cfHfkR+Xibf3FOySpRIOJIBqlfo1kCZbjVJaA /m7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PfzHBiZhKUhn0s0eLjPcHLmx5o0gtPl/KN/s/msn4zM=; b=rBPHuzh2JarelEWEsFOsNLn/3QqT7IY0QzNult+s+XnEhTon2Z245YNZwU6aRzrIoe 3Kx8vnLDFEVt6MM/2f4A3/DX+mc/fU8H17YlEr93jee3lUYp5hf1yjkmyAqdJDn7EsN3 1Z2EBoPVzKTKusbrsKhDxi4A/RFu5yFBY8R3aJmWfN2pXZo+nfOCIUZ2TjkiXivakPHO jtypKMC6eJmLwFs23y/xb+KtnkseYdW5WZNnRBuhfuAniwXG9eUJBxtG3/yBc5Y993te dOdu8qunU1HqKDFd7PMC/c+jK+RwgEqywoJwJQ0WOP+SbQDNZOrfSiggINeeTaV8dG2F NuXw== X-Gm-Message-State: AOAM531annibiwJ5sVeDGnD4MGstiUK172yM2a2wwUuuFd31YvY1ACe+ VAtmuX6t0Xb376YIVKmGYryAHA== X-Received: by 2002:aca:1706:: with SMTP id j6mr232425oii.57.1633396168224; Mon, 04 Oct 2021 18:09:28 -0700 (PDT) Received: from ripper ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id o26sm3174520oof.32.2021.10.04.18.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 18:09:27 -0700 (PDT) Date: Mon, 4 Oct 2021 18:11:11 -0700 From: Bjorn Andersson To: Doug Anderson 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 Subject: Re: [RFC] drm/msm/dp: Allow attaching a drm_panel Message-ID: References: <20210726231351.655302-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Hope that clarifies my conundrum. Regards, Bjorn