diff mbox

[7/9] drm/modes: add polarization handling to mode conversion

Message ID 1395052045-23848-8-git-send-email-a.hajda@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrzej Hajda March 17, 2014, 10:27 a.m. UTC
The patch adds conversion of DISPLAY_FLAGS_DE_* and DISPLAY_FLAGS_PIXDATA_*
flags to pol_flags in drm_display_mode_from_videomode function.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/drm_modes.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index b073315..5dbff8d 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -537,6 +537,17 @@  int 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;
+
+	dmode->pol_flags = 0;
+	if (vm->flags & DISPLAY_FLAGS_DE_LOW)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_DE_NEGEDGE;
+	if (vm->flags & DISPLAY_FLAGS_DE_HIGH)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_DE_POSEDGE;
+	if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE;
+	if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
+		dmode->pol_flags |= DRM_MODE_FLAG_POL_PIXDATA_POSEDGE;
+
 	drm_mode_set_name(dmode);
 
 	return 0;