From patchwork Wed Jun 1 09:46:30 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: 12866600 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 2AC0FC433EF for ; Wed, 1 Jun 2022 09:58:47 +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=2uyuVEDqKkVz7gbckkRm+rTCC2fuwEHBqd/LPLlOmCM=; b=1rML6nS5Ovyd6l h13KOrUFQdcVCxp+RzGTF9VZ4DMCdj2oBfs+qvG6E771qn3Mm61JqbAfUcKWlHsOtg33KGC9iz/wx WxpP6UZy13BrmONar1sqpArieUl3i14ZODhEqPkgwWyHYLWJO7uvLaiQk/oOK9guViQMoQoBHWNqr Iw5qDsBs8sMaJzPZcgWIr+3Vj6+TRzBm/y7xEnWokFEVXQYaUlAZi4Rmv1z6b0asfzM7yAwdcILvF IcWDqag8W0KhYPo+rFZw3hxNy6DFSl/6SZkdGEeJWdgAsYyzbrhQHfMldNmbXr3rtC/2z0fttEMgY jwLkMqBStdcYsbki4WvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL7f-00F5e8-2h; Wed, 01 Jun 2022 09:58:39 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwC-00F1EU-0o for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:46:50 +0000 Received: by mail-pl1-x630.google.com with SMTP id i1so1295019plg.7 for ; Wed, 01 Jun 2022 02:46:48 -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=+ly6+5XNWmCSkjCBGbVKtEs9r+Surb9t2PEnnpf5hGg=; b=QRBX/kxizeClVBE0CYu4NjV4OOEi4yCiQqllUL190dxEVKt6HTUf6obRnPH+h/5Do6 X67p3+jRpmcMr2sRMX1JDEgOAmWlHfT2i9GjxibwNOvxEKU13OXXV74hKqUHIvaf6LSo TiLpRisA8FksqwMAxdxJukxiVP42iMy06fPk0= 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=+ly6+5XNWmCSkjCBGbVKtEs9r+Surb9t2PEnnpf5hGg=; b=QlMmc3ns4dXmLwEIJOwaC7N7sQ2x3GJqIl6+sA4t8xmvv+NuFl5YTAPUDarBz9jLgZ kQjhu8gZ4TRKgW12podXHcaAvjxvXJt7nH4ymPBO74UN/Ruag47WnaKrxCbwA5hFUyZG yS7KvX23m7l/QafZaVhUkesLine2md+95WPc6y9HfzgIj8j9ZPK1acP/4f/HrmcDq7u4 nWL5tfxFdM7ULFNI/ncrRJvO2xxzkBWcVeIE1A6ixiYiObGZ25Nek+lkDyTofz8Ki1A+ BOEVXDctPvU9irQn3M/x2D+iI2svggssv1pczzxeFJ9wgtVllVe1Z0RgTbBxCEDswEdl wv6A== X-Gm-Message-State: AOAM530NJsfqvIR84PaVq5wTqXDLl4gIXcAr3XtxN8FgQC5YM0SxoiPN gkOnlrybQkWS8s7LPuMFbYOQyg== X-Google-Smtp-Source: ABdhPJzeWn2amYAMvPYY4kbTogyvoZUC/Zy9OCPdoeNKPYAG80RGrpKEdqDx8Y3iV2XaG61OhG6/CQ== X-Received: by 2002:a17:903:1211:b0:15e:8208:8cc0 with SMTP id l17-20020a170903121100b0015e82088cc0mr66287614plh.52.1654076807659; Wed, 01 Jun 2022 02:46:47 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:47 -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 v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation Date: Wed, 1 Jun 2022 17:46:30 +0800 Message-Id: <20220601094637.1200634-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024648_099115_D7AC40E5 X-CRM114-Status: GOOD ( 15.39 ) 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_panel_orientation() before drm_dev_register(). Suggested-by: Hans de Goede Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede --- drivers/gpu/drm/drm_panel.c | 8 ++++++++ include/drm/drm_panel.h | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index f634371c717a..4a512ca80673 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel, } EXPORT_SYMBOL(drm_panel_get_modes); +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->get_orientation) + return panel->funcs->get_orientation(panel); + + return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; +} +EXPORT_SYMBOL(drm_panel_get_orientation); #ifdef CONFIG_OF /** * of_drm_find_panel - look up a panel using a device tree node diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 1ba2d424a53f..d1bd3be4bbdf 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -133,6 +133,15 @@ struct drm_panel_funcs { * Allows panels to create panels-specific debugfs files. */ void (*debugfs_init)(struct drm_panel *panel, struct dentry *root); + + /** + * @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); }; /** @@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel); int drm_panel_disable(struct drm_panel *panel); int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector); +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel); #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); From patchwork Wed Jun 1 09:46:31 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: 12866602 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 4BFB8C433EF for ; Wed, 1 Jun 2022 09:58: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=Mi1bA+0lqWyFecmdnw8pEWr2k0Q5Lo36UhmJMJTzl+s=; b=MjZcswa5nRfA+q uIuoZEG1x6sWXwDwp4WsdZVGn+E4C9T2MgJFu2md3MnHgPdBS2i++/QJEiB8C0MSlL8iycZNblAeK /TcAZX2mc2I4zIQZOFtiFv9cRQV44AwM5hZ/dlanbcWjhx1jIxoptHzaejwHI0+Qvj+nf073+Dh4q woWg31aDquxASIso9LM1ZZvtl/WyGqSwPbWDSkewmfA5aGTLz6xK2ElE2kRHSjEn+sClgkJnzSoHb gNj1scQ6iogQ2qAZdeFFA7vuHN9ER6Bp27tQCjFBCGuXzmv9NxO2a9LhXabRPOwKW2lzeTaFWOYGI z7TNxB27+u1/GP9m9JdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL7m-00F5hZ-PD; Wed, 01 Jun 2022 09:58:46 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwQ-00F1IS-Vq for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:04 +0000 Received: by mail-pl1-x62c.google.com with SMTP id n8so1316253plh.1 for ; Wed, 01 Jun 2022 02:46:51 -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=INHYjrtzuqTmW29J42HX48K917nNuhGdGFIMxI84h6U=; b=LvoSbn8q477RrYSibfBveWnjpFmVPUg2kyylSMS3U9WKUzvZCOaAlljYZnNmB8h3IH KUfDjgnk6qR2j0EyxzpkDV27Lrn/h0xLPVTM/K48nLP97GkQUIcK/5Xj12qxQ980Pg5A F2Kp0FCwVJ89GKq2sYlijKOfjGgViTwvxvTj8= 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=INHYjrtzuqTmW29J42HX48K917nNuhGdGFIMxI84h6U=; b=pSvABqpWQrlhVGtnQjde+fsaHBv4+BbJ7zSFzsR1qm9djjfOB/I4viROU6oXg3Bf/H jPJmzR1oBdXufrsw8WIt9r6eX/rFVKTOfsGVc75cAVxPZW5Ze9g7EvhwmTLv9YugtwmT svHj6uw/frhsp/HUy6h+fWGaFLK3vYaO+WVfLsQHKT+Mr/TJlJ1CQNz3fRyLAs7UJwei 6AjXAAuPcD9Z/6qVmC9etwKivjCfolwiFfOzkTD52ldgdLTSysgaiYd1AMvazZEs+6OT DqAFnW2gazRv2NPvMODDCd/9+W6/Zy76s/Y/CemMH1dJGnYdPHzLB/ZqS+kXu8TiS88v ht3g== X-Gm-Message-State: AOAM531TNaY1FbQZ+yQClXgMadug0sjOn0vqf9NBnh8PYSkKSNMm5HjW MnnPq3BsPhHPSkfzHkMrPtfcsg== X-Google-Smtp-Source: ABdhPJzmCwkp/oP9bNtMxaNhr0RDu6E+1BWrnv69WtPiA4cmKqDHhI/gba5a1xxURUe2vVmGy8TPkQ== X-Received: by 2002:a17:903:22ce:b0:163:f186:f3f6 with SMTP id y14-20020a17090322ce00b00163f186f3f6mr11348483plg.59.1654076811040; Wed, 01 Jun 2022 02:46:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:50 -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 v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:31 +0800 Message-Id: <20220601094637.1200634-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024703_137681_D8A614C2 X-CRM114-Status: GOOD ( 11.66 ) 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 --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 8 ++++++++ 1 file changed, 8 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..0f1c9b685da3 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1516,11 +1516,19 @@ static int boe_panel_get_modes(struct drm_panel *panel, 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 1 09:46:32 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: 12866601 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 52AA3C433F5 for ; Wed, 1 Jun 2022 09:58:50 +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=5fPrekUaTFIVOj7rekMo+cgyWoyvy/Es2EoWpjr57P0=; b=cMo7O+7RdPcex9 fC0BIlH0Lbhl/h36bbqLh0aa1a1SW3GdcDkJ54iLrPFTzgACq04MZkckRwp6o/RmRiTJJTArKf8z2 e6/sOFrsKjIq/EFt6Ikc2W+i8yK9rwCklD4z0tlwmNIJM+Mxx/1FnBB7T1NjUefjOqGttH/vYGwmr wmvRCt8Ks2+hQhdiKPgogVC7CugCZa9GJ3k8+m76/+9ltNI9uUSyBY8rvp4Za60vX5dsLlgxf9E+r C+ock5idIacl65cAZ3jfGlxL44twNSgNPXXazsJZ0oFCupuqsOyXr17SyYDZTw53ryVDsSBCPKv5L F3V7APc6evJTSlU7niMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL7h-00F5fB-JY; Wed, 01 Jun 2022 09:58:41 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwI-00F1GZ-Pb for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:46:56 +0000 Received: by mail-pl1-x62d.google.com with SMTP id w3so1270053plp.13 for ; Wed, 01 Jun 2022 02:46:54 -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=ZBqJiw5iICb15XSMEIziFVB5wuNumdiuBxaQCMR6NjU=; b=AQSKii1jvRtBpq0Lrpj8ovAJqJPE2589nykaQe03mHf8JaCrY3Z4O1XawIEbsR/4UU PxLNY93/gtlAHrORYa+QAoX+Tb6aPH+1e2spp2tc7pfScCEf8S8gOf1+2pzvef6Lvi4o Vs3SdULDuc7uOWfaH/zRnk8xF0Wbjb+VseM+M= 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=ZBqJiw5iICb15XSMEIziFVB5wuNumdiuBxaQCMR6NjU=; b=W99K5Ta/bW/vmQVkpxWI8vfhqH+1dzwvLSFrB/arOaBcmxZkZ0/juJzsI81NgjLj0S el2akRBZxRhENehtXrlbWhyD3twfJm6BGG2aVRyTJJf6XX+CgZ0A+S1RAhxnUD6PaJGo 3VZ6pg9PCCbBYP8Bex9ZW+uJEKNnmXkNZkQDBaC58WVIugwkXW3J0qy4gYR+Wr1X4k0n WcFv2a+hOxQQYK7mJvCwBWHF2KfpfB5RrwMuy4yIISO2g9BdLXEb30Ibu+r9VzeQIBll Y7bflShKH3nevBhoQ/fsPrM9xPjo9sm74ROUL0OPub4Y0A9oRAqVdZscIeaaLaSBQhFR 07Og== X-Gm-Message-State: AOAM533aQ38K3D226TTu28Gbr0i8lq2u4W2lZv4klhuF0T8majfzOu2R 3PUmr+9xFz7QOYP2TTRjXPGOcA== X-Google-Smtp-Source: ABdhPJw72ka+6aqP/KnDSsfh0kJMmqQ6I49pRZC2aCEKoh72sgZsPQ9ORjmrG0OhkVOV4FFUNg74Gg== X-Received: by 2002:a17:90a:6308:b0:1de:fb6c:5944 with SMTP id e8-20020a17090a630800b001defb6c5944mr33599246pjj.60.1654076814431; Wed, 01 Jun 2022 02:46:54 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:54 -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 v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:32 +0800 Message-Id: <20220601094637.1200634-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024654_877537_8962D251 X-CRM114-Status: GOOD ( 12.31 ) 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 --- drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 1732b4f56e38..a2133581a72d 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -609,6 +609,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 +644,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 1 09:46:33 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: 12866603 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 801B0C433F5 for ; Wed, 1 Jun 2022 09:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iO0D3Q0b/3O+QqA0G9FFmKUm0MtGz3wItFyMaoRcpGA=; b=NMp3NEetCPlRRl bGp8PuTLtHAvlE2NLHX5uI4/1tZ3oOsXb2bAirOqnmEQ07ZX3Po45gzDiUqIgaeC/tNP0o9VXo6o+ HqzMY9Awzo4YLfIk7i6J0SQg1irai/pCD6tqmE7OLjQYWf1yaboO2fFlyUgu+2QdXoSGJDV88/Tu5 1aPd4LyJgmiG9Q87dc4HEgQWdboaCah1wBreLaNxs/QRks7znf0NkRDl8GB2YWZXNboOwrm7u5Rsg fzVjFwqZ2nA7LkEqQojVMf5m9orBcwRtR5z1/mFNYoRKmBIsx/unlN6XkA9a/zEC5JoSj9Hy9FvHC RSHRCOpCVMVqdctjPvMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL7r-00F5kC-Vz; Wed, 01 Jun 2022 09:58:52 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwQ-00F1NA-UP for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:04 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d22so1285444plr.9 for ; Wed, 01 Jun 2022 02:46:58 -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=uKIVyDAwCRbl3j6LCvOq2/nCq7m+//LNqW8/74aUWVc=; b=K55Diq2ttR9WJlI2/Wd+H9Ph2pL1ao/2eEjG7R/EElPqrHWmBsDDo2bMhx/9i6sjnq 9QbVWH6KHA9eu0L55xByn5/Y2fdGlY6l5yy8HeM+Jl69l4r8ee4Jbm+ctn6gS9wU4bMV dTqPBZMZKk10KcmnLXZVIxTJVWbgjkTwGEbV0= 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=uKIVyDAwCRbl3j6LCvOq2/nCq7m+//LNqW8/74aUWVc=; b=DWZ7v+Cy/X4aNGx24zj6dBdSPmOaMGjCtz3LsbrKxyVwn4P0GUSCBG+7s9HTuHMJga VoCtho0UCX30tUxAdUg9Ila9X6FZVqGbGiEnS9r9pCZol5FP/Um8QhK3hT0chErw8ooQ H/vaKSZtlGgHht7b2oUCyNRq9AfVg5GA0i8RGwQxxWeiqNNVPt4FDCyp/riQ8yXddPyH p7gOAXGn0k7P3A7YbXdehirkYmRkPhGfD841cqpUtso74z0sOl4+KnCHOpIgu+8nUkfd /FIlYSKt4ooqpAO86H2Il8RiE+sijzJbIVpq8yMGnsOXSpJ9TP+VwD0p2oA+FW9r4YPR k/ig== X-Gm-Message-State: AOAM530sdzMlwhalNYgZ6WH+QChCN0+23O864sCwx2VTKe56tFBYmm7N 3HMHsY/opgzH+V4WBPslRQi9WA== X-Google-Smtp-Source: ABdhPJx+L9NeZp/yBLzjW5DmKKRxM5eCbinJMWNY6Kiy9cOR+7U+YTZTSf56rWT+/WOY/0EfnFPp/w== X-Received: by 2002:a17:90a:b88:b0:1df:2b03:20c with SMTP id 8-20020a17090a0b8800b001df2b03020cmr33285059pjr.46.1654076817876; Wed, 01 Jun 2022 02:46:57 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:57 -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 v2 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:33 +0800 Message-Id: <20220601094637.1200634-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024703_027581_1D88299A X-CRM114-Status: GOOD ( 11.77 ) 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 --- drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 27a1c9923b09..dc50f73d400f 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -107,10 +107,18 @@ static int panel_lvds_get_modes(struct drm_panel *panel, 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 1 09:46:34 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: 12866608 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 E40B8C433EF for ; Wed, 1 Jun 2022 10:03:34 +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=wH+yWYku1TLr47atrHh5NvMibwLUpnmAiOOuhwQRBFE=; b=pspUvR4em2u558 Uy9zdYtGp8gThoClRdtaiK94PeKDEMljR4jNYk9r43m4WgoGwc+2N2hxTUHfDqhZ5l5h0R+hM6uWL BUtLuLO21IJNQJG0Rj0KrgGHAwQ7aMMOGTNArwMOeSEkLKN0Lv/pKakLzEDFRnZ05cr7ALdDOv305 ijKNimZZmZEPbb+nmXRcQz5L2+SY992+8wmfhyjZd0kE0/qtirk0rN1Bw9u1Zx+WlfrQPWoEbx9Bz CNzB3iN4yKc3aZrDGgkk7Vo6KWkHDsfQvOjYAFaaBerg0PY6gZOfplg/JJRqr+mSOQuvi/bZnTP8h mZezqTCMZo65OCPkCiVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLCH-00F7fU-Ox; Wed, 01 Jun 2022 10:03:25 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwT-00F1P7-1C for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:06 +0000 Received: by mail-pj1-x102a.google.com with SMTP id a10so1522972pju.3 for ; Wed, 01 Jun 2022 02:47:01 -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=jVLAPZRG5UqIkFmmis3uM10FnfT5Ljau+xefKKOpEpE=; b=OE93Xi6fuFvNjrUPzVoJX4DICUjzwZ0FrNbASk4QhkljwjjdO/t0+U9bsHLt3Nq16+ 2jXyFGb9vQV2JODWz1J1HY7MqWvFdGQfxoZCRMPGD0flte9sS8xfM5OvEXrqzlCd8Bhi wM7/e6IqFwZwACP7InwILEx1YGycyNgsKSh5I= 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=jVLAPZRG5UqIkFmmis3uM10FnfT5Ljau+xefKKOpEpE=; b=jLYoGciXTFBM2oGU3TWvJmb9uhZGubSEYP4xEbTzZjF5boBlJ/LIr8wjqqMtSYpguF bydBicGY3dOQ+IvavJ/2qJ6y3BZZg2v9KFS8ppkgMa0uN5o/7jUnbaFQYVwIrzq4Drv9 5gV5YfQ/E8AC+isCqDalDCGVIe9CWrUyjCuPJosn8m6RA/LfjFnRd+TXj/WOMmOG8ps/ MKhwbZ7hxQnEkfPx+9sWziqxm33kXpXN3SChaSwYXOMKrD+6mfUe+htK1zm7wcAnLXUT JZHrBLNC1iNET1E/LC7MaTWbfa8T08kbfEgPHTRmgdM64+ZOfj5m/5yYncelN5/D0eQW RA8w== X-Gm-Message-State: AOAM531l0HymGj882yiXKdTHXKTR9+NyQjYr6+4mETd4ANh4fX7JfPPf bQJBQ4I7fHdAkq2fadeZBeupsA== X-Google-Smtp-Source: ABdhPJxax220Y+zg4h1kp6XXN13EyER3sz3MXL01acYe3CvWec7xBmexQhbBRgOQrByQ7j3lpjfQeQ== X-Received: by 2002:a17:902:7045:b0:163:9c45:e330 with SMTP id h5-20020a170902704500b001639c45e330mr25430866plt.32.1654076821222; Wed, 01 Jun 2022 02:47:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:00 -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 v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:34 +0800 Message-Id: <20220601094637.1200634-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024705_163139_CD1B34DA X-CRM114-Status: GOOD ( 11.86 ) 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 --- drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index a34f4198a534..54e78d978dcb 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -434,6 +434,14 @@ 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, @@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = { .enable = panel_simple_enable, .get_modes = panel_simple_get_modes, .get_timings = panel_simple_get_timings, + .get_orientation = panel_simple_get_orientation, }; static struct panel_desc panel_dpi; From patchwork Wed Jun 1 09:46:35 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: 12866609 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 D6435C433F5 for ; Wed, 1 Jun 2022 10:03:40 +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=3hNXhHc2nPstMQdIDwzXuqG5j2z3rXayYEAAH7j0fgc=; b=Nrfk7qYnofr9eJ oTd82UwJzBVLtaPr0+UmPwfTa0QgBa9cqxj1oDj8S0o72hb5lxgbo1FhyKuu0PdSWZgMZc0pS1JQc 7J2CZ/J4D7YAsp8w5glRaXuV+EbW7PsXYUfJLxAUzCPB8MIsSQXKw8l6YHWgevGlrLj4Zm9Kxgh6A fWJwHoFCtIXDKs+uf/qJ3PH9TkoEw4QmyW/bulFQlQ2PhBglUWB5pXMMcpTKZ0uIZVYOzGnSmX0TG mRLdFkibgJOcj69WN5ZEokkuUk878qFl6cRPMQ+kUFuZvlTbzbo6lZOC3Hemp+bbaQpALrvBjazQs TLUFed2RdZ3oHKVXJhtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLCP-00F7js-Vw; Wed, 01 Jun 2022 10:03:34 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwW-00F1RZ-26 for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:09 +0000 Received: by mail-pg1-x535.google.com with SMTP id x12so1414204pgj.7 for ; Wed, 01 Jun 2022 02:47:05 -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=O/72CEn/8tEBsrCbwpSKpFCIgi9sYAXiNEhikH0IRpA=; b=OS+nvMctRYsuTwiXTJRqbgZKnlvrlKjvQu63bS3tE+z2ocwPpH+8Be8ETuIRFu1Bpm lzFSCn4cLpLN4zoriukqzBwgN/EobgeDfPFSG3Zm2uEEqlCB8YTCxRZ92yS+SNWZeqPD ZWiz7cFBMmKJ8XT1LNNfAPpMY17jnT59h3r1Q= 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=O/72CEn/8tEBsrCbwpSKpFCIgi9sYAXiNEhikH0IRpA=; b=b9QSiAq8e90iljt6JMwPQm9cn95KveNqKYIyJzVCDVBrICiVj2IwWkbMzsMzXygXV0 tGvltEBI01SZVzx2foXOrCzohnSmvZL2F98fnF5Ua1XstRSfBa+hxiPUSd31FQp7ift3 A7jONfWb2DCtaMX3246bP6YUjaUITs6eC64AbrmH5G4dYrTgIaqQCYoa5Lt20aIijQXf DhfnUDjx3U5lyWRJHI/L3z+aMXQ5ce2WovQMR6Cp4U5vSzZymYaL+roMNs8Gy/mZnOfO DcbMVR4gSzVyB0PLJBxrcSJko6ZlwCWXMIGbiwppi90Y9OkSlXw5eO8oD8IBUuvYq++u wmOQ== X-Gm-Message-State: AOAM532FQbiTyFUS238031zIStb238bSpXaQmrtZQnpMVd2o9qIH33KE wq2pwpjedN9bIV6m2H+PoeRPQA== X-Google-Smtp-Source: ABdhPJyQ5pLVueYfHXGuwinz70Ri9IG7lJaHjQY79NIVs7H7BxNtxvVzpvSC7OIOWWsYFbqCZuKYlw== X-Received: by 2002:a63:341:0:b0:3fc:824e:86bf with SMTP id 62-20020a630341000000b003fc824e86bfmr4498754pgd.140.1654076824594; Wed, 01 Jun 2022 02:47:04 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:04 -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 v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:35 +0800 Message-Id: <20220601094637.1200634-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024708_124161_9CD545E6 X-CRM114-Status: GOOD ( 11.66 ) 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 --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index ba30d11547ad..238b6a75d2ed 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -858,12 +858,20 @@ static int ili9881c_get_modes(struct drm_panel *panel, 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 1 09:46:36 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: 12866610 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 95D64C433EF for ; Wed, 1 Jun 2022 10:07:32 +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=h5d3BR6yQVWCxpwmOIUnDiJsLb5JzVD7mOeqhjV3Nkk=; b=oiEh3npC7Abb8I o2xzdfRYMcUjbdN2g67cS7hrktHtiXmU7D4MXazNjOxhynizfoRSk+8rMe/dh87hZXL/sV1IakEip sJTdrw4k8ut2oepNU95D6tS+ZDZSJbAtkWe5W73owoonhWDfGif0NlJhiQYJZvB1s0w0qV6ZVC9xR kd3LOo2LyDh8sp19SB/rSGeplNfDmD/Dpq+syecefonGquwLyMb/VnSOdwjf4rvBx0O9VJA+IizQt VPpdXRC0eY2+d8zaPZPaLZLdOMrckyVx03JFLPt+RT1Lozpt77DV5cIgkWdb0OD/wjcCveGwIP81y 25PiWGg/XdxOQWfLVWJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLG9-00F9VA-IZ; Wed, 01 Jun 2022 10:07:25 +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 1nwKwY-00F1Ue-Al for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:11 +0000 Received: by mail-pg1-x52c.google.com with SMTP id x12so1414330pgj.7 for ; Wed, 01 Jun 2022 02:47:08 -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=Bk6C27QNmt1+4+7KncB4viIiej/sMiUgOSBQvF7TcyY=; b=K5lzcMPBYc5vuIuvnrMLXcNHgjTQKop5EOpt+HwdgnFoFJa+hd9QbbKDaVebbKacZL OSwO3h44qdUkHgpNO01ZFKqIrpb7gnBjvepEql6SNrM5QPse6iv7B8DP6j5GEimsSfcl 7rLDinsDAlwVs0ZKykx56OzMFZvwhVG+tu1e8= 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=Bk6C27QNmt1+4+7KncB4viIiej/sMiUgOSBQvF7TcyY=; b=WlUOjS0Q4Iu2BNEA9hC0FMIQOX5OSgcKXbHSXhtairZzWR5AkJ/X3WZF6rLnNqqRa0 u56kZV0t4tKy+lLkJpnFkA58+Yfo8mzKM+AJjvvMgWFcHS/6GV6J+nWnNL0uSdD0uzvC aOSlL2IZTrX/NMwNagK4gQUmE/AEsOvKAGrucBO1KFnaPnCHmywuynV43+YS20Cont9y whvlDLSvRA17fnayBSdQprO9dBDDWdhQBfmSWGC9kqDoAHb5xYsWew5C79djExVcOpyB c2qxeNEfNiKRByhLl+CSfdXQ615IgMZ+VpV5g525lUPPA+/pT90NG84L3cWGGdBQBROX JVkg== X-Gm-Message-State: AOAM530y24Jbep9frM67qWq0p4pM/jsZjLXIwRemD9ZDJCROrbro22ea Nw8O3cJ+8rfpo3bnNfVQLyzeGg== X-Google-Smtp-Source: ABdhPJy780kRALjc91F0vxW4FURBQqFFfjKK3ZprK5u2ZLrMWSj311aX4pckzJCj6vHag0BcmbL/+Q== X-Received: by 2002:a05:6a00:2386:b0:519:1ff1:d723 with SMTP id f6-20020a056a00238600b005191ff1d723mr28880889pfc.21.1654076827998; Wed, 01 Jun 2022 02:47:07 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:07 -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 v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:36 +0800 Message-Id: <20220601094637.1200634-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024710_440072_7846BCAE X-CRM114-Status: GOOD ( 11.76 ) 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 --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c index 80227617a4d6..079ed71f660c 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -222,10 +222,18 @@ static int kd35t133_get_modes(struct drm_panel *panel, 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 1 09:46:37 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: 12866611 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 2086AC433F5 for ; Wed, 1 Jun 2022 10:07:36 +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=aEpPC0SLdIvIUMBiTAKj0Qe3tSYAtcY0dGmFLzFropA=; b=ipAakhexidVN0q g4Ypg/X25BNWfFUB1jcv0GoY+dTsrA347UK9/l4nA/+/H0tBhAQp+TPgnF3ztinMa8PoJUvJlglqR 3kMD7IyOkocUNT4Lbc5CSlmULa/nBYnXPWyqWWnqPa0p+D0OEH1gZplNwiMejnzK5yEh2kFQP2DEi mJYV2jn8WNGGk1h6IZgALRYNzIc3pfyDTesGuRilbPyHaNaarlmaO1o55MQvoU+RkbtTYsmKsFaAl DsvKLyOswZVHbL6iuPWA0LuoHM8Mac0xHOh/HlaYXdcPP3y3QKZMynRLRpKublnuCv3QEVdE6x9nu 4YAaf0iIkDMfiB4tWzXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLGD-00F9Wy-4i; Wed, 01 Jun 2022 10:07:29 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwZ-00F1IS-Qf for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 09:47:13 +0000 Received: by mail-pl1-x62c.google.com with SMTP id n8so1316253plh.1 for ; Wed, 01 Jun 2022 02:47:11 -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=kFnswbSxGwrRy/NQADQjmmMBaytsFgRzRtZUq2P5fVw=; b=ErjYVzHSMtL2UomTsVi7tibDCfhMwLbxBslThaP44wqh4DHChnKrN++NI5RhSZPYfC Gm3RRstEdhV4L3kxlolN40Nsg9TYKbIF6sbCjvLhWMacNHii7EhOCl8zF8PssLNTP/fS YGFNj0OxIkbV3RMUocdQHadyiWO87CoS4BxS8= 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=kFnswbSxGwrRy/NQADQjmmMBaytsFgRzRtZUq2P5fVw=; b=5ApMPm3cvT1gASnA4ZKfrrgMpQnOy2MJfoBi8ZLOW1T7NxfHE2ztmgKeiG7yAJhBXs vIhQLjsbJNEI40XYvcQP64WaA0ldgLnx5I8PZQoLi3T6c/D5kEzCTvb6TQSZMxl3STFZ j4/9sqgXl9158Kzh6uZwpPH6I2epqC9pBxhEF9BoUeeo0HnU3WkrvwzG8DV5y+ykhSAM 55N/HIBRfNSBG+FLL6BaMRouDIyz9VCJH+DcEU9GJPbxADnhpl6Y5MMdhEtpM90VA/Zn 4nz2Ai/1j9830qRCs2Op4DmfYVuQK2YLCD3mgq4qdaw47ylTplDkg90vVM96SQqzbFTs ZenA== X-Gm-Message-State: AOAM530pBYM30oDhXqoKLPwViQnMJ1Y9W+hAIaM6J2bXv20KvNjPpNfp Gw54NmgSq8OcItagwXidNm1ayQ== X-Google-Smtp-Source: ABdhPJxrRTUbKi5bPBa/fX0MOFI2Wb3mwKyCfpA3888E4QDVRu2YuRIzrg8baKhCW1q9srQYrEq3/w== X-Received: by 2002:a17:902:aa04:b0:163:c204:f41 with SMTP id be4-20020a170902aa0400b00163c2040f41mr17751950plb.172.1654076831401; Wed, 01 Jun 2022 02:47:11 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:11 -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 v2 8/8] drm/mediatek: Config orientation property if panel provides it Date: Wed, 1 Jun 2022 17:46:37 +0800 Message-Id: <20220601094637.1200634-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_024711_949171_494AD3D6 X-CRM114-Status: GOOD ( 17.93 ) 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 --- v1->v2: remove unused checks. --- drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index bd3f5b485085..86613360d2d9 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,12 @@ 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 */ + if (dsi->panel) + drm_connector_set_panel_orientation(dsi->connector, + drm_panel_get_orientation(dsi->panel)); + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); return 0; @@ -837,6 +844,9 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm = data; struct mtk_dsi *dsi = dev_get_drvdata(dev); + /* Get panel if existed */ + drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL); + ret = mtk_dsi_encoder_init(drm, dsi); if (ret) return ret;