All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Fierke <max@maxfierke.com>
To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie,
	daniel@ffwll.ch, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Max Fierke <max@maxfierke.com>
Subject: [PATCH v3 4/4] drm/panel: clockworkpi-cwd686: Implement .get_orientation callback
Date: Sat, 17 Sep 2022 22:44:15 -0500	[thread overview]
Message-ID: <20220918034415.74641-5-max@maxfierke.com> (raw)
In-Reply-To: <20220918034415.74641-1-max@maxfierke.com>

Returns the panel's configured orientation

Signed-off-by: Max Fierke <max@maxfierke.com>
---
Changes in v3:
 - no changes

Changes in v2:
 - this was added as .get_orientation is now available in drm-misc-next since v1

 drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
index 87d20d784596..2c433a458c8b 100644
--- a/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
+++ b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
@@ -340,7 +340,10 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
 	drm_mode_set_name(mode);
 	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
 
-	/* 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, ctx->orientation);
 
 	drm_mode_probed_add(connector, mode);
@@ -348,10 +351,18 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
 	return 1; /* Number of modes */
 }
 
+static enum drm_panel_orientation cwd686_get_orientation(struct drm_panel *panel)
+{
+	struct cwd686 *ctx = panel_to_cwd686(panel);
+
+	return ctx->orientation;
+}
+
 static const struct drm_panel_funcs cwd686_drm_funcs = {
 	.unprepare = cwd686_unprepare,
 	.prepare = cwd686_prepare,
 	.get_modes = cwd686_get_modes,
+	.get_orientation = cwd686_get_orientation,
 };
 
 static int cwd686_probe(struct mipi_dsi_device *dsi)
-- 
2.37.2

WARNING: multiple messages have this Message-ID (diff)
From: Max Fierke <max@maxfierke.com>
To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie,
	daniel@ffwll.ch, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org
Cc: devicetree@vger.kernel.org, Max Fierke <max@maxfierke.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH v3 4/4] drm/panel: clockworkpi-cwd686: Implement .get_orientation callback
Date: Sat, 17 Sep 2022 22:44:15 -0500	[thread overview]
Message-ID: <20220918034415.74641-5-max@maxfierke.com> (raw)
In-Reply-To: <20220918034415.74641-1-max@maxfierke.com>

Returns the panel's configured orientation

Signed-off-by: Max Fierke <max@maxfierke.com>
---
Changes in v3:
 - no changes

Changes in v2:
 - this was added as .get_orientation is now available in drm-misc-next since v1

 drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
index 87d20d784596..2c433a458c8b 100644
--- a/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
+++ b/drivers/gpu/drm/panel/panel-clockworkpi-cwd686.c
@@ -340,7 +340,10 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
 	drm_mode_set_name(mode);
 	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
 
-	/* 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, ctx->orientation);
 
 	drm_mode_probed_add(connector, mode);
@@ -348,10 +351,18 @@ static int cwd686_get_modes(struct drm_panel *panel, struct drm_connector *conne
 	return 1; /* Number of modes */
 }
 
+static enum drm_panel_orientation cwd686_get_orientation(struct drm_panel *panel)
+{
+	struct cwd686 *ctx = panel_to_cwd686(panel);
+
+	return ctx->orientation;
+}
+
 static const struct drm_panel_funcs cwd686_drm_funcs = {
 	.unprepare = cwd686_unprepare,
 	.prepare = cwd686_prepare,
 	.get_modes = cwd686_get_modes,
+	.get_orientation = cwd686_get_orientation,
 };
 
 static int cwd686_probe(struct mipi_dsi_device *dsi)
-- 
2.37.2

  parent reply	other threads:[~2022-09-18  3:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18  3:44 [PATCH v3 0/4] Introduce ClockworkPi CWD686 DRM panel driver Max Fierke
2022-09-18  3:44 ` Max Fierke
2022-09-18  3:44 ` [PATCH v3 1/4] dt-bindings: vendor-prefixes: Add prefix for ClockworkPi Max Fierke
2022-09-18  3:44   ` Max Fierke
2022-10-29 18:17   ` Samuel Holland
2022-10-29 18:17     ` Samuel Holland
2022-11-01  0:59     ` Max Fierke
2022-11-01  0:59       ` Max Fierke
2022-09-18  3:44 ` [PATCH v3 2/4] dt-bindings: display: Add ClockworkPi CWD686 panel Max Fierke
2022-09-18  3:44   ` Max Fierke
2022-09-18  3:44 ` [PATCH v3 3/4] drm: panel: Add driver for ClockworkPi cwd686 panel Max Fierke
2022-09-18  3:44   ` Max Fierke
2022-09-18  3:44 ` Max Fierke [this message]
2022-09-18  3:44   ` [PATCH v3 4/4] drm/panel: clockworkpi-cwd686: Implement .get_orientation callback Max Fierke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220918034415.74641-5-max@maxfierke.com \
    --to=max@maxfierke.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.