Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4800855pxb; Tue, 5 Oct 2021 10:34:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygCQ8bEiGRk94QVTI3qzAqPzkPyOR4F7GtZ362iGuNfDyvMJNOdacO3L1UtxnosAxHolUx X-Received: by 2002:a17:902:a710:b029:12b:9b9f:c461 with SMTP id w16-20020a170902a710b029012b9b9fc461mr6342200plq.59.1633455292046; Tue, 05 Oct 2021 10:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633455292; cv=none; d=google.com; s=arc-20160816; b=jSni0qv55kzkTS6iHgbb4deB6lUUh5fcZZPvhNPekJwYHMbzPwvUXjTaixphdjNj8i Mvxwm+0Hn/t/lGFzgCeYKEILpJFAp/UFcgZXD+ndkH0T0yb+NFaVIjgXgZm1IZdnlUsi G3IoP81JAD/h57AxOQVjfxzlO9WP5IjS83im2enAsW+xjG44FcsJkB9SJJCCJB2rKqBy EufJJSlAUr2X/Orq3EkuikVEDOOqhNVQBnIQru5QBay4WLsQVm6S68yzxYPaI41qwzp4 4fkRPz4YW6sIzRyRPgw9H0/8JbZprUtkhL75QYU8zVzw2oXPDVVI+Mie5RrqZihS45b4 4dIg== 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=71HyGq5jsXAg+sz6VrDwqjua1AYi4Yt0h0vLPVrLYyc=; b=x0cOgl29GStkzZsW78cmqV4Aq3FssElsA+MgJKBLe9UtYM86ieoOusJRiRqKT1hjHa s5G0YCrAG1+3uac6cKCmCGxFByiIDJIoNr5IbGVz31uEh49JnLi584w4BkonyUA/Gg12 7emyNyh5eSP4W1H6tM6o1av8Hgv88Ox4N8xcbwCq8Aze6Y7W7C2DomoQjiE0jvRzIUOn wbIOD6xZkwTCvvTxjB3bJam0zEiY/VxI4QbZFEzYr9uCtGwVMwaE24yGgwgmhbvc1pvY zMv3Ljp4bKPtr6iaXDCTs69JsgAPm7zXx5CsxQ5e4B1mkhQDTvoJGmu9fMzyYeC57dGB jK1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VnWFO8fe; 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 z21si26250754pgv.564.2021.10.05.10.34.38; Tue, 05 Oct 2021 10:34:52 -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=VnWFO8fe; 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 S234724AbhJERfK (ORCPT + 99 others); Tue, 5 Oct 2021 13:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234723AbhJERfI (ORCPT ); Tue, 5 Oct 2021 13:35:08 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AA88C06174E for ; Tue, 5 Oct 2021 10:33:17 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id n64so304223oih.2 for ; Tue, 05 Oct 2021 10:33:17 -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=71HyGq5jsXAg+sz6VrDwqjua1AYi4Yt0h0vLPVrLYyc=; b=VnWFO8feQ/jKEVNNYcCNDgAAFbjuPqav1DCKCE9RS6Bp1XdLPhtam4xcpTf/CpbsSc sinYpgamBHCflpT7bzw8WIfJEuxLdPEHmYh5wao0uqEsHHJ++9P/kORPaXtY8dmQK/El Ux06+7ABy1HOzZj/rOyETgeQkA65BgnrbBhzPw+CjK75rnN32pdEKiVj0rVK+VacAGq5 ZwLEa9IZ6fhtgVRR1hdLKPrT5OkI3XfbnQnlf/LZ0OmrqkSKWUuHXFaMFdO8+4dUJGmC fsmaRyXKuHdNnKr/WD6JJNWQsJyyl6XjVMU+F/3Zxjkh+2i/odHMHUnjQO+x4QhJIBGy MliA== 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=71HyGq5jsXAg+sz6VrDwqjua1AYi4Yt0h0vLPVrLYyc=; b=CeU0fP6NCLk5Fy0xqzK/ZqJvZKtsqcEI2l0AXH4ftiYkEJRJmbceRllBP0MO/J720c Exo8fWIPDvjcma8uVGrXqBpe+DtRA/qRsZlYWLgK1JzHgUU26ZnY3B/qSTWyM/LrOKy2 Pltg+co/O3fHerzUj+mkb9xmSj1vKhNLgXEsyCqjY+6kNgbse5m5KMP/fBXpfWN7QShW F14wdll5u9zyVbHINNU67jJaYSA5iOShkUvrLx0LoWEE8eroGGECeOQdFQZksjHG26rC F8x6bF5F3UT4akM3/5QDuCVwDvVTcct92Gmtv095pp7j/IN88ZJATs0VVs8jw0YbntXi q9RQ== X-Gm-Message-State: AOAM532p1IvrQL2evG01Q6daPh1uIfbv7RHoL/CxQ4zuYx6AFj6K34q/ t2LfnrdyaOlWgxGmMnWELLwLPQ== X-Received: by 2002:a05:6808:187:: with SMTP id w7mr3646625oic.140.1633455196519; Tue, 05 Oct 2021 10:33:16 -0700 (PDT) Received: from ripper ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id d4sm3664803oth.47.2021.10.05.10.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 10:33:16 -0700 (PDT) Date: Tue, 5 Oct 2021 10:34:58 -0700 From: Bjorn Andersson To: Doug Anderson , Laurent Pinchart 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 Tue 05 Oct 08:39 PDT 2021, Doug Anderson wrote: > 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" > All this seems to make sense for both eDP and "native" DP. > 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? > But I don't have a DisplayPort connector. I have a USB-C connector, that upon determining that it's time to play DisplayPort will use the typec_mux abstraction to tell someone on the other side of the of_graph about DisplayPort events (HPD). So where would I put this drm_bridge in the USB-C case? I don't see that it fits in the Type-C side of things and putting it on the DP side would leave us with exactly the problem we have here. So we would have to put a fake "DP connector" inbetween the DP node and the Type-C controller? For reference, this is how I thought one is supposed to tie the Type-C controller to the display driver: https://lore.kernel.org/all/20211005022451.2037405-1-bjorn.andersson@linaro.org/ I'm afraid I must be missing something in Laurent and yours proposal (although I think Laurent is talking about the native DP case?). Regards, Bjorn > [1] https://lore.kernel.org/r/YUvMv+Y8tFcWPEHd@pendragon.ideasonboard.com/