Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3527511pxb; Mon, 4 Apr 2022 20:00:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4eezBKgvL+1sWFs9fwtDx9h/10ES6y0ENfZPN7GM1hz/xv9OdcCLv7RxdmBUlrAqYzg5x X-Received: by 2002:a17:902:d714:b0:153:2e9:3bcc with SMTP id w20-20020a170902d71400b0015302e93bccmr1332552ply.83.1649127655093; Mon, 04 Apr 2022 20:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649127655; cv=none; d=google.com; s=arc-20160816; b=EKfgxpegSAA0fmtVs7OrSn5j7dJeJZOZTYoyzfbeJ3+vmH7ZCf02BWL/qUHl+M9Ax/ htQXBrmr9XJtei/1t+U38ZnwrsC1d3NJ1v95FF7JYRqW+LmH4U1qGQgm8YMUUm848QNJ T/QfUJJhyfaKXWW+/okJWKCENlBJyGmL7eHk+xQMBXQS7ofEB9FVOl7tq1cO75XGCLBy n04KJZonoe6siMj6agPKHv/kyyFcciWIoXPu9o3EUim2ffcQd3TBFdjujPgTOGLQ8bvE 0XgQprjqqZugD+0NLasRzoc33ijlEphJydk5GIIsh47FlEvW1O57xkp0j/EKvJ8ckHQT o56A== 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=5VLKCCSpyLmISzla9N+/XjTX+JlDxz/a8/Khh5Jtd44=; b=pcKulw/zRd7YPDx2WaSCPjx8Lq/1Qy6WL7SUFtkSgaOXIBsL6aD4Htwm2E6YoswzDu mvE+Tfjp+AtflGJLywRb9pgZk1VRieuFB2GnoYbszwKwJck11fpIanu9ip+oZAK5YSo6 xsbAlgM8yx48E+YZnT21nw7AZQPBXrusI7my71ufOEF4mQS8poFy0YcUUrCr7AQGXajc BQgnFxehxpD3R7DobCvqzOJizUgJaVHVWl/++XU+iKRuuUur9r963V2O9AGp3tScWL6l ckhFnUC+Awmx+dJivgKJa7o4+NaDIbCWYLH4eKPCxgZRdBWUMMNgKWIna0BxWt4VVhgv B+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EBQqUAyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x8-20020a170902ec8800b00153b2d164c0si12305830plg.200.2022.04.04.20.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EBQqUAyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 338E22E9BFB; Mon, 4 Apr 2022 18:25:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358683AbiDBRIe (ORCPT + 99 others); Sat, 2 Apr 2022 13:08:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357201AbiDBRIc (ORCPT ); Sat, 2 Apr 2022 13:08:32 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E835DE91A for ; Sat, 2 Apr 2022 10:06:40 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id a17so6337487edm.9 for ; Sat, 02 Apr 2022 10:06:40 -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=5VLKCCSpyLmISzla9N+/XjTX+JlDxz/a8/Khh5Jtd44=; b=EBQqUAyAT2mFgxAKYH2mUSOPgB8C0WKxoSl2rV5zFX5XrqYk/q4IfaW3dN8mTnyRaK 6GqdOmrmI+L2/7nD1BufbrQsZ9zwdhDQ43hGb4cJD8bbwF4a2c0hp1ZpB2K0ikTBCCm1 Qas1Q/6mJyz1+zmx9g8I5NTiOnNndaJ0Fh+pg= 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=5VLKCCSpyLmISzla9N+/XjTX+JlDxz/a8/Khh5Jtd44=; b=5m1Ixt6fh8uBwmCBb1X5lnzxNV6k/bleLeHloOmKrUrMHUSiy3DwpY5M5ZFrLtQIpW MPpyNcqIq8Wljhg8PFi4GlpAmkjhFyKVicSnlF2tyBm8j9MvgQJO2YVx/VxDd3c8Syoa aRxSEOPVMjYcitRgJksuAeA/CcgLshEOt7GmGuhuv0yP9b3ipCaJdKlYRZs9dlVWgQ04 3+OAi9OuGhiQoHiRFd8cRRVt3ZzYKLFec5Sw+sP3CqwOxzJApWjJeENd6SqYRnOkijOk 9GjhHwVlqoz9g9w/ZTa9MCmLuRVw6ioGu60A9+Kg0gJ2nREZBuTbm5Lm6x6C0U7vtBsE dDfg== X-Gm-Message-State: AOAM531J7lXcL//sGX71DJRp0YyG1XKlKzAPyxzmFu7YFP1F+H8/iYnI a/CrLrUG7dan+tncF9uu7KOWUJEk9oCI8g== X-Received: by 2002:a05:6402:1d4a:b0:419:7c50:dcbf with SMTP id dz10-20020a0564021d4a00b004197c50dcbfmr25612360edb.340.1648919198897; Sat, 02 Apr 2022 10:06:38 -0700 (PDT) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com. [209.85.221.42]) by smtp.gmail.com with ESMTPSA id i30-20020a1709067a5e00b006df6f0d3966sm2307837ejo.189.2022.04.02.10.06.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Apr 2022 10:06:38 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id j12so786654wrb.5 for ; Sat, 02 Apr 2022 10:06:38 -0700 (PDT) X-Received: by 2002:a5d:5551:0:b0:203:f916:e319 with SMTP id g17-20020a5d5551000000b00203f916e319mr11736269wrw.422.1648919197780; Sat, 02 Apr 2022 10:06:37 -0700 (PDT) MIME-Version: 1.0 References: <1648656179-10347-1-git-send-email-quic_sbillaka@quicinc.com> <1648656179-10347-2-git-send-email-quic_sbillaka@quicinc.com> <392b933f-760c-3c81-1040-c514045df3da@linaro.org> In-Reply-To: <392b933f-760c-3c81-1040-c514045df3da@linaro.org> From: Doug Anderson Date: Sat, 2 Apr 2022 10:06:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus To: Dmitry Baryshkov Cc: Sankeerth Billakanti , dri-devel , linux-arm-msm , freedreno , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Clark , Sean Paul , Stephen Boyd , quic_kalyant , "Abhinav Kumar (QUIC)" , "Kuogee Hsieh (QUIC)" , Bjorn Andersson , Sean Paul , David Airlie , Daniel Vetter , quic_vproddut , quic_aravindh@quicinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi, On Sat, Apr 2, 2022 at 3:37 AM Dmitry Baryshkov wrote: > > On 01/04/2022 02:22, Doug Anderson wrote: > > Hi, > > > > On Wed, Mar 30, 2022 at 9:03 AM Sankeerth Billakanti > > wrote: > >> > >> @@ -1547,6 +1593,10 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, > >> > >> dp_display->encoder = encoder; > >> > >> + ret = dp_display_get_next_bridge(dp_display); > >> + if (ret) > >> + return ret; > > > > It feels weird to me that this is in a function called "modeset_init", > > though I certainly don't know the structure of the MSM display code > > well enough to fully comment. > > It's called modeset_init() as it initializes KMS objects used by DP > driver. We have similar functions for dsi and hdmi Sorry, I wasn't meaning to imply that modeset_init() was a bad name or anything. Mostly saying that I wasn't sure that modeset init was the proper time to populate the aux bus. ...but then again, perhaps it is given the current structure of this driver? > > My expectation would have been that > > devm_of_dp_aux_populate_ep_devices() would have been called from your > > probe routine and then you would have returned -EPROBE_DEFER from your > > probe if you were unable to find the panel afterwards. > > I don't think it's possible to call it from probe() since > drm_dp_aux_register() is called only from dp_display_bind(). > The PHY also isn't initialized at that moment, so we can not probe AUX > devices. > > The overall semantics of the AUX bus is not clear to me. > Typically the bus is populated (and probed) when devices are accessible. > But for the display related buses this might not be the case. In general the AUX bus is modeled much like the i2c bus. You probe the sub-device when you're able to transfer. Then you can confirm that the device is actually there and init the device. > For example for the DSI bus we clearly define that DSI transfer are not > possible before the corresponding bridge's (or panel's) enable call. > > Maybe the same approach should be adopted for the AUX bus. This would > allow us to populate the AUX bus before hardware access is actually > possible, thus creating all the DRM bridges before the hardware is > actually up and running. So I guess what you're proposing is that you could probe the devices under the AUX bus and they could acquire resources (and possibly return EPROBE_DEFER) at a point in time _before_ it's actually possible to transfer. Then I guess you'd later do the transfer? I guess conceivably one could re-design the DRM subsystem like that, but I don't think it's trivial. Why? I believe that we need to know things about the panel at probe time. For instance, we need to be able to populate the panel's modes. To get this information we need the EDID which means we need to be able to do a transfer. If we're using an AUX backlight we also need to add info about the backlight at probe time and that also needs the transfer to work. So I guess the net result is maybe we should just keep it where it is. Long term I'd be interested in knowing if there's a reason why we can't structure the driver so that AUX transfers can happen with less intertwining with the rest of the code, but that can happen later. I would expect that you'd basically just need clocks and regulators on and maybe your PHY on. Ideally with some pm_runtime fun we should be able to do that independently with anything else the driver needs to do? -Doug