All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Derek Basehore <dbasehore@chromium.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sean Paul <sean@poorly.run>
Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/5] drm/panel: lvds: Set up panel orientation
Date: Sun, 14 Jun 2020 23:01:18 +0300	[thread overview]
Message-ID: <20200614200121.14147-3-digetx@gmail.com> (raw)
In-Reply-To: <20200614200121.14147-1-digetx@gmail.com>

The panel orientation needs to parsed from a device-tree and assigned to
the panel's connector in order to make orientation property available to
userspace. That's what this patch does for the generic LVDS panel.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 5ce3f4a2b7a1..333d21cee5f6 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -37,6 +37,8 @@ struct panel_lvds {
 
 	struct gpio_desc *enable_gpio;
 	struct gpio_desc *reset_gpio;
+
+	enum drm_panel_orientation orientation;
 };
 
 static inline struct panel_lvds *to_panel_lvds(struct drm_panel *panel)
@@ -99,6 +101,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	connector->display_info.bus_flags = lvds->data_mirror
 					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
 					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
+	drm_connector_set_panel_orientation(connector, lvds->orientation);
 
 	return 1;
 }
@@ -223,6 +226,11 @@ static int panel_lvds_probe(struct platform_device *pdev)
 	drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
 		       DRM_MODE_CONNECTOR_LVDS);
 
+	ret = of_drm_get_panel_orientation(lvds->dev->of_node,
+					   &lvds->orientation);
+	if (ret)
+		return ret;
+
 	ret = drm_panel_of_backlight(&lvds->panel);
 	if (ret)
 		return ret;
-- 
2.26.0

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Derek Basehore <dbasehore@chromium.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sean Paul <sean@poorly.run>
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: [PATCH v2 2/5] drm/panel: lvds: Set up panel orientation
Date: Sun, 14 Jun 2020 23:01:18 +0300	[thread overview]
Message-ID: <20200614200121.14147-3-digetx@gmail.com> (raw)
In-Reply-To: <20200614200121.14147-1-digetx@gmail.com>

The panel orientation needs to parsed from a device-tree and assigned to
the panel's connector in order to make orientation property available to
userspace. That's what this patch does for the generic LVDS panel.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 5ce3f4a2b7a1..333d21cee5f6 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -37,6 +37,8 @@ struct panel_lvds {
 
 	struct gpio_desc *enable_gpio;
 	struct gpio_desc *reset_gpio;
+
+	enum drm_panel_orientation orientation;
 };
 
 static inline struct panel_lvds *to_panel_lvds(struct drm_panel *panel)
@@ -99,6 +101,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	connector->display_info.bus_flags = lvds->data_mirror
 					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
 					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
+	drm_connector_set_panel_orientation(connector, lvds->orientation);
 
 	return 1;
 }
@@ -223,6 +226,11 @@ static int panel_lvds_probe(struct platform_device *pdev)
 	drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
 		       DRM_MODE_CONNECTOR_LVDS);
 
+	ret = of_drm_get_panel_orientation(lvds->dev->of_node,
+					   &lvds->orientation);
+	if (ret)
+		return ret;
+
 	ret = drm_panel_of_backlight(&lvds->panel);
 	if (ret)
 		return ret;
-- 
2.26.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-06-14 20:01 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 20:01 [PATCH v2 0/5] 180 degrees rotation support for NVIDIA Tegra DRM Dmitry Osipenko
2020-06-14 20:01 ` Dmitry Osipenko
2020-06-14 20:01 ` Dmitry Osipenko
2020-06-14 20:01 ` Dmitry Osipenko [this message]
2020-06-14 20:01   ` [PATCH v2 2/5] drm/panel: lvds: Set up panel orientation Dmitry Osipenko
2020-06-14 20:01 ` [PATCH v2 3/5] drm/tegra: plane: Rename bottom_up to reflect_y Dmitry Osipenko
2020-06-14 20:01   ` Dmitry Osipenko
     [not found] ` <20200614200121.14147-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-14 20:01   ` [PATCH v2 1/5] drm/panel: Add helper for reading DT rotation Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
