From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DC2AC433F5 for ; Wed, 27 Apr 2022 12:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235180AbiD0NCn (ORCPT ); Wed, 27 Apr 2022 09:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235103AbiD0NCi (ORCPT ); Wed, 27 Apr 2022 09:02:38 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390FF4CD64 for ; Wed, 27 Apr 2022 05:59:27 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id y3so3198687ejo.12 for ; Wed, 27 Apr 2022 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LDmJp5Whp8dmiIhAKFOdeRxPyoTu+bfhB5tptGx09HE=; b=K4S0rAP9lJ862776psIkLpwKBo+nn/e4mEFZkcbquLCnaqGCrJU59iqV3dfOIFdh/G zWZKaT3UAZqEGVfzw2zJsyxhRWthe1I2zoBlZ4t2ZtIOBIdHjBsT3fEn8d6bf4yLT/gW N4ZcGFwyp7xUVA49I9ZYumzPtsip5hnoK7eXw= 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=LDmJp5Whp8dmiIhAKFOdeRxPyoTu+bfhB5tptGx09HE=; b=LyJv0dS2Fm8WwRosfQi5zNREiSIdzzihcX/qjU0+wZUn/m4MlKhQJR1UeSb6yIIPFf ARtQAABiB1wjaB+MHqodswQ5MxBPTEb1sHKc0FwRrR7hgXoazY2BLxwxk+rZT/bFbmgf /YLdKJqm2fhUArhkLAP3qK56udVEa3dbYO5QTFgqoH2PsRIn0lrDXwZwyS1uzppbstnc jRB1NwmVgxRA9dlETcJa9u2SBoG5X+adS2zN033KrHzwIHoogLO+5e8fnTxZ+gzQj5sf 5VN1oRAwWIvHQrIiJw0AjJwFmxY5LtCcCBqKABQutbucOFeHvalsQ/F+9fnYnoQJmC9E boIw== X-Gm-Message-State: AOAM532eAPSgStsra5YQp0BE+sQY0JPgrxHIlzT0hJpw1tzAlW5ulBYE 0kLiKw5J7bBqia26S6YZ8nI38c/18FGh7CYssUhQdw== X-Google-Smtp-Source: ABdhPJx85svbNMmRdxdVllL14VDSpMLFHkEO+pHyAu218rBgoFHo2Rfwxf/WsB6BpXdKawskZgUeKZjUGhuPjw7j9IU= X-Received: by 2002:a17:907:7287:b0:6f3:8414:74f1 with SMTP id dt7-20020a170907728700b006f3841474f1mr18237119ejc.123.1651064365737; Wed, 27 Apr 2022 05:59:25 -0700 (PDT) MIME-Version: 1.0 References: <20220420231230.58499-1-bjorn.andersson@linaro.org> <20220420231230.58499-2-bjorn.andersson@linaro.org> <20220421082358.ivpmtak3ednvddrc@houat> In-Reply-To: From: Jagan Teki Date: Wed, 27 Apr 2022 18:29:14 +0530 Message-ID: Subject: Re: [PATCH 2/2] Revert "drm: of: Lookup if child node has panel or bridge" To: Paul Kocialkowski Cc: Maxime Ripard , Bjorn Andersson , Laurent Pinchart , Michael Nazzareno Trimarchi , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Thierry Reding , Rob Clark , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Linus Walleij , Marek Szyprowski , Robert Foss Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On Wed, Apr 27, 2022 at 5:49 PM Paul Kocialkowski wrote: > > Hi Jagan, > > On Wed 27 Apr 22, 17:22, Jagan Teki wrote: > > On Wed, Apr 27, 2022 at 12:29 PM Jagan Teki wrote: > > > > > > On Thu, Apr 21, 2022 at 1:54 PM Maxime Ripard wrote: > > > > > > > > On Thu, Apr 21, 2022 at 01:15:54PM +0530, Jagan Teki wrote: > > > > > + Linus > > > > > + Marek > > > > > + Laurent > > > > > + Robert > > > > > > > > > > On Thu, Apr 21, 2022 at 4:40 AM Bjorn Andersson > > > > > wrote: > > > > > > > > > > > > Commit '80253168dbfd ("drm: of: Lookup if child node has panel or > > > > > > bridge")' attempted to simplify the case of expressing a simple panel > > > > > > under a DSI controller, by assuming that the first non-graph child node > > > > > > was a panel or bridge. > > > > > > > > > > > > Unfortunately for non-trivial cases the first child node might not be a > > > > > > panel or bridge. Examples of this can be a aux-bus in the case of > > > > > > DisplayPort, or an opp-table represented before the panel node. > > > > > > > > > > > > In these cases the reverted commit prevents the caller from ever finding > > > > > > a reference to the panel. > > > > > > > > > > > > This reverts commit '80253168dbfd ("drm: of: Lookup if child node has > > > > > > panel or bridge")', in favor of using an explicit graph reference to the > > > > > > panel in the trivial case as well. > > > > > > > > > > This eventually breaks many child-based devm_drm_of_get_bridge > > > > > switched drivers. Do you have any suggestions on how to proceed to > > > > > succeed in those use cases as well? > > > > > > > > I guess we could create a new helper for those, like > > > > devm_drm_of_get_bridge_with_panel, or something. > > > > > > I think using the same existing helper and updating child support is > > > make sense, as there is a possibility to use the same host for child > > > and OF-graph bindings. > > > > > > I can see two possible solutions (as of now) > > > > > > 1. adding "dcs-child-type" bindings for child-based panel or bridge > > > 2. iterate child and skip those nodes other than panel or bridge. or > > > iterate sub-child to find it has a panel or bridge-like aux-bus (which > > > is indeed hard as this configuration seems not 'standard' i think ) > > > > > > Any inputs? > > > > Checking aux-bus with the sub-node panel can be a possible check to > > look at it, any comments? > > That looks very fragile and oddly specific. Also why base changes on the > original patch that you made? It is just showcased a snippet to check the child's conditions. > > With the follow-up fixes, we are checking the of graph first and only > considering child nodes if the of graph and remote are missing, so there isn't > really a need to be more specific in the child noise discrimination. So, does it handle child panel or bridge finding? just keep in mind the same call from the host need to handle with and without OF-graph representation. > > Actually I should also make a new version of "drm: of: Improve error handling in > bridge/panel detection" to also return -ENODEV if of_graph_get_remote_node > fails, so that it doesn't try to use the child node when the graph is defined > but not remote is defined. Jagan. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E33E9C433F5 for ; Wed, 27 Apr 2022 12:59:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8CEF10F428; Wed, 27 Apr 2022 12:59:28 +0000 (UTC) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43A6910F428 for ; Wed, 27 Apr 2022 12:59:27 +0000 (UTC) Received: by mail-ej1-x631.google.com with SMTP id l7so3267723ejn.2 for ; Wed, 27 Apr 2022 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LDmJp5Whp8dmiIhAKFOdeRxPyoTu+bfhB5tptGx09HE=; b=K4S0rAP9lJ862776psIkLpwKBo+nn/e4mEFZkcbquLCnaqGCrJU59iqV3dfOIFdh/G zWZKaT3UAZqEGVfzw2zJsyxhRWthe1I2zoBlZ4t2ZtIOBIdHjBsT3fEn8d6bf4yLT/gW N4ZcGFwyp7xUVA49I9ZYumzPtsip5hnoK7eXw= 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=LDmJp5Whp8dmiIhAKFOdeRxPyoTu+bfhB5tptGx09HE=; b=V7+hszHITZWhoNSW6MPsbvLTjWbI/dN0IrH690KM/CkSVq6KUDrpYa+wIuEbQd4iao O6dBq2SGJSho9dVdsCZir62h1zV/LQLe/vE0rfbWwhq+uVRv1uUOfym7KREniRFHUOmF vsOLk+1pFifWDCJpCUmt3zLvMzLLBmlmWjoovjY00vq0ZROE64EkTonuaxS46BmVwkku QghtCH6k7R0hwyg/gI0iLDe+Sc37NDl6SsjBMB14OljlAk87z4tixhA+qUz2M6pYerfC IbY98YY/6sDPCYxf7xa19v83wtyN/6GUjMWDxKrjTWVkt80WELvCEFtLdX2KodxvSz6f Geiw== X-Gm-Message-State: AOAM531YFsrzzdNof0YFo17G1SRI1A3ZHDiY1Jw3+3qnGO8uobfPePG4 LETV4B9nCZxWHV953Xpu3cuh8qc9l8bQ05PHFHurjw== X-Google-Smtp-Source: ABdhPJx85svbNMmRdxdVllL14VDSpMLFHkEO+pHyAu218rBgoFHo2Rfwxf/WsB6BpXdKawskZgUeKZjUGhuPjw7j9IU= X-Received: by 2002:a17:907:7287:b0:6f3:8414:74f1 with SMTP id dt7-20020a170907728700b006f3841474f1mr18237119ejc.123.1651064365737; Wed, 27 Apr 2022 05:59:25 -0700 (PDT) MIME-Version: 1.0 References: <20220420231230.58499-1-bjorn.andersson@linaro.org> <20220420231230.58499-2-bjorn.andersson@linaro.org> <20220421082358.ivpmtak3ednvddrc@houat> In-Reply-To: From: Jagan Teki Date: Wed, 27 Apr 2022 18:29:14 +0530 Message-ID: Subject: Re: [PATCH 2/2] Revert "drm: of: Lookup if child node has panel or bridge" To: Paul Kocialkowski Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Robert Foss , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , Thierry Reding , Laurent Pinchart , Thomas Zimmermann , Marek Szyprowski , Michael Nazzareno Trimarchi , Maxime Ripard Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Paul, On Wed, Apr 27, 2022 at 5:49 PM Paul Kocialkowski wrote: > > Hi Jagan, > > On Wed 27 Apr 22, 17:22, Jagan Teki wrote: > > On Wed, Apr 27, 2022 at 12:29 PM Jagan Teki wrote: > > > > > > On Thu, Apr 21, 2022 at 1:54 PM Maxime Ripard wrote: > > > > > > > > On Thu, Apr 21, 2022 at 01:15:54PM +0530, Jagan Teki wrote: > > > > > + Linus > > > > > + Marek > > > > > + Laurent > > > > > + Robert > > > > > > > > > > On Thu, Apr 21, 2022 at 4:40 AM Bjorn Andersson > > > > > wrote: > > > > > > > > > > > > Commit '80253168dbfd ("drm: of: Lookup if child node has panel or > > > > > > bridge")' attempted to simplify the case of expressing a simple panel > > > > > > under a DSI controller, by assuming that the first non-graph child node > > > > > > was a panel or bridge. > > > > > > > > > > > > Unfortunately for non-trivial cases the first child node might not be a > > > > > > panel or bridge. Examples of this can be a aux-bus in the case of > > > > > > DisplayPort, or an opp-table represented before the panel node. > > > > > > > > > > > > In these cases the reverted commit prevents the caller from ever finding > > > > > > a reference to the panel. > > > > > > > > > > > > This reverts commit '80253168dbfd ("drm: of: Lookup if child node has > > > > > > panel or bridge")', in favor of using an explicit graph reference to the > > > > > > panel in the trivial case as well. > > > > > > > > > > This eventually breaks many child-based devm_drm_of_get_bridge > > > > > switched drivers. Do you have any suggestions on how to proceed to > > > > > succeed in those use cases as well? > > > > > > > > I guess we could create a new helper for those, like > > > > devm_drm_of_get_bridge_with_panel, or something. > > > > > > I think using the same existing helper and updating child support is > > > make sense, as there is a possibility to use the same host for child > > > and OF-graph bindings. > > > > > > I can see two possible solutions (as of now) > > > > > > 1. adding "dcs-child-type" bindings for child-based panel or bridge > > > 2. iterate child and skip those nodes other than panel or bridge. or > > > iterate sub-child to find it has a panel or bridge-like aux-bus (which > > > is indeed hard as this configuration seems not 'standard' i think ) > > > > > > Any inputs? > > > > Checking aux-bus with the sub-node panel can be a possible check to > > look at it, any comments? > > That looks very fragile and oddly specific. Also why base changes on the > original patch that you made? It is just showcased a snippet to check the child's conditions. > > With the follow-up fixes, we are checking the of graph first and only > considering child nodes if the of graph and remote are missing, so there isn't > really a need to be more specific in the child noise discrimination. So, does it handle child panel or bridge finding? just keep in mind the same call from the host need to handle with and without OF-graph representation. > > Actually I should also make a new version of "drm: of: Improve error handling in > bridge/panel detection" to also return -ENODEV if of_graph_get_remote_node > fails, so that it doesn't try to use the child node when the graph is defined > but not remote is defined. Jagan.