mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <tomi.valkeinen@ti.com>, <thierry.reding@gmail.com>, <airlied@linux.ie>
Cc: <daniel.vetter@ffwll.ch>, <dri-devel@lists.freedesktop.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 11/23] drm/omap: dispc: Simplify _dispc_mgr_set_lcd_timings() parameters
Date: Thu, 22 Sep 2016 14:06:56 +0300	[thread overview]
Message-ID: <20160922110708.31242-12-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <20160922110708.31242-1-peter.ujfalusi@ti.com>

Instead of passing the omap_video_timings structure's members individually,
use the pointer to the struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 38 ++++++++++++++-----------------------
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 858d87dd7fe8..e29f33fd19cd 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -3141,29 +3141,23 @@ bool dispc_mgr_timings_ok(enum omap_channel channel,
 	return true;
 }
 
-static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsync_len,
-		int hfp, int hbp, int vsw, int vfp, int vbp,
-		enum omap_dss_signal_level vsync_level,
-		enum omap_dss_signal_level hsync_level,
-		enum omap_dss_signal_edge data_pclk_edge,
-		enum omap_dss_signal_level de_level,
-		enum omap_dss_signal_edge sync_pclk_edge)
-
+static void _dispc_mgr_set_lcd_timings(enum omap_channel channel,
+				       const struct omap_video_timings *ovt)
 {
 	u32 timing_h, timing_v, l;
 	bool onoff, rf, ipc, vs, hs, de;
 
-	timing_h = FLD_VAL(hsync_len-1, dispc.feat->sw_start, 0) |
-			FLD_VAL(hfp-1, dispc.feat->fp_start, 8) |
-			FLD_VAL(hbp-1, dispc.feat->bp_start, 20);
-	timing_v = FLD_VAL(vsw-1, dispc.feat->sw_start, 0) |
-			FLD_VAL(vfp, dispc.feat->fp_start, 8) |
-			FLD_VAL(vbp, dispc.feat->bp_start, 20);
+	timing_h = FLD_VAL(ovt->hsync_len - 1, dispc.feat->sw_start, 0) |
+		   FLD_VAL(ovt->hfront_porch - 1, dispc.feat->fp_start, 8) |
+		   FLD_VAL(ovt->hback_porch - 1, dispc.feat->bp_start, 20);
+	timing_v = FLD_VAL(ovt->vsync_len - 1, dispc.feat->sw_start, 0) |
+		   FLD_VAL(ovt->vfront_porch, dispc.feat->fp_start, 8) |
+		   FLD_VAL(ovt->vback_porch, dispc.feat->bp_start, 20);
 
 	dispc_write_reg(DISPC_TIMING_H(channel), timing_h);
 	dispc_write_reg(DISPC_TIMING_V(channel), timing_v);
 
-	switch (vsync_level) {
+	switch (ovt->vsync_level) {
 	case OMAPDSS_SIG_ACTIVE_LOW:
 		vs = true;
 		break;
@@ -3174,7 +3168,7 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsync_len,
 		BUG();
 	}
 
-	switch (hsync_level) {
+	switch (ovt->hsync_level) {
 	case OMAPDSS_SIG_ACTIVE_LOW:
 		hs = true;
 		break;
@@ -3185,7 +3179,7 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsync_len,
 		BUG();
 	}
 
-	switch (de_level) {
+	switch (ovt->de_level) {
 	case OMAPDSS_SIG_ACTIVE_LOW:
 		de = true;
 		break;
@@ -3196,7 +3190,7 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsync_len,
 		BUG();
 	}
 
-	switch (data_pclk_edge) {
+	switch (ovt->data_pclk_edge) {
 	case OMAPDSS_DRIVE_SIG_RISING_EDGE:
 		ipc = false;
 		break;
@@ -3210,7 +3204,7 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsync_len,
 	/* always use the 'rf' setting */
 	onoff = true;
 
-	switch (sync_pclk_edge) {
+	switch (ovt->sync_pclk_edge) {
 	case OMAPDSS_DRIVE_SIG_FALLING_EDGE:
 		rf = false;
 		break;
@@ -3270,11 +3264,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 	}
 
 	if (dss_mgr_is_lcd(channel)) {
-		_dispc_mgr_set_lcd_timings(channel,
-				t.hsync_len, t.hfront_porch, t.hback_porch,
-				t.vsync_len, t.vfront_porch, t.vback_porch,
-				t.vsync_level, t.hsync_level, t.data_pclk_edge,
-				t.de_level, t.sync_pclk_edge);
+		_dispc_mgr_set_lcd_timings(channel, &t);
 
 		xtot = t.hactive + t.hfront_porch + t.hsync_len + t.hback_porch;
 		ytot = t.vactive + t.vfront_porch + t.vsync_len + t.vback_porch;
-- 
2.10.0

  parent reply	other threads:[~2016-09-22 11:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 11:06 [PATCH v2 00/23] drm/omap: Convert to use videomode from omap_video_timings Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 01/23] drm/omap: omap_display_timings: rename x_res to hactive Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 02/23] drm/omap: omap_display_timings: rename y_res to vactive Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 03/23] drm/omap: omap_display_timings: rename hsw to hsync_len Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 04/23] drm/omap: omap_display_timings: rename hfp to hfront_porch Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 05/23] drm/omap: omap_display_timings: rename hbp to hback_porch Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 06/23] drm/omap: omap_display_timings: rename vsw to vsync_len Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 07/23] drm/omap: omap_display_timings: rename vfp to vfront_porch Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 08/23] drm/omap: omap_display_timings: rename vbp to vback_porch Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 09/23] drm/omap: HDMI5: Use pointer to cfg->v_fc_config.timings in hdmi_core_video_config Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 10/23] drm/omap: omap_display_timings: Use display_flags for interlace mode Peter Ujfalusi
2016-09-22 11:06 ` Peter Ujfalusi [this message]
2016-09-22 11:06 ` [PATCH v2 12/23] drm/omap: omap_display_timings: Use display_flags for h/vsync level Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 13/23] drm/omap: omap_display_timings: Use display_flags for DE level Peter Ujfalusi
2016-09-22 11:06 ` [PATCH v2 14/23] drm/omap: omap_display_timings: Use display_flags for double_pixel mode Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 15/23] drm/omap: omap_display_timings: Use display_flags for pixel data edge Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 16/23] drm/omap: omap_display_timings: Use display_flags for sync edge Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 17/23] drm/omap: Change the types of struct omap_video_timings members Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 18/23] drm/omap: Replace struct omap_video_timings with videomode Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 19/23] drm/omap: Use consistent name for struct videomode Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 20/23] drm/omap: panel-tpo-td043mtea1: Add note for incorrect sync drive edge Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 21/23] drm/omap: panel-tpo-td028ttec1: " Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 22/23] drm/omap: panel-sharp-ls037v7dw01: Add note for incorrect data " Peter Ujfalusi
2016-09-22 11:07 ` [PATCH v2 23/23] drm/omap: panel-lgphilips-lb035q02: Add note for incorrect data drive edge and DE level Peter Ujfalusi
2016-09-29 11:34 ` [PATCH v2 00/23] drm/omap: Convert to use videomode from omap_video_timings Tomi Valkeinen

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=20160922110708.31242-12-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    /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

all inboxes | Powered by JetHome®