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: 12866503 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 965A3C433F5 for ; Wed, 1 Jun 2022 08:18:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 582AD10EEC6; Wed, 1 Jun 2022 08:18:37 +0000 (UTC) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC69A10EDC0 for ; Wed, 1 Jun 2022 08:18:35 +0000 (UTC) Received: by mail-pg1-x52f.google.com with SMTP id s68so1211675pgs.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=AzRmfjpxqsj2SePIZU8Yfu61cQN44WBnJNFws08oOxLRnr+Vt2+6IC3vYLZ5Ju49Fu 3P/KCQ1UFQRQDBpG1ua1tutIYkkKFdC4zTAol8q6yPn17JYMK1cX+glPCsJeqEG6tPGL ayiwuI9WexjoyyAO8GhZRTmOt9OEOxu6+ap/qtY8jAEsHUTbwX0tWKJ2sA4+YAOvs4Ro i9IgpuDSfEC9HKbdI763wcI6xCNxgs62Bg8CgtQoWOl5gbR6ITy5PAwu7xzQOx8JJvuH UYPBssIDY8nTX1zkSGqwwkFzTaC8h/tnofaUn1pl/z+m9TiG+onJ5Z9EhQuH9M7bDL3U oEJw== X-Gm-Message-State: AOAM533wa3+p8uQq93GEwMDW10sqP1LLyVE99qyiLNXN3ZdfaQuq/Kyp tO+hNOhbKz26Sz24AJWMS7pywA== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866504 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E8A6DC433F5 for ; Wed, 1 Jun 2022 08:18:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 919FC10FABE; Wed, 1 Jun 2022 08:18:40 +0000 (UTC) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3035C10E521 for ; Wed, 1 Jun 2022 08:18:39 +0000 (UTC) Received: by mail-pj1-x1036.google.com with SMTP id j7so1320348pjn.4 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=LJYUYAIoqpQkHNV9Ndmd0H18UyTHLR+Eo+SG3C2AQjAHUJVmHiPKXLOlohmajEr9+0 SKPBHjIzHPKLhjnG1/ZN5xo+2vag1LDpZCdQC/5dKB9I5Nbvoa15w16liN3v+Be/BlBN NQSdNUp8/8NKwt6Re3LNZ+Or4mBFt+jTO1cEy9E0zXTKwWcMmrD13zUibYZmaDYFgGqO A+27Os3Z4SIbdLyP/Zpf1Degf04dAm3atbHDn5ZpbKTvXSvRIb7wd0fdw96H4KKhPvDb Tj9dcUuvgZwZUroIc4DLvK1CsL46PNpakqf9k6ag3aj9ddawFRP5w4LuAhuxVOqKfNsj jp+w== X-Gm-Message-State: AOAM5301d12d9jeFG+hcdOKmdjF9Wu+QUowjvYb7Hs3GwxalDkrhVra5 RepcXX6HGfJnJuX14LCBhh4RLQ== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866505 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 16509C433EF for ; Wed, 1 Jun 2022 08:18:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34502113113; Wed, 1 Jun 2022 08:18:43 +0000 (UTC) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E3FC113115 for ; Wed, 1 Jun 2022 08:18:42 +0000 (UTC) Received: by mail-pf1-x42f.google.com with SMTP id u2so1307986pfc.2 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=TcI+SW/MVUqV7+/8tUwC/OVi6DGTwphzCVaXl3o45Qd8ZhIKBuQ3xtDdAIzpvUWkqu SIQ7ujHuZ4is0db/9rmc6Mle2Ld0zMP9ariwM/a7B6Jkht3C752Tdv1zOt35I8lTzw93 wZEzic7/y3pC1fEamTcSin9RbnqKMeghMdikVeQiapvGaRyoZG6FTqPb54CgXhSnLNpx wZb72lCcg/qEFRIdRDY49ZGva2jYvkzFP/84b2S0olvT+5CJ1V7pJmObPpbNkENyhlqN tN+GOyfj4y4BOo0BnFsIUxtTnPaeFkobATv993E/RcVtIOnyVRGJK30HsYoRHCeOl9T9 1kxg== X-Gm-Message-State: AOAM531K3y1WQTJJ/SlNuI7ZNNRkDCFB9OPcnJWdVU3xGE+BPT+csmyr sGukif2uU3SykAP/k1ZBNgen9Vfz2O2jkw== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866506 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 2F5FCC433EF for ; Wed, 1 Jun 2022 08:18:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BADC1134B6; Wed, 1 Jun 2022 08:18:47 +0000 (UTC) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 032C01133D9 for ; Wed, 1 Jun 2022 08:18:45 +0000 (UTC) Received: by mail-pj1-x102e.google.com with SMTP id v11-20020a17090a4ecb00b001e2c5b837ccso5464057pjl.3 for ; Wed, 01 Jun 2022 01:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=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=CaHh++51JhEoEpilPTR+vtC1Vwpyu5sbCs/C10DpJbx5fnrJ1LlmVMyZTD+Qmq8sJc XVf2st7IRbdn9UZheazdNjwdmckTsEhRQnfql3QHVy/oXNuh2A9u41fVBoPwBwtwV4JN q17RCy/RxHse/5mnHzytxQVoL827hHaSt1ysHHno5msbO4eheaTIkWfzv/HP3P3UDvF7 QHn515SiLl2mj94tR5VJDa2W/v/49dr3zaCdPohMpV2j9ZGZE5QPHS7PpSBT5klhYnDa MNoNAG360pj1RorBI3oJZ3MNT3JHxdgkEjdXbr49zqTegb8d0lzLbLP5q+HQpYAddBxR V2EA== X-Gm-Message-State: AOAM531/Z90W+eekvy713Io3WzO6Njum3QIfNgewxTxfOdH9lb0TGCF/ pLXUG9olqq0rHdQO/EhK8C9CPg== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866507 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 33C88C433F5 for ; Wed, 1 Jun 2022 08:18:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83CC51134B7; Wed, 1 Jun 2022 08:18:50 +0000 (UTC) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D8201134B0 for ; Wed, 1 Jun 2022 08:18:49 +0000 (UTC) Received: by mail-pl1-x631.google.com with SMTP id w3so1071058plp.13 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=2HrcaN8ASc59lcAng9EuuRbBnlhRlnmKck9vrd37D1rF5gw1BzgQb7gEVh1x3iibdW Fyg6bIiQY6S41kwjRrW3MXz/2DIAn+pypdrrWUPOyXdYSstHsLksVxVkbx6Is9s46lGI zUAqUvDCfrKqsMLBeH4UgREThZTugpjJN0zx+XeIeKRuAFYpzzhzplmpMly8H6IjuVOa r51peovLsmEHtx4inlibp7re2nN36PivWVi6KozQeyqoo9zGOamCFwOSzvo5coAUjA77 BuGWrWYdv3fBMJR5WItCYW1Q/ihGjghJyrrYd1HxpzRXrRvobWDWGD4BYGoINbrSSgfc AlFg== X-Gm-Message-State: AOAM532wuzoLNO4dWgkM2c9yJzzPNLlxoOyS5NLz3lS0aVcmbOwm4oGm wP7VI7m3uABcQjHhOkSvwXhGGQ== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866508 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 DED5CC433FE for ; Wed, 1 Jun 2022 08:18:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E4E21134DD; Wed, 1 Jun 2022 08:18:54 +0000 (UTC) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by gabe.freedesktop.org (Postfix) with ESMTPS id C95D31134B0 for ; Wed, 1 Jun 2022 08:18:52 +0000 (UTC) Received: by mail-pf1-x435.google.com with SMTP id bo5so1300046pfb.4 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=ccl40zDyVmi5HBjw/9aFvO75Yet94du6o5bG/7oGBDG3qiHtoTzGgVCyBzz5IszXi2 3TOL+Xu/Cjtdjb3MgWpLRl7y4h5L+/4mwtX8MdBRFl6hk94FYp11eoojeQrWv/Y8TY5S YAakDyOzikL7KAYftq4s2tiGz4yoNEJrjcIwVUF3ZFaXtWtlW57jiMwzHBM3WeNJs5vu UssJcDblULrLDXV3APfxeDudQjVeXcZWlCryVN8F8CkKi4cWj3ztG3sm56cTT9Bxin32 ID9y6P1qUfQ1xtGKy9BgNUta7KGGsuMfkUwqNuoBDcpscAnzJCEM/AL1AxBEEJIrBg9g OWxg== X-Gm-Message-State: AOAM533QLAo1k58QkXexIVjhRGfRT+InMJh0xa9j0tmaIyr/fQ2SamgT Qy0YceSg9+e0K5ostn39CxK7DQ== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866509 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C8227C433FE for ; Wed, 1 Jun 2022 08:18:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BADE1134DB; Wed, 1 Jun 2022 08:18:57 +0000 (UTC) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18A251134DB for ; Wed, 1 Jun 2022 08:18:56 +0000 (UTC) Received: by mail-pl1-x631.google.com with SMTP id i1so1096273plg.7 for ; Wed, 01 Jun 2022 01:18:56 -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=L7oYhHNc0Xqs6NJJ/nPikeuwzgpJaqp6/ITaEQkhDsp62egg2BRK3x7T1hPXAGoPy0 1LjeuAr9UIKnuKRX0D8EihTzlWH4d4I+CvPgC8a7Kp0UfSwjny4jy2+mZ8TW8SSIdg9D la3njcnhocQ/6iNYFj7DKEqih1dE7o1sUaUMaTLi2eIc2bSvE761C4WMiXnwcF+vcsN8 4qA9d4VRrAT9UttWI4EFvWYVsYPrYIxE/+x++o51lNmxJHd8H4Ge/O9MSI9w5HiY0EZv vT//sb+ab+2YK02fq4IDP+DZivRbcD1RzJisVaP+TFpsZCAXE92nQUD5W6jpUEaH0POe CyQA== X-Gm-Message-State: AOAM5324eJiEVXDmdmYtjTOF9xX13zG+m+ha0Kb27SEL1HrctKIRRJns 9J99moCkRrjAuQC22e69Xgtweg== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12866510 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 BEF1AC433EF for ; Wed, 1 Jun 2022 08:19:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 057E810EF2B; Wed, 1 Jun 2022 08:19:01 +0000 (UTC) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CA9E1134DC for ; Wed, 1 Jun 2022 08:18:59 +0000 (UTC) Received: by mail-pj1-x1032.google.com with SMTP id w2-20020a17090ac98200b001e0519fe5a8so1353032pjt.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=iyFKHvG4cyyhNoqNvUICtM/ypt6hO/IKDrNDYhdaASxmLxGDLCAfrHwsFiP5lF7hFb ejXaOAIhVHjFCEg9tFkDpcw4oTchPaCeJlxrYXk8kFODdtTvVrhR0L2frKlbr+O1KzLW ZOFbnB7h+WW70UldtCP3GM5+TDDrWs4kGvkbPPQJISY/OKNkVA4m7e2SiOg9wMZQrZDO J8CKzFPZew0Dz9ScmvODj+7nlPhqMKL/TRjbLpE6qWOLhTjhHGSbV0S4p2Ocj6QTJrNh EB+vx1Ed2lmUYsBYQSa+de/86lBLFdQYT4Auu/djDhv30NbBCZS9zuc5JUx5p+ZSjB/N qcxQ== X-Gm-Message-State: AOAM5312HkxreLljhy6uV1AFlPLaUfEPVcOQh4hbmSl5v4NSzSEyMT9o hFKkQy7NfLb0gmp9hHO4tv1LuA== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Rob Herring , David Airlie , linux-kernel@vger.kernel.org, Douglas Anderson , Stephen Boyd , Hans de Goede , Thierry Reding , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;