From nobody Sat Sep 21 23:34:35 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 F1694C433F5 for ; Wed, 1 Jun 2022 09:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351429AbiFAJrB (ORCPT ); Wed, 1 Jun 2022 05:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351421AbiFAJqu (ORCPT ); Wed, 1 Jun 2022 05:46:50 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A58412612 for ; Wed, 1 Jun 2022 02:46:48 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id h1so1277484plf.11 for ; Wed, 01 Jun 2022 02:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ly6+5XNWmCSkjCBGbVKtEs9r+Surb9t2PEnnpf5hGg=; b=QRBX/kxizeClVBE0CYu4NjV4OOEi4yCiQqllUL190dxEVKt6HTUf6obRnPH+h/5Do6 X67p3+jRpmcMr2sRMX1JDEgOAmWlHfT2i9GjxibwNOvxEKU13OXXV74hKqUHIvaf6LSo TiLpRisA8FksqwMAxdxJukxiVP42iMy06fPk0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+ly6+5XNWmCSkjCBGbVKtEs9r+Surb9t2PEnnpf5hGg=; b=6Mxu31PEbyP2UAYm0jWkCA1fiqVc6L9837X01ezQUl2Y/BzGvIhy2ZgoIzCS6DpMcl 3XQfC7vIklNFrSZPNZjQ9Jt5jSpA5FBCq6jXnaz6FrzD4antynISEB3ppn47W490dfhC XtKDQskK3SbWnRtApKp6jH0cfVIrNeGQWKPgpYN4f76qDc28N/qedXVRUEBRDTWjCXz+ nhqQf9tsd1PS8uP89O/q/j61tfH+EQhLrl8VkJphwjFqor/aSqFbfUD62otPL/5ZIv/L kWL1uuVd8zIxu7JbBs1C5qMt3imZiVD/+8EXjf/wyelBca5RS4nheSO070MQGsumbnd1 b/3Q== X-Gm-Message-State: AOAM531S0WCIF37A7h85ouEN6gGpfglSnT7BcK2SkwZD8yXXwPj7oKFe vKfxiO5Zcg4XTZxWPU3tU8CAvg== X-Google-Smtp-Source: ABdhPJzeWn2amYAMvPYY4kbTogyvoZUC/Zy9OCPdoeNKPYAG80RGrpKEdqDx8Y3iV2XaG61OhG6/CQ== X-Received: by 2002:a17:903:1211:b0:15e:8208:8cc0 with SMTP id l17-20020a170903121100b0015e82088cc0mr66287614plh.52.1654076807659; Wed, 01 Jun 2022 02:46:47 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:47 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation Date: Wed, 1 Jun 2022 17:46:30 +0800 Message-Id: <20220601094637.1200634-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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(). Suggested-by: Hans de Goede Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede --- drivers/gpu/drm/drm_panel.c | 8 ++++++++ include/drm/drm_panel.h | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index f634371c717a..4a512ca80673 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel, } EXPORT_SYMBOL(drm_panel_get_modes); =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:34:35 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 B2B05C433F5 for ; Wed, 1 Jun 2022 09:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351423AbiFAJq5 (ORCPT ); Wed, 1 Jun 2022 05:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351433AbiFAJqx (ORCPT ); Wed, 1 Jun 2022 05:46:53 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EB212AAD for ; Wed, 1 Jun 2022 02:46:51 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 3-20020a17090a174300b001e426a02ac5so2503378pjm.2 for ; Wed, 01 Jun 2022 02:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=INHYjrtzuqTmW29J42HX48K917nNuhGdGFIMxI84h6U=; b=LvoSbn8q477RrYSibfBveWnjpFmVPUg2kyylSMS3U9WKUzvZCOaAlljYZnNmB8h3IH KUfDjgnk6qR2j0EyxzpkDV27Lrn/h0xLPVTM/K48nLP97GkQUIcK/5Xj12qxQ980Pg5A F2Kp0FCwVJ89GKq2sYlijKOfjGgViTwvxvTj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=INHYjrtzuqTmW29J42HX48K917nNuhGdGFIMxI84h6U=; b=kOB8QFk88SMIpizIouykiF2ki1lYsdQiPZdk5korWy24r/mCknG33j58qeM4eHO2E4 PTbTJeWxDL3Dh+5iT/ZXfYtCeGjhU1gx6cE0NsDUJ7+ZaMX5UTb6lwmbV+QAq8/HAKGJ kW/zYEIM9oJH+xMQZMHfrJbcY78+KlEkzcNIUp7ISog20tQOCaLfDPzxUutSVpQieEyj k217o5OTDxOrYRg7LnXZptEWhzgNSiuOpJh6DJjYv7msCAibemAtVOvYOHkT7Lu3hXjN uM76BdjEI+Pecrd3IFZvNSs9m51tg5GSq5gkI5FtHL4pXcifw22uMJM0c6bkBbUxf1se zO2A== X-Gm-Message-State: AOAM533IKMH4aKMYITLUbbumfYXSEmP9rPZjMnpR4bsM2ir/MsHPVZPn h3u0wwS1zKlpDcAXzzrxywT09g== X-Google-Smtp-Source: ABdhPJzmCwkp/oP9bNtMxaNhr0RDu6E+1BWrnv69WtPiA4cmKqDHhI/gba5a1xxURUe2vVmGy8TPkQ== X-Received: by 2002:a17:903:22ce:b0:163:f186:f3f6 with SMTP id y14-20020a17090322ce00b00163f186f3f6mr11348483plg.59.1654076811040; Wed, 01 Jun 2022 02:46:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:50 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:31 +0800 Message-Id: <20220601094637.1200634-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 5C912C433EF for ; Wed, 1 Jun 2022 09:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351364AbiFAJrF (ORCPT ); Wed, 1 Jun 2022 05:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351410AbiFAJq5 (ORCPT ); Wed, 1 Jun 2022 05:46:57 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10F93BA9 for ; Wed, 1 Jun 2022 02:46:55 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id t2so1303767pld.4 for ; Wed, 01 Jun 2022 02:46: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=ZBqJiw5iICb15XSMEIziFVB5wuNumdiuBxaQCMR6NjU=; b=AQSKii1jvRtBpq0Lrpj8ovAJqJPE2589nykaQe03mHf8JaCrY3Z4O1XawIEbsR/4UU PxLNY93/gtlAHrORYa+QAoX+Tb6aPH+1e2spp2tc7pfScCEf8S8gOf1+2pzvef6Lvi4o Vs3SdULDuc7uOWfaH/zRnk8xF0Wbjb+VseM+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZBqJiw5iICb15XSMEIziFVB5wuNumdiuBxaQCMR6NjU=; b=gyp8MS/tNFcJaWBSAfN8l8UycZYy5ivbsle4wFP2XcJpB6Okt/fuxWDhiIQerUmejw 3CPt9RF73gJCNkrhrU5Jn/+AhmSPtk4c6NdAc54tLwKLeizGwqUHCWtXwUTWQdfp9/7l iPeLp9Pkpw1l2go/ZZwwqchoowh5RKUlZlKuCHHb1yB7Je+vMgPMYy2sOuuyrwUiK3Tt C4gtTnyEyOne1mbyJ79EYtiMprpcTQDaay+LBCQssP69PRAxLumqtXwtMPb4JWEdQ1zS rutn5oePiPeEB191+uo5qeqbEM7e60HGjxqpYj+gXeae503S/2JOzmhWQOuk+C/yy50z InDw== X-Gm-Message-State: AOAM533OouG8yIskliOljNz6+lM/k7ccmuz2owPEVjQKVmUGD0c+Dpha FxTNuX7CYh9O6UAjDrw7zw9aZA== X-Google-Smtp-Source: ABdhPJw72ka+6aqP/KnDSsfh0kJMmqQ6I49pRZC2aCEKoh72sgZsPQ9ORjmrG0OhkVOV4FFUNg74Gg== X-Received: by 2002:a17:90a:6308:b0:1de:fb6c:5944 with SMTP id e8-20020a17090a630800b001defb6c5944mr33599246pjj.60.1654076814431; Wed, 01 Jun 2022 02:46:54 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:54 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:32 +0800 Message-Id: <20220601094637.1200634-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 E1BCCC433EF for ; Wed, 1 Jun 2022 09:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351455AbiFAJrK (ORCPT ); Wed, 1 Jun 2022 05:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351432AbiFAJrA (ORCPT ); Wed, 1 Jun 2022 05:47:00 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 658DE12612 for ; Wed, 1 Jun 2022 02:46:58 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id n8so1316512plh.1 for ; Wed, 01 Jun 2022 02:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uKIVyDAwCRbl3j6LCvOq2/nCq7m+//LNqW8/74aUWVc=; b=K55Diq2ttR9WJlI2/Wd+H9Ph2pL1ao/2eEjG7R/EElPqrHWmBsDDo2bMhx/9i6sjnq 9QbVWH6KHA9eu0L55xByn5/Y2fdGlY6l5yy8HeM+Jl69l4r8ee4Jbm+ctn6gS9wU4bMV dTqPBZMZKk10KcmnLXZVIxTJVWbgjkTwGEbV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uKIVyDAwCRbl3j6LCvOq2/nCq7m+//LNqW8/74aUWVc=; b=4Cy1DJETbrYTzI2crRpX9zs67Jhns4vxAiJ7o379kAKbTA1BpbMc5hLlKm/Z76oAYR /UPXMAI1ry9+Bfr4jkqkJu2WeDGKj/fkG9Xx8+1Q2ozkcw7jYM5fZqh5gbST73tRWQ7V DCjMXqRlKoN/D+gw1PbMvKEzmTGkX9hp0frvZtTv1bnTUxSb5QmJXo6MhTf4fMZBq4aZ aLai4oXVrexzSmlTgiiDapay9RSEU6fwtvckJwbpKDV2lE75jCkju9B/UW1+EHFRouhi OMsHTpJ/x2Oputi2ayhysK0DJQa0GHgqW+PWwCgw0sVAjzfNqR/aIT5h5viPh2+v/q52 F0Aw== X-Gm-Message-State: AOAM530HzHUElSJOlG/V11dEGyZtGoT794a5R7/GTrZRJIvEm+snA6wJ NqgERSdk5aXAGxtyVGQzqF6zVA== X-Google-Smtp-Source: ABdhPJx+L9NeZp/yBLzjW5DmKKRxM5eCbinJMWNY6Kiy9cOR+7U+YTZTSf56rWT+/WOY/0EfnFPp/w== X-Received: by 2002:a17:90a:b88:b0:1df:2b03:20c with SMTP id 8-20020a17090a0b8800b001df2b03020cmr33285059pjr.46.1654076817876; Wed, 01 Jun 2022 02:46:57 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:46:57 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:33 +0800 Message-Id: <20220601094637.1200634-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 37861C433EF for ; Wed, 1 Jun 2022 09:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351484AbiFAJrO (ORCPT ); Wed, 1 Jun 2022 05:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351430AbiFAJrD (ORCPT ); Wed, 1 Jun 2022 05:47:03 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5F611449 for ; Wed, 1 Jun 2022 02:47:01 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id q18so1274321pln.12 for ; Wed, 01 Jun 2022 02:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jVLAPZRG5UqIkFmmis3uM10FnfT5Ljau+xefKKOpEpE=; b=OE93Xi6fuFvNjrUPzVoJX4DICUjzwZ0FrNbASk4QhkljwjjdO/t0+U9bsHLt3Nq16+ 2jXyFGb9vQV2JODWz1J1HY7MqWvFdGQfxoZCRMPGD0flte9sS8xfM5OvEXrqzlCd8Bhi wM7/e6IqFwZwACP7InwILEx1YGycyNgsKSh5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jVLAPZRG5UqIkFmmis3uM10FnfT5Ljau+xefKKOpEpE=; b=lTYB5ggV12j4CyDrJMGjg+zHqbiDUc2ktW6eEAIqlIZAxonyRSmEA2Iq301g7fcJZJ /y9n02EZbufihCfKe9wF2XmKAqIsQTIa86s2+7l2GPnzjicjzXbjQR1cEcbbQjVMN0gH BbOzw35daB0ACpHEdb0JzeY4yEeMbXVSXFl5GWdgKftF2dO7ymimVR2EvPW7K0VkIWI/ xdSZVuOciokzkb3tou/cAQ9I791V5cdJDk4zZu/umUTtbzjgZHZuW11D2StZ67Vo/h1d 64aWj7GVPSlRb92hXzvQB2AIgNIfrCLtqx+j3jJeXsIrIpKFf2HQ72X7c+8xBRa3KHcm ou7Q== X-Gm-Message-State: AOAM5308Tf/Fe1clZ3CbzuIXxpfdOzcgcvBJ4vKnxccimEwS5DhqBAEf bgdoRkqSVLdK4RyJtSEDCW5RVA== X-Google-Smtp-Source: ABdhPJxax220Y+zg4h1kp6XXN13EyER3sz3MXL01acYe3CvWec7xBmexQhbBRgOQrByQ7j3lpjfQeQ== X-Received: by 2002:a17:902:7045:b0:163:9c45:e330 with SMTP id h5-20020a170902704500b001639c45e330mr25430866plt.32.1654076821222; Wed, 01 Jun 2022 02:47:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:00 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:34 +0800 Message-Id: <20220601094637.1200634-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 4AF1CC433F5 for ; Wed, 1 Jun 2022 09:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245098AbiFAJrT (ORCPT ); Wed, 1 Jun 2022 05:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351441AbiFAJrH (ORCPT ); Wed, 1 Jun 2022 05:47:07 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32492ED7B for ; Wed, 1 Jun 2022 02:47:05 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id y189so1466793pfy.10 for ; Wed, 01 Jun 2022 02:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O/72CEn/8tEBsrCbwpSKpFCIgi9sYAXiNEhikH0IRpA=; b=OS+nvMctRYsuTwiXTJRqbgZKnlvrlKjvQu63bS3tE+z2ocwPpH+8Be8ETuIRFu1Bpm lzFSCn4cLpLN4zoriukqzBwgN/EobgeDfPFSG3Zm2uEEqlCB8YTCxRZ92yS+SNWZeqPD ZWiz7cFBMmKJ8XT1LNNfAPpMY17jnT59h3r1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O/72CEn/8tEBsrCbwpSKpFCIgi9sYAXiNEhikH0IRpA=; b=GUpn1o9ebwwPsrfRiHVyucna7nJkLk3HDfLBPBVI3sMhetYMqoe2Mkv69o38rYxscX oV6lt8cpWMBI3dJJTQwNb1qGv0DyQ3WaIjt/FZ151G/hTLobvq1lafLzPoTOWsGFmidy qMzF5kj2hY8otHcxRCDcQFXbZ099u9nsoEBZthnbM/t2zMPhm7WvW9IwqnzdTiGFqouB FYxaSiobl2WsBdlRI4UsYkNo8DGg6ppRiUlm08HD3drZv1oBeIsHMYozNVy1NT86oBg2 o8thps4wt9V37QE42Of4ydf5sfQRPszOdvd3bHuYwQIiig0/F647sh8YHkwhvLTqawOW MkDw== X-Gm-Message-State: AOAM532NWD3yuSrf2DI6vYloywtzF4WNcPi3ZjD0phIYTs4Dg9+tR24S KBXDycHZqZiMmVYWMafnMdHFmA== X-Google-Smtp-Source: ABdhPJyQ5pLVueYfHXGuwinz70Ri9IG7lJaHjQY79NIVs7H7BxNtxvVzpvSC7OIOWWsYFbqCZuKYlw== X-Received: by 2002:a63:341:0:b0:3fc:824e:86bf with SMTP id 62-20020a630341000000b003fc824e86bfmr4498754pgd.140.1654076824594; Wed, 01 Jun 2022 02:47:04 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:04 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:35 +0800 Message-Id: <20220601094637.1200634-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 1BAD6C433F5 for ; Wed, 1 Jun 2022 09:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344053AbiFAJr3 (ORCPT ); Wed, 1 Jun 2022 05:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351490AbiFAJrY (ORCPT ); Wed, 1 Jun 2022 05:47:24 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB5BD49F9C for ; Wed, 1 Jun 2022 02:47:08 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id g184so1433797pgc.1 for ; Wed, 01 Jun 2022 02:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bk6C27QNmt1+4+7KncB4viIiej/sMiUgOSBQvF7TcyY=; b=K5lzcMPBYc5vuIuvnrMLXcNHgjTQKop5EOpt+HwdgnFoFJa+hd9QbbKDaVebbKacZL OSwO3h44qdUkHgpNO01ZFKqIrpb7gnBjvepEql6SNrM5QPse6iv7B8DP6j5GEimsSfcl 7rLDinsDAlwVs0ZKykx56OzMFZvwhVG+tu1e8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bk6C27QNmt1+4+7KncB4viIiej/sMiUgOSBQvF7TcyY=; b=D6iN786dN+s8cjSYGyCjEhsbIcnmzY7DzA7FQp06yzQVQ7qHlyd6rMZkIaV/NoJSIC kRLY47H2H/x8zVwSAsGvQl8IzYYsKHd8vV4dyUAvw5dBGwBPX4Ye86+cDmJTuYQFFFfX 5uRjoJO6+m6LUy+kUhGBUREZ0CHmae/e/mpX1pDeq1wy9HEicOWWZ1sxnT0cG3krHY94 cb6+uJiiyrEQAl4a+VDQoDEw9nTV+TUwj/h8OXssp7tnb9qwunHUkTC7qvGSU+x129RI RkIRXnlqlufAsNd5M7y9BCNSCqufXUq56m+tEBmTwK27fOiKiEkaOvoi9uqJMI6723Dp M8cQ== X-Gm-Message-State: AOAM530pZevceAO5VvZY/8IFgrs/0Ou6wG6Xg2o3wzEchPkZIz0RmaJI iWkRvQ3Cvru7ZxT8aGDye5HstA== X-Google-Smtp-Source: ABdhPJy780kRALjc91F0vxW4FURBQqFFfjKK3ZprK5u2ZLrMWSj311aX4pckzJCj6vHag0BcmbL/+Q== X-Received: by 2002:a05:6a00:2386:b0:519:1ff1:d723 with SMTP id f6-20020a056a00238600b005191ff1d723mr28880889pfc.21.1654076827998; Wed, 01 Jun 2022 02:47:07 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:07 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Wed, 1 Jun 2022 17:46:36 +0800 Message-Id: <20220601094637.1200634-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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:34:35 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 2B97FC433EF for ; Wed, 1 Jun 2022 09:47:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351470AbiFAJrh (ORCPT ); Wed, 1 Jun 2022 05:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351508AbiFAJr0 (ORCPT ); Wed, 1 Jun 2022 05:47:26 -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 6D2235000B for ; Wed, 1 Jun 2022 02:47:12 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d22so1285969plr.9 for ; Wed, 01 Jun 2022 02:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kFnswbSxGwrRy/NQADQjmmMBaytsFgRzRtZUq2P5fVw=; b=ErjYVzHSMtL2UomTsVi7tibDCfhMwLbxBslThaP44wqh4DHChnKrN++NI5RhSZPYfC Gm3RRstEdhV4L3kxlolN40Nsg9TYKbIF6sbCjvLhWMacNHii7EhOCl8zF8PssLNTP/fS YGFNj0OxIkbV3RMUocdQHadyiWO87CoS4BxS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kFnswbSxGwrRy/NQADQjmmMBaytsFgRzRtZUq2P5fVw=; b=4YyLxv1hd476923St5ba2+WGj8slARQAgrVkdceAqsvS1F2gZ1FOmZeaeFbU9FQ2T2 jhHhYVt6dKhr8Pgtj6fAEzimWHnNsOTWXXHkqGGjlGTTxjkgD5Qs6xbUb69iuM+XsNUn mPmBstZ42In5TwFMiRj8QnTabicQMWwIOse2FPS11q8Ske0HKSJPiN7nWvEdiaUHzJx2 EpBlupW1Hy3FElJ3v2qzwjN2EIZdvz/1+TQP24czgWriUcQI0JMr2RAD7FTCftbw9txi uwDzCW7rVmFr6XSq3iiwgPgblGxNU2jXcLkoduMkjC+bliS7YWxhZTf255v0jLmZgyI1 0WEA== X-Gm-Message-State: AOAM532o4yx4BJB8CDYdXYQG5Im2V83ZhvaSa8rwbxhRNzK70eAydTdd EgkGGL1DAEP3kBIupM746bFynA== X-Google-Smtp-Source: ABdhPJxrRTUbKi5bPBa/fX0MOFI2Wb3mwKyCfpA3888E4QDVRu2YuRIzrg8baKhCW1q9srQYrEq3/w== X-Received: by 2002:a17:902:aa04:b0:163:c204:f41 with SMTP id be4-20020a170902aa0400b00163c2040f41mr17751950plb.172.1654076831401; Wed, 01 Jun 2022 02:47:11 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:dc30:e75c:ae95:f2d6]) by smtp.gmail.com with ESMTPSA id x42-20020a056a0018aa00b0050dc762815esm1039494pfh.56.2022.06.01.02.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 02:47:11 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: Hans de Goede , Thierry Reding , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it Date: Wed, 1 Jun 2022 17:46:37 +0800 Message-Id: <20220601094637.1200634-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220601094637.1200634-1-hsinyi@chromium.org> References: <20220601094637.1200634-1-hsinyi@chromium.org> MIME-Version: 1.0 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 --- v1->v2: remove unused checks. --- drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/= mtk_dsi.c index bd3f5b485085..86613360d2d9 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -185,6 +185,7 @@ struct mtk_dsi { struct drm_encoder encoder; struct drm_bridge bridge; struct drm_bridge *next_bridge; + struct drm_panel *panel; struct drm_connector *connector; struct phy *phy; =20 @@ -822,6 +823,12 @@ 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) + drm_connector_set_panel_orientation(dsi->connector, + drm_panel_get_orientation(dsi->panel)); + drm_connector_attach_encoder(dsi->connector, &dsi->encoder); =20 return 0; @@ -837,6 +844,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 */ + 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