All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: architt@codeaurora.org, a.hajda@samsung.com,
	Laurent.pinchart@ideasonboard.com, airlied@linux.ie
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
	daniel@ffwll.ch, peda@axentia.se,
	linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 7/8] drm: panel: Use _LE LVDS formats for data mirroring
Date: Thu, 19 Apr 2018 11:31:08 +0200	[thread overview]
Message-ID: <1524130269-32688-8-git-send-email-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <1524130269-32688-1-git-send-email-jacopo+renesas@jmondi.org>

As now both bridges and panels report supported image formats,
use the newly introduced _LE version of LVDS media bus formats in place
of the DRM_BUS_FLAG_DATA_ flags defined in drm_connector.h

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/gpu/drm/panel/panel-lvds.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 5185819..ac03eab 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -37,7 +37,6 @@ struct panel_lvds {
 	unsigned int height;
 	struct videomode video_mode;
 	unsigned int bus_format;
-	bool data_mirror;
 
 	struct backlight_device *backlight;
 	struct regulator *supply;
@@ -129,9 +128,6 @@ static int panel_lvds_get_modes(struct drm_panel *panel)
 	connector->display_info.height_mm = lvds->height;
 	drm_display_info_set_bus_formats(&connector->display_info,
 					 &lvds->bus_format, 1);
-	connector->display_info.bus_flags = lvds->data_mirror
-					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
-					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
 
 	return 1;
 }
@@ -149,6 +145,7 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 	struct device_node *np = lvds->dev->of_node;
 	struct display_timing timing;
 	const char *mapping;
+	bool data_mirror;
 	int ret;
 
 	ret = of_get_display_timing(np, "panel-timing", &timing);
@@ -179,20 +176,26 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 		return -ENODEV;
 	}
 
+	data_mirror = of_property_read_bool(np, "data-mirror");
+
 	if (!strcmp(mapping, "jeida-18")) {
-		lvds->bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG;
+		lvds->bus_format = data_mirror ?
+				   MEDIA_BUS_FMT_RGB666_1X7X3_SPWG_LE :
+				   MEDIA_BUS_FMT_RGB666_1X7X3_SPWG;
 	} else if (!strcmp(mapping, "jeida-24")) {
-		lvds->bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA;
+		lvds->bus_format = data_mirror ?
+				   MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA_LE :
+				   MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA;
 	} else if (!strcmp(mapping, "vesa-24")) {
-		lvds->bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG;
+		lvds->bus_format = data_mirror ?
+				   MEDIA_BUS_FMT_RGB888_1X7X4_SPWG_LE :
+				   MEDIA_BUS_FMT_RGB888_1X7X4_SPWG;
 	} else {
 		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
 			np, "data-mapping");
 		return -EINVAL;
 	}
 
-	lvds->data_mirror = of_property_read_bool(np, "data-mirror");
-
 	return 0;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2018-04-19  9:31 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  9:31 [PATCH 0/8] drm: bridge: Add support for static image formats Jacopo Mondi
2018-04-19  9:31 ` [PATCH 1/8] " Jacopo Mondi
2018-04-22 20:02   ` Peter Rosin
2018-04-26 18:44     ` jacopo mondi
2018-04-26 18:44       ` jacopo mondi
2018-04-23  9:27   ` Laurent Pinchart
2018-04-23  9:27     ` Laurent Pinchart
2018-04-26 18:40     ` jacopo mondi
2018-04-26 18:40       ` jacopo mondi
2018-04-26 19:57       ` Laurent Pinchart
2018-04-26 19:57         ` Laurent Pinchart
2018-04-19  9:31 ` [PATCH 2/8] dt-bindings: display: bridge: thc63lvd1024: Add lvds map property Jacopo Mondi
2018-04-22 20:02   ` Peter Rosin
2018-04-23  7:35     ` jacopo mondi
2018-04-23  7:35       ` jacopo mondi
2018-04-23 11:59       ` Laurent Pinchart
2018-04-23 11:59         ` Laurent Pinchart
2018-04-23 12:02   ` Laurent Pinchart
2018-04-23 12:02     ` Laurent Pinchart
2018-04-24 16:37   ` Rob Herring
2018-04-24 16:37     ` Rob Herring
2018-04-19  9:31 ` [PATCH 3/8] drm: bridge: thc63lvd1024: Add support for LVDS mode map Jacopo Mondi
2018-04-22 20:02   ` Peter Rosin
2018-04-23  7:41     ` jacopo mondi
2018-04-23 12:12       ` Laurent Pinchart
2018-04-23 12:12         ` Laurent Pinchart
2018-04-23 12:08   ` Laurent Pinchart
2018-04-23 12:08     ` Laurent Pinchart
2018-04-19  9:31 ` [PATCH 4/8] arm64: dts: renesas: eagle: Add thc63 LVDS map Jacopo Mondi
2018-04-23 10:29   ` Simon Horman
2018-04-23 13:07   ` Laurent Pinchart
2018-04-23 13:07     ` Laurent Pinchart
2018-04-19  9:31 ` [PATCH 5/8] media: Add LE version of RGB LVDS formats Jacopo Mondi
2018-04-23 13:06   ` Laurent Pinchart
2018-04-23 13:06     ` Laurent Pinchart
2018-04-24  7:16     ` jacopo mondi
2018-04-24  7:16       ` jacopo mondi
2018-04-19  9:31 ` [PATCH 6/8] drm: rcar-du: rcar-lvds: Add bridge format support Jacopo Mondi
2018-04-22 20:08   ` Peter Rosin
2018-04-23  7:28     ` jacopo mondi
2018-04-23  7:28       ` jacopo mondi
2018-04-23  7:59       ` Peter Rosin
2018-04-23  8:47         ` jacopo mondi
2018-04-23  8:47           ` jacopo mondi
2018-04-23 12:59           ` Laurent Pinchart
2018-04-23 12:59             ` Laurent Pinchart
2018-04-19  9:31 ` Jacopo Mondi [this message]
2018-04-19  9:31 ` [PATCH 8/8] drm: connector: Remove DRM_BUS_FLAG_DATA_* flags Jacopo Mondi
2018-04-23 21:03   ` Laurent Pinchart
2018-04-23 21:03     ` Laurent Pinchart
2018-04-24  7:22     ` jacopo mondi
2018-04-24  7:22       ` jacopo mondi

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=1524130269-32688-8-git-send-email-jacopo+renesas@jmondi.org \
    --to=jacopo+renesas@jmondi.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=peda@axentia.se \
    /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.