2020-06-14 20:01   ` [PATCH v2 4/5] drm/tegra: plane: Support horizontal reflection mode Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
2020-06-14 20:01   ` [PATCH v2 5/5] drm/tegra: plane: Support 180° rotation Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
2020-06-14 20:01     ` Dmitry Osipenko
     [not found]     ` <20200614200121.14147-6-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-15 16:57       ` Ville Syrjälä
2020-06-15 16:57         ` Ville Syrjälä
2020-06-15 16:57         ` Ville Syrjälä
     [not found]         ` <20200615165758.GR6112-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2020-06-15 18:07           ` Dmitry Osipenko
2020-06-15 18:07             ` Dmitry Osipenko
2020-06-15 18:07             ` Dmitry Osipenko
2020-06-15 21:47       ` Emil Velikov
2020-06-15 21:47         ` Emil Velikov
2020-06-15 21:47         ` Emil Velikov
     [not found]         ` <CACvgo50P5i2jX6ZrMD=UuGr_bA=8MbFhYBWBNvkMcdCyJKS5xg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-16 11:25           ` Dmitry Osipenko
2020-06-16 11:25             ` Dmitry Osipenko
2020-06-16 11:25             ` Dmitry Osipenko
     [not found]             ` <e21404bd-49c9-039e-4aef-c4912a9c0640-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-17 18:50               ` Dmitry Osipenko
2020-06-17 18:50                 ` Dmitry Osipenko
2020-06-17 18:50                 ` Dmitry Osipenko
2020-06-15 22:26   ` [PATCH v2 0/5] 180 degrees rotation support for NVIDIA Tegra DRM Emil Velikov
2020-06-15 22:26     ` Emil Velikov
2020-06-15 22:26     ` Emil Velikov
     [not found]     ` <CACvgo51QuXMgWhFk4C=3rGvUZDX1_W0RZtVb5RtRPiHTpMebWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-16 11:40       ` Dmitry Osipenko
2020-06-16 11:40         ` Dmitry Osipenko
2020-06-16 11:40         ` Dmitry Osipenko
     [not found]         ` <8f789ef5-bebf-c869-784d-afda70fc1fb8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-16 15:48           ` Emil Velikov
2020-06-16 15:48             ` Emil Velikov
2020-06-16 15:48             ` Emil Velikov
     [not found]             ` <CACvgo50oSMbgXw1vHwVT4hhGe6g3YzKQEohCLJdfDq+0UaN1jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-16 17:20               ` Dmitry Osipenko
2020-06-16 17:20                 ` Dmitry Osipenko
2020-06-16 17:20                 ` Dmitry Osipenko
     [not found]                 ` <646b3f37-0f72-7f3b-388f-f71dbcdd5c84-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-16 17:45                   ` Laurent Pinchart
2020-06-16 17:45                     ` Laurent Pinchart
2020-06-16 17:45                     ` Laurent Pinchart
     [not found]                     ` <20200616174558.GA913-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2020-06-16 21:25                       ` Dmitry Osipenko
2020-06-16 21:25                         ` Dmitry Osipenko
2020-06-16 21:25                         ` Dmitry Osipenko
2020-06-16 18:54                   ` Emil Velikov
2020-06-16 18:54                     ` Emil Velikov
2020-06-16 18:54                     ` Emil Velikov
     [not found]                     ` <CACvgo50BFH5qsPyWx9a1aZ4k5bzjSN-3KTU0BvnZ-nG-hfzKOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-16 21:16                       ` Dmitry Osipenko
2020-06-16 21:16                         ` Dmitry Osipenko
2020-06-16 21:16                         ` Dmitry Osipenko
     [not found]                         ` <fe845434-cbf6-29d4-eeb6-8868d628fd04-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-17  9:34                           ` Daniel Stone
2020-06-17  9:34                             ` Daniel Stone
2020-06-17  9:34                             ` Daniel Stone
     [not found]                             ` <CAPj87rPwwHWtYpuZfiTMyELvr3D+UAY8CVnH3v6+Lo1-UMRRVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-17 16:27                               ` Dmitry Osipenko
2020-06-17 16:27                                 ` Dmitry Osipenko
2020-06-17 16:27                                 ` Dmitry Osipenko
2020-06-16 12:00       ` Dmitry Osipenko
2020-06-16 12:00         ` Dmitry Osipenko
2020-06-16 12:00         ` Dmitry Osipenko

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=20200614200121.14147-3-digetx@gmail.com \
    --to=digetx@gmail.com \
    --cc=dbasehore@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    --cc=thierry.reding@gmail.com \
    --cc=tzimmermann@suse.de \
    /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.