* [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag
@ 2015-03-16 17:29 Sébastien Szymanski
2015-03-16 17:29 ` [PATCH 2/2] imx-drm: ipuv3-crtc: Use DRM mode flags to configure pixel clock polarity Sébastien Szymanski
2015-03-17 10:43 ` [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Philipp Zabel
0 siblings, 2 replies; 3+ messages in thread
From: Sébastien Szymanski @ 2015-03-16 17:29 UTC (permalink / raw)
To: David Airlie, Philipp Zabel, dri-devel, linux-kernel, linux-api
Cc: Sébastien Szymanski, Steve Longerbeam
From: Steve Longerbeam <steve_longerbeam@mentor.com>
[Sébastien - rebase, update drm_display_mode_to_videomode function]
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
drivers/gpu/drm/drm_modes.c | 8 ++++++++
include/uapi/drm/drm_mode.h | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 487d0e3..464828f 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -611,6 +611,10 @@ void drm_display_mode_from_videomode(const struct videomode *vm,
dmode->flags |= DRM_MODE_FLAG_DBLSCAN;
if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
dmode->flags |= DRM_MODE_FLAG_DBLCLK;
+ if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
+ dmode->flags |= DRM_MODE_FLAG_PCLK;
+ else if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+ dmode->flags |= DRM_MODE_FLAG_NCLK;
drm_mode_set_name(dmode);
}
EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
@@ -652,6 +656,10 @@ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
vm->flags |= DISPLAY_FLAGS_DOUBLESCAN;
if (dmode->flags & DRM_MODE_FLAG_DBLCLK)
vm->flags |= DISPLAY_FLAGS_DOUBLECLK;
+ if (dmode->flags & DRM_MODE_FLAG_PCLK)
+ vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
+ else if (dmode->flags & DRM_MODE_FLAG_NCLK)
+ vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE;
}
EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode);
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index ca788e0..1abb2fc 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -72,6 +72,10 @@
#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14)
#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14)
#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14)
+/* drive data on rising pixclk edge */
+#define DRM_MODE_FLAG_PCLK (1<<19)
+/* drive data on falling pixclk edge */
+#define DRM_MODE_FLAG_NCLK (1<<20)
/* DPMS flags */
--
2.0.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] imx-drm: ipuv3-crtc: Use DRM mode flags to configure pixel clock polarity
2015-03-16 17:29 [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Sébastien Szymanski
@ 2015-03-16 17:29 ` Sébastien Szymanski
2015-03-17 10:43 ` [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Philipp Zabel
1 sibling, 0 replies; 3+ messages in thread
From: Sébastien Szymanski @ 2015-03-16 17:29 UTC (permalink / raw)
To: David Airlie, Philipp Zabel, dri-devel, linux-kernel, linux-api
Cc: Sébastien Szymanski, Mohsin Kazmi, Steve Longerbeam
From: Steve Longerbeam <steve_longerbeam@mentor.com>
Previously, pixel clock polarity was hardcoded and wasn't configurable.
This patch adds support to configure the pixel clock polarity from the
DRM mode flags.
[Sébastien - rebase]
Signed-off-by: Mohsin Kazmi <mohsin_kazmi@mentor.com>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
drivers/gpu/drm/imx/ipuv3-crtc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 98551e3..71f888b 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -171,10 +171,12 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
else
sig_cfg.clkflags = 0;
+ if (mode->flags & DRM_MODE_FLAG_PCLK)
+ sig_cfg.clk_pol = 1;
+
out_pixel_fmt = ipu_crtc->interface_pix_fmt;
sig_cfg.enable_pol = 1;
- sig_cfg.clk_pol = 0;
sig_cfg.pixel_fmt = out_pixel_fmt;
sig_cfg.v_to_h_sync = 0;
sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin;
--
2.0.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag
2015-03-16 17:29 [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Sébastien Szymanski
2015-03-16 17:29 ` [PATCH 2/2] imx-drm: ipuv3-crtc: Use DRM mode flags to configure pixel clock polarity Sébastien Szymanski
@ 2015-03-17 10:43 ` Philipp Zabel
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2015-03-17 10:43 UTC (permalink / raw)
To: Sébastien Szymanski
Cc: David Airlie, dri-devel, linux-kernel, linux-api, Steve Longerbeam
Hi Sébastien,
Am Montag, den 16.03.2015, 18:29 +0100 schrieb Sébastien Szymanski:
> From: Steve Longerbeam <steve_longerbeam@mentor.com>
>
> [Sébastien - rebase, update drm_display_mode_to_videomode function]
>
> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Thanks for bringing this up again. This is a very crucial bit of
information that somehow needs to be communicated from the panel driver
to the crtc/encoder drivers. I vaguely remember that an earlier attempt
to add this flag to the userspace visible DRM_MODE_FLAGs was met with
resistance before, but I can't find it right now.
regards
Philipp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-17 10:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 17:29 [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Sébastien Szymanski
2015-03-16 17:29 ` [PATCH 2/2] imx-drm: ipuv3-crtc: Use DRM mode flags to configure pixel clock polarity Sébastien Szymanski
2015-03-17 10:43 ` [PATCH 1/2] drm_modes: videomode: add pos/neg pixel clock polarity flag Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).