From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: David Airlie <airlied@linux.ie>,
Philipp Zabel <p.zabel@pengutronix.de>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Daniel Vetter <daniel@ffwll.ch>
Cc: "Lothar Waßmann" <LW@KARO-electronics.de>
Subject: [PATCHv4 2/3] drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT
Date: Tue, 12 Jul 2016 15:30:02 +0200 [thread overview]
Message-ID: <1468330203-29150-3-git-send-email-LW@KARO-electronics.de> (raw)
In-Reply-To: <1468330203-29150-1-git-send-email-LW@KARO-electronics.de>
add a helper function to extract information about pixel clock and DE
polarity from DT for use by of_get_drm_display_mode().
While at it, convert spaces to tabs in indentation in drm_modes.h.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
drivers/gpu/drm/drm_modes.c | 15 +++++++++++++++
include/drm/drm_modes.h | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index fc5040a..51804e5 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -657,6 +657,21 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
}
EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
+void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags)
+{
+ *bus_flags = 0;
+ if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
+ *bus_flags |= DRM_BUS_FLAG_PIXDATA_POSEDGE;
+ if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+ *bus_flags |= DRM_BUS_FLAG_PIXDATA_NEGEDGE;
+
+ if (vm->flags & DISPLAY_FLAGS_DE_LOW)
+ *bus_flags |= DRM_BUS_FLAG_DE_LOW;
+ if (vm->flags & DISPLAY_FLAGS_DE_HIGH)
+ *bus_flags |= DRM_BUS_FLAG_DE_HIGH;
+}
+EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode);
+
#ifdef CONFIG_OF
/**
* of_get_drm_display_mode - get a drm_display_mode from devicetree
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index ff48177..a8164d2 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -434,7 +434,7 @@ struct drm_cmdline_mode;
struct drm_display_mode *drm_mode_create(struct drm_device *dev);
void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
- const struct drm_display_mode *in);
+ const struct drm_display_mode *in);
int drm_mode_convert_umode(struct drm_display_mode *out,
const struct drm_mode_modeinfo *in);
void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
@@ -457,6 +457,7 @@ void drm_display_mode_from_videomode(const struct videomode *vm,
struct drm_display_mode *dmode);
void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
struct videomode *vm);
+void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags);
int of_get_drm_display_mode(struct device_node *np,
struct drm_display_mode *dmode,
int index);
--
2.1.4
next prev parent reply other threads:[~2016-07-12 13:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 13:18 [PATCHv3 1/1] drm/imx: convey the pixelclk-active and de-active flags from DT to the ipu-di driver Lothar Waßmann
2016-07-12 11:54 ` Lothar Waßmann
2016-07-12 12:43 ` Daniel Vetter
2016-07-12 16:50 ` Philipp Zabel
2016-07-12 16:49 ` Philipp Zabel
2016-07-12 13:30 ` [PATCHv4 0/3] " Lothar Waßmann
2016-07-12 13:30 ` [PATCHv4 1/3] drm/imx: parallel-display: check return code from of_get_drm_display_mode() Lothar Waßmann
2016-07-12 13:30 ` Lothar Waßmann [this message]
2016-08-15 14:33 ` [PATCHv4 2/3] drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT Daniel Vetter
2016-07-12 13:30 ` [PATCHv4 3/3] drm/imx: convey the pixelclk-active and de-active flags from DT to the ipu-di driver Lothar Waßmann
2016-07-12 14:39 ` [PATCHv3 1/1] " Thierry Reding
2016-07-12 16:49 ` Philipp Zabel
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=1468330203-29150-3-git-send-email-LW@KARO-electronics.de \
--to=lw@karo-electronics.de \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome