From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FFEBC433EF for ; Wed, 1 Jun 2022 08:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350557AbiFAISu (ORCPT ); Wed, 1 Jun 2022 04:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234146AbiFAISg (ORCPT ); Wed, 1 Jun 2022 04:18:36 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA5F28720 for ; Wed, 1 Jun 2022 01:18:35 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 7so430876pga.12 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=Ii4aC1MB5Qk3tLAX4FZE4Q4UISp7glQcevdRBtB0+Fv1/bDkdwdYOBctXcG4M46Dad iJJlC+WAIQ3Xyb0B2dLdbBb2OItSgoatTnitCbIoRcpkdGtKexHQLmRqcNKpsiPuL22i wyD0wgHQaiswrwjdiHE1PCkPDwNax5FUoShlQAUo7UiQuqOF/MeZRAy4M1TMrE5HcJRS aJY8mX1rpCP72ZNj4rEZPptU89B9gg4aPb3f3FpVPd6ufRD8vWo9KF9CJppXjCrUWkGe c3t/6T65YegXiLrGGJbNUIR+y/x1RedayLxEUiKEK5Kzx0xVj3GX+6BnTZtWgB1bo1UR yqAw== X-Gm-Message-State: AOAM533rYDZzw/U1pDF6brYPFf/qAapT/GWxjcDJSStaoeEqaJbfDnWi 8rquOn6yJpyVKKO2EoQP6ecMYA== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Hans de Goede --- Previous discussion: https://patchwork.kernel.org/project/linux-mediatek/cover/20220530081910.39= 47168-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); =20 +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *pan= el) +{ + 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); }; =20 /** @@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel); int drm_panel_disable(struct drm_panel *panel); =20 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *con= nector); +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *pan= el); =20 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE28CC433F5 for ; Wed, 1 Jun 2022 08:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350567AbiFAISy (ORCPT ); Wed, 1 Jun 2022 04:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348447AbiFAISk (ORCPT ); Wed, 1 Jun 2022 04:18:40 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F4628720 for ; Wed, 1 Jun 2022 01:18:39 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id a10so1326358pju.3 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=kCRR2lGQbnERs/1faILfUKJ+FUPsoypeRKYmFxE5HsKleJi5UljKOAsFn+OTro51tk YJoICOyp5b/lnkFsTTt7msrb6YHOCrWVKz6FmAFVqAHgQulbc6blwQ88Z8XzEWF3tep8 5TVScRKXIWp5mgnmk8BmEZb0/izAfuHCykH9ZUh70OXx/k9kz/WTOKPEj2UlHkBP/FdG iq9VuGDV6WUhnDI8p1Q2+LZZHDb55uHhrR+h//OhVMay1kd3vL34yWfVG/lBxARV/Vw6 aYenDqgjN4i0or946sSinylIIsaH2uz90byNTQzG3tPQQerX3Gt78UILb/WQzQVxNN/Z yXcA== X-Gm-Message-State: AOAM531y7g12+w5smht6RYKxVU9073BXBTXvVNUMGUgYh1qdS0EWKZVH hfY20UqWF6FLmO0s7O0CcPysxQ== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/d= rm/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 *pa= nel, return 1; } =20 +static enum drm_panel_orientation boe_panel_get_orientation(struct drm_pan= el *panel) +{ + struct boe_panel *boe =3D to_boe_panel(panel); + + return boe->orientation; +} + static const struct drm_panel_funcs boe_panel_funcs =3D { .unprepare =3D boe_panel_unprepare, .prepare =3D boe_panel_prepare, .enable =3D boe_panel_enable, .get_modes =3D boe_panel_get_modes, + .get_orientation =3D boe_panel_get_orientation, }; =20 static int boe_panel_add(struct boe_panel *boe) --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0894FC433F5 for ; Wed, 1 Jun 2022 08:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350596AbiFAIS6 (ORCPT ); Wed, 1 Jun 2022 04:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348784AbiFAISn (ORCPT ); Wed, 1 Jun 2022 04:18:43 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BB83EF15 for ; Wed, 1 Jun 2022 01:18:42 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id i185so1236977pge.4 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=Qifu7XX0BCA+jSpTTPrmW8ZSemSv4mrQEE33JyvpQGlZTDCQIK79S3QpnKH9dr5ffj 2FcKUYVX9Gma1jSoR/r4GRWJ7MhOIBLaJYBnVUApkX29LbQB11s8q2em8lo62jq/nv4K END1MYC7dlUX7rLyh79yWxwgTo9qyRgVYRb7HvK67vvGkbrfvubnyZ+IISBtklNwO/gs 42VCqaW/vK7r1A/7R22t4sjIMy1axiFdGHM9lRdfrvdxAe3D2QcBtD0xX4Z5o2gcs+Wp 27ZR847iejy4PXdGi9T0aUIdXv/mU7YgDYlgLq9ugvKGHG3k1U/DlBW8bAi7EA98Kg5B 5KCQ== X-Gm-Message-State: AOAM531O7uV/wAT+g/AsMAHski+cVRwKxw20tZ2l6RcQwhqBnaGRf/B8 Q/v66uwp1pGrj8at4nf1DVV0RQ== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/pane= l-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 *pan= el, return p->desc->num_timings; } =20 +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_pan= el *panel) +{ + struct panel_edp *p =3D to_panel_edp(panel); + + return p->orientation; +} + static int detected_panel_show(struct seq_file *s, void *data) { struct drm_panel *panel =3D s->private; @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs =3D= { .prepare =3D panel_edp_prepare, .enable =3D panel_edp_enable, .get_modes =3D panel_edp_get_modes, + .get_orientation =3D panel_edp_get_orientation, .get_timings =3D panel_edp_get_timings, .debugfs_init =3D panel_edp_debugfs_init, }; --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6137C433FE for ; Wed, 1 Jun 2022 08:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350579AbiFAITB (ORCPT ); Wed, 1 Jun 2022 04:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350555AbiFAISq (ORCPT ); Wed, 1 Jun 2022 04:18:46 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C7F2BB0F for ; Wed, 1 Jun 2022 01:18:46 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id q12-20020a17090a304c00b001e2d4fb0eb4so5460280pjl.4 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=ucWpZTXcjiH0zToFvwQHxE6S3w+x5xdRKpQhBZs6elC9e5FJjl+CoufOMl/ebXVAXA +l8Jj0cOovdaBr4O8NWpN93zerm+AqM9ecdq5gqJ8BcH4318Hx8EDG2qB3tdiMhkif/7 Yfb6AAka7FSAp7DkmzT7ZTQm6KpYE/9JGmNBlI49GUV3UuMBm2vgcO9s+hPq9IIvvLZX 7+c/Bfy1XSZQJVk4ofyK9rCYwRxi9x9eC+PC6Z6ENMHm3wceyxzI6xz8jfE2clb31j2B 08k6i4aRu7+3MJhsPhGx7IdOGDgwDFg2b0lSv5e/CwytAG051PyXoFpB6eASOX7fZk2L 7GBQ== X-Gm-Message-State: AOAM530ojkSDWkFJO+oiReTg8XizRzCptyHkJ5Zfoqq2jtzLRRqbMOA4 l56m54tJpf1FwcsbxFo9XkV1zg== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/pan= el-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 *pan= el, return 1; } =20 +static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_p= anel *panel) +{ + struct panel_lvds *lvds =3D to_panel_lvds(panel); + + return lvds->orientation; +} + static const struct drm_panel_funcs panel_lvds_funcs =3D { .unprepare =3D panel_lvds_unprepare, .prepare =3D panel_lvds_prepare, .get_modes =3D panel_lvds_get_modes, + .get_orientation =3D panel_lvds_get_orientation, }; =20 static int panel_lvds_parse_dt(struct panel_lvds *lvds) --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA00CC433EF for ; Wed, 1 Jun 2022 08:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350639AbiFAITG (ORCPT ); Wed, 1 Jun 2022 04:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350560AbiFAISu (ORCPT ); Wed, 1 Jun 2022 04:18:50 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B13D24F07 for ; Wed, 1 Jun 2022 01:18:49 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id s14so1089880plk.8 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=SOyactO+x0KRECkSTyHzD/w6kO+Nm2CJUrkQKMM2a0v76mFF6kZCi9NJBJfDCKpe6o EqtVEYcmW3iU8NhykJsTfkzw6zLWUGVvxfYUlCZTPhh2v4v3W0CZ0XNPPwFSYLOs9gtD MFH4Z3vfKTjC649NyGEcZlOsWU3ux/Y2Ks2IEdzKx+yOQWAP3tAIqM3ruoLL5bDEMWwb MRl77f4N6qSinzsaO4QGfPW/ZScQb5RuxSdV5jEKczWUlTtFo/EYjmphi1Tmsivz5FGk rYm6NFBFU7XsW9HS7RUjdTh/nJjIA+rDpEpv9DFocItVaPKljSyjZOuKAWUoWC+yMMGG qkTw== X-Gm-Message-State: AOAM530xBoKIP3mWc9ILw1WnwPzZnRFv//Q6+VS0Dy8SFsHSpVpKP6jI fdsfMLri1OA8JIzr6RTO9jkvig== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/p= anel-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; } =20 +static enum drm_panel_orientation panel_simple_get_orientation(struct drm_= panel *panel) +{ + struct panel_simple *p =3D to_panel_simple(panel); + + return p->orientation; +} + + static const struct drm_panel_funcs panel_simple_funcs =3D { .disable =3D panel_simple_disable, .unprepare =3D panel_simple_unprepare, @@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = =3D { .enable =3D panel_simple_enable, .get_modes =3D panel_simple_get_modes, .get_timings =3D panel_simple_get_timings, + .get_orientation =3D panel_simple_get_orientation, }; =20 static struct panel_desc panel_dpi; --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 202AFC433EF for ; Wed, 1 Jun 2022 08:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350641AbiFAITM (ORCPT ); Wed, 1 Jun 2022 04:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350574AbiFAISx (ORCPT ); Wed, 1 Jun 2022 04:18:53 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D899664D0F for ; Wed, 1 Jun 2022 01:18:52 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id v15so1205325pgk.11 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=DH+T8Deo/xQZH+g6zVCPPzf6E9q7Br+Xi0h3ypPp6WpoLkzN2IGWU+5q8UIS16l6Um KsmuKBgLISqbT/AYF9vRpHIX4Txgx5RsrzhYy7UYYNrXOt6HSsnZvcWODpEe4FeJIiqs /3pWDbSkroDNXRzdaKlAICryIm5fkkCdQbK+UFR7jizQPBai096H5RMVFrHRSgAHJuCk KQdb1Ye+rbOw+6ZSFk23NMtUvt+utdtsp0bKzi7tlXtT2kMgO1kxpjYqChta0OIrp8cL tWrm79tQ5Kr9lk/LgK4C2tlJSRf8RqhCihCGpu6qPoKdQbz5UfFFz+DMv9lVYp3FRPq4 aKHA== X-Gm-Message-State: AOAM530BDQoaUEWH75dlfc8i24OzM2cP2e2kjPElMyoxHCNS4KlgLHIk BodKe7iyvKkXwZN8bbK4PM+GkA== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/dr= m/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; } =20 +static enum drm_panel_orientation ili9881c_get_orientation(struct drm_pane= l *panel) +{ + struct ili9881c *ctx =3D panel_to_ili9881c(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs ili9881c_funcs =3D { .prepare =3D ili9881c_prepare, .unprepare =3D ili9881c_unprepare, .enable =3D ili9881c_enable, .disable =3D ili9881c_disable, .get_modes =3D ili9881c_get_modes, + .get_orientation =3D ili9881c_get_orientation, }; =20 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77040C433F5 for ; Wed, 1 Jun 2022 08:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350633AbiFAITQ (ORCPT ); Wed, 1 Jun 2022 04:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350601AbiFAIS7 (ORCPT ); Wed, 1 Jun 2022 04:18:59 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 392742BB0F for ; Wed, 1 Jun 2022 01:18:56 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so1370516pjq.2 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=pVe9j7KXJyRst5XXCg2VzcTa3G9ROthPHwnCsC9/MOafrq+IyGb2xCtLBbdF9HdCMQ CFji8sJGm9tHUpr/edO+7gHjOlCutWIR8nKAUhxLP5PkfIrhCIhCTeCBVzjMuH/ab7+u sBVKmOAMdRDqB+p+BCU7xv9H8qOaGifW2RkHM5/xhmBWsrs8fR4iK901OzB0kKNzgu2x izve1T5JEOqpi+LMaij/0i35N9ySaWTPNgknpXUBBLQL+qotBjY1eRpCumXcpDra94/e VSaHbfKsYIulntnNegvqqXCl3SjBwiPI5N0TxbzrPjDJdi+0eLP4ZlBxzEzqWsGIuSRa 1K9g== X-Gm-Message-State: AOAM533UEj1G5MoB/LC5prmzXgq0APSjKinfsg1ynX8OFryL3gLgFwgd l6VGYreyvDme7V0JoFnWqCPm2g== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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; } =20 +static enum drm_panel_orientation kd35t133_get_orientation(struct drm_pane= l *panel) +{ + struct kd35t133 *ctx =3D panel_to_kd35t133(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs kd35t133_funcs =3D { .unprepare =3D kd35t133_unprepare, .prepare =3D kd35t133_prepare, .get_modes =3D kd35t133_get_modes, + .get_orientation =3D kd35t133_get_orientation, }; =20 static int kd35t133_probe(struct mipi_dsi_device *dsi) --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:26:15 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BADC6C433F5 for ; Wed, 1 Jun 2022 08:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350655AbiFAITV (ORCPT ); Wed, 1 Jun 2022 04:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350608AbiFAITB (ORCPT ); Wed, 1 Jun 2022 04:19:01 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE9AD8B0B5 for ; Wed, 1 Jun 2022 01:18:59 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id v5-20020a17090a7c0500b001df84fa82f8so1347336pjf.5 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=798ffEB4B6kOoOxPiyf6e9UCajSf8WEe3alWdbVGoluTTxk+E87cgLHb9dasuWozlL vjrS/xzIMeTUdnM7iyIFCGWZ17zuhZ61D+FttOITEwzVapQC/U+P/tZNJKaRnGlfyLHD WxioOgK3c4qvNUbFknQD/7Mlf3MIICkaJC9duaVk2Vt4JhArNq0+WCCsS4tLBB9jbBOE vdZr4m2znqKx+yrpfrh4m0m/Yg5QyPmcMWbKMwMf0YI3K8is3s+kPVgMPlBy7Ek0pPby Kiy2EiJbLW1nrC0S7PRP5906eQkj+AVfHHcNTkAbGnibX6Jq3Wq2agStmRVMLK/pYGne WGRQ== X-Gm-Message-State: AOAM533dVpXIfpY7Xs1l5BMm4JClsbTZQYzAG4fbWUBMpYIOyKYdvuzY fmcJ/BDUoIFwpdqJDeMqjFu7Jg== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Hans de Goede --- The concept is the same as the previous version. https://patchwork.kernel.org/project/linux-mediatek/patch/20220530113033.12= 4072-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; =20 @@ -822,6 +823,16 @@ static int mtk_dsi_encoder_init(struct drm_device *drm= , struct mtk_dsi *dsi) ret =3D PTR_ERR(dsi->connector); goto err_cleanup_encoder; } + + /* Read panel orientation */ + if (dsi->panel) { + enum drm_panel_orientation orientation; + + orientation =3D drm_panel_get_orientation(dsi->panel); + if (orientation !=3D DRM_MODE_PANEL_ORIENTATION_UNKNOWN) + drm_connector_set_panel_orientation(dsi->connector, orientation); + } + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); =20 return 0; @@ -837,6 +848,9 @@ static int mtk_dsi_bind(struct device *dev, struct devi= ce *master, void *data) struct drm_device *drm =3D data; struct mtk_dsi *dsi =3D dev_get_drvdata(dev); =20 + /* Get panel if existed */ + ret =3D drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL= ); + ret =3D mtk_dsi_encoder_init(drm, dsi); if (ret) return ret; --=20 2.36.1.255.ge46751e96f-goog