From nobody Sat Sep 21 23:31:09 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 CAD00C433EF for ; Thu, 9 Jun 2022 07:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240028AbiFIH1o (ORCPT ); Thu, 9 Jun 2022 03:27:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239990AbiFIH1l (ORCPT ); Thu, 9 Jun 2022 03:27:41 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7695F166D5F for ; Thu, 9 Jun 2022 00:27:40 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id t2so19603321pld.4 for ; Thu, 09 Jun 2022 00:27:40 -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=bSY8PN7v8lUTRFzxoXQ+q0czheJOMexRG2Ekt+dl1cw=; b=STJ78LHWIq3C6SkgzJ/vmNYE8VNnAJLKUqWHPZRVIUmZBSKT92GoA4MlA2UUn+zELj Hecy+rWHtXRTwVJWiNpg4XrX00FawpR2IH3ajUFEBTJ39rvjrxyMYGCLADFePJ90Fxl+ vrYyOqQ1njaCv4FURyE3Kxlnv7lisKIFrKmC0= 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=bSY8PN7v8lUTRFzxoXQ+q0czheJOMexRG2Ekt+dl1cw=; b=FWfe7IrszCjTpBqtYDhkntWBsutUM7vOgQVzPYTac0z6S1KOPfxL7VY/4zsXanm3cq 5pOCBDNI9xcP70rEBznVIVW7jNZkxvGbLTeoVsOU/k7HaTsFwzk1b7qQkvJky5dsoUZV 5B20tytRDSW6FRrRoVj+S0lrGhnQUdzs/cWyuPM5dHXSWM7Koyq8YvtzLoZlqMAmU7q6 lFmR3+NDkkjwphm9Rqa4CLQDxX1HLsHtqgaKc2W2jFh2lFPAEM8C04cqTcqsW3AuKXn/ wrvHRc7jxKl8FMUuyZ9Sq8DQS0igu+50XV6t8ul0Nf5zR3q8+gQwdG2KdobN5UjJQjmC Tg/Q== X-Gm-Message-State: AOAM533mOTWggJIP0EqKZaqygC/XsrVrbgZvTeDoDuvEWnrKD+7qx+k9 H5QcmiD7qXa3ULXz2pJrejGvvg== X-Google-Smtp-Source: ABdhPJwo9bGpZq3j3Hg8vWR6yfq0caGSeW49YqnFYPqIpd3sh6CRePqPT5MMChG5397aZoHFHAVPCA== X-Received: by 2002:a17:902:8b89:b0:168:ab37:3283 with SMTP id ay9-20020a1709028b8900b00168ab373283mr1151222plb.101.1654759659616; Thu, 09 Jun 2022 00:27:39 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:39 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 1/8] drm/panel: Add an API to allow drm to set orientation from panel Date: Thu, 9 Jun 2022 15:27:15 +0800 Message-Id: <20220609072722.3488207-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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_orientation_from_panel() before drm_dev_register(). Suggested-by: Hans de Goede Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- v6->v7: remane variable. --- drivers/gpu/drm/drm_connector.c | 31 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 4 ++++ include/drm/drm_panel.h | 9 +++++++++ 3 files changed, 44 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connecto= r.c index 1c48d162c77e3..ab066a063f3ba 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -2320,6 +2321,9 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); * It is allowed to call this function with a panel_orientation of * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op. * + * The function shouldn't be called in panel after drm is registered (i.e. + * drm_dev_register() is called in drm). + * * Returns: * Zero on success, negative errno on failure. */ @@ -2389,6 +2393,33 @@ int drm_connector_set_panel_orientation_with_quirk( } EXPORT_SYMBOL(drm_connector_set_panel_orientation_with_quirk); =20 +/** + * drm_connector_set_orientation_from_panel - + * set the connector's panel_orientation from panel's callback. + * @connector: connector for which to init the panel-orientation property. + * @panel: panel that can provide orientation information. + * + * Drm drivers should call this function before drm_dev_register(). + * Orientation is obtained from panel's .get_orientation() callback. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_set_orientation_from_panel( + struct drm_connector *connector, + struct drm_panel *panel) +{ + enum drm_panel_orientation orientation; + + if (panel && panel->funcs && panel->funcs->get_orientation) + orientation =3D panel->funcs->get_orientation(panel); + else + orientation =3D DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + + return drm_connector_set_panel_orientation(connector, orientation); +} +EXPORT_SYMBOL(drm_connector_set_orientation_from_panel); + static const struct drm_prop_enum_list privacy_screen_enum[] =3D { { PRIVACY_SCREEN_DISABLED, "Disabled" }, { PRIVACY_SCREEN_ENABLED, "Enabled" }, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3ac4bf87f2571..94b422b55cc1f 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -38,6 +38,7 @@ struct drm_modeset_acquire_ctx; struct drm_device; struct drm_crtc; struct drm_encoder; +struct drm_panel; struct drm_property; struct drm_property_blob; struct drm_printer; @@ -1802,6 +1803,9 @@ int drm_connector_set_panel_orientation_with_quirk( struct drm_connector *connector, enum drm_panel_orientation panel_orientation, int width, int height); +int drm_connector_set_orientation_from_panel( + struct drm_connector *connector, + struct drm_panel *panel); int drm_connector_attach_max_bpc_property(struct drm_connector *connector, int min, int max); void drm_connector_create_privacy_screen_properties(struct drm_connector *= conn); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index d279ee455f014..3a271128c0784 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -116,6 +116,15 @@ struct drm_panel_funcs { int (*get_modes)(struct drm_panel *panel, struct drm_connector *connector); =20 + /** + * @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); + /** * @get_timings: * --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:31:09 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 C2ADDC433EF for ; Thu, 9 Jun 2022 07:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240051AbiFIH1t (ORCPT ); Thu, 9 Jun 2022 03:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240043AbiFIH1p (ORCPT ); Thu, 9 Jun 2022 03:27:45 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F1A15877D for ; Thu, 9 Jun 2022 00:27:44 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id bo5so20374900pfb.4 for ; Thu, 09 Jun 2022 00:27:44 -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=6cns58U7ETFcRJZ3rxmYxEFcjgwqUT9LK1/jcMIzzTI=; b=d5E1HKLGWGQ+MJC1zhqIlaMdVqsmrJIiSTzfeCCJ8GRtmrxDluI8Nr3EsxGpB97Ios Kr+asgLmD6JQ2jgDM5t0DTd/FRpUUoJo7U0ZIe+nMxZDSiXb5ewCvsLZMX/tOZhbUVGs glzUZY+7Ruud+lKjcMEk+WIHOm2Nd1Jvp7emc= 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=6cns58U7ETFcRJZ3rxmYxEFcjgwqUT9LK1/jcMIzzTI=; b=FySqqqCI0SvLquxppXabC+tNBPW0ED2hC6DmM7LKQz2twNrCdQdatUb/w4b6ngvU1B jUtrnkBig7HmkYY3kHFZk8KBn3Tz9iy4wE5paGnE1y14LiwWCV5vqKHF/Qo3X4gtrGaU 84RCiVrHgOh21nscY4FnXpleNjNSjY7zxDZWxR+FghhmwydMNcmRJnvgjnXBivxbV4+P n/+O0miVHJqROrfM44oImEySRFsWpH2tHqUJXUpJtc5NHp5Tm1gXmQN53lrfpJ7WI3Os KX/1tGMA22Jkd8GcWGe1Sxof9QYOsoZNsQCxri1gRPQY+yrcVTKxt7Z4p7+vhSwPEUDL U0Zw== X-Gm-Message-State: AOAM5319HcHSVXBYXWF5+ae5djzRQwL7B0lMlDqY3pPXL+lorfWH0pRc NYVYpzpRBSifJY0ilehyiidBZg== X-Google-Smtp-Source: ABdhPJxEW2aEZOOk3eVwTOVHc08TJtKl0jc1RGX7hhglR738NBHPdiIFVkzAMa8GiWT2HYaWCqw6DA== X-Received: by 2002:a63:483:0:b0:3fc:9128:60a5 with SMTP id 125-20020a630483000000b003fc912860a5mr34278819pge.606.1654759663639; Thu, 09 Jun 2022 00:27:43 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:43 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:16 +0800 Message-Id: <20220609072722.3488207-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 12 ++++++++++++ 1 file changed, 12 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 1be150ac758f5..07f722f33fc5b 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1511,16 +1511,28 @@ static int boe_panel_get_modes(struct drm_panel *pa= nel, connector->display_info.width_mm =3D boe->desc->size.width_mm; connector->display_info.height_mm =3D boe->desc->size.height_mm; connector->display_info.bpc =3D boe->desc->bpc; + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, boe->orientation); =20 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:31:09 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 BCED4C43334 for ; Thu, 9 Jun 2022 07:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240080AbiFIH1w (ORCPT ); Thu, 9 Jun 2022 03:27:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238646AbiFIH1s (ORCPT ); Thu, 9 Jun 2022 03:27:48 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F220815D335 for ; Thu, 9 Jun 2022 00:27:47 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id c18so12759036pgh.11 for ; Thu, 09 Jun 2022 00:27:47 -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=/3gA/gCwNifa063k5zO2io8sIa7XPaHVQ/76HnmkOsg=; b=NMwQPNA8GcvOzDm4isJzui7YhPgnhg1xX3kh0UaVTH2jfU4mkwDoRC0quvFK4/QecR arfnWRpveJ0pUy0K4Zn7eItprSorYSdiUF0DxIYSzy+sPVzUfh/4UU+9GQWFSrnbBwol 4dws/dn+SgtfP55mhYaY5yVIN0hIRkMuNotpU= 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=/3gA/gCwNifa063k5zO2io8sIa7XPaHVQ/76HnmkOsg=; b=DotP2SXrqWAVfjf9xcO0Pm5fs25GNx8+n0zpk3YgBXD6Zke1YZHlaaPcBCTEZG4R05 e/RDCZfe5Xme3JMxYcGtwtl9X36/9WijPou+Oox3FNUXzf1DGSTpPvhz8D+hEllNUP5Z vEn3fh+to1scoYHwlXzApCMITlMHjchhl72V2PASlXHyWL0TJc+yB6mYZXcT8A1mIahA scttfM5AzgF6vxl/BSJ0Bty5GFmM3S2a30sTPQYkpjnliuFVnAK5B3eP8K6FITt0ii46 +7xR3VbvaMMenlZHahKafBYX0g6Si6CrPN5FGtw/fj/ukP1g/orXpbwgeqonMJTNd11T gFCg== X-Gm-Message-State: AOAM532t/GyMoH+qHecd8IEdEMgUXYcSldYnvdPxA7LjPDdssWJqBNwa GDkQYcyZxmPJlFt6oXX7wffHPQ== X-Google-Smtp-Source: ABdhPJxNBX/FBxOUBMeGOirfu/EQZDMrKKnPoYbe2fo82dpTd1VenDY+rtKnkXplac6gWM5VzUu+0Q== X-Received: by 2002:a05:6a00:15d3:b0:51c:1a20:f8d8 with SMTP id o19-20020a056a0015d300b0051c1a20f8d8mr19746114pfu.57.1654759667464; Thu, 09 Jun 2022 00:27:47 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:47 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:17 +0800 Message-Id: <20220609072722.3488207-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-edp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/pane= l-edp.c index c96014464355c..ee622c1dd5322 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -586,7 +586,10 @@ static int panel_edp_get_modes(struct drm_panel *panel, else if (!num) dev_warn(p->base.dev, "No display modes\n"); =20 - /* set up connector's "panel orientation" property */ + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, p->orientation); =20 return num; @@ -609,6 +612,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 +647,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:31:09 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 8D4E8C433EF for ; Thu, 9 Jun 2022 07:28:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240109AbiFIH2F (ORCPT ); Thu, 9 Jun 2022 03:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238722AbiFIH1x (ORCPT ); Thu, 9 Jun 2022 03:27:53 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7AF16A512 for ; Thu, 9 Jun 2022 00:27:51 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id q18so19575452pln.12 for ; Thu, 09 Jun 2022 00:27: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=979njmg3lDINGZi/hjk1WmVdoXok3WEPuAqEU9cZJ2k=; b=j9KpAI/b9qRseLDWsOBweqGi86kh7wYZQ3ofyFDfkDqIfZ+/HB8ErM8G4QPMbx/1K/ wrn500+3sYP2OfOeyGIlRevPsuSzxegJU4bDZ01Hl0kdJZqsMwrQoTkyshushfeQtZor gqU3O6bM87DjmVq4Kln8bX86DBr+n1dbNzoV4= 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=979njmg3lDINGZi/hjk1WmVdoXok3WEPuAqEU9cZJ2k=; b=oJwP1YS7/ugPjDv24e2KymhmFjl6R57+3VB5C0oL8/LzrXpMgF4ZprTqquEPpCkG4o HG7JS276tFuUuoSjW6hYpRk2Smez/s1NJ33XPaQcvFKjMjaUt0OW8b9MmElA77kd83np T2bZTl9CtYqjbHuidV6IgFWWBuGJojWgpL1PBoT94K3iAoeWTl20IKO/sbDCRjK6dKzt 4QTL1dk1kCNT8Q5B+7cTgFR7HQm+2/XGD2Xh/ALnJJKJNNqSEq9USt3edosEKJ17tjA/ 0WQAcgV5/ROp2DNt2DFNf4x5Py006OUntvlC/DVZN6LOZCj6c7SEmsvX6/lfZXB823r5 xFYA== X-Gm-Message-State: AOAM533JeofLb9TxdKopZzQeuVnYGrSGE4VCUz6+tNc/S9KrSoRK3+H6 dMTjGZhE56dKpSNeZ1JtbvwiFQ== X-Google-Smtp-Source: ABdhPJzUtYiKc+YHbz9WSYk2PsW/dDB6EjjkY/X/5kiQ0m6h6L5dfv1hbOR67mOKxuCqT6BPA0oK+g== X-Received: by 2002:a17:90a:4e82:b0:1ea:3f61:51b with SMTP id o2-20020a17090a4e8200b001ea3f61051bmr2127811pjh.16.1654759671059; Thu, 09 Jun 2022 00:27:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:50 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:18 +0800 Message-Id: <20220609072722.3488207-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-lvds.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/pan= el-lvds.c index f11252fb00fea..7a4fedc63e8ec 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -99,15 +99,28 @@ static int panel_lvds_get_modes(struct drm_panel *panel, drm_display_info_set_bus_formats(&connector->display_info, &lvds->bus_format, 1); connector->display_info.bus_flags =3D lvds->bus_flags; + + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, lvds->orientation); =20 return 1; } =20 +static enum drm_panel_orientation panel_lvds_get_orientation(struct drm_pa= nel *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:31:09 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 87A52CCA473 for ; Thu, 9 Jun 2022 07:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238456AbiFIH2K (ORCPT ); Thu, 9 Jun 2022 03:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240121AbiFIH17 (ORCPT ); Thu, 9 Jun 2022 03:27:59 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D2231F5898 for ; Thu, 9 Jun 2022 00:27:55 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id c14so21043110pgu.13 for ; Thu, 09 Jun 2022 00:27: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=wQhOn/YiixyOJw4v/o8WRfr7u50AUleNhUdb032jkoc=; b=L7jS/0Ul8GyfGFjRHSjlC/3V1YgWm5fckAx4cb0ozB4CuNwCbDePiYLy99VKkO4eYR vsIEwXCARojXs6cMBuEgOpj5milTERUvgpkWcuL7Sfsn8AInOOdQvfSoVcc334NhuGZ4 7TUKV91TAvpAbsMABW8YLDZN6I2yI6bugPIPI= 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=wQhOn/YiixyOJw4v/o8WRfr7u50AUleNhUdb032jkoc=; b=Px8WMhGuXfWvCTE93ntVD6bfSGiu5QI9TRFMK7nDzBhNsYH84+ZCbo14Ij8ol5ZbwX w4zSe8hSCCh9hEcWgW7abmeRlTXrE90GBip4Z+65CXrk6faLjEJkJ04vBhRVpgCw7Jc9 9ZBvVPvqWtuDeh61CnL7P6VTewPC9OxrxXm+0V7zDOgvcs2o0iTE/XvvG8Wtc7j7dQqF YmnhCA07kxOvaDPg80LEKpCPLBKl5td1FajZlAiqJUgOLw6LlzA0I5dNxki+OyAvqbFH JipDob+K1cmcWwc5xFL5fTZVXQcVtDT/IbrkUgAiENsKqCXSETK/gLRsHPN/nSLTbzmJ iAOA== X-Gm-Message-State: AOAM533CAxPhcMuiQJOM8Cu6Lm1qx33eJI10ZKWC8H9UVFg+7QBZs0XT FZ2Z8T/mim5EZv/8waUmcYeAHw== X-Google-Smtp-Source: ABdhPJwaokvXUJTqJoAx08HJzYQQnKmSiU3Qu9ykQ3bFrg5pAH7mwkib4XyJbC+tUSapAx+aGXawRQ== X-Received: by 2002:a05:6a00:1805:b0:51c:3a7:54dc with SMTP id y5-20020a056a00180500b0051c03a754dcmr23846453pfa.15.1654759674657; Thu, 09 Jun 2022 00:27:54 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:54 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 5/8] drm/panel: panel-simple: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:19 +0800 Message-Id: <20220609072722.3488207-6-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Sam Ravnborg Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-simple.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index 4a2e580a2f7b7..b4b9195251891 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -411,7 +411,10 @@ static int panel_simple_get_modes(struct drm_panel *pa= nel, /* add hard-coded panel modes */ num +=3D panel_simple_get_non_edid_modes(p, connector); =20 - /* set up connector's "panel orientation" property */ + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, p->orientation); =20 return num; @@ -434,12 +437,21 @@ 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, .prepare =3D panel_simple_prepare, .enable =3D panel_simple_enable, .get_modes =3D panel_simple_get_modes, + .get_orientation =3D panel_simple_get_orientation, .get_timings =3D panel_simple_get_timings, }; =20 --=20 2.36.1.255.ge46751e96f-goog From nobody Sat Sep 21 23:31:09 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 51452C43334 for ; Thu, 9 Jun 2022 07:28:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240392AbiFIH21 (ORCPT ); Thu, 9 Jun 2022 03:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240168AbiFIH2B (ORCPT ); Thu, 9 Jun 2022 03:28:01 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34D1156B7D for ; Thu, 9 Jun 2022 00:27:58 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id e9so10110893pju.5 for ; Thu, 09 Jun 2022 00:27: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=K7MRkR8auhgUPzxY/AhWyDzJkPMHJW4gIp7+t1KlPCE=; b=l7ZtrVUBq2GYXh2+SH235Ub+vP7lWLaHmSegb5FpWeD2UBMVxBbbSg+yfXe8Ha0sHa sRrJmsQrI/ZCdxQ+/mkSj46cerzBPD3JKq3Y5+z0BBzUgbEQ/2VS82VzI3LUsJM4QZbp QiY5PgrIjbT2MZf10Yl5LRotp6JHblUn1MP+c= 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=K7MRkR8auhgUPzxY/AhWyDzJkPMHJW4gIp7+t1KlPCE=; b=YFR6AqQGvzj96AU+i2ELl92y/CDvYx8TwgHXtjTsyrf3jjjWFBbQOaqcK5vdu6WtJQ OOWotb2dSiArStPKA8fTvu01Ldq4Av66jfM9Y3rGKRT1s95b6iTakbkjqyiDWqNTt82H N4P+yKAuBgiC9P8JM810wxn0MJU314M3rd+XZJ7TE5wIeSNHkRencLsWci9cyrbpcskt mssr8fPqb0I+j0IIxewiIDcerDa7FZBIO/uj7sfMc59blTbWZErCWYcoJHPCN3JTIv28 3aMz0gwAg6nMqdu5q0SPdxC1J4eG8qIXCU7fBzWEBUk2seypmmZNgKTwGOBwEWB+cMxW sUYg== X-Gm-Message-State: AOAM532picc8PSrPRRa19zIVzksBQJXEoGMEbdjvi50x2ESi8F7hbWGe 2FoqTg7B1TyyQLMtM3kc3C0IzA== X-Google-Smtp-Source: ABdhPJz4dqkjFokdBYRKpv24v7t0WqPiApCHL3ML7AXlrOqT/NAZMvUv0SYaTx3mNhk2+YTvTonvkA== X-Received: by 2002:a17:902:74c3:b0:167:6811:40 with SMTP id f3-20020a17090274c300b0016768110040mr25200983plt.120.1654759678228; Thu, 09 Jun 2022 00:27:58 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:27:57 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:20 +0800 Message-Id: <20220609072722.3488207-7-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/dr= m/panel/panel-ilitek-ili9881c.c index ba30d11547ade..58d6798c25ed8 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -853,17 +853,29 @@ static int ili9881c_get_modes(struct drm_panel *panel, connector->display_info.width_mm =3D mode->width_mm; connector->display_info.height_mm =3D mode->height_mm; =20 + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, ctx->orientation); =20 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:31:09 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 616B9CCA47D for ; Thu, 9 Jun 2022 07:28:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240510AbiFIH2d (ORCPT ); Thu, 9 Jun 2022 03:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240194AbiFIH2D (ORCPT ); Thu, 9 Jun 2022 03:28:03 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CAF814A27E for ; Thu, 9 Jun 2022 00:28:02 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id bo5so20374900pfb.4 for ; Thu, 09 Jun 2022 00:28:02 -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=G916ndi6znAFvnEdjgirXsQTXINNxUlsFrUsl3kkHpM=; b=Ab/Ic+N3PYzvVY9rC4wLHn0KuEQnNGOKYgz5k7NDX1sDl+NPwdPDWR2BTqZJmMuyl7 pJCNL0LMj1LMqRy0fVBiGW/q7oiDb1RPX14nYbfqbrOyJwmIWOPP49WI3ESH+OQb3CwZ BdcdiPGm/oVRjmwfOeH/hiY03hlkzKvGPKMWo= 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=G916ndi6znAFvnEdjgirXsQTXINNxUlsFrUsl3kkHpM=; b=seXR6CXTFXm7w6hgFjE9zq/KU0CEV7Z4Wd7n4CxrrRXoh0bvdgDusYA9m5K5ldBkTW ySGjyrluPGmr9ADWNNoBLpF4II2o962S3/psBYFCX7Caib7NXc9m3lV5pIQu8DxieToD NTmlcceTEn3c4yVxpRE0UKYSJrF2ijJ/c44dEytDpaqKQRx+e4Hvt8YliuI8gPggBUOj HiieI1WRnVZSym6ChpgGeqFJhQzfV/6r95wG0VqJfEsf2MLIpKjXdHC0vJNN77rGhtwb 0/FwKBuYtxzJEXaTA/UKG4ON7pQ/Bi+zzQQ13ar/jLE70aFqw/9GkcMomrdg2jVPRJyh bw1w== X-Gm-Message-State: AOAM533DppWkBET7FKi8dhBzof+T+g2F8sXjgH3IF/XzV4pnsfpTexJT QnsvP6ZGzZxWNXoQyDnmwRIYnw== X-Google-Smtp-Source: ABdhPJye6fPlx4aQdZZkt+w0q0qfXmG0AQ+D0AlqoMudVOh6zefu4Y7cFZKkoiaVOrEQnuzP7CFd/g== X-Received: by 2002:a63:2cd7:0:b0:3fe:1c0a:75ce with SMTP id s206-20020a632cd7000000b003fe1c0a75cemr9121819pgs.602.1654759681962; Thu, 09 Jun 2022 00:28:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:28:01 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback Date: Thu, 9 Jun 2022 15:27:21 +0800 Message-Id: <20220609072722.3488207-8-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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 Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd --- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm= /panel/panel-elida-kd35t133.c index 80227617a4d6e..fa613d1d7a8ff 100644 --- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c +++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c @@ -217,15 +217,27 @@ static int kd35t133_get_modes(struct drm_panel *panel, connector->display_info.width_mm =3D mode->width_mm; connector->display_info.height_mm =3D mode->height_mm; drm_mode_probed_add(connector, mode); + /* + * TODO: Remove once all drm drivers call + * drm_connector_set_orientation_from_panel() + */ drm_connector_set_panel_orientation(connector, ctx->orientation); =20 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:31:09 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 05172C433EF for ; Thu, 9 Jun 2022 07:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239089AbiFIH2x (ORCPT ); Thu, 9 Jun 2022 03:28:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240178AbiFIH2T (ORCPT ); Thu, 9 Jun 2022 03:28:19 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 894D4157E87 for ; Thu, 9 Jun 2022 00:28:11 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id q18so19575452pln.12 for ; Thu, 09 Jun 2022 00:28:11 -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=EU3KV+nUfeIhuNF/Ro7jf0eLAkt330a3bAydA7XSi+w=; b=VqbUTr3H73qk7OZZz/TA+W+HpQdKZ3GSi8c1Gz+F66d9XD1DhQZtcZj9tYoGnBFCMH 9jxzZQrJD2AuqpJhiITLGgJFsgqcH4cZdZ4DMvOA/HAXrFenxq9XEcffHdqI51W5b0+R vgKEqD5AT7EuudEvdhCxmhMR6bB4DJJnlMh60= 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=EU3KV+nUfeIhuNF/Ro7jf0eLAkt330a3bAydA7XSi+w=; b=uoFmfiziMMoj9CUY17Eje0IW6EcnULeI3Zkphv0JXg4mTbXuzuiig+exytfYx85+Fw aCv8sTW8qTlXu8ENxffA4YGSP3FM8XsHfLKhgq/RsHF39aDpWj0WxonHMWu7b9u9lOTE Uk/vOS90nuLWB9T459lah4O88ST8heSA24IrcNeu8xVRl3GrwI1MyYhEBDqvHTcccmqL Ct/u1kinYGzjtFuZIuJd+nHUV8AVmfanvdQqc81rTTfi77sCGsf+WSdqIMzmsL72E3FR eajqpe3wJx/xILFks2nF/iCxybzvyWAHH+7J5ev8gYsdWHdQut7wKzFjbMq0hgPqY9Do Hwdg== X-Gm-Message-State: AOAM531W1aNRzIrpOPOtlI5p0ewY4hzd5WD41E04gHHVyz3UOL3US34C RTDSiYAcoob2GOMAacAk+zASJw== X-Google-Smtp-Source: ABdhPJx0y6DchLUvvk/yuIYEnoMtoscHMuzTnupHjzPr0+cwAebGuaRDhnVQTQoMdt/AcKvuivAq0Q== X-Received: by 2002:a17:903:24f:b0:15c:e3b8:a640 with SMTP id j15-20020a170903024f00b0015ce3b8a640mr38088332plh.5.1654759691087; Thu, 09 Jun 2022 00:28:11 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:5119:d95b:c6cd:77fb]) by smtp.gmail.com with ESMTPSA id p16-20020a1709027ed000b0016403cae7desm15312221plb.276.2022.06.09.00.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 00:28:10 -0700 (PDT) From: Hsin-Yi Wang To: Hans de Goede , Sam Ravnborg , Stephen Boyd , Douglas Anderson Cc: Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 8/8] drm: Config orientation property if panel provides it Date: Thu, 9 Jun 2022 15:27:23 +0800 Message-Id: <20220609072722.3488207-9-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220609072722.3488207-1-hsinyi@chromium.org> References: <20220609072722.3488207-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(). Some 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. In drm_bridge_connector_init(), if a bridge is a panel bridge, use it to set the connector's panel orientation property. Suggested-by: Doug Anderson Signed-off-by: Hsin-Yi Wang Reviewed-by: Doug Anderson Reviewed-by: Stephen Boyd --- v6->v7: remove redundant check and fix config issue. --- drivers/gpu/drm/bridge/panel.c | 34 ++++++++++++++++++++++++++ drivers/gpu/drm/drm_bridge_connector.c | 8 +++++- include/drm/drm_bridge.h | 14 +++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 0ee563eb2b6f9..4277bf4f032be 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -170,6 +170,19 @@ static const struct drm_bridge_funcs panel_bridge_brid= ge_funcs =3D { .debugfs_init =3D panel_bridge_debugfs_init, }; =20 +/** + * drm_bridge_is_panel - Checks if a drm_bridge is a panel_bridge. + * + * @bridge: The drm_bridge to be checked. + * + * Returns true if the bridge is a panel bridge, or false otherwise. + */ +bool drm_bridge_is_panel(const struct drm_bridge *bridge) +{ + return bridge->funcs =3D=3D &panel_bridge_bridge_funcs; +} +EXPORT_SYMBOL(drm_bridge_is_panel); + /** * drm_panel_bridge_add - Creates a &drm_bridge and &drm_connector that * just calls the appropriate functions from &drm_panel. @@ -269,6 +282,27 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge) } EXPORT_SYMBOL(drm_panel_bridge_remove); =20 +/** + * drm_panel_bridge_set_orientation - Set the connector's panel orientation + * from the bridge that can be transformed to panel bridge. + * + * @connector: The connector to be set panel orientation. + * @bridge: The drm_bridge to be transformed to panel bridge. + * + * Returns 0 on success, negative errno on failure. + */ +int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge) +{ + struct panel_bridge *panel_bridge; + + panel_bridge =3D drm_bridge_to_panel_bridge(bridge); + + return drm_connector_set_orientation_from_panel(connector, + panel_bridge->panel); +} +EXPORT_SYMBOL(drm_panel_bridge_set_orientation); + static void devm_drm_panel_bridge_release(struct device *dev, void *res) { struct drm_bridge **bridge =3D res; diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_b= ridge_connector.c index 6b3dad03d77d0..1c7d936523df5 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -331,7 +331,7 @@ struct drm_connector *drm_bridge_connector_init(struct = drm_device *drm, struct drm_bridge_connector *bridge_connector; struct drm_connector *connector; struct i2c_adapter *ddc =3D NULL; - struct drm_bridge *bridge; + struct drm_bridge *bridge, *panel_bridge =3D NULL; int connector_type; =20 bridge_connector =3D kzalloc(sizeof(*bridge_connector), GFP_KERNEL); @@ -373,6 +373,9 @@ struct drm_connector *drm_bridge_connector_init(struct = drm_device *drm, =20 if (bridge->ddc) ddc =3D bridge->ddc; + + if (drm_bridge_is_panel(bridge)) + panel_bridge =3D bridge; } =20 if (connector_type =3D=3D DRM_MODE_CONNECTOR_Unknown) { @@ -392,6 +395,9 @@ struct drm_connector *drm_bridge_connector_init(struct = drm_device *drm, connector->polled =3D DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; =20 + if (panel_bridge) + drm_panel_bridge_set_orientation(connector, panel_bridge); + return connector; } EXPORT_SYMBOL_GPL(drm_bridge_connector_init); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index f27b4060faa2f..bd11bbe5e9b33 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -917,16 +917,30 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge, enum drm_connector_status status); =20 #ifdef CONFIG_DRM_PANEL_BRIDGE +bool drm_bridge_is_panel(const struct drm_bridge *bridge); struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel); struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, u32 connector_type); void drm_panel_bridge_remove(struct drm_bridge *bridge); +int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge); struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, struct drm_panel *panel); struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, struct drm_panel *panel, u32 connector_type); struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge= ); +#else +static inline bool drm_bridge_is_panel(const struct drm_bridge *bridge) +{ + return false; +} + +static inline int drm_panel_bridge_set_orientation(struct drm_connector *c= onnector, + struct drm_bridge *bridge) +{ + return -EINVAL; +} #endif =20 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE) --=20 2.36.1.255.ge46751e96f-goog