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 7E758C433F5 for ; Mon, 30 May 2022 11:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235878AbiE3Le5 (ORCPT ); Mon, 30 May 2022 07:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235740AbiE3Lez (ORCPT ); Mon, 30 May 2022 07:34:55 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E84FC80229 for ; Mon, 30 May 2022 04:34:53 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id c62so10543635vsc.10 for ; Mon, 30 May 2022 04:34:53 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=5MClguokXHuzrGIeuiJRCGePayCXHD5nXxS4gLpBzPGEH/VlKr4DD0FNZJg1rWjVIh FkN71+jbV0h3ukAVGyHU6UaWE+IUMFoGAmpkymjag/pib6c4Yd3pQIV6T+truWqXBRMJ vRmrqm3YD/ChA/1rUAGUZuEewLJtJ0nIYhrRiesVpxAD0k/83m9llGXAXSvOeRkRx6WB 5LH0H1x+DcedhyCuDFXjFKaEZXsvtZzm/gsMQKE83dCm0BIlC8CpAVPyRyUAu0FHwvXG 0KQ04Rmp4ozNFyfOOJGsfkXwrydrtDtcNLYovWVnxKJ+d2fQBcvZBvcLooE9sCZQswNb 4Mbw== X-Gm-Message-State: AOAM533fsYRAB5mfHw+IVZ1ZyiEzF5JobpH7RM8JAficzocE7vwQNq6O 5KjPtvM3ByrWIuxxjSS9FMvutujZpgErSRF+d6f/XQ== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: Subject: Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting To: Hans de Goede Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Rob Clark , Stephen Boyd , Douglas Anderson , Chun-Kuang Hu , Sean Paul , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-kernel@vger.kernel.org, Rob Herring , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Simon Ser , Harry Wentland , Alex Deucher , Jani Nikula , Emil Velikov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > > 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A59BDC433F5 for ; Mon, 30 May 2022 11:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oZN2AGJ+ze4m0h/d+u4j86IgaodOxMXGv4K+RFV0HzQ=; b=z4wvueaKCcza8/ zpyhtt3po/K/13q3FyjBNXacez6tQrR+VKxPrBW2Jls+xPae+ZOau4MOdUu7j5XuQf5Hf6/UKGMuB 3ZPMmU3iqAZ1Z/HfMwKeQvQKJCxSk5CPXFZdvid1OSagPSSHzWp9Q0gkLAxnUzWZySwIJmCHc6LiC ZX2+S4tPCNSv4NrwRec7qxVlfOQVUTrmhoKTNZ5c0jZEIJjRqED+0JWCh18Rch2KqUgIOS0KitaQN zZ5HPrCC6PbG5rcDV8ZhgtHSfIi+UAh30hqdRHxrLgAZ93FBMEhwE/4NoNS7yZJj7ws5SS/uNgBUx rS5eGl3/ALES4huTF49g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvdfl-006N1e-K6; Mon, 30 May 2022 11:34:57 +0000 Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvdfi-006Mzh-JG for linux-mediatek@lists.infradead.org; Mon, 30 May 2022 11:34:56 +0000 Received: by mail-vs1-xe29.google.com with SMTP id j7so10545855vsp.12 for ; Mon, 30 May 2022 04:34:53 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=XtM8/e9Tw4+zNin0PjSkfWP9N1EEBib6+RpVlWt7gaQ5PVW+5mgyc9UXrhJDlM3KJE pKuHztZgHaZMInb4WEA+Ng27q8M+pWwVSOfV3Gh5sQ4CI5e6IdJpLSPClMi2K6gEAkAu icAq0RD76W9RZ7B16RIWpxIJ7YdYvhBzzUCnimTIeJYbHXlVnnwerOGUMnBA42DYsTeT N9elbucmTe46WZ3VCV0luGFJoCdO7yT6SRDTYudpZFEFJKYImH7Xs9tO0GGy3WH6hMpX fd2T5ruWLo23/1x5H2NnlmPRxBREdtcGJ0bGfOd2PkC39Agljcq+uFr19v53C1e4fJNt KFzg== X-Gm-Message-State: AOAM530e1XtDqGLRG2VQCiGobEsstkZn0BJxe40GGeVKYAMzHaYxaUcZ DmeHWXnnLhShDhtqJf9RF8Tyx3OCkfZfABuYClSQEQ== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: Subject: Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting To: Hans de Goede Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Rob Clark , Stephen Boyd , Douglas Anderson , Chun-Kuang Hu , Sean Paul , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-kernel@vger.kernel.org, Rob Herring , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Simon Ser , Harry Wentland , Alex Deucher , Jani Nikula , Emil Velikov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_043454_720747_DEEEEF55 X-CRM114-Status: GOOD ( 28.11 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 6C674C433F5 for ; Mon, 30 May 2022 11:34:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC8F010E357; Mon, 30 May 2022 11:34:54 +0000 (UTC) Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12F3510E50D for ; Mon, 30 May 2022 11:34:54 +0000 (UTC) Received: by mail-vs1-xe35.google.com with SMTP id h4so10548265vsr.13 for ; Mon, 30 May 2022 04:34:54 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=yYb5aCiZzHrsFcCmg0Hk5INF+BPrkkaPMNpLnPEpJLETYmcgFmLzs+UZVcRBTkat8U HWHiRHka2tva1G4t7UC/pjXFlEs1JjMlARgRF1oqiH9NHfNPPZ2lEF+x1uujPvI3NXVE zL5TTMCWso4DRZxyKxTw2NzXDTcF5txKZhTy6kX2kWbyj9xb4S+gdzSB4woUbDymy4Jm hOCVlMHZlKupQ5WedWlyMte/bYBterQp+7tUe3CfgvXaHzx5MPp14vqUddzkq2k0++Je QmSG7nwcy/Zv/LYxnio9Vd4nvyQxA4k9Ce5D9QkyzOoCDaBA5pBcVO+ef0Vekj5p0bw7 oGbA== X-Gm-Message-State: AOAM530vNX1Nob5waStGfrlmbst+5tUVkxkRSTQxeTUTJuKRNOrhN7JJ NTtwdwLGmtNprpvnV1mrjzDoNuZZPr0y5S7awfpO5g== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: Subject: Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting To: Hans de Goede 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: devicetree@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Clark , amd-gfx@lists.freedesktop.org, Chun-Kuang Hu , intel-gfx@lists.freedesktop.org, Stephen Boyd , Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Sean Paul , linux-arm-kernel@lists.infradead.org, Emil Velikov , Douglas Anderson , Thomas Zimmermann , Alex Deucher Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > > 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 11377C433F5 for ; Mon, 30 May 2022 11:34:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3209B10E416; Mon, 30 May 2022 11:34:55 +0000 (UTC) Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12F1010E416 for ; Mon, 30 May 2022 11:34:54 +0000 (UTC) Received: by mail-vs1-xe35.google.com with SMTP id z6so10587489vsp.0 for ; Mon, 30 May 2022 04:34:54 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=j5lXHg15zTilt+8vwFRbsg4QCodPvYBr6BG5XCkZJu+xVTUGONxldj8j4Zjg9Uxgwl YlnvW6lvZtfK5+5U0lYekp/OfMwFU4R6+llw1IbLye4jzOVnnw500PK3K9R5TAH3Q7wz jxm4nqbfLYv6aDGkcNf6shHecDcjeCeKRMNFroLL77BqdQF8UBz210Nbs6nJ4f9msaqQ ZkjDuPyH0rlnyqSpRP47LdXHBhBLUjzjATtcrmpOt2Q06ie2yywa+yLjFkpgsDujiZLD v44oPbMaIm0qANgKBw3bzfNGBOLHRoJjekxkznm/HDg4ywJNmJJ32SJIeJsfGBb0DnbF svzQ== X-Gm-Message-State: AOAM531nsidFkL6EgJjbs9Kgay9MuVP1pls3XGpbHXBOThnhvKB5Eb4i x3HDdd29Y98lWnq9V5Q27EhtiJsZYVjpAMOraNewuw== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: To: Hans de Goede Content-Type: text/plain; charset="UTF-8" Subject: Re: [Intel-gfx] [PATCH v10 0/4] Separate panel orientation property creating and value setting X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Clark , amd-gfx@lists.freedesktop.org, Harry Wentland , Chun-Kuang Hu , intel-gfx@lists.freedesktop.org, Maxime Ripard , Stephen Boyd , Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, Simon Ser , Douglas Anderson , Thomas Zimmermann , Alex Deucher Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > > 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1826AC433EF for ; Mon, 30 May 2022 11:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zV83Ic3sSvjQ+jx+lyrqFXuEDVEsz5USJQ02HuWV9Sw=; b=Sq5ybUReHwFj5Y t7WRBbpbIyw5YrqcRTVrjtiUPTwX/rZWr3w5uAHyB6swaO2arCBsKnTT1uvs4nJpDuTLU3HxddSFv 2O8wMJhCQokII6wmDzBq6OIC+PTjxV6w4cOQefaFHNPZgxcqQDJA3eOQkwzc01FO6fl6rGRYile+s IYaEof3xj6GjvDUFo/4dZBFELc3zv8r+MnTXcfnLQp6wRc0JzjOmN1W3ilWN6pF6a4n7bq7NtAjma nPkj/YoJajBCTANwJq9ruWfJFH+62eym7yvM9sNwXRJ7HwjKRji/KhTyXNW+xdeqWe4H9sYh5oOoK 1DEwTKumdwkfDu+h/ZyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvdfn-006N2F-5k; Mon, 30 May 2022 11:34:59 +0000 Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvdfi-006Mzg-JG for linux-arm-kernel@lists.infradead.org; Mon, 30 May 2022 11:34:56 +0000 Received: by mail-vs1-xe29.google.com with SMTP id m2so10553036vsr.8 for ; Mon, 30 May 2022 04:34:53 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=eZSBfsiPH1aBQxy35wcmt8TTvKlM1bao5ckbnH78lAnuygiIV/CtZRMriZMKTSGbAh ypVhpK2ZNq+SIzm81n7qBrRwrGzkJUmXs2VHEC7VvspfjK4tjFBcAV1Iyj7n08RwrnyS +68wEMQYVsDVzNGnbvKxdIPZrOErh7IIqzel5xyH4IFCA+grXMDlnfk3IVBkrym3lw3T aZOw3bw8OOnn1lNo8DuQ3iJtSN4XlQR0wKs5uC7zFnOCYa/5yJt2iR0Am+ad1WJRZ5CR 9MAY33R+3yMRE5VYQPvPVr9hcywkl+Dn6zUvBpa8PSLHrpXM2mqlH5iYLDRJwfoBlr/4 8b4A== X-Gm-Message-State: AOAM532kCkPzaAyH76UklMvDABNBiczWjy1yloyn4Xv2L65AdPP/ZEb5 G+OKbv1qgPbst6ZgVJAHhKDLU7LyXPbND1btDfNqSg== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: Subject: Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting To: Hans de Goede Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Rob Clark , Stephen Boyd , Douglas Anderson , Chun-Kuang Hu , Sean Paul , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-kernel@vger.kernel.org, Rob Herring , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Simon Ser , Harry Wentland , Alex Deucher , Jani Nikula , Emil Velikov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_043454_728936_550AAA6B X-CRM114-Status: GOOD ( 29.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 9B15CC433FE for ; Tue, 31 May 2022 07:45:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D48310F575; Tue, 31 May 2022 07:45:35 +0000 (UTC) Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EEB210E357 for ; Mon, 30 May 2022 11:34:54 +0000 (UTC) Received: by mail-vs1-xe36.google.com with SMTP id h4so10548266vsr.13 for ; Mon, 30 May 2022 04:34:54 -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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=nylRUfykXAR4BPxN2kUQcQBx4UFaWucm9OU50Q26J8eVjUxEfey2e3vXkpeXlJPdBw yk04wEP2nFeCYhiVSzO2zQEQN7BleasMfad4K+q10YYI80QpMv9sXRHHxhDiw+J4mjqe y47MsyfOZhDnFZ0lbA46oIfYX2KDrn8RZ59ME= 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=qavSBhjyJguHpZQtpsLoQunCmJj0UaxeZNUkFbvKHQI=; b=OyKEcihT6zIfshmobHmH0C5c58qj2TyBU6ZYzo+e6zxDAaVZ9lpeobRkqGuGf+Y+Kj EWos3YV8mdb3xl5yVqDrnJK+uLID/pxYPCLomZtAeRALyItYeIIdyOKD43VT0Ay0g4u/ 4JfOkRPmVMdFABcQvD06G0HWJxrRI4TElZlmD5yveyGvBL49veeAMLdflHJ7v8sZbsRN IJKN/H00/WWJFO7h0x6VYW3k83GOKm0o8UfXKIoNFjWM3kCp9r+RE4zqKQnegIJHIci7 VDu+bKnL19TYUbd5/VySJ6wplCp/mBZvDK1/tCOFBMutcQYkw2sogd4iAwLmFuBb8O3C 7cbw== X-Gm-Message-State: AOAM532v+jcllZ4iJSrte8klqW+eYuo/ntnZ0tE8PI+wHTtABYOMO79g oC9PY5PmFnjZRjDxPItjY7PkJFxmJqihLf8XJGFapg== X-Google-Smtp-Source: ABdhPJz7U/gg2bILW7eDQUEq+WiZSAg270VcwmISAU4Df/YG59TiLQ7aY2VN1tkTv7lkJuqBw4E/tvdvjiwMPfduP50= X-Received: by 2002:a05:6102:1008:b0:335:e260:9ff1 with SMTP id q8-20020a056102100800b00335e2609ff1mr21708870vsp.32.1653910493009; Mon, 30 May 2022 04:34:53 -0700 (PDT) MIME-Version: 1.0 References: <20220530081910.3947168-1-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 30 May 2022 19:34:27 +0800 Message-ID: Subject: Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting To: Hans de Goede Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Tue, 31 May 2022 07:45:33 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rob Clark , amd-gfx@lists.freedesktop.org, Harry Wentland , Chun-Kuang Hu , Daniel Vetter , intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Stephen Boyd , Rob Herring , linux-mediatek@lists.infradead.org, Jani Nikula , Matthias Brugger , Sean Paul , linux-arm-kernel@lists.infradead.org, Simon Ser , Emil Velikov , Douglas Anderson , Thomas Zimmermann , Alex Deucher Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value. However, connector properties > > can't be created after drm_dev_register() is called. The goal is to > > separate the orientation property creation, so drm drivers can create it > > earlier before drm_dev_register(). > > Sorry for jumping in pretty late in the discussion (based on the v10 > I seem to have missed this before). > > This sounds to me like the real issue here is that drm_dev_register() > is getting called too early? > Right. > To me it seems sensible to delay calling drm_dev_register() and > thus allowing userspace to start detecting available displays + > features until after the panel has been probed. > Most panels set this value very late, in .get_modes callback (since it is when the connector is known), though the value was known during panel probe. I think we can also let drm check if they have remote panel nodes: If there is a panel and the panel sets the orientation, let the drm read this value and set the property. Does this workflow sound reasonable? The corresponding patch to implement this: https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ Thanks > I see a devicetree patch in this series, so I guess that the panel > is described in devicetree. Especially in the case of devicetree > I would expect the kernel to have enough info to do the right > thing and make sure the panel is probed before calling > drm_dev_register() ? > > Regards, > > Hans > > > > > > > > After this series, drm_connector_set_panel_orientation() works like > > before. It won't affect existing callers of > > drm_connector_set_panel_orientation(). The only difference is that > > some drm drivers can call drm_connector_init_panel_orientation_property() > > earlier. > > > > Hsin-Yi Wang (4): > > gpu: drm: separate panel orientation property creating and value > > setting > > drm/mediatek: init panel orientation property > > drm/msm: init panel orientation property > > arm64: dts: mt8183: Add panel rotation > > > > .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + > > drivers/gpu/drm/drm_connector.c | 58 ++++++++++++++----- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ > > drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++ > > include/drm/drm_connector.h | 2 + > > 5 files changed, 59 insertions(+), 13 deletions(-) > > >