From patchwork Wed Jun 1 08:18:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12866493 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 8CEB3C433EF for ; Wed, 1 Jun 2022 08:19:29 +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=5cXWx0bILZi8tHNk+O5zgYRzIMT/lB+wNPw/gBJCPag=; b=QExdcp+UHsp68c xdGOyDa/iBOHrdhBxpC4Ww6/H0tF/b0duH8VGRqIZo+K4ctDwrtwBcbX4kIv1FNU0C+3kjEPJHO3/ 4qHGQJHjPVF58g2jR3lbkheQsEpFiV+/c4FNltns9ozt8jsFWrCK9Hm7RkMiIMZsScm39QLHZVd1/ n1x7ia4/+PZNNudLVXPSpKbTbveIdNhqk6oeWtbGZrmvyHY5N1Yz15mvHJeUZfmDl/5tUYAG66kB3 Tfcpu2q5IjG2oturhVSSjhWjTJEl0QRZk9Lig3jkZqIFuykheluCkiR070aH7k1yVI7xSQKkCGCrA WOjyF8MoHoe7TS5lDaBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZY-00Eagr-HQ; Wed, 01 Jun 2022 08:19:20 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJYs-00EaJ5-Dd for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:41 +0000 Received: by mail-pf1-x42a.google.com with SMTP id y189so1274694pfy.10 for ; Wed, 01 Jun 2022 01:18:35 -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=J6otup5wwDiJiR5+96KYND5483KtpYkBAJdtKoJuyjw=; b=BGAvSYU9vjZTkpLSJ7omYSCLkD5rwGC1Zrhe14tzTJ6mJD+IIaL5fUI5zVIvCYI+5u O3f/OGU3hXmiYGCIGDMvonGidLU3nu4HPEq+CqlZbJgIDMOLjCYmDLKBo5HvLSpDqxVe H1KJgITqR080yv/vNhZy4x0gJZsaELlx3YRkA= 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=J6otup5wwDiJiR5+96KYND5483KtpYkBAJdtKoJuyjw=; b=kJq/RoHvBFoPb1tyruolUKbcrJ2FYbcpO5vKAOB6AZQcBxdi32TXExgu+qeUeSv1o0 zlJ2kbvk8JJTZIt/GVWgSvbu50bnA2G6L200inobVRKQ75gZA2DyNE202HDGsaG7Ipzj ka4w/j0pukqKz5PH4RfP7y7bWmVHmP2RCMetk4FkMT/lHDnZB2dV1NeQQJiMnnywSb3s d8wOOOlKJtzIgu3QrggYdwg3z9MIFC3Qa/9EPLITPn6A7kgYpYRsDLJyWPc1LaHNcyrq TN0zb5ThuOSszMgbK4jhbFGSsDW/VLB2aSfGkO5Img/cQOSIRfh/dypvDbbHFCDMvEJA mZng== X-Gm-Message-State: AOAM533DFhW23+VyaR0hFPSWdM5kIJWKzskbKd4/g1/gshs4Ia5Sdb4O +Hr6YGck4AUfRVF5Uau1oFHe1Q== X-Google-Smtp-Source: ABdhPJxZtG9SxZt0jjn5YoMjm5E41BxQstTom3oWSD4bkT9rz40vuUR4Iqfq9TVHuB+ISGAC/oywrw== X-Received: by 2002:a05:6a00:850:b0:518:a9b2:1a19 with SMTP id q16-20020a056a00085000b00518a9b21a19mr45874414pfk.75.1654071515261; Wed, 01 Jun 2022 01:18:35 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:34 -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 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation Date: Wed, 1 Jun 2022 16:18:16 +0800 Message-Id: <20220601081823.1038797-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011838_549521_E9A9ACC1 X-CRM114-Status: GOOD ( 15.40 ) 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(). Signed-off-by: Hsin-Yi Wang --- Previous discussion: https://patchwork.kernel.org/project/linux-mediatek/cover/20220530081910.3947168-1-hsinyi@chromium.org/#24877477 --- 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 08:18:17 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: 12866495 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 21ECBC433F5 for ; Wed, 1 Jun 2022 08:19:59 +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=YfWw8S6kpW65OaRYkLAm8tSzhkpWl4Exv0C84AU+Jdk=; b=PHBPfGAagWH6iI nlVB2yUcBP7olhMpYfQBLsnz28emQmUmwg76OeJnCdSP0LU33dIH72t9DMv6Y1tI19ZNeH392oJ4o tMMfYnsTd4eezhPHQVp2zLytIX4k/JwQvt8iCdxnfGDgaxUwuFUrx8rvKppp0hG2HMSpv1cRkFQaC Ms5vHqOETbWXHE5RkkqON7kyrRPJtMMkN+zqwRiiDwLo6ezmRen2HF+NAmjjW8r0x8UCmPHPO/H2a NC9eYxgerhf8+1AH58pEDGz7bG364qtDjxtqNIigpg3OIzMZQ7XQahWXjeQRIRh3/kPSdCMvfLyWF 39c5BAGqs4QW9hx73Fxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJa3-00EavJ-3W; Wed, 01 Jun 2022 08:19:51 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJYv-00EaKv-Te for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:45 +0000 Received: by mail-pj1-x1036.google.com with SMTP id u12-20020a17090a1d4c00b001df78c7c209so5488548pju.1 for ; Wed, 01 Jun 2022 01:18:39 -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=wmbEut7AQ7/Bf3HWTLDsZtp4DOqAEomrHS3HpyZ9OO4=; b=igURx3teJeErCLwWW62RZUsTiA0yqJqs5g1N0ySEf7hYZ0aQu17UQuOLGN0K/bQkFv oIayxg9GbTmWrLSfdAVeYA/N/zIJ+CTzhRi6uQdSzkNPBbyiIFACjzza0SYrv17UUtQv aeGqsnM/aIpZfOz7ZST/lSBoAilfn+Kv/UZw0= 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=wmbEut7AQ7/Bf3HWTLDsZtp4DOqAEomrHS3HpyZ9OO4=; b=eD6pJXDyK9oJJ3PFVEmOy7f/Tk5nDhTBXnHa+yp0uQVHhKiZMvuiP6rL2ZWVPC/hMR X7mo1bMyEAQ3+ncGTHzYLti5D28GmyWXyvZRypHqxzlWDWSWgpNF159ggkjNiKSV2PHC Rye+NV65LkteCCYQpM64htYlXX0vllD9Jz3P6DqyrYpX+ilaNB8O9UlgfLdCc3efOILD yeLfZWp9uiqz35cEau7nUx9DACM2+PAxoJCklFnv/lb/bJ5HadvvofOnUMmNXpK+2Ief 3+PUA3IxCZtK5tUnKACqYEpATA9xpBDIrMc+fPNobaTuYXnJQJZa1WmUrIxZ7RTF4E0J jufw== X-Gm-Message-State: AOAM533tzIE+PbxQhqmU7xwlerdNxiPODyZMq+8hhMbW6QOSE5JdbinN nl/kNzuudI9dbNMKuOfCjfadHm496ppX5g== X-Google-Smtp-Source: ABdhPJzAOTg2fw10j7HFjvrblLTUzc60T5jBHgR4OhGqZldKydmmJeCI6jBogTpq8SWmmOAAjGhg6w== X-Received: by 2002:a17:90b:4f44:b0:1e4:b161:f9f6 with SMTP id pj4-20020a17090b4f4400b001e4b161f9f6mr3465677pjb.43.1654071518643; Wed, 01 Jun 2022 01:18:38 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:38 -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 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:17 +0800 Message-Id: <20220601081823.1038797-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011842_046962_9C588AC2 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 --- 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 08:18:18 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: 12866494 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 8B04FC433EF for ; Wed, 1 Jun 2022 08:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hgMrqYbI1qhC/FA6JHi39IRTr8SSL7kK4YhxwrGBk5U=; b=JgYQTYnePdhujO msaNg7XdQIxYNEwztMGKFVR27SfICyhhgjJiV4lfQiJth3wJ5AbRM1KsOLV4FkyWrL76+vJsn8xDo oKY2cGPgytPj8Y/hlmZHypbSD38Lj4k/JmKfz1DIAYO40FxVc78SYVZNBM+mLi5Iovc2kdE0jDsSj nXtKACa5agOiV6lP9mFgXTIQaeBmaBtyqv8lGqNXFJWJdvpiJClhDLWrtDsc75w33iLtzIIXhlSJf 4fYzP1y4AALJ8Q2V6VxPzhByLHf5csT5uQRhPx/aAnNhbvl2nEnq5OrfcCF331yyf4Gtg4oaZuIam qznua8GYZlmwHSnMZ4IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZz-00Eatj-3p; Wed, 01 Jun 2022 08:19:47 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJYw-00EaJ6-Ds for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:45 +0000 Received: by mail-pf1-x431.google.com with SMTP id 187so1283161pfu.9 for ; Wed, 01 Jun 2022 01:18:42 -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=ZXVJXoTliTs9PH6H4bJtRqk079LoRX34taoZ9SWcFs0=; b=UExVF+t0yo+CUF2U9NAgRgv1F5D/5gLH7m1BIMgAkp9BcaghU1VJRCg+9tTux1uS7p GooLVoefjUwi/Wrx57PtSiJASyS+d4Ci5wz5l5KeokvzcojAPYUOE8G6TY7CFUX1ZfS9 GLZf2eHTn+ISk0qXAjhx+ohsQOjgmPIjWeWms= 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=ZXVJXoTliTs9PH6H4bJtRqk079LoRX34taoZ9SWcFs0=; b=gCk9Tzuj1Su9yTUAlOlG83Zxn2vIH961I5LnKk1Fl6GZqDnsu796fBdss42W/zxSNO MklAAq5Kw91luZ3IGNV+eNLEWKv2nalkQTtZ3pToq+MId8s7mqCeaCf267Vc+ZX1stDc WbYaOsn9rVCxr41IELsBJL3K45+9gpcNmdoWwJwY/Q6XfEup6xoof5q/ZTv7iFZbPJDD 0gbxNHncoefRfXxfRwRCm8H9pzEmS1t5ZPQVCyrX8a7GJ97KTCjcoXjjlyyvXcCm4y32 c7M47/lpqbUWab4xZij2kTTtWcycU6/G7v8780X4OPLt8ZadiBDog4TKOXgMAKZVBBik 7heA== X-Gm-Message-State: AOAM530vbOL2ChGz1YiVq2N8KQTvQE2xuTyYtgKgz0fb6vmNtZ+YUrTg oWwe7fAlLqVgm8IEYY+A9av3mg== X-Google-Smtp-Source: ABdhPJxQ9eCDaf4dvRJZI6lO8kC3TdeHI0Lqsx36TI7SwrRFIzm9uahMlqRrBMTjw3p/O2lQbj6Fcg== X-Received: by 2002:a05:6a00:218e:b0:51b:2c21:26f7 with SMTP id h14-20020a056a00218e00b0051b2c2126f7mr19812855pfi.62.1654071522073; Wed, 01 Jun 2022 01:18:42 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:41 -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 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:18 +0800 Message-Id: <20220601081823.1038797-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011842_551712_AEF8942F X-CRM114-Status: GOOD ( 12.41 ) 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 --- 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 08:18:19 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: 12866496 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 EF0CEC433EF for ; Wed, 1 Jun 2022 08:21:04 +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=HVRGzK6aHwNpDpepZ5CXbxBzGGWA/rSxhO38yu0gg1E=; b=kStuQRvNZaYua7 KBd4lAiWuaSm5IvbW3DQP6HgX2hdC7C0/Y1iVCYDg/FXZcs15Eg225tt8cFCHXTYgQeuO8kak3Id3 48omMGUIAjsddnLf/Oc+Nxp9C+SSq52z+HEHechA8VZIg5dcIs/xFmx0YtgqKiGNCojfNlUXywIEl 3jXUgeTSwP6Eg7XABbqnJNgrGmq9tcpihdM5D3sm/zyCkckeqxFBY/8cxesAhJ0bzCrfr2TfdKXQR hcBtIKHUx03ZqcyvWmYUfKQjQF60rkwhJmDkFVLzDoV777LzhwATRMrLLjSZ0OK3Bernm42jZK7eR qU89YmATfDETHI9KCc8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJb8-00EbVJ-TD; Wed, 01 Jun 2022 08:20:58 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZ3-00EaOX-QD for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:51 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d22so1085952plr.9 for ; Wed, 01 Jun 2022 01:18:46 -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=PdPl/Tf6jL9+D3LT0u150RT4I6KqqkA79M7TaHGqeRs=; b=T8iFrxlGkDnezem3qfebm9nWuH2n0YbQw2LTIT85bYvGyWqfRsYh5tWeX+uuL2GHHH Hcig0S6hO3U8bdSdxwGUJaC69Ku95h6my1S7xZvpIT5ALq/Aas+WyotltbQtw+44YRVo 5AksVCmgz8eam66xN85U5ePqXAjiMGHFnFSek= 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=PdPl/Tf6jL9+D3LT0u150RT4I6KqqkA79M7TaHGqeRs=; b=mcQI2dgya2wVqMzpB1/7jHc9MsjFtgzAoiPgneFYdY3SJgoo7urFnsigqDnfS3idCz uCqk9Rs5RzGrwF5S8EtpECozgJOcgZ5uddGNFujU5cSxB4Dcl3MFDpLWaPxX797h9OLX R8KqBSWd9DpGhooHMKZREJVXVJMLGgT/QGJZO4GF42Q3KkpYIMcQ27oZYZFl3Y9y/xNg ecTjaqDfO72u44fW030bEKGx+dfmaDBAOaqPHg6NyPwpAwCm2E+6fvS7aq49YfI/OvH/ JElmUU0Ip2TTMNnZzYLnY/RU/1f45DNwNgs7bnobeNSBoTnaFuruCfKTAwVXr2D8fugR yAtQ== X-Gm-Message-State: AOAM532YLjNB1R/lzfx00rfANDf5FbB7O5R++gxtVf4WZubpz5c87xZc 8evJZUZvY/T5UxTOdWwurYskyg== X-Google-Smtp-Source: ABdhPJxKELhOFU4LHTDmNuq52nBBrczXLmtFgK6gdtzyOHFSGBG4Ze/wn5pXmjLWXZGt7iwaLDo+WQ== X-Received: by 2002:a17:90a:5b0b:b0:1e2:8e28:1a61 with SMTP id o11-20020a17090a5b0b00b001e28e281a61mr25453869pji.187.1654071525517; Wed, 01 Jun 2022 01:18:45 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:45 -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 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:19 +0800 Message-Id: <20220601081823.1038797-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011849_870880_0596EA2F 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 --- 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 08:18:20 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: 12866497 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 C7883C433FE for ; Wed, 1 Jun 2022 08:21:07 +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=rgP7Osv0o3qqqFN1heapl2/UvJXYg5VewQHEpMDK/6w=; b=CRQu9YFozb64uH MzNotfNrrh6fXypCA6P2i42RuwyyFRWJt96t1o+xes8mzFaShXz20vF7ipNll7Rie/WaXNFgVHgYB 5Hvm1cBSsmJdFT8IioXOOgI6hobH1kNwDA9r/5UO8whl/WUev3o8DR/1+Zrtf1Y5sSz7AXzay1Qwk TW0HjXmVqJJUlxQ2N7fjC6/5xdcB1zTyDMO2MfSlDFm0IdbKtbZk7jnrqzvahxIdkH1BxRoR9+Vm4 fTtB4DXRdra4DzKibruCwEYU/KBrD2XVmHvbvqy96Ut8XYHVOYP9/ImA9PyJluOmf9b+zcGQj2Gfk SXRi9wrCqzzcY5Zuf8ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJbA-00EbWF-Ja; Wed, 01 Jun 2022 08:21:00 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZ3-00EaQU-Tz for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:51 +0000 Received: by mail-pl1-x632.google.com with SMTP id u18so1111545plb.3 for ; Wed, 01 Jun 2022 01:18:49 -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=s8d1zMyQL8ZiF08W1HsnKeLAzP5rqfEzV2IbS5Izuy0=; b=ksf8bG7XN7niA4y9qzTxWIPlIOFWTcLTSarHP02vVmoXUREl/ysj2VMRvOMzVquSZp 74rYEsAYHeD9oNsiY+Xk9dezvNSEy8kQ9/ge4tXgXhzEPSugxwLbmLq5cKfe5XNIvu2k xkG1RIDytD/qALPSRIQ2XcJksj/Vu4jDPblQM= 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=s8d1zMyQL8ZiF08W1HsnKeLAzP5rqfEzV2IbS5Izuy0=; b=MgJ2VanCGSXggNJnXB/KPGlcvR6IqSqTqVLpDRVgt0rdtC3P+DXibG+V5sVmpLUsgo MLWNfpPQr8S2s8G6StwYgoxMwab1uU6nfxUSWmqByQ5HnwJWrB+ojYI0eXdPajF/gJcG S54O3gbAgBocjtAH+ksf0Ry4CyymkF4BHc5iXdVr3SjeB7b++qSrx8wGw2mZbBDoukNb Z0VzB3uNAprX1D1hEg04Vy73HWbJW30a663WcmVo9ZXy2MRyPMBb4v7RYTzezyEHyZje cGEAElL187Mlm4IBauT+WnZ41nrLBL0F5bOkKZz58mDorAYUKvZeU8FvHHTuGJeHLLSM dtBw== X-Gm-Message-State: AOAM530Jls/4L07p2xICK4HWSXiN+n5DSt68zhatWY5270rdwnL9Csur MAQpk267SDsp4uw7tPBd+gb5pg== X-Google-Smtp-Source: ABdhPJzu2dskjcB1Tt4UKMFKzdt9KMOK3CIoubeiISeLw+ntZYQQClm4pmYrRg1PPV6+tb9enszBDA== X-Received: by 2002:a17:90a:14a6:b0:1dc:f64f:ff2c with SMTP id k35-20020a17090a14a600b001dcf64fff2cmr33347670pja.161.1654071528928; Wed, 01 Jun 2022 01:18:48 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:48 -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 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:20 +0800 Message-Id: <20220601081823.1038797-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011850_033281_74257A11 X-CRM114-Status: GOOD ( 11.95 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang --- 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 08:18:21 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: 12866499 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 D95FCC433EF for ; Wed, 1 Jun 2022 08:21:37 +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=MqNQ7I22zU/W2gDz81UTNvoJPe71bfHQ1QDHeAijdOc=; b=Azlu0CKrI9oO39 vSgwfAODARirppmHX5j+0JFmp1oPt8BM+bJkKTv01tVnT0H6+64gUIPqgt7AHpPVz920WCYi8DVRn wFDmKDlpaBff5ceF04eUo56AO41L7Gh+y+1cphQEnvrRDTzXn/i4mqGHIRw4votVrYH6fFMTGgV/u Y//6qu0RjcrGocPPFBd+rMWbTHbsAl71NGB3xVoPoq/FLbGFxKp7a2rfCBU7w6gOYkW+im0DDODFx 8kEi5Iikl9ZqYCf2H5WVc6BSY5fTWqJYdwJc2xIGL1fP5dPkynnjufo3w+Up4d16wq3LxeKMBcRw9 WyaqinwORCSbOIYY2luA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJbd-00Ebkc-J4; Wed, 01 Jun 2022 08:21:29 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZ7-00EaSm-0U for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:54 +0000 Received: by mail-pf1-x431.google.com with SMTP id e11so1295099pfj.5 for ; Wed, 01 Jun 2022 01:18:52 -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=M55jesM2/bLrZTqeLQbPue+qYepgHtq5DKFSuhycS2c=; b=aYfb6XQeGN+agxPiXMc5cMMCvRMycYKm3pjxf5IuRCdZkzxHVMNiMARTXTzWZUQPQG RTyI09JGjcklxzXAbDnf/Di/q40nfaQ7S4bgFQVenhFqddaJnUPtH0xkmzLf3rpgk7MS mME6bPb0/mloYpW/tF0wiOlWADxaQd/hVTSug= 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=M55jesM2/bLrZTqeLQbPue+qYepgHtq5DKFSuhycS2c=; b=5lSms+nUaGniu/InOPCAw/2xW0FrFj06VQ3jPpvrD0YKUE+GSEomQ+D69XwKu+mufH z/DzTpr0jlmHDiUI5V4HDIKnuLxPvUOqOcZBe5rhjDqSjaIGT+l2iFAI/xZ0gmsTXCzT Yt1veipKdtoOTa/pHCoTAHkmDpg6OhtEDCxid9mhnxc+4qfPZhFNyE8dT7JNxHGjEazj hbasv56aL1xVCnG43bVKFbcWvFooBgKgF96Pbv9QB3lxrCZ063OR7OOX5TjcCyyKth4R xu83Bt/+YWmG+WoKfq//lKsSbxzlXc3+XP3lNYo3TCuRPGajtV9uE9uR3jHzi+rdBAFM jLag== X-Gm-Message-State: AOAM530M4fCPNAXvgxq2+9klid7jqq+cXX1WHJrie60vX8MP+eNpetf4 jKjSB2mBkIJQvRUdXSkbcCMCjw== X-Google-Smtp-Source: ABdhPJw1updJCiw3Qsgmdq3tUxrZNaTrj9u2SGii7IU9H10RIUQW1QdPFu5jUXYEGA9RVz0ZD8Btpw== X-Received: by 2002:a05:6a00:a03:b0:51b:5131:704e with SMTP id p3-20020a056a000a0300b0051b5131704emr13202436pfh.53.1654071532308; Wed, 01 Jun 2022 01:18:52 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:51 -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 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:21 +0800 Message-Id: <20220601081823.1038797-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011853_111052_8F5EA30E 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 --- 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 08:18:22 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: 12866498 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 7C264C433F5 for ; Wed, 1 Jun 2022 08:21:37 +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=wn7HHoNe6nWwOn2umy4mA/NBVEdFq8PCYckBOpiZw1Y=; b=sDd7cGubfeeb67 9hf+vHWY/ffByl0u8y/L7qB6hub3zl8IgFlpbKux42e5T4l9kC3pNNTp99S+pYJcKmWaC/mTtTtaZ /wMMvhiOBBCrOz/jqZo3d8i6NKC/IMb/843oFllmIYGlvtijTDwI4WF6YKlQ+zZ8x/c5E/VC8l7cV J7z6sFevPsLgwLwHc3hk4TrYBZK0Q2WKkmjDCgFA8ApjhOJsnOvXLWPVLNrPRs78x0w3JdVUo04hv 3ga6LwpayDWjy+JLkXn4nd9Of4JFQb9MtKL+LrGW+BSkn8avl1mtTGVIbcL01DOJhtONCm4TZrxzi GJWwOgaMKj1Cgl/tOHYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJbg-00Eblr-01; Wed, 01 Jun 2022 08:21:32 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZA-00EaQU-0G for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:18:57 +0000 Received: by mail-pl1-x632.google.com with SMTP id u18so1111545plb.3 for ; Wed, 01 Jun 2022 01:18:55 -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=xeMLg+35N7hSrKTKnxWGY/ydjeaKMZYeAKhgclNfW00=; b=QnX8EAqj1NdSiodi34RQfAUVxRFwDNNVr9xsWDQow2cE5INydMl18CERAzjA7RQN9L iyrE/btER8fTucQ5/nH8nOa+GoOQ9wwDukPAOPagcGYHZmiKcSWDkDl3u3+Kw0OY8n8L b9x8pOz1UR8mWvMu4W3ha9pWcmlyQb2tDBHP0= 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=xeMLg+35N7hSrKTKnxWGY/ydjeaKMZYeAKhgclNfW00=; b=o9VrLhobxWOMzJLyX3gg/QOZs0655FdYH7OF1y0faKEi1yt6ys4iotmP2hcbsIsEfF zmIdSFc+FQ2hUMy0lDzWwlQOCHnmrZuZS39ggUbS21CNWQxhBs2gzztw1QurEaeiww8e CcenFiVrHGhrzQalK7gmbc1fuYpTk6rSWnkooSj92dzWrXiXfCRuu65jGNl3pZ9xs1Xq hsWBMT81g+b+F8QomxVVzFaNcShIUJcUTjUhYj08UGyBIi27YC7QqStnjRAl6YaJhIhj qhBFeJnZwE8C8OaQpIJuawelz8XR7E3SjXiEjIwCGUS4g8Dg6BGhFyXbsZUd3cbrxjuk StvQ== X-Gm-Message-State: AOAM531GqvVr+Po3PGvbIq3KuPc9/2JpPrtfDtPgmAnWAoq3OkXbKiPM e7yKIS+xsXQ+jsXWafXsCdLdYw== X-Google-Smtp-Source: ABdhPJzLVGMo42m5euNK4kp07ZocNgWlb4mGFb+T8VtJCH8enEAQQ9fbe9dx6N+5RtJX12cxrzs+SA== X-Received: by 2002:a17:90b:4ac9:b0:1e3:1dca:d995 with SMTP id mh9-20020a17090b4ac900b001e31dcad995mr11560854pjb.111.1654071535681; Wed, 01 Jun 2022 01:18:55 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:55 -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 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Wed, 1 Jun 2022 16:18:22 +0800 Message-Id: <20220601081823.1038797-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011856_086371_1CF752A8 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 --- 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 08:18:23 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: 12866500 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 46803C433EF for ; Wed, 1 Jun 2022 08:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=thQDy1uJd6jUlVbBNd48BWmu2e12SiNy83H2ggtLupY=; b=3tJEMLNqRowCg0 PAZKG692uvsBMqxx06/r0ikGGjVVSIfewsziDHrOSjn0J/HgvugQrtyaOX+DXgoq1FjQ92rA+D0QY QH+aUW9xVfNOSxQoqzYMiEF4uefzSqhfF94FyStMMEazYcaJTVgcsPmmyqOBoCYO9xi4aTeefSJeX GdysGBIg4aSu6Tkwggu9KtsdMd9FF9dyeCPomP+iwM8qQZpubF83S7kpA2xq6VVAt4gYN1p+MK91Z jIvVxCIrVmOj+1E9bnClMHZGwwSk6u0Rj1oNMpqBrk+xFpBXaK5fTakhvobI8BJ83LFtHPirHSmdK sQjSvgt0nZrInGOmiMdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJcB-00Ec5N-Sb; Wed, 01 Jun 2022 08:22:03 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwJZD-00EaWy-PI for linux-mediatek@lists.infradead.org; Wed, 01 Jun 2022 08:19:01 +0000 Received: by mail-pl1-x62a.google.com with SMTP id t2so1105592pld.4 for ; Wed, 01 Jun 2022 01:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tde+IhIAyMS5phfhjLJ/xUjc9TpTeEZ8Vt0Thw0su/Y=; b=AvPaiVerLhPA7bu4ah3qZZGvu6x+scDrnj9QwMVpBGEzH3jZ7jjZctDsthGN2X75vw +gqQh9EYZiKEDVg457+bSPZMSAva31GxPBAHUAeqWSP4I5zE+e61zJti+EJ+Q8OnrZ/N KigOKjCuq65/FJ5z6+Tj+iW5NfPqCgjMotibk= 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=tde+IhIAyMS5phfhjLJ/xUjc9TpTeEZ8Vt0Thw0su/Y=; b=rSHHAuJV12k3G1HjR75geXnOaPK5HqxJuarvDnnMcW32hTZLb8rlYOelaawRX/m/n4 EG82AN6l/RqXUSzmh5mftK3ygHVkLrAl/DYwIZ8Fag7PR2Drz+aHgWXCMPDzBQ8VVTNk SWiuLS8tpVK9FQXxMF2tXHngF6LzrGJBFOUggBpl8SH0aOwtHU5EH5KvZFrdJkYY5KOc U4ILUmBnDroZFLsCbt8KjGPf4TCGmKJYKF/owpA56t9pmYTTJ3Vf9Dhf/sqZ9GitOXa1 2oMzg13R1vrTfIjgXszfts1c6nL/t7XgejhqA4Qz4aTEmrbgrwlZic6So/qEVyz6Hbgd QQbg== X-Gm-Message-State: AOAM532jjF5AbRjdIjVbVE6rU+iwBZlJa/dGJBOwa7mLBQwMHDub6ABU rb52gVTOr8A1BQ+cfqAjolfMVg== X-Google-Smtp-Source: ABdhPJyJZ9Nd5iUhCD6MyJuY2jjn3E+5iA+mGbWJIcSz/UCeJVMvsyFTNMYYQQ2/CExPe30dQ0kFsA== X-Received: by 2002:a17:90b:1e44:b0:1e2:e772:5f08 with SMTP id pi4-20020a17090b1e4400b001e2e7725f08mr17755299pjb.129.1654071539081; Wed, 01 Jun 2022 01:18:59 -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 c3-20020aa78803000000b0050dc7628182sm824680pfo.92.2022.06.01.01.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 01:18:58 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] drm/mediatek: Config orientation property if panel provides it Date: Wed, 1 Jun 2022 16:18:23 +0800 Message-Id: <20220601081823.1038797-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601081823.1038797-1-hsinyi@chromium.org> References: <20220601081823.1038797-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_011859_898396_F50C44C2 X-CRM114-Status: GOOD ( 18.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 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 --- The concept is the same as the previous version. https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.124072-1-hsinyi@chromium.org/ The only difference is, it now uses the panel API instead of parsing orientation from the driver. --- drivers/gpu/drm/mediatek/mtk_dsi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index bd3f5b485085..12836a697f56 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,16 @@ 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) { + enum drm_panel_orientation orientation; + + orientation = drm_panel_get_orientation(dsi->panel); + if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) + drm_connector_set_panel_orientation(dsi->connector, orientation); + } + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); return 0; @@ -837,6 +848,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 */ + ret = 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;