From patchwork Wed Jun 8 09:48:09 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: 12873111 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 88A6FC433EF for ; Wed, 8 Jun 2022 09:49:41 +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=hBwqBVt8KLeY7bn7JLiDxrZ2wyKESMUzLQtiB1dPUHw=; b=E9WAHSZnuGaTSR qye+xcqArx+GjLx8g/T8FzeDOD9iuaayuUKo65L279LiNPL9hlHwpuH/9QP9HQq5hVePAK4bWOzae 9mqDQ22FznZ6wxdv7lNdSyTer9VLoWppjIwPq/4sXBNvIc+WLao7o+EehBeLoZ89nixd1KcFQEy5y lpwSGV29WJtvs1viuZepHHAR+hA+tgLtFs1o6QO93E2acnA3pc543q3Q9iQNJ+t04j+Wsg/lslQHk Goag88VpPtJBILwqCTRZ/vP8FaVaZhKA0zWF8ZB7jLEiP3ks3t1zaTjf1FxCQigML/jx2QoIG8rQk SJAHO7nd7CCFyZAfylNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIn-00CT8C-Ax; Wed, 08 Jun 2022 09:48:37 +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 1nysIc-00CT4q-E3 for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:27 +0000 Received: by mail-pj1-x102c.google.com with SMTP id o6-20020a17090a0a0600b001e2c6566046so23335230pjo.0 for ; Wed, 08 Jun 2022 02:48:26 -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=Dk2EVUG101rQm23r/ZlU8mzZDKwDG1KKDCi7n9ZjRd8=; b=j8QWqh3VeH6zE+x5CqSxyRP92nBBtths9qDeKi+gqFUHoz2TBsRRzOmCA/dl65TGwX /YWZzow5DUgSybhjFdXM6++3qtRpUf+Y3ZTUfD0/hucV8+31RhGlibfVOBG48yYoOvcN ChPCccBhnxS9PivqID9+qUOQp1utj7jEqX7+I= 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=Dk2EVUG101rQm23r/ZlU8mzZDKwDG1KKDCi7n9ZjRd8=; b=jZ0GxbzwZLw5v4t6PXMSJYBIMu42jVFiTHz+dR5C7BWm7Xufuph8t65Ik9MQPOAgmd qyfcaQISxCUcS5XPoIIvNAFNADUBj7bN+b/eH2Q6O/mlT8AAxtabHvxRzNsKkja5Gap8 KhWeRVQYjmuPT0F6fiEnO+3iUTW3WZHRJ5li5sxK3sJ+suTsTulFqNb22qjtZp8m5yzu QspPrhfGN9mJGnO0aGYszQpB/UrhMlOsrQhQxQX5Bdtm/dvfdl3kYy/A907bik0pszz+ StfIkLTz1rtrAvbQkXCAFuOXyyH5wysnitaJZF9BPUdp1zOpbfo7pnNNdNSh2YO8L2x3 ipkA== X-Gm-Message-State: AOAM532YoOfpyIeD9rAArn7wfEkfxlSUCMONL4z1E7bkSHV0tut3rLk2 fTQ6IIdN0zomH3BmmKcE6Q55hw== X-Google-Smtp-Source: ABdhPJzyscN4nhpdxlEaz3bHujhJtkfRSWOh9x+gpg+krvUZqaEWRACfaESxbhHHo/6Uk0P45Tdfvg== X-Received: by 2002:a17:90b:c85:b0:1e2:e645:a8c9 with SMTP id o5-20020a17090b0c8500b001e2e645a8c9mr36464915pjz.185.1654681705655; Wed, 08 Jun 2022 02:48:25 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:25 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/8] drm/panel: Add an API to allow drm to set orientation from panel Date: Wed, 8 Jun 2022 17:48:09 +0800 Message-Id: <20220608094816.2898692-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024826_514479_A8F8AF83 X-CRM114-Status: GOOD ( 18.65 ) 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 Reviewed-by: Stephen Boyd --- 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 Wed Jun 8 09:48:10 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: 12873112 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 DF547C433EF for ; Wed, 8 Jun 2022 09:49: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=mKmqtc2KSelynTmTlt+U0G0vzLWB+G2RYqDoup3NhBY=; b=dyy3oOdgnlT2HC T/4qKzlq1sn7JNA8BjWU9BCcoJdEssLcj2YxJmHflyYDSMs7OL8BIeMZj16XPM7gHNWhiYO1FjM3O fZOXJmdzAX/Mmg1LGU0rrprTZJI5ooPAIRoad5hZyLXFCqnPnFjgKhGxNCvkxeD7c0D+zzhMFglDS t0z1XiupgyTMLm7fdLz/eYPmg4yah7GRcwDfSLvAP9gEvN0Ik6WlR3SewIJN5K8jQYFEenf3Cq3vD hlHqJqLNuNov8dqpaJRCgjp8yl8pQYDv+MN5idmbz9tiSgTDZS1Knm5Fvyam8b8eoyZmEbVA5CrwH QMQl/xIwSyp0A8GtZmzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIy-00CTCp-8B; Wed, 08 Jun 2022 09:48:48 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIh-00CT5r-LD for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:33 +0000 Received: by mail-pg1-x52e.google.com with SMTP id g186so9528940pgc.1 for ; Wed, 08 Jun 2022 02:48:29 -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=W5IKfgYz5xf2GI+6lvPe+62g09BBcgumm5yF5o1+Nx4=; b=FQ7vGEL7CIyuMkUWz69rqKrfbSKqncuXS8hn3qh8zQiCYfyqiMehg/B+6gdS5GARXc ui9CaQ7f77yeRz7RY/Zsh7ogBiuv7UkxPXGf8AbJYk/iYQ6T/2ylrotouKqEowLpbmeo JdnYEyK/8LRszk3diG3Wrg1lqdPFcK30T8wZ8= 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=W5IKfgYz5xf2GI+6lvPe+62g09BBcgumm5yF5o1+Nx4=; b=7d8RowwgRNGZsBU7NtkzeC2kpRvWVOdzhvJj67Gtmx646AUcFTbP/YMIwcOgYIDTB/ yt36/46zMKpdw1SWq6F5fG/zcDS8NIth6l/vaTVBkiQ8LK3/vC2lsn/gfwtT+xjLLM1C K057fIXfzTN0T4wkv+lpIY4G+pLRh3AtuinCFbbyKhvK6U9mO5ye8sgdnTqYnTDe0wFZ xf3U1IH3Es2ppHPyPyJ7cP+KtNIWhxlvxVk+FYbzPa3CKbGVA7GP54Q855lJNnAQdXgc IDuHpKXFzpXoQmUF9ezx3TfRecBSiFlJ2jbWUY4iyEXBk7gDBIJFGUGS1aQUppNtdnzK SrEQ== X-Gm-Message-State: AOAM530orzCjpKkWhe8Ej3sUQ8n6hAgFxCzJNxfBhmkXdZp7YfMlQRAR EZR4TqyWldlNDihwSytzs0zyqA== X-Google-Smtp-Source: ABdhPJwY10X54qkCemGXIJKUyFcIOP4JABpqefy/KV0RlOOHwUX0S+RhW7c3RXQRcQoGKn5AVKPZbw== X-Received: by 2002:aa7:85d1:0:b0:51b:f4b5:db7b with SMTP id z17-20020aa785d1000000b0051bf4b5db7bmr21661005pfn.41.1654681708744; Wed, 08 Jun 2022 02:48:28 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:28 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:10 +0800 Message-Id: <20220608094816.2898692-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024831_789006_EF4132E2 X-CRM114-Status: GOOD ( 12.05 ) 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: Stephen Boyd --- 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 Wed Jun 8 09:48:11 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: 12873116 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 3D0C4C43334 for ; Wed, 8 Jun 2022 09:51:11 +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=evueH3YQp36/+C HGcBKXBfJnBA5WE+MEht3440U+VT2OkkslsNSU9mNnhla3kPv3/983ic7tuJA2r1CVB31ciW4n0kl /b3dSP3rA+2k13uaRHQPrjZ7PWtvEKs8p72qc4zVE17mU+WkjZSJ6qLrFyahGXsWgyLsHekMFInos eP9YLqbMxJmpsVmWddWnnGU3pe/dvAgB7ipwhGl5UV7cXC3/We6vYEKvuPUAuLqluzPACAAvCMPVd VDhbTqM+NovD+nU/7yF5EUJqoNvbmi9H6NA30DvyHRjQ1us9cnJ3Q99VNkWk2EGxjBvWXo0sOXTIr yRTaZtt/3k5fTWNncG+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysK7-00CTiT-2w; Wed, 08 Jun 2022 09:49:59 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIv-00CTAs-AL for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:46 +0000 Received: by mail-qv1-xf36.google.com with SMTP id b11so14132505qvv.4 for ; Wed, 08 Jun 2022 02:48:43 -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=PC2Lf+u82p33uAaLxsXBYJ5HR2k1jQ6H+aVDwMbLLghVBr2zDl0OupdsKQJX49uHlU jghqbYWRYx6nQjD4D/zcrT57r9Z1nUyag0neqj0aXKiuTekODbs3teUCdmSgDnmW6Gj4 HkfsrRM9CHzuMRJnbG3uPkwoM/Cze2d1WnxpA= 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=3xUIyZ9e681A8Q0SYNlEc4dNfWVwBpCASTJ4GSSzaAVtvmIl3rOhKJBfrZcFKkGj77 kxzDxC8zhpDgddFvQYssZHyG74pONwu7kApU5+hMET4LXfYZWGQas9S9nLeEbY8pFBBL bjekdW3Kfbx6g/2AqfToFtK+aaoVcDURrj75pEpUkA5dUDnlIekI/43+iUJps1WabwZa yMfMO6D9SZoi0yI48gc6hmSjBTkYo6EBSXT/inbSxSUHzBEtNyMni3QUctJJ0JV+HrDr IG5DG9Ol/xJihnOJqIIVtCLXXucd/Mvi4nPDvD/9kAXDNmwOubdYEoZblhB0DvceZJRx 1XmQ== X-Gm-Message-State: AOAM532G6EY8sMGRu7fV8lJwQlJSJPolsQBrUFxm1ZNOifwN9aGMH1Tc gP1yviLJlr+qgk1Ui4soXrMvPkVzHaRw4g== X-Google-Smtp-Source: ABdhPJwCus0/AHl/dRscJRgIX7poTraTPgZla5QlFjXvawXiC6yhcifPPOgD8PTJrjHmTVrLJxUjpg== X-Received: by 2002:a05:6a00:170b:b0:51b:cf4b:9187 with SMTP id h11-20020a056a00170b00b0051bcf4b9187mr31051182pfc.15.1654681711868; Wed, 08 Jun 2022 02:48:31 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:31 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:11 +0800 Message-Id: <20220608094816.2898692-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024845_403145_C43FA446 X-CRM114-Status: GOOD ( 14.20 ) 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: Stephen Boyd --- 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 Wed Jun 8 09:48:12 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: 12873117 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 A6CE7C43334 for ; Wed, 8 Jun 2022 09:51: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=16vXaaVFGnNpak31TxmhOhH1K67eK88C/LiYMPWUzuk=; b=uzaNv8pKLlhtOZ P3TL0wOIk11nd4JIYcF/2GCuu/R2jz+qPjw7nn45DZ/LfSxFMMUmHZVOLrQ8RL4Jpd2+H2qyfoEBJ 1bBOXmeaO7TQ0jaQdpNV93Js1yPiJkBQ2SzDAkPfZEMYCpl/EKxdh7DBdd3ALKgWw+89ozX6zUq47 8eH+8y7bUs/L0qkR+qsKPi+4GXyVNJlnJJ/YVKgjWHyKTLv1Ng90lX1qOgo0xry6BPW5XRMoPWb1T WT8cbUr1OwgA6/mSGjAol5IIV0zvoFtB7afUNjPuqRSe47ibXDeNs/hYatNskCEIojkmJiUqu/j9d 8MBL5VPmmJ45dwcLNWTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysKS-00CTt1-RU; Wed, 08 Jun 2022 09:50:21 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIy-00CTBt-6C for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:49 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-fe15832ce5so826997fac.8 for ; Wed, 08 Jun 2022 02:48:45 -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=guUBWKPAZLE2AlknSqalQJBGhSqpjjGX0nCX7fEpw8mzo0ObUjigy0AnDfLEAgdFk7 Y8GbNFpn/KksfZR0VbXB03OYgAEdrAzGbZiNOhgBNz3CaGmcY822U1qi1ig0Bh6r+fBz n+dMy4c5aZO+9GYZOnCLA+xXQx2vcJI4LqdQ0= 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=cdqzTx9dA0/OakOUqpbnVhf+mL7Ecd7QAWf/lFxJZFIdO8hlMXztLlnfVjgWfnENJA SbdrhZk3v1dsQZM/cKdN5adlNrn/7t06L5AGfcCEm/NMc2jsh8KfyEjkb0NDSyyt77Cz L48Hkbd50qf/6mLADZcJxjUt/npfVO3kRVVP77K4N8ZLvP1qTnVNmOfKKjGcG4mArmSI t8yp4kLOq8UnzCMQGY7y1hoYs8VY5LcW6ERzfUHBfmZiTwLwH9rL11DB1jFm4wpLzbjU H57/F4+fWhZAPSlcmKBrV0+diEsb7ytquOucJCbIWSP4KdLRZMnIpfXYrGzzESPz43Ro mmYQ== X-Gm-Message-State: AOAM531cskw4EOmKiURl9irSoZ6zD6ooP1PiznO7XxW2TGaprD+3P5Zv bYpMU5PGv9GMQKujrEBZuK5Vqqtm8ardXQ== X-Google-Smtp-Source: ABdhPJwy4JZc4zb4+EKQwQ9hvDSYmC3kXEw76KbN7E6cksRjAfK4BeN+5E0C6Ehlqqimys/OXDBLMw== X-Received: by 2002:a17:90a:4897:b0:1c7:5fce:cbcd with SMTP id b23-20020a17090a489700b001c75fcecbcdmr72094458pjh.45.1654681714929; Wed, 08 Jun 2022 02:48:34 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:34 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:12 +0800 Message-Id: <20220608094816.2898692-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024848_298437_B89CD82A X-CRM114-Status: GOOD ( 12.39 ) 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: Stephen Boyd --- 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 Wed Jun 8 09:48:13 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: 12873113 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 13DF2C433EF for ; Wed, 8 Jun 2022 09:50:12 +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=3g1AMj7gvmmk9mvylnFtc9rvlggPT+KJtsCwNhk2FKw=; b=JNN7z6Cwxadfxm noRUE0OhYuEch0ITi1WBTZr2H3jSfq3+oLvTbV3sgCgZe3NP8JsnButW3kP8OJLMgmNPIUAs/e4aj OcoXmM5VWPeq/WC0DTGFDS7N0GyUNoXVeAgYn6Uv12Qg4yWlpRbkJCPtZD3aJQR6pnSvMKEXfK4fa tgyvqqKmdQFZxrZVBXTzdwRf5Q68H2NpuGRVoAFeyYaaBhGdSSeGitvMg+9lRZCotA//6tK9ux2+E v03dvQBmFojKEc11hnzbuReinazukv06bdbX//waCTIzbdwmDVQEtfjIT6si1YCQGAcsI2J4/8Io/ RHbzd/maPxBSo8cels/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysJC-00CTKR-It; Wed, 08 Jun 2022 09:49:02 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIp-00CT8g-Eh for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:40 +0000 Received: by mail-pj1-x102b.google.com with SMTP id w2-20020a17090ac98200b001e0519fe5a8so17839792pjt.4 for ; Wed, 08 Jun 2022 02:48:38 -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=2Kwtqm69tvB7WRggJ5XHn949T/ZlxMDJh6EaE6ZnDiY=; b=YiFjyl4RYZQSh2zneOZKlgN1NfU3DRQWkkpcKfqjp4gdEGrKO0TU93MKmu/BaDusgr zeN07NEm+R/RJuhTParW40BbEBlEfW6j4KaVcmMe4NVLl7RXkACfADg2vkGqZxj8WJlW uaqt6JEDWLB/Ntzjx+fFCaPdezjTpOAfA3lkY= 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=2Kwtqm69tvB7WRggJ5XHn949T/ZlxMDJh6EaE6ZnDiY=; b=ir477rCfPtY6VKfyHHbdorbqhUUEM2h5sDVvy2vVG1ILToDx5Xd7miQGpIgH8X9SGK rXQDDxQbyeuOpI5+piFql583oJWErQNWmFywYZKg7fsexHaknEorPZcStqG6TNCA0fYU I83mA9gPkM1SmYGZJwLLLlx16m1P4LLA850r0ir2AHYfSpyMugZm4NKCryG7n2rryWsb 4h+n9khgmDY5XaddY0Z1Wo3C45/u+G9CyHxwCi6IPWBnsF9K84x9da5qR3dxCIpFZFDl idrxTbQ6+egwpHvXQ2hUSEP5UotqS6/BFbTJyyu//49VXrKk3Kx/58RcBYxu180sLJep wvSg== X-Gm-Message-State: AOAM531xK9B9RKp7eu/wzvmfFPT8UnW3Z/V+6OD7xmN90UuWf7uXk9jD Aly9HUUEAz3AaRzzZwM2V0t10A== X-Google-Smtp-Source: ABdhPJw8/VjrArS/YwkMwV0jBdv3BkZXAYmdj1+zyPegpaHvf6Ix+84rliKCIlsZqY98UOd6QgTghQ== X-Received: by 2002:a17:90b:4d0a:b0:1e2:c0b4:8bb8 with SMTP id mw10-20020a17090b4d0a00b001e2c0b48bb8mr36934374pjb.94.1654681717995; Wed, 08 Jun 2022 02:48:37 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:37 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:13 +0800 Message-Id: <20220608094816.2898692-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024839_510342_36625FBC X-CRM114-Status: GOOD ( 13.51 ) 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 Reviewed-by: Stephen Boyd --- 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 Wed Jun 8 09:48:14 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: 12873114 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 BA3FCC43334 for ; Wed, 8 Jun 2022 09:50:31 +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=QZtuNIxAMLkQGy A/FoeY8pPWuqqALJSt+kaqgfW95lMGGS1yUNkNT57U8lNzpgFqsJjUzF98MIqXVSWL2w5TI4mcfE2 X8A6EeaWYgC1guFXJHipTdMs6O/6gXM3n/EI9vrsZqLe+zM9oHjlRMtR3HxtupWJWz0s93ltInC76 spptkdVNzoqUMf9KoPJCf0WkTSJ8BeiezCsiCa4zv1LrxZCC5R3WVUOKPMJfxvbZqQpshfSUYA9mI xKdW1y8LoMRedFX3Ti+ck2QAaQ+DEHcu+UGFp6gmyxbDvu1Pal0nilEFtSscbMUlu1FI/qM7ZuyKl 1O5QgHsrz6uN/W5ishOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysJS-00CTRX-Tb; Wed, 08 Jun 2022 09:49:19 +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 1nysIr-00CT9v-G3 for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:42 +0000 Received: by mail-pj1-x102c.google.com with SMTP id d12-20020a17090abf8c00b001e2eb431ce4so17861673pjs.1 for ; Wed, 08 Jun 2022 02:48:41 -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=TKlka2JWr44ssLLTx/ABCtjfqthwug/PJ8osEPhlEiu9s3s0R2eFiNlLU2VVBCK2oY spEI6IcIC0Y7RuS5XIz/7AcpSgMzg9RJ+pNYuGhUAVQ+QcbzhgLC4+gLDblo9s8kXDwj LwKR6/SQt8R+YXpVbDMufrMBVQbFsJS6qxt74= 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=0HMBoCL5Od3NMRJEwWH2HL0bxZq3HrWJ0NYOlx5ZTB0KCw9brZpHz+Dry1hOxg6IxI tnWwIJrqPgWK4qW/kzfxYIKJ57bmIRFGyKJ1IZIdti5PxNAh+vgvwX2mYqQbcluphch1 2udBra5lpvBrKCXsP+4kBFajYeJjYuiXqMrWpx370yyyUTVg+4a4pcdMHhoF10xuuFwC T0jkOVgy4zKjN1ahynP840R5ruDfsBGEXs2kYf8t6/x1xtM1GoR2JNnFZqatBtDC2Oe1 tFVLmQMIjDKf1xlw5qYcptsRpF033SoUm1EcxmCu+3VUCDS7l+6FSgL3gfs22fB1Dyri Enkw== X-Gm-Message-State: AOAM530l3F9PcGhww3yEbDgeibwgBMGpTtF+zlepokv3JquWXbhyQ9x2 3/o5b202gRuNOSKJtFm6Hf0oTw== X-Google-Smtp-Source: ABdhPJziscByCaE36IM356mQcufbuxFzgH4ydP6X03lbRU/92TTGOXEDQhe7TphA6EcNjWJhBZO09g== X-Received: by 2002:a17:90b:1d8e:b0:1e6:74da:97b4 with SMTP id pf14-20020a17090b1d8e00b001e674da97b4mr37453886pjb.147.1654681720998; Wed, 08 Jun 2022 02:48:40 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:40 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:14 +0800 Message-Id: <20220608094816.2898692-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024841_575840_C5563B0C X-CRM114-Status: GOOD ( 12.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 Reviewed-by: Stephen Boyd --- 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 Wed Jun 8 09:48:15 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: 12873115 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 1964CC43334 for ; Wed, 8 Jun 2022 09:50:56 +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=cbIIa/mzmbnviu 4GxKsFGOn4zwJXTz1cgxT3jffgUFhY/83r5Fgkx+kKIzJ+pMgsQKlQsCoROsgl0oAepfGtCdxTM6V 2c5phvhajj8ZcGx8U5W4p+MXjPn95xTPJR3K3alUCIFtxOlSnCZK8dIiYCmOTGIHn6GMdEAbpP6X+ l1fGKBXGwBszqfEMGsFIg0veE8OUot+w6ZQJIS8/upiDml+SlBJblY7aC0RFMFVJSlWdzIqHkLDuH k5M/0ZcMZQfRXr03EFLBx5xYT74HntpMtgaIxqFXBLPPU+bXEaJ/srOQ9seWN2qtzuMiVwOaQjtH5 0pRJxMpzyqHLob5HBDsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysJl-00CTYx-SM; Wed, 08 Jun 2022 09:49:38 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysIu-00CTBN-Nz for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:46 +0000 Received: by mail-pg1-x52e.google.com with SMTP id d129so18392267pgc.9 for ; Wed, 08 Jun 2022 02:48:44 -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=mjuft6W3VEPdNGWKnaMySpl6rJhexsAI7rf4/oPj/3tXgbm/bcKGzqwDhkVuWJKaoW 6ZkK7zLQTboNF1KItp4Oxfn3PweihWVf1xrivLIyCgakTPyxHhEPSn37kHoOU5EpDFgD fYZKTD6N8AwubVrXTmhjJCn+kUhyJL/ibOvnM= 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=VZu/SUYp+cy8d5AnIa1VOUVWE+wvsEBz2DpqUIKSoySByqd51IT7eM/9Mj5Np9uohh h7smfomZo7jcAnyomcxlrNqIbHW6bxTaDxkDCCgGbwwrjs5VjPYcLALOMJz/6xJv9Q8f S4O4O5FWHAYWyWGl/9ZPmaTVfz4U/Jfhc2dr5gZZM73dCbh6cmEhALVv0HXqrmSxvmt5 hvomPybu07Wctv6Zdc2rKJ/SkPVCUvuB1pYP08GDfowoc2ARoiFDUcr8ziSnhJ8DSWVY X1OxZ2a4AWRdV698nIKOtKDRqy6bsWrC8mBXI4i2dQd7tVunhCeHxoFsa8ZB1qSrgQLX d73A== X-Gm-Message-State: AOAM530JJt4cFFky7HPz7u5A/aMJX+1cqBiAFlaConpRNsG+jPVmEUJW qFymcd7AmEJGyEGa8N4SUq6RXA== X-Google-Smtp-Source: ABdhPJw0BdPzl0+1r4mTbW1xYGaRkwt3tvYvHMMvISgXDyTrIfNUNk9FoJ++5/FT423uIbh+qaXxnA== X-Received: by 2002:a65:644b:0:b0:3fd:d5d5:8c7e with SMTP id s11-20020a65644b000000b003fdd5d58c7emr11242077pgv.590.1654681724058; Wed, 08 Jun 2022 02:48:44 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:43 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Wed, 8 Jun 2022 17:48:15 +0800 Message-Id: <20220608094816.2898692-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024844_825844_5897A9CF X-CRM114-Status: GOOD ( 12.13 ) 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: Stephen Boyd --- 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 Wed Jun 8 09:48:16 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: 12873118 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 D7A70CCA47B for ; Wed, 8 Jun 2022 09:51:52 +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=unTtpp3z3Z4JRaAMR/X7x5HxLy8dp31DnZ32JA62oQs=; b=JsGnWVd9xgig/U JmgDKK86sQvVkgM7e7MB3FoQXw+1t/ToumWOYIDEZtaNp5afb/fD919Gij4Lta6XMMgAZasG/mB+E OP/U85y5wydHzOTnCUGI8XC1JitmL49YPHBs3GLHR6OJVD1nLbrfJ2pXwE9fbuGmtzNNZoHZpkC/e eCG3+IP0Cehv2G2lfIbj2J7mbsA463duevsoAks0s/YhoQz0hmTg+sGMecRc4BMZ9nx1LUhmkGWsV Pt34GQonMpwqdHpuuSq7Gw5+otnOMwdvsWbHlHAx2hA1ipM6uS8QjZFATXuRq22DL9G9w8P40wOju 09cYfgRrxVeAhNmWbJ+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysKl-00CU1r-BQ; Wed, 08 Jun 2022 09:50:39 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nysJ0-00CTDJ-9L for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 09:48:52 +0000 Received: by mail-pg1-x52c.google.com with SMTP id c14so18370735pgu.13 for ; Wed, 08 Jun 2022 02:48:47 -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=BEB2zHdExy2JKoB2FnnXWzAZLyF7rSGKqnEw/8nOqCs=; b=BFMw6WULQCXhZ0tMZpRPApSUFdvzdpcdbu7DQ5CIROH9eKmlQdSvTvQvryO95/iwNh KjlKG2uLJlvDV3lsqovmLOB1RgNHoYkLjGCexXy9vCymrGL+byGXwuwL9r0yXNb0mdcf mXOpu12iRggJxkgYZEBDa+j0NDJ2POeM1/G5I= 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=BEB2zHdExy2JKoB2FnnXWzAZLyF7rSGKqnEw/8nOqCs=; b=A4au5RMH/vXwGvp9+Q1AJYAgTt/4HbhXMickgC5a2OI/aGMbwc0Pr+Gs6uJDdGZ3c/ ifpKtCewNbLkgObtXGKFTyZ/uIXoE0FC6eZVpdWu7gqmI733JE0pZ6rlyArtCmggfumB pMlfhats1ASGHjN/95PARGfpyQbSP+NXyCknJIXzeGmq68YKQjRaA9X+AcC21cco/dWB pCUGLLVsjogVcMunUYSZsS4o+byQjkqAqw6YXOlsW8jJCpBRcwaIPYwFIVq9vB1M8kmD zQwQvGREc7+fM+mbTYLp+v0Azbnt9XYk/U7XrDXV7mlq3spbSSwmUjy0MbelacnTrMoD rFJg== X-Gm-Message-State: AOAM533GvYPCFSJcqUMKdMH5NuwL9/L/kDtFFGu17r/iKZ8YBG++q7B7 cqiPJ5WNWlUYEAsSYaDNk7aLGw== X-Google-Smtp-Source: ABdhPJx3PhU71x1q1DzxQGfjWbLB3CXS9FckTrvMBw6DjrgI8cNdYqfg0cuniygWSY3E6OgqeEJ2xg== X-Received: by 2002:a63:8a44:0:b0:3fc:a1f8:806d with SMTP id y65-20020a638a44000000b003fca1f8806dmr29776837pgd.363.1654681727327; Wed, 08 Jun 2022 02:48:47 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c46b:e7b1:f6c8:5eb8]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e28e80a8d6sm13584038pjo.38.2022.06.08.02.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:48:46 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 8/8] drm: Config orientation property if panel provides it Date: Wed, 8 Jun 2022 17:48:16 +0800 Message-Id: <20220608094816.2898692-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608094816.2898692-1-hsinyi@chromium.org> References: <20220608094816.2898692-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_024850_380006_56409112 X-CRM114-Status: GOOD ( 21.16 ) 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(). Some 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. In drm_bridge_connector_init(), if a bridge is a panel bridge, use it to set the connector's panel orientation property. Suggested-by: Doug Anderson Signed-off-by: Hsin-Yi Wang --- v5->v6: mtk_dsi is using panel bridge, we don't need to obtain the panel in mtk_dsi. Instead, drm_connector_set_orientation_from_panel() can be called from drm_bridge_connector_init(). --- drivers/gpu/drm/bridge/panel.c | 36 ++++++++++++++++++++++++++ drivers/gpu/drm/drm_bridge_connector.c | 8 +++++- include/drm/drm_bridge.h | 3 +++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 0ee563eb2b6f..53c98cba719b 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -170,6 +170,17 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { .debugfs_init = panel_bridge_debugfs_init, }; +/** + * drm_bridge_is_panel - Checks if a drm_bridge is a panel_bridge. + * + * @bridge: The drm_bridge to be checked. + */ +bool drm_bridge_is_panel(const struct drm_bridge *bridge) +{ + return bridge->funcs == &panel_bridge_bridge_funcs; +} +EXPORT_SYMBOL(drm_bridge_is_panel); + /** * drm_panel_bridge_add - Creates a &drm_bridge and &drm_connector that * just calls the appropriate functions from &drm_panel. @@ -269,6 +280,31 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge) } EXPORT_SYMBOL(drm_panel_bridge_remove); +/** + * drm_panel_bridge_set_orientation - Set the connector's panel orientation + * if the bridge is a panel bridge. + * + * @connector: The connector to be set panel orientation. + * @bridge: The drm_bridge to be transformed to panel bridge. + */ +int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge) +{ + struct panel_bridge *panel_bridge; + + if (!bridge) + return 0; + + if (bridge->funcs != &panel_bridge_bridge_funcs) + return 0; + + panel_bridge = drm_bridge_to_panel_bridge(bridge); + + return drm_connector_set_orientation_from_panel(connector, + panel_bridge->panel); +} +EXPORT_SYMBOL(drm_panel_bridge_set_orientation); + static void devm_drm_panel_bridge_release(struct device *dev, void *res) { struct drm_bridge **bridge = res; diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 6b3dad03d77d..1c7d936523df 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -331,7 +331,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, struct drm_bridge_connector *bridge_connector; struct drm_connector *connector; struct i2c_adapter *ddc = NULL; - struct drm_bridge *bridge; + struct drm_bridge *bridge, *panel_bridge = NULL; int connector_type; bridge_connector = kzalloc(sizeof(*bridge_connector), GFP_KERNEL); @@ -373,6 +373,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, if (bridge->ddc) ddc = bridge->ddc; + + if (drm_bridge_is_panel(bridge)) + panel_bridge = bridge; } if (connector_type == DRM_MODE_CONNECTOR_Unknown) { @@ -392,6 +395,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + if (panel_bridge) + drm_panel_bridge_set_orientation(connector, panel_bridge); + return connector; } EXPORT_SYMBOL_GPL(drm_bridge_connector_init); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index f27b4060faa2..b0691d728139 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -917,10 +917,13 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge, enum drm_connector_status status); #ifdef CONFIG_DRM_PANEL_BRIDGE +bool drm_bridge_is_panel(const struct drm_bridge *bridge); struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel); struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, u32 connector_type); void drm_panel_bridge_remove(struct drm_bridge *bridge); +int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge); struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, struct drm_panel *panel); struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev,