summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-11-23 14:23:42 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-04-03 12:36:40 +0300
commit956d4f9308d027119282330b54859cf20d222710 (patch)
treeef104ac0b8f72a2c3f51c7653e524678c052d21e /drivers/gpu/drm/omapdrm
parent39135a305a0f0a82d60ceb79dcbf094fc4e70123 (diff)
downloadlinux-956d4f9308d027119282330b54859cf20d222710.tar.xz
drm/omap: dispc: improve debug print of display flags
Instead of printing 0/1 for display flags like vsync high/low, use a tri-state print (-1/0/1) to indicate the "undefined" state. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dispc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 83241052df6b..2e6a71dbc25d 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -3229,6 +3229,16 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel,
}
}
+static int vm_flag_to_int(enum display_flags flags, enum display_flags high,
+ enum display_flags low)
+{
+ if (flags & high)
+ return 1;
+ if (flags & low)
+ return -1;
+ return 0;
+}
+
/* change name to mode? */
static void dispc_mgr_set_timings(enum omap_channel channel,
const struct videomode *vm)
@@ -3258,11 +3268,11 @@ static void dispc_mgr_set_timings(enum omap_channel channel,
t.hsync_len, t.hfront_porch, t.hback_porch,
t.vsync_len, t.vfront_porch, t.vback_porch);
DSSDBG("vsync_level %d hsync_level %d data_pclk_edge %d de_level %d sync_pclk_edge %d\n",
- !!(t.flags & DISPLAY_FLAGS_VSYNC_HIGH),
- !!(t.flags & DISPLAY_FLAGS_HSYNC_HIGH),
- !!(t.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE),
- !!(t.flags & DISPLAY_FLAGS_DE_HIGH),
- !!(t.flags & DISPLAY_FLAGS_SYNC_POSEDGE));
+ vm_flag_to_int(t.flags, DISPLAY_FLAGS_VSYNC_HIGH, DISPLAY_FLAGS_VSYNC_LOW),
+ vm_flag_to_int(t.flags, DISPLAY_FLAGS_HSYNC_HIGH, DISPLAY_FLAGS_HSYNC_LOW),
+ vm_flag_to_int(t.flags, DISPLAY_FLAGS_PIXDATA_POSEDGE, DISPLAY_FLAGS_PIXDATA_NEGEDGE),
+ vm_flag_to_int(t.flags, DISPLAY_FLAGS_DE_HIGH, DISPLAY_FLAGS_DE_LOW),
+ vm_flag_to_int(t.flags, DISPLAY_FLAGS_SYNC_POSEDGE, DISPLAY_FLAGS_SYNC_NEGEDGE));
DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt);
} else {