From patchwork Fri Apr 9 04:53:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12193033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03955C433ED for ; Fri, 9 Apr 2021 04:56:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FDE861165 for ; Fri, 9 Apr 2021 04:56:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FDE861165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+Jl5KE/zAp8I+0Yiqo45sUywqe9a6PFNAUuCGADXKXA=; b=ettSpidCCuToUzv/2NBKBXiwkC fZEr2HN1JyY6laoRPxBhF+0GXNdv/Zz9jaLjDGTj/6x6uDuc0NBp+KWuRjpH/yVf84pUDwP3hY5a3 4940BPf9g22b+EDG4MP6qF2rRluymoslCKB6GknJnEDKe7BVeB/XP5Jumqxlzi2thAzec7dY5ivEi qfoErQTfE6LYHtu0Xhuna6qs1y4Hu58/pNIMiv0xfxDEdGdXyHHTlC2RVD8LN3T4cSfI9jCj596oR r27jGhj0yPpT78cesuY/Xy9lnBGLtH+jKoAzLUaTSPPOYyWWQJIRf/angXrphOuYGq1DEHo6FNmc5 BayTVVmw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUj9p-00A4dB-57; Fri, 09 Apr 2021 04:54:13 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUj90-00A4Yq-Ch for linux-arm-kernel@lists.infradead.org; Fri, 09 Apr 2021 04:53:33 +0000 Received: by mail-pj1-x102d.google.com with SMTP id i4so2292753pjk.1 for ; Thu, 08 Apr 2021 21:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U8tMg25UODn9zLUOH4J81Emc3aCsG/EQSjte3RxVFwU=; b=VOyYiA7av5Bi6O4IQeERXt8QsT+l7zDqkusCiXRR6I6d6aEWWRveSCJzo+jMpzWMYX 995UQaizcAn0Gn1/TUm1Zbpoun/QWNaS3N/MUEX8ihV9QpVgJ4tWnFL/PkYWQMetjf9y H8qMY2CgRr0JwIhO6HKkNQFHQWMMulSZkXb4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U8tMg25UODn9zLUOH4J81Emc3aCsG/EQSjte3RxVFwU=; b=JeJQmvdueDUKO4emPEb0rOTBLCnw+ZA7pDBDQIfGJN/cNsAJBaDc/gypvYuBQc3dea ABNaZgNm3NEKrB8Kzqaz6Ui0nSzbBMUK99HgqFWSZdmdO3eQZ1PZH/lQ5LdpVG5NFeiD EtZgGUKIyPmQmSqMZ2Xh1014fYA3KbG2eJQOHosGhJskut5HLWBpJxqCX699fpmK8/n/ A5zxJTXlYNNkNAIbKBFX+HuP/pGZrT1iuX0jG1DUmRti0tdqWccIBN5wu33HK3HdC9oW hK5FhClaItiWIbX2wmvW2KW4Zix85RcUT/ieaw0uEzPbIhWOiZAmcYhY4fspGgwLwhCd Ua9Q== X-Gm-Message-State: AOAM533drtOgKEKQp+YxEI2BdSZUT6gANLCxxy17ywlwP+Db+kNXn7QW /qElpV/nyq7o+buCVWqn3e/9Fg== X-Google-Smtp-Source: ABdhPJyiCXafNiJ32rllXnQwLlA8TSdl0M9YXElPFDmX+now4Elzlf3lVZHWQ6cxIai9C+eZPZH4fA== X-Received: by 2002:a17:902:6f10:b029:e9:7fdf:4902 with SMTP id w16-20020a1709026f10b02900e97fdf4902mr8114984plk.41.1617943998661; Thu, 08 Apr 2021 21:53:18 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:f9f6:696:a955:72e9]) by smtp.gmail.com with ESMTPSA id p2sm900696pgm.24.2021.04.08.21.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 21:53:18 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu , Matthias Brugger , Enric Balletbo i Serra Cc: Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register(). Date: Fri, 9 Apr 2021 12:53:13 +0800 Message-Id: <20210409045314.3420733-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_055330_847964_EBA21F8E X-CRM114-Status: GOOD ( 13.37 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org drm_dev_register() sets connector->registration_state to DRM_CONNECTOR_REGISTERED and dev->registered to true. If drm_connector_set_panel_orientation() is first called after drm_dev_register(), it will fail several checks and results in following warning. So set panel orientation in dsi before drm_dev_register() is called. [ 4.480976] ------------[ cut here ]------------ [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc [ 4.609772] Call trace: [ 4.612208] __drm_mode_object_add+0xb4/0xbc [ 4.616466] drm_mode_object_add+0x20/0x2c [ 4.620552] drm_property_create+0xdc/0x174 [ 4.624723] drm_property_create_enum+0x34/0x98 [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0 [ 4.634716] boe_panel_get_modes+0x88/0xd8 [ 4.638802] drm_panel_get_modes+0x2c/0x48 [ 4.642887] panel_bridge_get_modes+0x1c/0x28 [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4 [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700 [ 4.658266] drm_mode_getconnector+0x1b4/0x45c [ 4.662699] drm_ioctl_kernel+0xac/0x128 [ 4.666611] drm_ioctl+0x268/0x410 [ 4.670002] drm_compat_ioctl+0xdc/0xf0 [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100 [ 4.678436] el0_svc_common+0xf4/0x1c0 [ 4.682174] do_el0_svc_compat+0x28/0x3c [ 4.686088] el0_svc_compat+0x10/0x1c [ 4.689738] el0_sync_compat_handler+0xa8/0xcc [ 4.694171] el0_sync_compat+0x178/0x180 [ 4.698082] ---[ end trace b4f2db9d9c88610b ]--- [ 4.702721] ------------[ cut here ]------------ [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8 [ 4.833830] Call trace: [ 4.836266] drm_object_attach_property+0x48/0xb8 [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0 [ 4.846432] boe_panel_get_modes+0x88/0xd8 [ 4.850516] drm_panel_get_modes+0x2c/0x48 [ 4.854600] panel_bridge_get_modes+0x1c/0x28 [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4 [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700 [ 4.869978] drm_mode_getconnector+0x1b4/0x45c [ 4.874410] drm_ioctl_kernel+0xac/0x128 [ 4.878320] drm_ioctl+0x268/0x410 [ 4.881711] drm_compat_ioctl+0xdc/0xf0 [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100 [ 4.890142] el0_svc_common+0xf4/0x1c0 [ 4.893879] do_el0_svc_compat+0x28/0x3c [ 4.897791] el0_svc_compat+0x10/0x1c [ 4.901441] el0_sync_compat_handler+0xa8/0xcc [ 4.905873] el0_sync_compat+0x178/0x180 [ 4.909783] ---[ end trace b4f2db9d9c88610c ]--- Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index ae403c67cbd9..45a702ee09f3 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -205,6 +205,7 @@ struct mtk_dsi { u32 irq_data; wait_queue_head_t irq_wait_queue; const struct mtk_dsi_driver_data *driver_data; + enum drm_panel_orientation orientation; }; static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b) @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) } drm_connector_attach_encoder(dsi->connector, &dsi->encoder); + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation); + return 0; err_cleanup_encoder: @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev) ret = PTR_ERR(dsi->next_bridge); goto err_unregister_host; } + + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation); + if (ret) { + dev_err(dev, "failed to get panel orientation %d\n", ret); + return ret; + } } dsi->driver_data = of_device_get_match_data(dev); From patchwork Fri Apr 9 04:53:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12193031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5091CC433ED for ; Fri, 9 Apr 2021 04:56:35 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC1A260FF0 for ; Fri, 9 Apr 2021 04:56:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC1A260FF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XQXkTubig/n1fZ1lY08/15UDgqtLK95ToKFbTIEe/yA=; b=ZIeYTirlfns7hTLOOtxu32dgt Hgm3BV1v069Ua4zoMY99Qbrnaw5Ic99sOe64aWg2V2rLImvtitRxa8m8woBrD9FXUU4xSxQbzEVWJ 8uJ+j7wT/tvFknUNxPwyGli9q7dn5R9aeJnBwFnKxBG3FlYJPynh4ZI3TVykpMXNqwIRBJoQvkLeM EyUCcZAyg7XwHbhkIv3FMDkWKmM1+UNFLiz/I4fklxy7Fa6znGhxGOdKYfgR473iSzZFmdq470iIi quxr/abQbmzVfSBGphF4S0dYD7yc6Rj93rIkTbtalad8pGIQ2Ou1vejOLYES3qHc+3bvns+quYjaW BTXLdSCjg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUj9Z-00A4bY-JA; Fri, 09 Apr 2021 04:53:57 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUj90-00A4Ys-OA for linux-arm-kernel@lists.infradead.org; Fri, 09 Apr 2021 04:53:32 +0000 Received: by mail-pg1-x52d.google.com with SMTP id k8so2980651pgf.4 for ; Thu, 08 Apr 2021 21:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OS7lcaPxknITZLvovVkA4QPXgon3j/mJxiD24igJRqo=; b=h4zcLAdWfRJgihK2lfSX3Ypml2LDDqkOCQxP1jzvewO4jhVm55tUwaYfZcqvP2cxZG +p00cv2fniK5dn64pXL/DD4rWqhDqCXJA/Hy890kQH2cKfRb6uQHe8wlmXMWoHg65I/s 0ddH48c2OC/fmk1+1JQ6/j6A3800tbq4+63TA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OS7lcaPxknITZLvovVkA4QPXgon3j/mJxiD24igJRqo=; b=H3ALcrs0gZfFE43rm3+5gxXQ6FYncWg4ZCXXc/0QmiRgus8+Eosspag3CRzmNPLQpn fL6IUIcwqJuGkfZPaoSWukfNGJb/Sk5VKJYylDk1r2gcPfJU4kJxWz0tJ+3UfY8YZcqY 0QHwA5k4PLHszFLRVppasdi6W5URxpyYKpsaBnAjxVx961a9BUj7SV2kGoku7plI6CHf eMvlCKrbt3F+tfBLKgBdYvBna/NWFDmlzQbrpvAJy3RtgSf9GooRevRtz6cz9EQkv5he 2xJ3cI/x95TH40WQ5RnvKKeSVMvvhxrY+2Ex3Rd8Dm8bTzWZJpk3jXM/tgoxaiWKL5qe 1dxQ== X-Gm-Message-State: AOAM531OChn+ZphPAeF1e7H+7JetU8SI6wMsNKZUEggH6KB73nJNAJ0W 0UfTjDklBibIIeJ9kK03kmFV2w== X-Google-Smtp-Source: ABdhPJwvi9n1MpPr9EbApqw4tpal6rn4nFHgDRv5qpHpDXeyET2KUNc94sSla03g7YL6LJLDGwmMDw== X-Received: by 2002:a05:6a00:1c77:b029:241:5c43:8cf5 with SMTP id s55-20020a056a001c77b02902415c438cf5mr10989642pfw.10.1617944000932; Thu, 08 Apr 2021 21:53:20 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:f9f6:696:a955:72e9]) by smtp.gmail.com with ESMTPSA id p2sm900696pgm.24.2021.04.08.21.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 21:53:20 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu , Matthias Brugger , Enric Balletbo i Serra Cc: Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Date: Fri, 9 Apr 2021 12:53:14 +0800 Message-Id: <20210409045314.3420733-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog In-Reply-To: <20210409045314.3420733-1-hsinyi@chromium.org> References: <20210409045314.3420733-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_055330_848799_2CC38A75 X-CRM114-Status: GOOD ( 11.34 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org krane, kakadu, and kodama boards have a default panel rotation. Signed-off-by: Hsin-Yi Wang --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index ff56bcfa3370..793cc9501337 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -263,6 +263,7 @@ panel: panel@0 { avee-supply = <&ppvarp_lcd>; pp1800-supply = <&pp1800_lcd>; backlight = <&backlight_lcd0>; + rotation = <270>; port { panel_in: endpoint { remote-endpoint = <&dsi_out>;