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: 12871572 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 DF439C43334 for ; Tue, 7 Jun 2022 09:11:38 +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=mwTyrJ04OF8BSUHVMILeHoYoetqxQ8XEUit64xs/DSs=; b=bHJYpKCewcn3z6 J+Ldl27Ap10z3P5migKpp6HQ5O8vbcFSuOd99ZqrkiQQc8sqlTm6HoqW1E002yGwLu1DFTQ+Hm6EF jAMAs0le+ugBQ4WmpZHcEWIyylDfme+r0GbFTH3zYq996dwx2PXW8QPDipYzbTUlG5RNHvy+yuK+J L5w4CINKDzK8tuOzSM8wq2EX+3Ie/J7n59tO5buAnFk0SwBoSVNLNo+ZzglwleyppnodpepMi5xbB 5IFsXr6SgGtEJj/9CJFXfPdhM6Lykcky86tAZfBZrIHsEYxMa0w8pSf/rO4gHPaL2i4p5pw1eaSeN +Qh4vR/Bgacx9+lCivmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVFK-00663g-Hv; Tue, 07 Jun 2022 09:11:30 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA1-00636l-MJ for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:05 +0000 Received: by mail-pj1-x102f.google.com with SMTP id o6-20020a17090a0a0600b001e2c6566046so20290309pjo.0 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=QypuBc1KSDbAVk0LCwsdryX8PBPpPb7+sB04Nq+PiL6pfV19MGhAXCb8UmQt8w6OMD y8NhASAYj9s/WXlcX/4nb5E0vsL+HIRrRz3YX7ZhcS+RiVXFk1oICp2iQ86aURhPCw0Y 4MvhL9/jG6CA3T/hpCs72MPN9qTW3K7CAeOqr1RGwnKHrujUmqLEU/9GiR3lBmF7qh3B b4kTwB2bkCe+JjSMLh7GygXoz7sXZQx+PmhbRHJw2OXJIzaRifegAQklY+2IwMMgGSLR 5sUxEB9Qsx/2kRzWYAX4LX/9dHZZrXCjXYi7UpGOTBE0GW4nzD7/3f44lxAesl1IOYqn Gt2w== X-Gm-Message-State: AOAM533Qlsw3AcU0IZ8nbt+8OxyVSoH0SgcbYoWW9E4uZd8HFkeiXLCp WLWG07NTBnqsIZA7dDuKiC5GbQ== 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_833894_0656CD23 X-CRM114-Status: GOOD ( 19.90 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871573 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 EF9A5C43334 for ; Tue, 7 Jun 2022 09:12:35 +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=spmChpnkhSCMQqC7MB2zU8kBfupWNo8y9kktcYeQYBk=; b=GTkqaqo7vCJlXe m9cr4WjBbLREJgWsQkQ5rhS2O5zWoQ6fRAaK7/30kvZa4gQn2P2G0GDYGCeiBK/S587RpTGCEmm5b uKCq3tAxZibrYPb0hglmqilQRkGPqJg3rXnEiYHkXk0Ff84X9Sim9knOYOUl8X9HA2E8tO8Zdjcg/ 3raZ4+6Z5SQ98Ul46CUfUI+e0ftM4RIF1eR6aI/imUVTyiAVpVbXCMYb0OXXLQzsqHk++NJQzgNei 8Tx9KwKzUaFlpaUNI3TifOJvXAJYpWkpfJkw+Hn+321SG+UEqx4jxWLlgEBb011wurioRHNUyXeAu 9DjJtg9hoD2flnXfssjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVGG-0066fa-Gs; Tue, 07 Jun 2022 09:12:28 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA8-00639w-D1 for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:10 +0000 Received: by mail-pj1-x102c.google.com with SMTP id j7so15105021pjn.4 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=xHHTmYYqNtjO8mpdj/TgpF3vAU+q1pUnlZoerrfguc1lL8QMkWnGbxWTyLK8zYkwEJ 8M1L44fhGif0K0D6BfPHSPdz3YZjzAvpTxh15UKxHxICJkg0JbosBs/Lmk8/4xM/HkC9 R0exk/YMwRxQ/tNi+42uv5i5tZX9gV2Kw72I0CdMDBnkNbPK5d6geBL/Qj87HU/Uw6D/ UhUAEj8KJuZcuX5DlNVxcT5DRf3/4UX97ufHGOM2nZXpNvZUM6QYT4E14rX7VAIJtYL8 DOkx92xqO/Js+sExj2DPHXYq6dh3jHraUoTDVY7i9zPLlggswrmgs38ccVneb8YcmfEU abCw== X-Gm-Message-State: AOAM532x6JGQa8xg087gF5txwTuzl9VN0LY9xZvvgrdM6H4Sxp7WOe9M p3utit7n29eeXVKwpGwrgcknGA== 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_020608_459420_5CC31065 X-CRM114-Status: GOOD ( 11.95 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871586 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 530E7C433EF for ; Tue, 7 Jun 2022 09:14:16 +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=7c6Y15hnPgTVUTF/+wDzhVaU188aLX5BDwN1sL0J8XA=; b=lix8TjLT5H5+UI 6D+bIAt51P/Ci+HbyaAmh8EuTxFcJjrSA6qgyrCGcMG6m7JqwdNgN5qggPlX+ETJpDU4Uo+0NMQt6 SEPHuk7BwTMtwu9oH/jTby1bY9Zrb8erIM7i1FRyyWWXMfn26XOAs+ZPzw0/enr5zw1tcmNAdrO4T uhno51HJd/AfFiHEMFpMesoqvin3cIMg24uJbzpzbiNOX9FWou8GAnzIa2kVyZzjFCMgAQcA1dPZL nvxT70eqYuVUP9C+hxrZ0rExOwrLfa76orIJNGLsfntxCvrqorXUillc3m5DGzPfQlE4zCXY+ULjf i17ZLwyJkqJUXPB+Bt5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVHt-0067Ke-Ks; Tue, 07 Jun 2022 09:14:09 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVA9-0063Bb-JH for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:12 +0000 Received: by mail-pj1-x1030.google.com with SMTP id u12-20020a17090a1d4c00b001df78c7c209so20276052pju.1 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=Uxmj0lSps/SbgwozYZKckB2TUwuwWOnY5oj592rrXvfQs6L39p8KG9W3uigFJHMV28 8OcsFDmoHDz5AtW/ez5DNW7M50jsRgODV7rD52i9xA30L3j4EgXG69ztr7Y6YC7jwncB u8chYCMqyWi03W1SvPV6TLJGltlx09t/9+Rsg843wUykpaDntz+ytIXaYRAdZeiipZ4c ZL0oI0Q01zo/3eUIDqRos2PnxXWSd2fF11wBU+747I9+FAv11fjmIOx9MkfpZHVPk6BS hbP4lghC2Q1tVFqvg/m8aq46ATdFW50NldXrECnWSe9ECuBb8CwLZNx4GyVnX5EUPQt/ N2Ug== X-Gm-Message-State: AOAM530z8dlLfcafkAtLF3qi3iiPxWf4nM6W4tO6xg2b6w5vuAWb9Nd5 Pb5WKfYC3GuM5QPwxNWXLmRtqg== 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_020609_694491_F4C31677 X-CRM114-Status: GOOD ( 13.91 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871588 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 76727C43334 for ; Tue, 7 Jun 2022 09:14:21 +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=GOvvIgARuUNVOHHyr7VzHKfHYezsSTPwGh1H17rwJns=; b=ClET6tj27I8715 BcxYKXRwyv8hWKFnGSD6CaUWA7CsNpXAMv2qFDFQd3yXWlSuiMz2P0+PF3c9C9IdcEpLbmdnpG6y0 o3rjjjqmaEd4tmxZt5iNL2dv95Gaoc5jheAvwCt5BPfd14AUWtHb+X80VWhIiWzw/Z/2ZLlmZxMSF qjgcP9kJrdfSZxcNEwcOvI8tm8buuQ3mHY369XtUOjc88Cyl5Ls6dLAxEL9QVwlsDJrT5HzrWv+mH TdwKql5/vhZ8PsPO6G/STTbreUd9qR5YAoFc4Emw2BHpj7el/e99Sg8j8tx1HPbWMSTUdfajeY8o0 6LnxP7ybNrOf6X3Nx5QQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVHz-0067N4-FS; Tue, 07 Jun 2022 09:14:15 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAC-0063E8-MI for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:14 +0000 Received: by mail-pj1-x1032.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so14875952pjq.2 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=PQh/dJ4IqOS68m+3J6LLeIRyj4BlOY87eICi+YRpyKcF7Au10/LdYMJ9aBvhwYAtRW 5zSm/2hMJQ3FC4KiO7mx9KUR0z98dW4TJDMB7haJdMkLN6seSwurhTfU4DYzy0D90euP qkb6iELhQiaY8ED7SOFZSwjabB8LYvcAfq7VBFSRafV1ArqNHETgonkPP6KFdQ2VGye7 wq9nrJOiGhN+kJbyuO1fBo8Z3DGBWX8FIp7iND/mRbLFyQ5poDrH6/Fg9KSIPzsUTzLd x7Nu3EQ2isMP1QdyITDFYRJM7Nj6nd4fkOzEFJucoWIjhg0I0MpRsaqCtL7OhvZbk2eU rnKg== X-Gm-Message-State: AOAM533tGR0JW9/Jb1lhldQJ4AC6h6FsH6K/Xq0NyhDuPUYqzVAYsQqB 54GN9MPOCVBPL27xK2sSv3T3YQ== 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_020612_786553_8132AEE1 X-CRM114-Status: GOOD ( 12.01 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871587 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 D2A1CC433EF for ; Tue, 7 Jun 2022 09:14:19 +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=2jVThZwmtm2YB3WtcT8xAdBqFQFtLTgOaxw6SM3Bc/k=; b=WvWzjF/+E05Lud 5zqK+0qoV0s3uWEhSzkl7OO4qvVejvSLJKVwJyLFinYZXqg958Qlp4z2NyhHEicBq/pSmicmlCVhP IvTLVxHdnM8rLtqgGRr8TGaiqBUvo1xTzfk5ErxTvq/P+jRuE7tqPBtqZKeglmPJXiufVAL7Dsaum k+ZyLfFNQJ28bEXhKX8JQDULi7oiF+3954RsuxvGDa9is6tmwIo7lb27rdZ9AtF9X1KP0VJV9GxKp jgYOiEYj1coOrjDC9FN+lxl7e+jDQqpt2jq+INFYsKKg8srvZVFLuSH7L8HPH+6PClHWC/WR9lpb8 2tWtD6vOxaW7DT7FmpcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVHv-0067La-Mx; Tue, 07 Jun 2022 09:14:11 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAD-00636l-9d for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:15 +0000 Received: by mail-pj1-x102f.google.com with SMTP id o6-20020a17090a0a0600b001e2c6566046so20290309pjo.0 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=6wwpf41ucNJr3GxMAFkEvXc5JsuxZtH6MC8nGhljwGpoksugZ+Jl7SIOyfa0J8qpPy 6GtiFdxzyyJ6/0EkS50rhLfaVhZSBOsC55/vL8jRmdikfnVFiNTcrBUFPQkMCPNDQKwp 6k0O67iTIttDO4rxdNNOkXgLeuNeFQ5ti8QczbVIcIo0h9cAQHwd5nyzIhXi7tRuIVj0 sIH3nLE2B5u4xaBVV0KGWcyg30dGIXfmJjlqLnEWK9L3u0lPXQLcrJCwuY9yUtmnZZgF lrrEtMyuoyqPmwNl2bG6SjOx9HbPzzYaUCdyJaVpFbsKoI42pmkyli6/aIONORsx74lh 2drg== X-Gm-Message-State: AOAM530O5J9fIDd2kmXUgb5c93ALS7x2YOjxr5fH3VRs00Xdsj4CX0nW E5Bmt/ywXgXc93TQCTZQQoJ1nw== 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_369563_727C9C36 X-CRM114-Status: GOOD ( 13.03 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871589 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 591C5C433EF for ; Tue, 7 Jun 2022 09:15:24 +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=YfhSfneBxsGmI/8YGS9CfjgY2qFJcgzKjuQooBD5mig=; b=cyr6jh6loA1vf/ zN4Qr+Gc9MaWpU2albhiT9fAmj27cbix9cqxiB7yUjT05eEo+2edKZS6URWwNuJ5VEHbFgTF1CgKb I+vH5GM4fBB9HiOIQc/RuYGwIYVnw+nN5BZ96Ko9PoB2dsDvQVdjiDGj5rGTGEg0bfea0oHb8emSG e77+5lGwAs5QJwDc3g+yY0Hnzn6tbtjjjZ018SDkdg7LtEbaVYO/peJ85c1TLk4Y1nGkbxn1ke2bB JK87UZdu9uNGwlOFwEIoerRj2XORn3WojlKmQjiY/7ainQJFXbTRctXX8PHwqg7pf96Fv7xPSogGu d66wuY3rFEt1IaytGaMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVIz-0067o9-QM; Tue, 07 Jun 2022 09:15:17 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAI-0063Jq-Jl for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:19 +0000 Received: by mail-pg1-x531.google.com with SMTP id g186so6400217pgc.1 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=ZM9FU2uHw4bGdZ2JRV3HGxtMwEf3qPmNMleQSbf7w4T2vR1vjuEvx1LAtBNlGEficP aFm+6Cj7a0hKy4lJGeaUMKFWW9uNthnB/X1Uwbui/8CfzZ1xr9EXEO3I5iFnM4GCCu0/ aAyWA2r48xIa7yFyiBQsTJ6vef9TXXzCbp+Q/4DQ/VcHspI3GsMCapjC3W3n7PFTuc67 GmxDMUomXVCj+d0CnBaNPwclztmGcN0qFlA87roYeKOT/ZvoU/iRSKZYqTivDenKffXy KUxJTsP6VGMWc56i1uUU5JV6LAzZEJUND9VH3nGoeRh5sRQm1F21TXkWwEnBpR3VdyKW nSlg== X-Gm-Message-State: AOAM530rlGxcHanV/qGM1SF8qUFOcBJPiFD4V/uDcOFZXCznQRtpR80K eHj8sWFsJTClDM4cw2MQVQSCq+M5Il5a2A== 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_020618_705080_CE8DC4CF X-CRM114-Status: GOOD ( 11.58 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871591 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 1E913C43334 for ; Tue, 7 Jun 2022 09:16:38 +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=vYTFCuKSSv3i23Fc7KaZkBlWCB2D/YjJzm4pmF5c+ds=; b=ZRFHNensr2SmPC /DFiClvcU6LQ0pgfb8HbJS6DI+f7godvu+xDu4uOH16LT5a2P2qX6mP4nl0imAnQxA9viVhY4dTUB ZsA+r4Ym576owhkhb3fxL+dUB6OP9imQW0fTqqIw3eWT7iSNHysgwMi+zSHlegQce1taOaO+mZVig yFkRDVkae0N2KaBQh7MWNFUrcQlmkAKSYjRERPeAwaU4Xty2pFWRFFmF2YRo+qryeArYY6PgTZ4eK hQfKPZnQbAhaxFIzhoSDGARAhfJJTX3cUdWVoool5Scd4prRUSvL0sRtgwDTf+5pKk1CwrGt45MpT cnQ4mA8KQYZLrEkU5LzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVK9-0068KX-UF; Tue, 07 Jun 2022 09:16:30 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAN-0063MK-Rf for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:26 +0000 Received: by mail-pg1-x52b.google.com with SMTP id h192so8489751pgc.4 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=bondEJFx8dQUgskcuJsgeT1Q86M1O6vIO+GuWPmbXGwvV0M++fN4L5oF3Brk/uj1M5 M+iSxUteVc3c6qVtMt+Pyfz8cdn5hsSOaC/wyaUVTuEs7mw4U0qVh8ff8a3rqbcd7kP3 uqAL2J/kPhp6SaZAaIOXm2gMaD0PCwwG7WENux8VaHc1iPyng9udNlvPHNyJxFF9mt8+ UECSqYe0pbFXUHYdJgYAeBAh8iUjHUNYkeLuIen/xqrzNLKpmxRJwaKMd240hP37PMZX Frk3sylsV4I00Q7hd01FXToV5ggPrqdCQRTT0bTKtEJaBAkM21x2NFg+OLG7VvZaoTol IOSw== X-Gm-Message-State: AOAM531fATdIFVRYbqfRzDWLP8Xwoo4XRUlvbVHjGwAqs8qlH/ql2yOn BJ3pQUp5R2wfmMJZTnj7SEXn1A== 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_075103_2C79D643 X-CRM114-Status: GOOD ( 11.75 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: 12871590 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 62BA2C433EF for ; Tue, 7 Jun 2022 09:16:33 +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=wDX4hMfe/InBolGClrraVgxX8E/dyZSVYCCE5R3M9og=; b=OkAZ9zbvOSAHmQ r004yFq06tyCtU00/HWTdSm8FrIpLCAsibkN9RogbaVtv5++Xle9D28QmUJ343e1HWaVfFB67EXaD WiYDUr2FOfsJ5AXpD+nnmOvh5gwflQ3TP/x6wM8wY40tgKFJPt36p8W3G6+r+SwP2Qhoxo8dYiwMC j2fzx/LS1nfQi3pah83wYYfLbOGk4L0EIaatjMODWI0fG6vbE882VbD34cgOidLOdPxe21SyE2zAQ wqDWup9oFj8GdRcjheUP1HQPILnHCGD78gK3OpBCFP6YWLYOaH+3wHSCFfiFOjNRRcs9+9fM8uet4 TP4e4QcVE4Vu0RdQHABg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVK5-0068JA-SG; Tue, 07 Jun 2022 09:16:25 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyVAN-00634y-Vg for linux-mediatek@lists.infradead.org; Tue, 07 Jun 2022 09:06:26 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 129so15287490pgc.2 for ; Tue, 07 Jun 2022 02:06:23 -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=Qlj8tomM6/PiB9vvkz+ffLIseqMxg2/hKYQsQb4rcHi0uGVsPnW62ZY/nXxZQm2tTD L5/RnSijItlbeW41s+XuqGC0ZN0nkOyUiQXD3u4zYCmPm5qicNxjX7f8c5uOlJ/ZBZoD FKvs8cjK1w9njSAeAuVMmGqEhzeY8hAaUkiLi0VuL5UKIorVYFH91JwNVE38G5w+K4ys ybZyK8oJcArP44kenb4XeWWhpwOIpW1MCAMyfi/k7T1H4Rg4QXhIHklwnGGXc2BOiRL0 4h+Di96dGc3FnKrZyzVsVSFGQtcoyaEQCu8eZsSmkO+Aqpo9U8EBaf2ac6RIKyAZV7uT /vDw== X-Gm-Message-State: AOAM531CXFI+aUTj6EdJN3Kfm/rHNLZrQGXyv0VGR6c/1QcFjsoQEcTU 7Q/W0lrdKdOpqjX8EkSVC4dgaQ== 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_020624_080899_F9B3F9A1 X-CRM114-Status: GOOD ( 17.62 ) 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: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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)