From patchwork Tue Jun 7 09:05:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871570 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 4FD6DC43334 for ; Tue, 7 Jun 2022 09:12:02 +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: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=eOrwoywhvp42ZHRORq/KiMQXCMfTNy1o7CLSOYJkzQU=; b=l8NQdV0A64zs2+ ZwSIxHmOxNdOjQ2Q7tH+OUlEgv+rES6S82APsDGTG/Aw/1nkKTeV7wXxVJy1mnb5Pdj3Q++U84Rfe UJnTtFKDv3eCFjL0M09cpMEXTX36mvrzdswqGLDaaj+jQyDxILAfTr5PJyu/XEcocKAPjrCTDP7Ry 7r12jwYyRG3bgRvr9pMDDHc56z2RHAEa2pWOgpAdqlpgHk0v4idiO/Yfp9AvcLQzy50UP9bId/x8V CbN1XYC/N/m9lY21PtCp8iY971wvqKfs9U/zY1v4O41znvokmalBGxz+Lkgizbd8TrFRMlgzxjf8M aM3zk8L+ioqgjHjjG0SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVEW-0065cd-Ea; Tue, 07 Jun 2022 09:10:41 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA1-00636m-ME for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:03 +0000 Received: by mail-pl1-x62d.google.com with SMTP id n8so14328167plh.1 for ; Tue, 07 Jun 2022 02:05:59 -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=JYiFnAz00MQeZi91E0UGkYUB+X1a+/Lsax/pqn3rMlA=; b=KH3+lr+udpk9BxBvp8pMA2hNB+th+s1iQrrtA3y5IMRralVN952OscgP2INjWAZFd8 k4mjICqnU4+kEi0V4d+uTKrHr7Rh/7LZgNlFafUHVj0Q1/jNY9mXrUrB2PtUobzOOhqC rFSPen3RMgxDU4KLhSxdhq54eJ0q9X09oVhzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JYiFnAz00MQeZi91E0UGkYUB+X1a+/Lsax/pqn3rMlA=; b=AH9Y92uyNt8aZTEzVVxS9CupkQnc5M2ZNb+/7ss6wXFEi2jhvLGW/8rFHjTkDKxRe7 7P0W7v45ob/3jnuK/PWMoEIIDkRkcDja/5HkbPTtY6H0aL+h8nvP7p4ETXg0Ss1gotdF 1E1sIjWIgUDEur5gQRUgV/ri/6HnWTlRrXcsHHkXdGRV07fUyvIqa6PLA25Ax8XxG63r +RkQHJ/P1Q91EH0skodnwBz/d0rVNscSWUMIyL7S59XIlbliITIxW/ovJ7eIOp8jAigQ oQcsYh8ZDA8ljAL+oM2Kf/Ka14cX6OQGavvs62RaR7B8zX7tkMkbYgTPhoVbWk/hHpxE 9XjQ== X-Gm-Message-State: AOAM531CD/vl5tKjsgP0xtoBImVWIE/8rQ9aRgTV8pI7uxJ/ZGeSwvVx Ll34l6XeXE/YJHGrORe0BGuz9w== X-Google-Smtp-Source: ABdhPJyr2A4/F6vIPaUyB60Ia6c6CqNra9a2QyXEjIj5RyHeqzXzhdCeEAtKv/SYI0gMhRUktDj0qw== X-Received: by 2002:a17:902:a413:b0:156:15b:524a with SMTP id p19-20020a170902a41300b00156015b524amr28148208plq.106.1654592758652; Tue, 07 Jun 2022 02:05:58 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:05:58 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/8] drm/panel: Add an API to allow drm to set orientation from panel Date: Tue, 7 Jun 2022 17:05:42 +0800 Message-Id: <20220607090549.2345795-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020601_829623_EE13D702 X-CRM114-Status: GOOD ( 21.21 ) 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 Panels usually call drm_connector_set_panel_orientation(), which is later than drm/kms driver calling drm_dev_register(). This leads to a WARN(). The orientation property is known earlier. For example, some panels parse the property through device tree during probe. Add an API to return the property from panel to drm/kms driver, so the drivers are able to call drm_connector_set_orientation_from_panel() before drm_dev_register(). Suggested-by: Hans de Goede Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- v4 -> v5: - Simplify the caller from drm_connector_set_panel_orientation(connector, drm_panel_get_orientation(panel)) to drm_connector_set_orientation_from_panel(connector, panel). The main function is also moved from drm_panel to drm_connector. - Add some notice for the original drm_connector_set_panel_orientation() usage. - sort callbacks. --- drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 4 ++++ include/drm/drm_panel.h | 9 +++++++++ 3 files changed, 45 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 1c48d162c77e..859165a1c8f1 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -2320,6 +2321,9 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); * It is allowed to call this function with a panel_orientation of * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op. * + * The function shouldn't be called in panel after drm is registered (i.e. + * drm_dev_register() is called in drm). + * * Returns: * Zero on success, negative errno on failure. */ @@ -2389,6 +2393,34 @@ int drm_connector_set_panel_orientation_with_quirk( } EXPORT_SYMBOL(drm_connector_set_panel_orientation_with_quirk); +/** + * drm_connector_set_orientation_from_panel - + * set the connector's panel_orientation from panel's callback. + * @connector: connector for which to init the panel-orientation property. + * @panel: panel that can provide orientation information. + * + * Drm drivers should call this function before drm_dev_register(). + * Orientation is obtained from panel's .get_orientation() callback. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_set_orientation_from_panel( + struct drm_connector *connector, + struct drm_panel *panel) +{ + enum drm_panel_orientation panel_orientation; + + if (panel && panel->funcs && panel->funcs->get_orientation) + panel_orientation = panel->funcs->get_orientation(panel); + else + panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + + return drm_connector_set_panel_orientation(connector, + panel_orientation); +} +EXPORT_SYMBOL(drm_connector_set_orientation_from_panel); + static const struct drm_prop_enum_list privacy_screen_enum[] = { { PRIVACY_SCREEN_DISABLED, "Disabled" }, { PRIVACY_SCREEN_ENABLED, "Enabled" }, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f257..94b422b55cc1 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -38,6 +38,7 @@ struct drm_modeset_acquire_ctx; struct drm_device; struct drm_crtc; struct drm_encoder; +struct drm_panel; struct drm_property; struct drm_property_blob; struct drm_printer; @@ -1802,6 +1803,9 @@ int drm_connector_set_panel_orientation_with_quirk( struct drm_connector *connector, enum drm_panel_orientation panel_orientation, int width, int height); +int drm_connector_set_orientation_from_panel( + struct drm_connector *connector, + struct drm_panel *panel); int drm_connector_attach_max_bpc_property(struct drm_connector *connector, int min, int max); void drm_connector_create_privacy_screen_properties(struct drm_connector *conn); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index d279ee455f01..3a271128c078 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -116,6 +116,15 @@ struct drm_panel_funcs { int (*get_modes)(struct drm_panel *panel, struct drm_connector *connector); + /** + * @get_orientation: + * + * Return the panel orientation set by device tree or EDID. + * + * This function is optional. + */ + enum drm_panel_orientation (*get_orientation)(struct drm_panel *panel); + /** * @get_timings: * From patchwork Tue Jun 7 09:05:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871574 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 9B336C43334 for ; Tue, 7 Jun 2022 09:12:58 +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: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=aMuJvk01WkOL2KziEb0V9pBI38pzg69YWqmcLqYP2K0=; b=cQl+dsQBOBUsb4 i06yIrU9oeqvr8sPdJFG4g2GJfMSOkDK0wjbAZE1JQFP2452CcfqdB6v71up4ACwTqW4Fj8hXnjgx xXJaJzC1twO8vaWiQeWCtchXBrHeVKa3p656DDhiURKNinM26NB0CHKcHSO4AgU65NF9yte7fNWzE qG/ezWN+cp/k8FNO/5DHzXLoYsva98nsNTJoyem7d3k+2V1tJvwBVpvd11mDLB7QhiJHtdZYcZLlk avsOf9MDQbPWjIvm3GNPF5BwE8UW555QH0WzmQZbVfdJK6za3DFHnieO5xcRT2RddlvW0R8gH10Yl 3lYAYAG/nm5cY88D9M4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVFU-00666Y-TS; Tue, 07 Jun 2022 09:11:41 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA6-00639v-Mw for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:08 +0000 Received: by mail-pl1-x62b.google.com with SMTP id w3so14278223plp.13 for ; Tue, 07 Jun 2022 02:06:03 -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=FkC4wQn3+nXU7dST9FaxB+QRGREtiwsJHA3bRU8iD1Q=; b=KBM2BBQMMLkgUMsyR9jAjWANoeklgbSZu54h1hNjBmSk+dJ8U+LkBMOQU9IEslajqr IMWKVu3kPIKAiCJEzAlwxvBzAZUNCr9GzM0AXvUMoGO3F/K9fF3Irci+SpskTJtYvYsm XH6CtIIBAipgd4VblS3HvTpbYCYgpm9EN69YM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FkC4wQn3+nXU7dST9FaxB+QRGREtiwsJHA3bRU8iD1Q=; b=INnOtCF2lblCLlWUf3zz7GmZ9XhxDU9L1sNrwKxJLSRzkAIgVRSipamk7DkdAvOnm5 uFQByKiZIxlhtdeci6fU1vwjBjJwMDY+mowkxOvs0WbxCfZukNhvaRUR2wKBDo9GnJzm /FNMMFUphr7Wv8SCMrNI58DTo7+Se+BYjRy+56qRrrM16WknIhVlSmTIgbS6FGMngYdu EVdMvpqSxFr0IjyxbZI6yckIXpkAHuAi5ViEo5XRHGnWUXkV5I9xf3f5ClwnDq6EW5H9 IT5WpwGdzKEqxeCYau+EiVal/ECLOLyPVu8u9A6YACObmIc8+HeuXtQeCRyxCjV4cD3N 68qg== X-Gm-Message-State: AOAM531VvmnVjtufyqHNS3tOKLby7LBp5mBHMjtTahJmPPxcmFBPlFVO BD9fx7SYQmqAHEM7tnRB+44wwQ== X-Google-Smtp-Source: ABdhPJxtMveNapxOscHpOj1UN38se05kULc+7JDGp1azNMKPpid/CV/xKFokwk5MP3Wyrs0aUn69hA== X-Received: by 2002:a17:902:6a85:b0:163:d764:e1a9 with SMTP id n5-20020a1709026a8500b00163d764e1a9mr28522297plk.50.1654592762305; Tue, 07 Jun 2022 02:06:02 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:01 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:43 +0800 Message-Id: <20220607090549.2345795-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020606_805029_A719C1BB X-CRM114-Status: GOOD ( 13.26 ) 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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- v4->v5: Move the usage text from caller to function doc. Leave todo instead. Same for other panel patches. --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 1be150ac758f..07f722f33fc5 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1511,16 +1511,28 @@ static int boe_panel_get_modes(struct drm_panel *panel, connector->display_info.width_mm = boe->desc->size.width_mm; connector->display_info.height_mm = boe->desc->size.height_mm; connector->display_info.bpc = boe->desc->bpc; + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, boe->orientation); return 1; } +static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel) +{ + struct boe_panel *boe = to_boe_panel(panel); + + return boe->orientation; +} + static const struct drm_panel_funcs boe_panel_funcs = { .unprepare = boe_panel_unprepare, .prepare = boe_panel_prepare, .enable = boe_panel_enable, .get_modes = boe_panel_get_modes, + .get_orientation = boe_panel_get_orientation, }; static int boe_panel_add(struct boe_panel *boe) From patchwork Tue Jun 7 09:05:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871575 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 14461C43334 for ; Tue, 7 Jun 2022 09:13:53 +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: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=mfrRrikL/C1UnGlRr13viUWNAjuNKQUp1/6sOGH0/L0=; b=Mb/GoTin5N005p 305lNHTIWAm5/8Kd679NvGPPfv+UjnP4+ADjgHpoLnbakFiqPCiIe1M4s7dS6FSRdaDwpqK1jGTBL dls12fsbc3YxKAqyLxLWDQ4GHILvNhMfJBhLMB6TJEF6dyDgzsFEPRKS703qCA4BkpRLPyWyxh5Kk qxxwOsYpkT3TWbv+JC39FPoZVPr99Y0NOUmFv0C2X+G0kSpg9kUXA4xW1grVdRoYHVA3e1AR3AB4P FQXigvWroblsl5Z3Yx/ynW8BaRITtFcOTjoiBwSyByCbgPuiNhv91IoSGyLnQkEBg7v/DhQO4TW4M Qfo5ZmLkSasEYBDLmnTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVGN-0066h1-Ei; Tue, 07 Jun 2022 09:12:36 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA8-0063Bc-KD for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:11 +0000 Received: by mail-pl1-x634.google.com with SMTP id o17so14312433pla.6 for ; Tue, 07 Jun 2022 02:06:06 -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=xYeDQhf6C4qNcR/ypeqIeNKvzW6/RJ1frKBoLaPHIDU=; b=e5GUX3w98mXidj6PktAsCCs+1jtyi7CTkOjk4ZtoYHy7DxEANDLibad2GC3quOwOrm UVZoqe81WqocOq5NEs/kaeH0rl1kjIlsj08svMQHfMdKvx5CkRYStIBgMRcuCypTHAy0 URnedot666T8TmTtSlzzLt0YKeJ/9f/LZz9XI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xYeDQhf6C4qNcR/ypeqIeNKvzW6/RJ1frKBoLaPHIDU=; b=BOPVrQmnh1/OiFHYErGqmADoGqvxjBhVa/UjXnuxD1zNDEnU1JP+QCGOzMTMWNR13B 67VrPP9qAo7P+AODO/ed/3RX2MCu843iwDxvjxNXTQf2S8O0pmRw8n8JxZb5ZfQmU3j3 hSD+nuIAISOuJiJvRP5BLE5mdPPnTsahmx8r4lepeyXucMExbdn6ni2jrRW++tOI4QQO nP5M4PpqHAZgKw70cF5Z/nKyMq3QsvwBI3j42boC5xXBC2wj9gADsHw7D23TuhOX236q m6sEzzm2rhWk7Y1/Gp1F6Ow9dHKhgHr/WB0E7jm+4T7bG5J1KdASHuXLkVbYXq6pi8g9 XfFw== X-Gm-Message-State: AOAM530jjDNMJIOu1kebtwNEls2xpHuD2qct42jK+dibAAsnofQ+Ofzi wAE+bwQU00XmxiQb6xEShUqabA== X-Google-Smtp-Source: ABdhPJzeaeZzletu7cyNw10d23dKyONDwXP2r/qWUVnyVfAreMR1Ry/RctWwZMxAUZbcnT+OV3SZpQ== X-Received: by 2002:a17:90b:3c4e:b0:1e3:36c8:8496 with SMTP id pm14-20020a17090b3c4e00b001e336c88496mr40678398pjb.82.1654592765731; Tue, 07 Jun 2022 02:06:05 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:05 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:44 +0800 Message-Id: <20220607090549.2345795-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020608_737551_DEF13783 X-CRM114-Status: GOOD ( 15.23 ) 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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-edp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index c96014464355..ee622c1dd532 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -586,7 +586,10 @@ static int panel_edp_get_modes(struct drm_panel *panel, else if (!num) dev_warn(p->base.dev, "No display modes\n"); - /* set up connector's "panel orientation" property */ + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, p->orientation); return num; @@ -609,6 +612,13 @@ static int panel_edp_get_timings(struct drm_panel *panel, return p->desc->num_timings; } +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel) +{ + struct panel_edp *p = to_panel_edp(panel); + + return p->orientation; +} + static int detected_panel_show(struct seq_file *s, void *data) { struct drm_panel *panel = s->private; @@ -637,6 +647,7 @@ static const struct drm_panel_funcs panel_edp_funcs = { .prepare = panel_edp_prepare, .enable = panel_edp_enable, .get_modes = panel_edp_get_modes, + .get_orientation = panel_edp_get_orientation, .get_timings = panel_edp_get_timings, .debugfs_init = panel_edp_debugfs_init, }; From patchwork Tue Jun 7 09:05:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871576 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 99CC7C433EF for ; Tue, 7 Jun 2022 09:14:45 +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: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=16vXaaVFGnNpak31TxmhOhH1K67eK88C/LiYMPWUzuk=; b=iVcowEgNVI657t /Ui8ccK5L+I6JwsKeHEnOyFbNRmmIoov6GijuQ07uM/qiX9CVYpMq5FzfiQR0svVSK3Eo5yCA7hRD NIQxvajN33RG+gcLtPfAJgzlpbjhJvCPtuKkHeg/T/DHlaIEEteX6fGD6qYCqluruoz2IbzTqgxwC i3QueimOEAemrCwqclJV27HAhmCpFjKVJGlK/NSEOCGD5edjHGgf8QqonWrkteyQuoupa0kfknL4h SoDeVlrSoyaCxxkqqDr3I26fBozndEByuvdfgNzW1hFj6NkBn3akUY/uzvzwLVJXM/Ar8Vgwh+ffI 6gVma4WtHIB17s7K1QUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVHB-00673D-Gz; Tue, 07 Jun 2022 09:13:26 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA9-00636m-L2 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:12 +0000 Received: by mail-pl1-x62d.google.com with SMTP id n8so14328167plh.1 for ; Tue, 07 Jun 2022 02:06:09 -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=URQgL2yUP1UPEGjFj3Vtkw+GlIVy5pPiHox/tAieZas=; b=KkdhkZR0WaPbNGFjnV5JiCzsW/4Td/Y1uAFcoXb7bs6qedkwYqr4useNkOhECnjn51 Aq3h7Q9o6cOxgUZHsiYDmtF1268mVFmhpOCB/F3QQ8y02faY5NkR3KYqvXQzUO7cqmiO 2nqtwa7AfOlK/1DOFkxqwBsRQTuz59g/WYL28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=URQgL2yUP1UPEGjFj3Vtkw+GlIVy5pPiHox/tAieZas=; b=eo3myc+2W8IlldyUrnOk9nxXwIcZpsoSJ6qqF1t92xaEr+vxeOd65f5ZWQpFr/FX68 8vlRQeZkl7F8Fgl7gkHUct36GEDjCgyUO1PatavgGYNyiUzbisuA51mOWDRi6WOi7wcr Tlv/6okpMLl8pFpWXIqbJZNR918o/Do7eDvbUyosm4zCsi95pV/r6d/Arg1VUgHkqoQU LS8YGmfjDvkg7Y/iB/o/Y+QC9bRdXVoDv3Vjv0Wv8Xm6I4VhPszVMWmxBZwwh/lzFPrf KJuC17ObIuDnSFU8l6DnEh/d+VWuEP8QSUxlSwkDxhJud95TKFOgq1fHbDSISxYyM4EM aDkg== X-Gm-Message-State: AOAM531WG/iPsVP9rBejvuVWyAdRVRe4w9ovlcfjAiwxH1AmkMl3khks 6D4HIsuyz+4kDOyQqTROjWvXPA== X-Google-Smtp-Source: ABdhPJxUb/prMt/A7sRaNQTJtn9oWDj3rVo1IOvfLfcAgTaDday8s3jr1NXmj+cqqrwS88WfrUyMFA== X-Received: by 2002:a17:90a:8b93:b0:1e2:728b:1fa9 with SMTP id z19-20020a17090a8b9300b001e2728b1fa9mr31329972pjn.167.1654592769235; Tue, 07 Jun 2022 02:06:09 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:08 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:45 +0800 Message-Id: <20220607090549.2345795-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020609_769475_9C57FDD9 X-CRM114-Status: GOOD ( 13.32 ) 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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-lvds.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index f11252fb00fe..7a4fedc63e8e 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -99,15 +99,28 @@ static int panel_lvds_get_modes(struct drm_panel *panel, drm_display_info_set_bus_formats(&connector->display_info, &lvds->bus_format, 1); connector->display_info.bus_flags = lvds->bus_flags; + + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, lvds->orientation); return 1; } +static enum drm_panel_orientation panel_lvds_get_orientation(struct drm_panel *panel) +{ + struct panel_lvds *lvds = to_panel_lvds(panel); + + return lvds->orientation; +} + static const struct drm_panel_funcs panel_lvds_funcs = { .unprepare = panel_lvds_unprepare, .prepare = panel_lvds_prepare, .get_modes = panel_lvds_get_modes, + .get_orientation = panel_lvds_get_orientation, }; static int panel_lvds_parse_dt(struct panel_lvds *lvds) From patchwork Tue Jun 7 09:05:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871577 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 EB9AEC43334 for ; Tue, 7 Jun 2022 09:15:54 +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: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=827kowpiI3QnnxWnJPTpOCt1xSEgo9o/vaFm710Nc5Q=; b=TEjkT7tvR3neeg c6vkcUF0/Hh7d2NEHC3rWjoqZ7i3eHtdaYxVlwARBrcvJm8hHTkb/3c8FfYYi6/usmT9TGlyApfNp fmwW9CghqcZFjw8AnSLDQjZ6uRMgxyqYhA0jCAQDqPpyFLiD9FNXzxBoqJIe6LiSioWVSY/NrCQgX eM+X5eY4KVGnMqjTVay0DinXhVDc6v/3pbG23WGK4WbkDld5SLjct+D8h6o6UnjDFPYUySd1E/rth f9aXCqpk5piCfX7RuoqQ4H//Vh5C0lqK0hMTDFBuLYlT7W5PR/J0UW/jbb8pSXD3m+etTWQCEV8JY /wugu78t1//t4JdK5mOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVI4-0067Ot-GS; Tue, 07 Jun 2022 09:14:21 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAD-00639v-7Q for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:14 +0000 Received: by mail-pl1-x62b.google.com with SMTP id w3so14278223plp.13 for ; Tue, 07 Jun 2022 02:06:13 -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=Hkt2l/tO7WYacCl3ivjTi6HGPHGi5NrMwDGXS9zHi3w=; b=HKI56lq5igyQeKgyyIqASr2VCu3+pT9siwjRtEo3q3xCuBFlEAce2uIG1aG3NqbRxx Bi3f+3QlYQIFoTudRE/CoNXXS60RYvhisuyogmtBpm8JNYPyLJm93E7hUNq0bPE7E3wr MzH+y1JYIRGuCPOgZlP7fGUe+7MJkLeNMCFkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hkt2l/tO7WYacCl3ivjTi6HGPHGi5NrMwDGXS9zHi3w=; b=3GBm+LDzGY6LHON6EelUHhFh7NWWFpjnJvc5BUP6DJunDtr9ke8YtfdkAckLDuOJRl icOzAw92JxphJjbvQXXVXpZ0JuHQdMoz5k55ocj6XO2H+HYUePfCe/t1I3agDZ/hCZ6m PKO5K1vOKjv3xgOG4QYD4xaS7Ox2YWSMcHOMrc9+FflDi8pDxP0aiqcewCUQpT/gHrCW 7cyGQgvSqbBJlCalQsxgiZUaIHB1Wl66keaOutVNuw0iwOPpoaMSOMK4oJGLEpCNgSY2 xLBHLIJJNOycFWDfBkavb6DPPcImy6cKuNwhxnBuC/GIoHIVtmCuX+UUZyVyRN+vo2vY Q4TQ== X-Gm-Message-State: AOAM531sT1AHiEgxCdoJVD8FiwJOcx4QzkryGs96P6bYr+t1nz1GEk84 WX94bwuPdGKyL2qYvIJqYlG5qw== X-Google-Smtp-Source: ABdhPJwQgiNLMIZtppqeYqzT8XKH3y3+vFRRwA/niksJDMFoL3S6gwS/5deq8RA1segUx7+d/t8x4A== X-Received: by 2002:a17:902:d4cf:b0:167:735a:e7a1 with SMTP id o15-20020a170902d4cf00b00167735ae7a1mr12121479plg.161.1654592772767; Tue, 07 Jun 2022 02:06:12 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:12 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:46 +0800 Message-Id: <20220607090549.2345795-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020613_323707_81B33DAB X-CRM114-Status: GOOD ( 14.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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson Reviewed-by: Sam Ravnborg --- v4->v5: sort callbacks. --- drivers/gpu/drm/panel/panel-simple.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 4a2e580a2f7b..b4b919525189 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -411,7 +411,10 @@ static int panel_simple_get_modes(struct drm_panel *panel, /* add hard-coded panel modes */ num += panel_simple_get_non_edid_modes(p, connector); - /* set up connector's "panel orientation" property */ + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, p->orientation); return num; @@ -434,12 +437,21 @@ static int panel_simple_get_timings(struct drm_panel *panel, return p->desc->num_timings; } +static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel) +{ + struct panel_simple *p = to_panel_simple(panel); + + return p->orientation; +} + + static const struct drm_panel_funcs panel_simple_funcs = { .disable = panel_simple_disable, .unprepare = panel_simple_unprepare, .prepare = panel_simple_prepare, .enable = panel_simple_enable, .get_modes = panel_simple_get_modes, + .get_orientation = panel_simple_get_orientation, .get_timings = panel_simple_get_timings, }; From patchwork Tue Jun 7 09:05:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871578 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 D6ED4CCA48A for ; Tue, 7 Jun 2022 09:17:00 +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: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=nMfeYzTVqVpHkU/9n/6xOcyYprPcWX8J2n+v4p9WozA=; b=nI8PBh1PP5LsSS C5JxpGAYwgwVTHpAZL0Xo5OO6IDupfN8aheXRZpHOEYDToxKmhBd7dn/9ChOYR8fYC+gBufnnH5SN wZcpb0+MnhwS3YvHBniXZlEKwWJ932bDoHgRUnI/bNLVz+WGqW7SGV08owyH9P4ljzZdwXr8ZJpyP 4zBEra/vfPWE7QcBXwfpfSFuIJpRdyt2xe7i6OtiEMAvcQQp7O3Yz3uqWKeieso8swCi0zhmnMeIC EW7hwvOxF6rjBMsGa2UYWIGCq5xoQIQSd+nAnZNPCJxgTSGFRFOKx7G4h5ovCOThcKpxWA5jENYE9 LTFEoDy+rKaPIoSZkSDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVJ6-0067q0-00; Tue, 07 Jun 2022 09:15:24 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAJ-0063Jr-I5 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:21 +0000 Received: by mail-pg1-x52a.google.com with SMTP id y187so15295735pgd.3 for ; Tue, 07 Jun 2022 02:06:17 -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=1HCnyXhOafzmcP69v2HLalUicns4RO/ZQ4qvjS6XyGk=; b=ge9Jny+hYIej3cj9ag/91xWa81svwEBV3N/ogFXUBgG8rjD7S/momLJGj/7KfP47Wy LYvdSpbngfwMYyTZAwYAiJC5uxG+viVuvfdtirnB7O0giwIJnl+IUWu8X0LiYKRKC6/z Lb0aWIcnWIDHNQ4GOq+bVdZ8jjlqGU35La27o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1HCnyXhOafzmcP69v2HLalUicns4RO/ZQ4qvjS6XyGk=; b=EyxPDv0Ue9Omljx5rf1xBw1YEwMNqiUdGK9thMnoxEW57z3gIEuS/RXuQ9q3dflxNG 5+zE49EEP/X9KyCtyZLktFn+QNo7YiefS+OHpAhAUjSNc5muAgXHKpMmcllIvs/JrQ+L OoBtNKhXkkfbvQD9JpshSEKHwljbnN8QnKB3iXirqwWDHyH22qMe1/djhP55Vwtw230F wlFHEyEZVfnM5qMwQ1xZi/SIeFmZM+FbfnJueltsrBAnqb+yWFlXecqCcVmyq5L966f2 BTltYlyGcJb8+IYgMtX1iWXhkVc5u0ktY0vBpkquYzQ2AXPGNFvhC5q7TaWVD3v5NELT ujzQ== X-Gm-Message-State: AOAM530pTAsS88J7t6plf79o4elxVFK3M6YFm3rBZHKk0/C4D7hh//7I xpSoND9qRMq0OHRyWJKgoQQRrw== X-Google-Smtp-Source: ABdhPJxKZGd/WWz8p/7xzdQeoeP8D9dga0Yr240VSGPMjirb2qQdTmq6Ah77nkDx9vsM0hVp0VQ0UA== X-Received: by 2002:a05:6a00:1a49:b0:51b:8e5d:424b with SMTP id h9-20020a056a001a4900b0051b8e5d424bmr28485080pfv.66.1654592776372; Tue, 07 Jun 2022 02:06:16 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:15 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:47 +0800 Message-Id: <20220607090549.2345795-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020619_648376_D7025D82 X-CRM114-Status: GOOD ( 12.99 ) 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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index ba30d11547ad..58d6798c25ed 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -853,17 +853,29 @@ static int ili9881c_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, ctx->orientation); return 1; } +static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel) +{ + struct ili9881c *ctx = panel_to_ili9881c(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs ili9881c_funcs = { .prepare = ili9881c_prepare, .unprepare = ili9881c_unprepare, .enable = ili9881c_enable, .disable = ili9881c_disable, .get_modes = ili9881c_get_modes, + .get_orientation = ili9881c_get_orientation, }; static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) From patchwork Tue Jun 7 09:05:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871607 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 F17B9C433EF for ; Tue, 7 Jun 2022 09:18:13 +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: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=57/4ZnDOk/2NeJN5GXPGmPwer0ii5yI/M+KmvMEkxDU=; b=nMC20Ijdzrrmi7 Ns1Fxu3eF2O17wF7eHHzlpy8rfhN0S/QNpr5NQzdACynIIPyuVdCPX3+8KJT1UpK0G8Om4oEWxKGT OOAjlMH6NRwEn/ae2xAkms455ikETW3UXLlyfqmt0Q18TnT7uqoj+xnE0A6ZwnuxWkuzQ4z2VKSlp LwDU2+537wnXE/pyD23O9fjkt+fnRYnOOUic23MECkpkACtAFZuogwF+EnzQal/brEISzttHfFimY c2wf4IVM8zmvL29avdz4Vn8cZwl3n+bP7lm9fenlCgtinXStC9s83xBgPmpsZ18RxLYLNkjlcPzoZ 1ahd4V75NjLn+j/n9K6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVKN-0068PH-Bb; Tue, 07 Jun 2022 09:16:44 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAN-0063ML-V0 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:26 +0000 Received: by mail-pf1-x434.google.com with SMTP id c196so15005514pfb.1 for ; Tue, 07 Jun 2022 02:06:20 -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=k48F1xGdZKHAitodolvWiz5jWt34V6z7uuaNSWQHz/4=; b=oSqdlpz/+1EVr71yB5JJSZiahSwMJDpQSfi0wg1oZhrGuVUcVGy+jjbo99bnZ670g4 YuHEr+1VVs1fkdFx3qoAXUrtK4owpH0jzwPZtKVMjcUqYFTRSKP1dszaqK07o7LDBheh UmjUb4CHeVsjZ4zgrxSOiVJT9dGJ/kSflLBM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k48F1xGdZKHAitodolvWiz5jWt34V6z7uuaNSWQHz/4=; b=Rs9+durPwMkCloUn9fIAN9hPTI2OqmfnAz4IYvUHE/Be6Q+8TM1vp4ZbnCSY/16nuA ZKahMc7Um5beeEED62GIiAw72ee0rP/TduS9OAaVAcUnf1iRn2uGuiTesiMgHHpwzVBR gnyMbKoKw7QHZ8N8o6QOV8YyyWexfnRhXie4wYKlHpP/6ofGgdEFfj0DiSlg5wB30+9o P1A7udp4xTJzIsFr45m5ve1vXTHxkkfaw9cv032fhGougOHBUEH2YDSiR2D3uJG34g06 p/NXn75dMqRXJEl8D/Y0NoAEvDYI0tSZHNACjSQJWUt6q0BfPCdU25T+IxWqETXcjqlz /Itw== X-Gm-Message-State: AOAM5302W4o1Cj/wsrOyM8iJ55Zkzs6D941Ezcasf/g3U3IgKKEkxOeE jQpS+/2i9QfxQDpoCsLdigrsmQ== X-Google-Smtp-Source: ABdhPJx4/R3wgiPjf10Tc6Ix6ehs1YFuhLKxv4LZf8DhLrSrjuaQEmxY4+09E9Xrn4CO2l/wwZLFbQ== X-Received: by 2002:a62:ce4f:0:b0:51b:ac5c:4e49 with SMTP id y76-20020a62ce4f000000b0051bac5c4e49mr28557254pfg.81.1654592780106; Tue, 07 Jun 2022 02:06:20 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:19 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Tue, 7 Jun 2022 17:05:48 +0800 Message-Id: <20220607090549.2345795-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020624_065436_9DF92CCA X-CRM114-Status: GOOD ( 13.06 ) 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 To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index 80227617a4d6..fa613d1d7a8f 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -217,15 +217,27 @@ static int kd35t133_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; drm_mode_probed_add(connector, mode); + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, ctx->orientation); return 1; } +static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel) +{ + struct kd35t133 *ctx = panel_to_kd35t133(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs kd35t133_funcs = { .unprepare = kd35t133_unprepare, .prepare = kd35t133_prepare, .get_modes = kd35t133_get_modes, + .get_orientation = kd35t133_get_orientation, }; static int kd35t133_probe(struct mipi_dsi_device *dsi) From patchwork Tue Jun 7 09:05:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12871608 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 3CF4CC43334 for ; Tue, 7 Jun 2022 09:19:54 +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: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=B1ZOncO8SboqpZoaTeYFnfsoD/itqLZ5ta1Th0cbxGQ=; b=om5JMIpu1/eTnA BSvSrr+hIO29CiGtWGkC1EZoDRgoCgVPpNGvMUjUNY8yS6sc9TW7XIRU2lK2J96sQ66ScLq/dK1aT Gv+lP+HLJqPcq/F3qTtuKIonV9KqPyH5Th1JCHqkXdloLA6M6jB9ghfMNtnPRA7xtAmfd+DhEb63O ItbBsYYXzf3fMfTNlcQfy7ZpVFSMPn1ueGcuD4xG408N2gG2zX4eAies1STKXMKvtuToGdR/RED+7 W7TTcbVv2L1HYvR9JJtfkm1A3jyX+lmNcSx/URR5nnTI8nmWw4Zzh1cDN0og8towbu0650GZvVBXO ev7rUESmSeV7SrEwqocQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVLp-0069MD-4A; Tue, 07 Jun 2022 09:18:13 +0000 Received: from mail-pf1-f172.google.com ([209.85.210.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAQ-0063Pe-Tg for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 09:06:28 +0000 Received: by mail-pf1-f172.google.com with SMTP id w21so15037393pfc.0 for ; Tue, 07 Jun 2022 02:06:24 -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=lndmMwy1Xi5onPK/2gR/uuIgcJtx+Xqka0AqhZOCETk=; b=nEwqxsOomZ0VyeLUG6ZdtIT5DHvDyUz42wh0TrdWqyIV7DES04zqZT/xTI4m/jl4wJ 7spZlLhVnaPE9NGehQBm6p/6cay1FPtBmqiYv//gBqWsA0rsYdzGXBPrKChzufa8M3X8 yHZDSKUIaIuf8HkJxNNZ8scTGDOI7mvF2sKjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lndmMwy1Xi5onPK/2gR/uuIgcJtx+Xqka0AqhZOCETk=; b=Nw44siDTiACkB/aI1VeKHNA/ApREt8LfepMdVZqNrAWlfdsK9PKY2ifTG9Kkc0S5a3 wT1hUOpAzVKBXbCkBaf+XaL9/lJFHim3uZhT9mOW+d6Loiw8zWsT7Ohdd6WNGO1lA9zh DjNrd1LD+GnZBPOfRlaG0BVqKRKyW4y8pUxxqIzWGFn9Ge63z+sR+JCV7lyMbmQkkvO8 OAh5qeVxT0kp4t2xrLORyYq1C7eh8QOf8scrjRP5+klPllmYw5JztkwQuoYsSqwORSdJ Ui4ExKijMmpL9CJQACf2/LzWLufEBvz6vPM+db1VvHxiJSQdNMFIjQ9ylkGi/eOFJD08 z8cQ== X-Gm-Message-State: AOAM532cUyjtIn0juVF0majuKsibpqZzkwPOqgxexzUhEucNcLO77fd/ yQ/hQJ/J5UpiLv8vcD6M+BZs/Q== X-Google-Smtp-Source: ABdhPJy9/p/zRGqxgyYDjGPvzOwSsGPu3zYSpJfyIjbAxG5xTl/4JRnWDwLQuIRLjKB4AcijPvphZQ== X-Received: by 2002:a63:8641:0:b0:3fd:94e8:a650 with SMTP id x62-20020a638641000000b003fd94e8a650mr11053873pgd.367.1654592783556; Tue, 07 Jun 2022 02:06:23 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40b7:55ce:10ee:c7a0]) by smtp.gmail.com with ESMTPSA id t27-20020aa7947b000000b0051c0fe8fb8csm4507010pfq.95.2022.06.07.02.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:06:23 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 8/8] drm/mediatek: Config orientation property if panel provides it Date: Tue, 7 Jun 2022 17:05:49 +0800 Message-Id: <20220607090549.2345795-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220607090549.2345795-1-hsinyi@chromium.org> References: <20220607090549.2345795-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_020626_982089_37BBE909 X-CRM114-Status: GOOD ( 18.93 ) 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 Panel orientation property should be set before drm_dev_register(). Mediatek drm driver calls drm_dev_register() in .bind(). However, most panels sets orientation property relatively late, mostly in .get_modes() callback, since this is when they are able to get the connector and binds the orientation property to it, though the value should be known when the panel is probed. Let the drm driver check if the remote end point is a panel and if it contains the orientation property. If it does, set it before drm_dev_register() is called. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: AngeloGioacchino Del Regno --- v4->v5: - use the new function in v5. - don't use drm_of_find_panel_or_bridge(). --- drivers/gpu/drm/mediatek/mtk_dsi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index d9f10a33e6fa..998b1237e193 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -185,6 +185,7 @@ struct mtk_dsi { struct drm_encoder encoder; struct drm_bridge bridge; struct drm_bridge *next_bridge; + struct drm_panel *panel; struct drm_connector *connector; struct phy *phy; @@ -822,6 +823,10 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) ret = PTR_ERR(dsi->connector); goto err_cleanup_encoder; } + + /* Read panel orientation */ + drm_connector_set_orientation_from_panel(dsi->connector, dsi->panel); + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); return 0; @@ -836,6 +841,16 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data) int ret; struct drm_device *drm = data; struct mtk_dsi *dsi = dev_get_drvdata(dev); + struct device_node *panel_node; + + /* Get panel if existed */ + panel_node = of_graph_get_remote_node(dev->of_node, 0, 0); + if (panel_node) { + dsi->panel = of_drm_find_panel(panel_node); + if (IS_ERR(dsi->panel)) + dsi->panel = NULL; + of_node_put(panel_node); + } ret = mtk_dsi_encoder_init(drm, dsi); if (ret)