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: 12866597 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 14F13C433F5 for ; Wed, 1 Jun 2022 09:58: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=Rykw59Oc7LlCULLFTZA7+XluCf8PFf2HrtEKRI0Mg3M=; b=mINyLkk8++tGaz GOndc8mYNHcmD8MVrcKSaFYZzdbwVwSTuGoZZDH0p2oVF+Ugka7kGeYENN31N0vmPl9PjJ/Wz0VRl FLVYcQpRvKErFbQKwyrXTdiKOVXwNVRLA3Tx1UCu4B+L/GVLPG0YrxiBQMsoz9zbL/xxcQ5GSeQS/ bio/1yXCOJ/6siysZP5Hip4eAQOSp+ZVHQ8g+uh403Ay6hRexIQmbpcO9bsQvUzsODREB+UQNmWRT zmC/oI7UJWtPeL0O4SepT+b0DUL1TdVj3Rmuzt5Z+o5MsvItdn8BIIi8EcB02Y2qBAJq6EXxJHKBa YSRyeonOpyjLOS3FaQFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL6D-00F57V-6E; Wed, 01 Jun 2022 09:57:09 +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 1nwKwC-00F1GZ-QP for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:46:50 +0000 Received: by mail-pl1-x62d.google.com with SMTP id w3so1270053plp.13 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=uix0Ixgoa4MLSrKUqc9pGpgqP+BFpCbIb9Slsgis9/8vmIWeNFZjQIUcyI2S5kAVUE cdzwdVuc6cVeL9Y1x2wf7vd+EUxikzQw90IZvhotLUivIOHS8THNf8c8FEKHwLgexEyn SHXYQmAbDQ1GFMKHdwx+stNw6GGkNlFbPyGGGMoXHweb1oNhAWdoABOGXzg7/qrz7jFN udUHHtuiwtR+GNTePcYlr80Nzio3+21dplXwSzKlUlyI2cfJELTBGGYAYPiMiZf5H1pr obA9IWWy6G5xO6FSLGVjhJQEexuhoa1XhVg0n+kPr3c+bCu329KtSwSTeeuqoKj8wtyD yChg== X-Gm-Message-State: AOAM533OawQajXFAasabPz2iZPtRM6xSJV9q9y7cpJmJDEwCGEO3bwmK z50pR3njyelY4W+bHqimJJUnyA== 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_918109_38C42F98 X-CRM114-Status: GOOD ( 16.71 ) 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_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: 12866598 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 45A4CC433EF for ; Wed, 1 Jun 2022 10:00:46 +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=pgmIT6LFGxG3HaOghFPRVvpaf0wTLbVV56tqjTxNtrc=; b=zKvJ4yU2/rzbAb NbFBfh1jishx1P8oOj3hNag6hlyaEHUApTXIari/1uKiwGcCAp8+Es5dt5iCG6AvNJoXWmBpXp/M+ l6eXEXXrRW4j1lSpeOeD/0w/PulEAedzl1kjtkS2+vzRxh2bWEW6g9Y592B11NhBTWe/PuKpYuDnq 8YwM+j4xT/h/VHCxzGKE6kC02Usrgv9SzM0KBT2fq11xpdYPhRC8h8yflL8cV1I/X8fY+N9niFT97 Wf0UCqiNX7AXCH9pHJBi+cpO/+/XfLST2oAOqOmIyRPAa33kZSlnVa8IDX2QSJxNjb8fO/qSiKam2 68h2Lv9j6e66p5d41MxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL7z-00F5mJ-B8; Wed, 01 Jun 2022 09:59:00 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwQ-00F1IT-Vl for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:05 +0000 Received: by mail-pl1-x633.google.com with SMTP id n18so1302170plg.5 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=CiRYWjP2z7j5dmhC7ieZ2GHbj/whUiMlUT5ACAdhoJYQ/J/ZSzPM/Zigra3JTdR5Ha /WEgmkUrbIXmy5V1JNF28Mao2lGhDniUxkTh55ncqONq4+d9e9lYeWBN6CqEu6If/gxz JgXjMJElaoUiYbt1YbzWJza44vJ+pqurddWH+PeXPEb6mDzCt10MksQFTR71Y0cxvxMV QgQyjo08FV752vVm8HRluFA0X/T0AorSaoGSLylSfuwguIK4kTQl0TNVSma779WLjG/k V0ssOdzuJElt0CZf/WRaeQBovqGd8K4PKBdQNmySQyeZQj6nA8b94ePixAEWhnRPmXqR rUqQ== X-Gm-Message-State: AOAM530a0DFKjRrtcFlOiSwqOIqKs3V0BmsTEUHF4jabL7lnnc/BQxqG 2S+IK3vuMT9ddC0s1uzI/OTgyg== 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_120618_729F4F14 X-CRM114-Status: GOOD ( 12.98 ) 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 --- 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: 12866605 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 51458C433EF for ; Wed, 1 Jun 2022 10:03:44 +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=F39y7JoDxjl7Rpm/mfo11I6ADez0tXYZ+wr6s9W8MPg=; b=5BOrpUVN3HJ++Z vgASlHYADYDF1TIkiZiR6n8Po7LpIvNTpefZjOZZ7ebKgo7+6boVAHRvS2f59Ox/Ig21W1mxSFmlp 9qRtIesL0NZg8GmP9zAZrhq7A0XaU+K1nAnKw35Qr33RgtSHsnc79fhJg9C41mm2dafHvm13/QZ3y p7GF4gHtVikCctiaAjOmN8JbwLsf0f6i8ROUPoP24hww8BKxF0Eub9WirecmrILrHXRxafBhULstj sBqi7VLhPK0a72j+O51YVXGwJLu/UJiPWLJ8c2hu56JE474gnXq3CTLLrTHiUAm/PgnF4F7c7ADz+ kQN6vS7lz5/d3lYix1oQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLAy-00F78k-0K; Wed, 01 Jun 2022 10:02:05 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwR-00F1Kv-PV for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:06 +0000 Received: by mail-pl1-x62f.google.com with SMTP id c2so1314232plh.2 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=xEP2KHp/HsDQ9TzCZjptx5PI9dVuBoIS21XbIWzVitn+D7i1CNPllN3BM2Q8DnzT3f 80GtoOEEBiL0mwm/HkFLS9YbMPrv8G9EeVhVjSEy/eAQeknxFcD1ptcZIAfMLKLS4oYU fwYW21aQOTcdFE9tG91G68s026ORD51mg3pTAmAJ8oW5q2HiD7iL5glF9+L8v7hgso1M syHxk9BRyIFj06XlTUmhO/QEDZ6Yhefq8/DcskcKDt5X9s1bf4rsziQnvdeQlrNboEmx aB6wc+mlpOzh0SIEMg0F1rtrK6wC0oW0G6MS46RyYqCSThAAFjdkGzS0g05jJkxRxjDM oA2A== X-Gm-Message-State: AOAM530ixMCtsneRorcy9waOQ2WTnPLXOT3eEVH2rW8l0DG88y6jeVmU BnNlnM+M1w53k3CPX72NIYniGw== 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_024703_870874_C3BB854D X-CRM114-Status: GOOD ( 13.63 ) 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 --- 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: 12866599 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 32F0EC433EF for ; Wed, 1 Jun 2022 10:02:20 +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=7LxwaxkKmMbintAh03mXvDAYnEvWPUJycg6eZ/quj0M=; b=b4b4tB6J0rXiF0 GKtP4bSfbVRb23DknEQtev6zn7T0+2FZUn/zMovVyrcNm4J2SWSPvSW6rMiNyRryQ2aB3fhohHA2v m1l+OR+8135KODPSiGErjlx+mzsovlfOVbbiT3uj7Cnaaug/leoYiHs8qydGFhilMvtnGtqH2CUYF M3NRwceD+iNRtw5nje/HKlpcbLbcFIJUDx3LPBFrIJMcIeEJaxwolv7VwtZFkj/UvDC606PLjJ0x0 mNxnmA+Fz4fiFHMniZyhzwRBzWTxQhsfIX2Ejtr4IqzK+ooq3EXjzt1t9tShFVer2y0BrAjJI4O5L dcSNTEIJMm/Gi+BSUVuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwL9Y-00F6Rl-92; Wed, 01 Jun 2022 10:00:37 +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 1nwKwT-00F1N9-1M for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:06 +0000 Received: by mail-pj1-x102b.google.com with SMTP id j7so1517013pjn.4 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=zilcmomA9zlx1tYpXJvbaVWgVDYvuhss8C125tyPWKcoVFN5kqj//h/asOkCwWGUnr Nri9+8X76q50lQ5izesWwogfQf3gHrbJIEZq35TODR7zay5vYrVOgELqkPZrxXICESDb 1hv+ka6i7l86I2mM9GsxqQOOX9TkPGoqfFEoSbIBwREvo9nqqk3hLtt0tTUZnmeYBjTL gUccPu1czyiqXIoazkNPK9a1UNKT7m1dYvK09o1bm4JozDNp1bNNEhL38Jc9Vf8e+xQ/ llrOAbLHIC5AxD4kd8pKzhvi2S2dQMIZIXpLKEAA7e22r0tgVGWuaXZtnQHz5H9hfZNB u8OA== X-Gm-Message-State: AOAM532SlFKrCyUXGuuxQYBZk5cTJO8XBvfSaUMA3r02Fj5mqaWgYNkE CGrOb7PbBhan1RYiFdi3EMrdyA== 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_024705_151052_65109367 X-CRM114-Status: GOOD ( 12.98 ) 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 --- 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: 12866606 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 931F3C433F5 for ; Wed, 1 Jun 2022 10:05:30 +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=weiE/OKIc2PAtM7H1vAHGf/mVURVGRXzc5w+BXTtyZI=; b=WK1A/jS6NMyCyd lmg+6iA2RzrnwPZjpTTLkOisl7thT+lWXrr6iFB1WlbaRAhKBzogGpTvox7yxuVHJejRxOQlk7Uvb rzAEIzsQxy4OSSorXP+qt8vu0HWtIWYD8SbTS9syIa7Pt1gmAA5DTsJSHGLQEPOy+e8ZHN5aYmb/n gNEoW13QEnRjJeOKa7uToHNyMc/xOcMlZBlQg04s36SdIGewovskp0ZdDpWAl76uTMwCiVBA4FyKf xtlQ43UAqueKbg/7eydR3sjrazP1fe7hvgstsR//7pGieR9/jBX8ZemMw0GrU2/E7etrsT1M11Jps EunLaV2DOGR89AVFTe1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLCa-00F7nU-L1; Wed, 01 Jun 2022 10:03:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwX-00F1UN-CA for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Jun 2022 09:47:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jVLAPZRG5UqIkFmmis3uM10FnfT5Ljau+xefKKOpEpE=; b=ppZBxqTIOddlydgub/sB9HTvpI vHNkK4qP4srio1TAzMNBJAFvgle3tYy/mw82IwHllUIix+yuG/+Ft2iDVs8pBO3K6g8MEodgmgVsm 7cDUNwxdMpYuQvwxEjxSYO+Sf+xqpSKfL8YD28yeUINEiWEWdnIOdeQKhT3+IQGBUXKuW+suSLf62 8dNyAv3CM/OV7C0yFjHIT8tXlxoJluHvzPZyfisTU74o/BOPgfgMsw9yRzIbrlyVDlMrH2Yyv3xGr 0rQ9hcWbtqJLDBxvwtN+4EFHx06dJ5h9GiaYwWVk/meyJ/XdxR8PXQRclDTo0PqiA94Qxm97ggmgA XJeXvZlw==; Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwS-003jgr-26 for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:06 +0000 Received: by mail-pl1-x62e.google.com with SMTP id c2so1314515plh.2 for ; Wed, 01 Jun 2022 02:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=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=ej6b4KNTXet0EO8a4BbRcBcrmZOHmJH4AZeyBKahGGY68Ge3WPIL+CxpI7ERfJc5qS +CvYSdiVixGr+rbHFpVbj/8eehq8kWwC+zFrqyZ3C15MiBCn3Ael4jEdKbjpkUm3GpJD cDRfRiVAlh6BrD5YEs/Z11bCTm8W84xqEOMdxn0tK/VNg27HmHqAGAp5RcxOMYEfrCaW CypdVWkvS+zE8/fvWCmWsMsCpyKk6ceHwgtSHAKmyQT7VUaN/gKHl32rDIF4Vp+LeM6m Cz3kJXcwCDCffkXJocj5zBLqOy4we/s9wOn1sINU7752vTYhFwCKUpxUVN8l84ikt1j7 n8YA== X-Gm-Message-State: AOAM532dYfPr95OmDQRL1QbLQmnHflvDJGPTtvbe3rrBPkHQmYjww1AV OvqalqLhUETll0QK7q0PWcFo9g== 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_104704_688557_407BD45D X-CRM114-Status: GOOD ( 13.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 --- 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: 12866607 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 584B3C433F5 for ; Wed, 1 Jun 2022 10:06: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=OySKOSBXAn58yceztbGyBrQZew6fTMDTFmUw/TBvpvI=; b=IXsY/aUUwZIO2Y J5GL6AFekie5fM2G0NB0K59sxQKbRm80dOCE3xntrPucQdy97BOkpdxf3rBJIlO9W/gj9TEINDzLA VkAiM3842pDM7yRdYdRlSrq2tNf2w507kmCUWSvcvSyGyrRBr1DhIz7SIzCy0fNc5yBeuGRBiFQ5o Nc/BUfyFZi1Q5J8SqOUNsaF4xhenzvc3NmKr0FS5M/dlCjkeW8Yk+OpZBsPkoiQCoOXHM1LxeRd+W UKytzG2RpyvMGTGyDLCjkirQFCitTxceT5Ksix/uOL4XiPUeVBGSppx1+ikNqvMcJzdKPgR0Y+767 XcudU+BFa1FPl+z9xLGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLDu-00F8RS-Hc; Wed, 01 Jun 2022 10:05:07 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwW-00F1RY-9w for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:09 +0000 Received: by mail-pg1-x52f.google.com with SMTP id y187so1428780pgd.3 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=r1CS/s0WDO4HBsksTq+SretTxWqwNscRgSgA15k5ddBD9njbHazwLjIpsXbqIcMadG elC62Nth0+MM/T1OEXpM4GddkUi3sHruGMEHoBa9ovHTyxKZyhlMpdgefRxZuDHUbjBH MAa34ujAr8oSCo1NyootTHRhBhJpeY5NNFU8mc+usa9LLZu3QotN8uOG65yQsu8KMwuz qfQL8pTmuqiMMu+gR9Qu5R+2ISpMrTPG09dsHAERlf2ynTjjdqJ92BH3xdPNYtnKjP3R nmFFWkymhsXJmbmIdpumDjgbXTMZYCyKZfkAwHxAXFkPvpVXr19BsJHddSxDOCUtzPru U96A== X-Gm-Message-State: AOAM533t5TVzNRcbt1ClafDrYusuppLfdyxHLCe6kt5Oh2O9U9oZ64UH jUizTSib9P97yvSgEwazzmYYQg== 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_363229_C7FE846C X-CRM114-Status: GOOD ( 12.98 ) 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 --- 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: 12866616 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 D0270C433EF for ; Wed, 1 Jun 2022 10:07:49 +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=HvH/9fxsSefkaY8rLF+tW9lRcL28HIZa7HCDj7H+0Hc=; b=FB1hP8YMkhjxFM QXAWPBSoqO7MFTDQgJ7gPABOjUDrc5z3HyvbrA2xZYCe7bkwbMuCapp3PXOn5zt7MySDJx+kX+y31 aovCV/4cuVz+G5ZlRddDS8qCAFPwhvB+xRMiSaGRwAvEfm4jOHgTV0pE6+WJdWQgIFNt3lrdPrMrV N++/SzY5pWzS1he73Q+3+PSo4vikVq6R3QdnzDU7s+Um4cgPCCMLpXKGCzhOK29ifZfKoiEDfv1/R nZDQTDpSPQqW80KjCwEV5C92Er9Hcgy+bBgwbgU5vT2fmjNHIfqS6IlLdRxWnI7iH5v5arOCupU5H Q05ySHyfxGlZm0F/hN3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLF1-00F8zm-1c; Wed, 01 Jun 2022 10:06:15 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwY-00F1Uf-Aq for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:11 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 137so1417706pgb.5 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=LxieXJYWMxlYks2ccLXOwX+mRS5x/60YtaWYWXJSbReoLQI/Dd2kTQgXzUs4Tyov99 LUpuhB4fTkfPc9l4ZqJB/xwsGsyUiEiT3kQZnnUl1Q9AS8lfLsCSHoMOchaqF9ITBpgq O/GrjmXHGQCo3Bk493D95fUVpYJnUtXMcSYzR2EGsDF8O845vhRW3chW6hlgW9ZvSe6u +vRxkcEfLpJ+3lMR7j0lcxX9VAcTTCM19mXwth+yMJqX3ECr7v6iQsPXWW1ceTW0eZUE Xyzl8X1XX2OFG8qAJdm+iL38+TTeDfMaRzMmNGvqql1rQ9yeKJrnzAGAzsJG2Dea1MNO LE5Q== X-Gm-Message-State: AOAM532tOJf+5n0XE8om1xOE3Tv8NWVfacp5fBWT1bb+0CllJC6+vup/ NnyotUrobZ3wJk5TtTOVg4M76Q== 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_424787_B4CBE506 X-CRM114-Status: GOOD ( 13.07 ) 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 --- 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: 12866617 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 7BCCAC433EF for ; Wed, 1 Jun 2022 10:09:06 +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=ngVTA6jkk7Jb1RkwFv9DhkXCV/dwDOgZIq3wTIPjk50=; b=J16/E/o0O0YZuL gBy8nlbj93A42zy5Tee9MGgjDpXOrcKQ4vOdcE9+bsUQifZHsSUGpoe+UXDdH3mgN53SDIRxeQ6l4 3iJw4gJ02A+s7rR5zfzvuhjYfAubpca3BOMHUiHodrQT2RDyiClyDFxjSKHSUNWhO8Uf8R8hLDRlG KjEEm9Hdu11pI6I6kThxOtv4PufZcUK4zlLLrNemnpB68Yqz9AWrNfdjK9Nm4DlQARiBP6c8HKlVt 4hg+JB1NYtoCrQo+g4cj5V3VGtcwU2mk7ctRvSFQeUHbvBME7b+RGhbbmJ8exhqe57yWCRfabhWHJ ta+qSKYih95ufXK/NKcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwLGN-00F9a1-Gx; Wed, 01 Jun 2022 10:07:40 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwKwc-00F1XU-4k for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 09:47:16 +0000 Received: by mail-pj1-x1029.google.com with SMTP id nn3-20020a17090b38c300b001e0e091cf03so3479661pjb.1 for ; Wed, 01 Jun 2022 02:47:12 -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=np5oQ/Ew0SKApZnugxZJfkjoHkPOOIDZleAnrrY3Ry9AGGdLeihG6LD+iwH9+NEbRr zlLBw6VCxCFekTZOg2+2QWfQ6cuG91gKQpSkoPJLsIL91DYe6bWFXmnsKkRFkVtUV/pf duKB3lbVlUhEqMZOSGQxJjfBn6BVz2w2Dqtjp1tfHy7D+LLB9zZfZwDkUymeU5yZtCWI EI4AvG2A/zZiXCdDAbDElCZdHyCu8I17ZpSRc2cWGFkcEaSyOgCx68PTErrivpRBQZbE XEuzl7sj5UkQfAdxxuxvOKX79yDdGTMdKJjdn+C82yON/Is8o8D50uxGo6tJHwqsWGAM WpMw== X-Gm-Message-State: AOAM531iu3SjEqtVhmcnCvW0STSPaGqYMGcaN4ssqAjSV77VEuTFUGCt MtG+G5JPw6vYo5fOV/6UKz/lcg== 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_024714_266974_F7C32083 X-CRM114-Status: GOOD ( 19.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Panel orientation property should be set before drm_dev_register(). Mediatek drm driver calls drm_dev_register() in .bind(). However, most panels sets orientation property relatively late, mostly in .get_modes() callback, since this is when they are able to get the connector and binds the orientation property to it, though the value should be known when the panel is probed. Let the drm driver check if the remote end point is a panel and if it contains the orientation property. If it does, set it before drm_dev_register() is called. Signed-off-by: Hsin-Yi Wang --- 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;