linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features
@ 2012-11-28 10:53 Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
                   ` (7 more replies)
  0 siblings, 8 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

Hi everyone,
this patch series aims at cleaning up of dss_features.c by moving features to
respective submodule drivers.

The 1st patch
 * moved struct omap_dss_features members burst_size_unit and buffer_size_unit
   to dispc_features
The 2nd patch
 * added definition of struct register_field
 * created enum dispc_feat_reg_field
 * moved data from dss_reg_fields to dispc_reg_fields
The 3rd patch
 * added definition of struct param_range
 * created enum dispc_range_param
 * moved data from dss_param_range to dispc_param_range
The 4th patch
 * created struct feats and initialized dsi_feats
 * created enum dsi_feat_reg_field
 * moved data from dss_reg_fields to dsi_reg_fields
 * created dsi_init_features() to initialize dsi_feats
The 5th patch
 * created enum dsi_range_param
 * moved data from dss_param_range to dsi_param_range
The 6th patch
 * added members fld_dispc_clk_switch and dss_fck_max to struct dss_features
   and initialized corresponding dss_feats
 * removed definition of dss_reg_field
 * removed respective omap2_dss_reg_fields, omap3_dss_reg_fields,
   omap4_dss_reg_fields and omap5_dss_reg_fields
 * removed members reg_fields and num_reg_fields from struct omap_dss_features
 * removed enum dss_feat_reg_field
 * removed function dss_feat_get_reg_field()
The 7th patch
 * added FEAT_PARAM_DSS_FCK to enum dsi_param_range and initialized
   corresponding elements in dsi_param_range
 * removed struct dss_param_range
 * removed enum dss_range_param
 * removed functions dss_feat_get_param_min() and dss_feat_get_param_max()

All your comments and suggestions are welcome.

I have based my patches on git://gitorious.org/linux-omap-dss2/linux.git master

Reference Tree:
git://gitorious.org/linux-omap-dss2/chandrabhanus-linux.git dss_cleanup

Regards,
Chandrabhanu

Chandrabhanu Mahapatra (7):
  OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features
  OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  OMAPDSS: DISPC: Move DISPC specific dss_params to dispc_features
  OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  OMAPDSS: DSI: Move DSI specific dss_params to dsi_feats
  OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max
  OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK

 drivers/video/omap2/dss/dispc.c        |  188 ++++++++++++++++++++++------
 drivers/video/omap2/dss/dsi.c          |  198 ++++++++++++++++++++++++++---
 drivers/video/omap2/dss/dss.c          |   22 +++-
 drivers/video/omap2/dss/dss.h          |    8 ++
 drivers/video/omap2/dss/dss_features.c |  212 --------------------------------
 drivers/video/omap2/dss/dss_features.h |   36 ------
 6 files changed, 358 insertions(+), 306 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-29 12:01   ` Tomi Valkeinen
  2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The burst_size and buffer_size being local data to DISPC are moved to
dispc_features and so removed from struct omap_dss_features. The functions
referring to burst and buffer size are also removed from dss_features.c as they
are now accessed locally in dispc.c.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |   21 +++++++++++++++++----
 drivers/video/omap2/dss/dss_features.c |   29 -----------------------------
 drivers/video/omap2/dss/dss_features.h |    3 ---
 3 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 3d0ff5b..9f259ba 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -104,6 +104,9 @@ struct dispc_features {
 
 	/* swap GFX & WB fifos */
 	bool gfx_fifo_workaround:1;
+
+	u32 buffer_size_unit;
+	u32 burst_size_unit;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -1056,7 +1059,7 @@ static void dispc_configure_burst_sizes(void)
 
 static u32 dispc_ovl_get_burst_size(enum omap_plane plane)
 {
-	unsigned unit = dss_feat_get_burst_size_unit();
+	unsigned unit = dispc.feat->burst_size_unit;
 	/* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */
 	return unit * 8;
 }
@@ -1145,7 +1148,7 @@ static void dispc_init_fifos(void)
 	u8 start, end;
 	u32 unit;
 
-	unit = dss_feat_get_buffer_size_unit();
+	unit = dispc.feat->buffer_size_unit;
 
 	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
 
@@ -1203,7 +1206,7 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
 	u8 hi_start, hi_end, lo_start, lo_end;
 	u32 unit;
 
-	unit = dss_feat_get_buffer_size_unit();
+	unit = dispc.feat->buffer_size_unit;
 
 	WARN_ON(low % unit != 0);
 	WARN_ON(high % unit != 0);
@@ -1247,7 +1250,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
 	 * buffer_units, and the fifo thresholds must be buffer_unit aligned.
 	 */
 
-	unsigned buf_unit = dss_feat_get_buffer_size_unit();
+	unsigned buf_unit = dispc.feat->buffer_size_unit;
 	unsigned ovl_fifo_size, total_fifo_size, burst_size;
 	int i;
 
@@ -4095,6 +4098,8 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.calc_scaling		=	dispc_ovl_calc_scaling_24xx,
 	.calc_core_clk		=	calc_core_clk_24xx,
 	.num_fifos		=	3,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4111,6 +4116,8 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4127,6 +4134,8 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4144,6 +4153,8 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
 	.gfx_fifo_workaround	=	true,
+	.buffer_size_unit	=	16,
+	.burst_size_unit	=	16,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4161,6 +4172,8 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
 	.gfx_fifo_workaround	=	true,
+	.buffer_size_unit	=	16,
+	.burst_size_unit	=	16,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 1d125c6..092e21b 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -54,9 +54,6 @@ struct omap_dss_features {
 	const struct dss_param_range *dss_params;
 
 	const enum omap_dss_rotation_type supported_rotation_types;
-
-	const u32 buffer_size_unit;
-	const u32 burst_size_unit;
 };
 
 /* This struct is assigned to one of the below during initialization */
@@ -632,8 +629,6 @@ static const struct omap_dss_features omap2_dss_features = {
 	.clksrc_names = omap2_dss_clk_source_names,
 	.dss_params = omap2_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /* OMAP3 DSS Features */
@@ -653,8 +648,6 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /*
@@ -677,8 +670,6 @@ static const struct omap_dss_features am35xx_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 static const struct omap_dss_features omap3630_dss_features = {
@@ -697,8 +688,6 @@ static const struct omap_dss_features omap3630_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /* OMAP4 DSS Features */
@@ -720,8 +709,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features  = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */
@@ -742,8 +729,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* For all the other OMAP4 versions */
@@ -764,8 +749,6 @@ static const struct omap_dss_features omap4_dss_features = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* OMAP5 DSS Features */
@@ -785,8 +768,6 @@ static const struct omap_dss_features omap5_dss_features = {
 	.clksrc_names = omap5_dss_clk_source_names,
 	.dss_params = omap5_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 #if defined(CONFIG_OMAP4_DSS_HDMI)
@@ -892,16 +873,6 @@ const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id)
 	return omap_current_dss_features->clksrc_names[id];
 }
 
-u32 dss_feat_get_buffer_size_unit(void)
-{
-	return omap_current_dss_features->buffer_size_unit;
-}
-
-u32 dss_feat_get_burst_size_unit(void)
-{
-	return omap_current_dss_features->burst_size_unit;
-}
-
 /* DSS has_feature check */
 bool dss_has_feature(enum dss_feat_id id)
 {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 385b0af..16658e1 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -114,9 +114,6 @@ bool dss_feat_color_mode_supported(enum omap_plane plane,
 		enum omap_color_mode color_mode);
 const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id);
 
-u32 dss_feat_get_buffer_size_unit(void);	/* in bytes */
-u32 dss_feat_get_burst_size_unit(void);		/* in bytes */
-
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
 
 bool dss_has_feature(enum dss_feat_id id);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-29 12:05   ` Tomi Valkeinen
  2012-11-29 12:18   ` Tomi Valkeinen
  2012-11-28 10:53 ` [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The register fields in dss_reg_fields specific to DISPC are moved from struct
omap_dss_features to corresponding dispc_reg_fields, initialized in struct
dispc_features, thereby enabling local access.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
 drivers/video/omap2/dss/dss.h          |    4 ++
 drivers/video/omap2/dss/dss_features.c |   28 ----------
 drivers/video/omap2/dss/dss_features.h |    7 ---
 4 files changed, 80 insertions(+), 46 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9f259ba..21fc522 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -80,6 +80,16 @@ struct dispc_irq_stats {
 	unsigned irqs[32];
 };
 
+enum dispc_feat_reg_field {
+	FEAT_REG_FIRHINC,
+	FEAT_REG_FIRVINC,
+	FEAT_REG_FIFOLOWTHRESHOLD,
+	FEAT_REG_FIFOHIGHTHRESHOLD,
+	FEAT_REG_FIFOSIZE,
+	FEAT_REG_HORIZONTALACCU,
+	FEAT_REG_VERTICALACCU,
+};
+
 struct dispc_features {
 	u8 sw_start;
 	u8 fp_start;
@@ -107,6 +117,8 @@ struct dispc_features {
 
 	u32 buffer_size_unit;
 	u32 burst_size_unit;
+
+	struct register_field *reg_fields;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -1150,7 +1162,8 @@ static void dispc_init_fifos(void)
 
 	unit = dispc.feat->buffer_size_unit;
 
-	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
+	start = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
+	end = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].end;
 
 	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
 		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
@@ -1214,8 +1227,10 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
 	low /= unit;
 	high /= unit;
 
-	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
-	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
+	hi_start = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].start;
+	hi_end = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].end;
+	lo_start = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].start;
+	lo_end = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].end;
 
 	DSSDBG("fifo(%d) threshold (bytes), old %u/%u, new %u/%u\n",
 			plane,
@@ -1297,10 +1312,11 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
 	if (color_comp = DISPC_COLOR_COMPONENT_RGB_Y) {
 		u8 hinc_start, hinc_end, vinc_start, vinc_end;
 
-		dss_feat_get_reg_field(FEAT_REG_FIRHINC,
-					&hinc_start, &hinc_end);
-		dss_feat_get_reg_field(FEAT_REG_FIRVINC,
-					&vinc_start, &vinc_end);
+		hinc_start = dispc.feat->reg_fields[FEAT_REG_FIRHINC].start;
+		hinc_end = dispc.feat->reg_fields[FEAT_REG_FIRHINC].end;
+		vinc_start = dispc.feat->reg_fields[FEAT_REG_FIRVINC].start;
+		vinc_end = dispc.feat->reg_fields[FEAT_REG_FIRVINC].end;
+
 		val = FLD_VAL(vinc, vinc_start, vinc_end) |
 				FLD_VAL(hinc, hinc_start, hinc_end);
 
@@ -1316,8 +1332,10 @@ static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
 	u32 val;
 	u8 hor_start, hor_end, vert_start, vert_end;
 
-	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
-	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
+	hor_start = dispc.feat->reg_fields[FEAT_REG_HORIZONTALACCU].start;
+	hor_end = dispc.feat->reg_fields[FEAT_REG_HORIZONTALACCU].end;
+	vert_start = dispc.feat->reg_fields[FEAT_REG_VERTICALACCU].start;
+	vert_end = dispc.feat->reg_fields[FEAT_REG_VERTICALACCU].end;
 
 	val = FLD_VAL(vaccu, vert_start, vert_end) |
 			FLD_VAL(haccu, hor_start, hor_end);
@@ -1330,8 +1348,10 @@ static void dispc_ovl_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
 	u32 val;
 	u8 hor_start, hor_end, vert_start, vert_end;
 
-	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
-	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
+	hor_start = dispc.feat->reg_fields[FEAT_REG_HORIZONTALACCU].start;
+	hor_end = dispc.feat->reg_fields[FEAT_REG_HORIZONTALACCU].end;
+	vert_start = dispc.feat->reg_fields[FEAT_REG_VERTICALACCU].start;
+	vert_end = dispc.feat->reg_fields[FEAT_REG_VERTICALACCU].end;
 
 	val = FLD_VAL(vaccu, vert_start, vert_end) |
 			FLD_VAL(haccu, hor_start, hor_end);
@@ -4084,6 +4104,46 @@ static void _omap_dispc_initial_config(void)
 	dispc_ovl_enable_zorder_planes();
 }
 
+static struct register_field omap2_dispc_reg_fields[] = {
+	[FEAT_REG_FIRHINC]			= { 11,  0 },
+	[FEAT_REG_FIRVINC]			= { 27, 16 },
+	[FEAT_REG_FIFOLOWTHRESHOLD]		= {  8,  0 },
+	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 24, 16 },
+	[FEAT_REG_FIFOSIZE]			= {  8,  0 },
+	[FEAT_REG_HORIZONTALACCU]		= {  9,  0 },
+	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
+};
+
+static struct register_field omap3_dispc_reg_fields[] = {
+	[FEAT_REG_FIRHINC]			= { 12,  0 },
+	[FEAT_REG_FIRVINC]			= { 28, 16 },
+	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 11,  0 },
+	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 27, 16 },
+	[FEAT_REG_FIFOSIZE]			= { 10,  0 },
+	[FEAT_REG_HORIZONTALACCU]		= {  9,  0 },
+	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
+};
+
+static struct register_field omap4_dispc_reg_fields[] = {
+	[FEAT_REG_FIRHINC]			= { 12,  0 },
+	[FEAT_REG_FIRVINC]			= { 28, 16 },
+	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15,  0 },
+	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
+	[FEAT_REG_FIFOSIZE]			= { 15,  0 },
+	[FEAT_REG_HORIZONTALACCU]		= { 10,  0 },
+	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
+};
+
+static struct register_field omap5_dispc_reg_fields[] = {
+	[FEAT_REG_FIRHINC]			= { 12,  0 },
+	[FEAT_REG_FIRVINC]			= { 28, 16 },
+	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15,  0 },
+	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
+	[FEAT_REG_FIFOSIZE]			= { 15,  0 },
+	[FEAT_REG_HORIZONTALACCU]		= { 10,  0 },
+	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
+};
+
 static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.sw_start		=	5,
 	.fp_start		=	15,
@@ -4100,6 +4160,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	omap2_dispc_reg_fields,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4118,6 +4179,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	omap3_dispc_reg_fields,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4136,6 +4198,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	omap3_dispc_reg_fields,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4155,6 +4218,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.gfx_fifo_workaround	=	true,
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
+	.reg_fields		=	omap4_dispc_reg_fields,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4174,6 +4238,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.gfx_fifo_workaround	=	true,
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
+	.reg_fields		=	omap5_dispc_reg_fields,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 84a7f6a..aa273d8 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -143,6 +143,10 @@ struct reg_field {
 	u8 low;
 };
 
+struct register_field {
+	u8 start, end;
+};
+
 struct dss_lcd_mgr_config {
 	enum dss_io_pad_mode io_pad_mode;
 
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 092e21b..defdfc0 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -60,13 +60,6 @@ struct omap_dss_features {
 static const struct omap_dss_features *omap_current_dss_features;
 
 static const struct dss_reg_field omap2_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 11, 0 },
-	[FEAT_REG_FIRVINC]			= { 27, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 8, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 24, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 8, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGN]			= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGM]			= { 0, 0 },
@@ -75,13 +68,6 @@ static const struct dss_reg_field omap2_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap3_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 11, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 27, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 10, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGN]			= { 7, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 18, 8 },
@@ -90,13 +76,6 @@ static const struct dss_reg_field omap3_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap4_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
 	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
@@ -105,13 +84,6 @@ static const struct dss_reg_field omap4_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap5_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
 	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 16658e1..42a1bd1 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -72,13 +72,6 @@ enum dss_feat_id {
 
 /* DSS register field id */
 enum dss_feat_reg_field {
-	FEAT_REG_FIRHINC,
-	FEAT_REG_FIRVINC,
-	FEAT_REG_FIFOHIGHTHRESHOLD,
-	FEAT_REG_FIFOLOWTHRESHOLD,
-	FEAT_REG_FIFOSIZE,
-	FEAT_REG_HORIZONTALACCU,
-	FEAT_REG_VERTICALACCU,
 	FEAT_REG_DISPC_CLK_SWITCH,
 	FEAT_REG_DSIPLL_REGN,
 	FEAT_REG_DSIPLL_REGM,
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params to dispc_features
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-29 12:08   ` Tomi Valkeinen
  2012-11-28 10:53 ` [PATCH 4/7] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DISPC specific dss_param_range are moved from struct omap_dss_features to
corresponding DSS version specific dispc_param_range struct, initialized in
dispc_features thereby enabling local access. The mgr_width_max and
mgr_height_max, members of dispc_features, are also moved to dispc_param_range.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |   80 +++++++++++++++++++++++---------
 drivers/video/omap2/dss/dss.h          |    4 ++
 drivers/video/omap2/dss/dss_features.c |   16 -------
 drivers/video/omap2/dss/dss_features.h |    3 --
 4 files changed, 63 insertions(+), 40 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 21fc522..0b7388d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -90,6 +90,14 @@ enum dispc_feat_reg_field {
 	FEAT_REG_VERTICALACCU,
 };
 
+enum dispc_range_param {
+	FEAT_PARAM_PCD,
+	FEAT_PARAM_DOWNSCALE,
+	FEAT_PARAM_LINEWIDTH,
+	FEAT_PARAM_MGR_WIDTH,
+	FEAT_PARAM_MGR_HEIGHT,
+};
+
 struct dispc_features {
 	u8 sw_start;
 	u8 fp_start;
@@ -99,8 +107,6 @@ struct dispc_features {
 	u16 hp_max;
 	u8 mgr_width_start;
 	u8 mgr_height_start;
-	u16 mgr_width_max;
-	u16 mgr_height_max;
 	int (*calc_scaling) (enum omap_plane plane,
 		const struct omap_video_timings *mgr_timings,
 		u16 width, u16 height, u16 out_width, u16 out_height,
@@ -119,6 +125,7 @@ struct dispc_features {
 	u32 burst_size_unit;
 
 	struct register_field *reg_fields;
+	struct param_range *params;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -2185,7 +2192,7 @@ static int dispc_ovl_calc_scaling_24xx(enum omap_plane plane,
 	u16 in_width, in_height;
 	int min_factor = min(*decim_x, *decim_y);
 	const int maxsinglelinewidth -			dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+				dispc.feat->params[FEAT_PARAM_LINEWIDTH].max;
 
 	*five_taps = false;
 
@@ -2226,7 +2233,7 @@ static int dispc_ovl_calc_scaling_34xx(enum omap_plane plane,
 	u16 in_width, in_height;
 	int min_factor = min(*decim_x, *decim_y);
 	const int maxsinglelinewidth -			dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+				dispc.feat->params[FEAT_PARAM_LINEWIDTH].max;
 
 	do {
 		in_height = DIV_ROUND_UP(height, *decim_y);
@@ -2292,8 +2299,8 @@ static int dispc_ovl_calc_scaling_44xx(enum omap_plane plane,
 	int decim_x_min = *decim_x;
 	u16 in_height = DIV_ROUND_UP(height, *decim_y);
 	const int maxsinglelinewidth -				dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
-	const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+				dispc.feat->params[FEAT_PARAM_LINEWIDTH].max;
+	const int maxdownscale = dispc.feat->params[FEAT_PARAM_DOWNSCALE].max;
 
 	if (mem_to_mem) {
 		in_width_max = out_width * maxdownscale;
@@ -2333,7 +2340,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
 		int *x_predecim, int *y_predecim, u16 pos_x,
 		enum omap_dss_rotation_type rotation_type, bool mem_to_mem)
 {
-	const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+	const int maxdownscale = dispc.feat->params[FEAT_PARAM_DOWNSCALE].max;
 	const int max_decim_limit = 16;
 	unsigned long core_clk = 0;
 	int decim_x, decim_y, ret;
@@ -3029,8 +3036,8 @@ void dispc_mgr_set_lcd_config(enum omap_channel channel,
 
 static bool _dispc_mgr_size_ok(u16 width, u16 height)
 {
-	return width <= dispc.feat->mgr_width_max &&
-		height <= dispc.feat->mgr_height_max;
+	return width <= dispc.feat->params[FEAT_PARAM_MGR_WIDTH].max &&
+		height <= dispc.feat->params[FEAT_PARAM_MGR_HEIGHT].max;
 }
 
 static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
@@ -3592,8 +3599,8 @@ void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
 	u16 best_ld, cur_ld;
 	u16 best_pd, cur_pd;
 
-	pcd_min = dss_feat_get_param_min(FEAT_PARAM_DSS_PCD);
-	pcd_max = dss_feat_get_param_max(FEAT_PARAM_DSS_PCD);
+	pcd_min = dispc.feat->params[FEAT_PARAM_PCD].min;
+	pcd_max = dispc.feat->params[FEAT_PARAM_PCD].max;
 
 	best_pck = 0;
 	best_ld = 0;
@@ -4144,6 +4151,42 @@ static struct register_field omap5_dispc_reg_fields[] = {
 	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
 };
 
+static struct param_range omap2_dispc_param_range[] = {
+	[FEAT_PARAM_PCD]			= { 2,  255 },
+	[FEAT_PARAM_DOWNSCALE]			= { 1,    2 },
+	/*
+	 * Assuming the line width buffer to be 768 pixels as OMAP2 DISPC
+	 * scaler cannot scale a image with width more than 768.
+	 */
+	[FEAT_PARAM_LINEWIDTH]			= { 1,  768 },
+	[FEAT_PARAM_MGR_WIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_HEIGHT]			= { 1, 2048 },
+};
+
+static struct param_range omap3_dispc_param_range[] = {
+	[FEAT_PARAM_PCD]			= { 1,  255 },
+	[FEAT_PARAM_DOWNSCALE]			= { 1,    4 },
+	[FEAT_PARAM_LINEWIDTH]			= { 1, 1024 },
+	[FEAT_PARAM_MGR_WIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_HEIGHT]			= { 1, 2048 },
+};
+
+static struct param_range omap4_dispc_param_range[] = {
+	[FEAT_PARAM_PCD]			= { 1,  255 },
+	[FEAT_PARAM_DOWNSCALE]			= { 1,    4 },
+	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_WIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_HEIGHT]			= { 1, 2048 },
+};
+
+static struct param_range omap5_dispc_param_range[] = {
+	[FEAT_PARAM_PCD]			= { 1,  255 },
+	[FEAT_PARAM_DOWNSCALE]			= { 1,    4 },
+	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_WIDTH]			= { 1, 2048 },
+	[FEAT_PARAM_MGR_HEIGHT]			= { 1, 2048 },
+};
+
 static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.sw_start		=	5,
 	.fp_start		=	15,
@@ -4153,14 +4196,13 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.hp_max			=	256,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_24xx,
 	.calc_core_clk		=	calc_core_clk_24xx,
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	omap2_dispc_reg_fields,
+	.params			=	omap2_dispc_param_range,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4172,14 +4214,13 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.hp_max			=	256,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	omap3_dispc_reg_fields,
+	.params			=	omap3_dispc_param_range,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4191,14 +4232,13 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	omap3_dispc_reg_fields,
+	.params			=	omap3_dispc_param_range,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4210,8 +4250,6 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_44xx,
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
@@ -4219,6 +4257,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
 	.reg_fields		=	omap4_dispc_reg_fields,
+	.params			=	omap4_dispc_param_range,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4230,8 +4269,6 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	11,
 	.mgr_height_start	=	27,
-	.mgr_width_max		=	4096,
-	.mgr_height_max		=	4096,
 	.calc_scaling		=	dispc_ovl_calc_scaling_44xx,
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
@@ -4239,6 +4276,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
 	.reg_fields		=	omap5_dispc_reg_fields,
+	.params			=	omap5_dispc_param_range,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index aa273d8..da6cf81 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -147,6 +147,10 @@ struct register_field {
 	u8 start, end;
 };
 
+struct param_range {
+	int min, max;
+};
+
 struct dss_lcd_mgr_config {
 	enum dss_io_pad_mode io_pad_mode;
 
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index defdfc0..3a9d1df 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -385,24 +385,16 @@ static const char * const omap5_dss_clk_source_names[] = {
 
 static const struct dss_param_range omap2_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 2, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_FINT]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, 0 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 2 },
-	/*
-	 * Assuming the line width buffer to be 768 pixels as OMAP2 DISPC
-	 * scaler cannot scale a image with width more than 768.
-	 */
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 768 },
 };
 
 static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
@@ -410,13 +402,10 @@ static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 750000, 2100000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 1, (1 << 13) - 1},
 	[FEAT_PARAM_DSI_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 1024 },
 };
 
 static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
@@ -424,13 +413,10 @@ static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
 	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
 };
 
 static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
@@ -438,8 +424,6 @@ static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
 	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
 };
 
 static const enum dss_feat_id omap2_dss_feat_list[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 42a1bd1..40b98ff 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -81,7 +81,6 @@ enum dss_feat_reg_field {
 
 enum dss_range_param {
 	FEAT_PARAM_DSS_FCK,
-	FEAT_PARAM_DSS_PCD,
 	FEAT_PARAM_DSIPLL_REGN,
 	FEAT_PARAM_DSIPLL_REGM,
 	FEAT_PARAM_DSIPLL_REGM_DISPC,
@@ -89,8 +88,6 @@ enum dss_range_param {
 	FEAT_PARAM_DSIPLL_FINT,
 	FEAT_PARAM_DSIPLL_LPDIV,
 	FEAT_PARAM_DSI_FCK,
-	FEAT_PARAM_DOWNSCALE,
-	FEAT_PARAM_LINEWIDTH,
 };
 
 /* DSS Feature Functions */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 4/7] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                   ` (2 preceding siblings ...)
  2012-11-28 10:53 ` [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 5/7] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DSI specific dss_reg_fields are moved to corresponding dsi_reg_fields
initialized in dsi_feats. The dsi_feats structure is initialized as per
corresponding DSS version in dsi_init_features().

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dsi.c          |  119 ++++++++++++++++++++++++++++++--
 drivers/video/omap2/dss/dss_features.c |   16 -----
 drivers/video/omap2/dss/dss_features.h |    4 --
 3 files changed, 113 insertions(+), 26 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index cf32dc7..2d387cb 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -344,6 +344,19 @@ struct dsi_packet_sent_handler_data {
 	struct completion *completion;
 };
 
+enum dsi_feat_reg_field {
+	FEAT_REG_DSIPLL_REGN,
+	FEAT_REG_DSIPLL_REGM,
+	FEAT_REG_DSIPLL_REGM_DISPC,
+	FEAT_REG_DSIPLL_REGM_DSI,
+};
+
+struct feats {
+	const struct register_field *reg_fields;
+};
+
+static const struct feats *dsi_feat;
+
 #ifdef DEBUG
 static bool dsi_perf;
 module_param(dsi_perf, bool, 0644);
@@ -1645,12 +1658,15 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev,
 		dss_feat_get_clk_source_name(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI),
 		cinfo->dsi_pll_hsdiv_dsi_clk);
 
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGN, &regn_start, &regn_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM, &regm_start, &regm_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM_DISPC, &regm_dispc_start,
-			&regm_dispc_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM_DSI, &regm_dsi_start,
-			&regm_dsi_end);
+	regn_start = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGN].start;
+	regn_end = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGN].end;
+	regm_start = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM].start;
+	regm_end = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM].end;
+	regm_dispc_start +			dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM_DISPC].start;
+	regm_dispc_end = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM_DISPC].end;
+	regm_dsi_start = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM_DSI].start;
+	regm_dsi_end = dsi_feat->reg_fields[FEAT_REG_DSIPLL_REGM_DSI].end;
 
 	/* DSI_PLL_AUTOMODE = manual */
 	REG_FLD_MOD(dsidev, DSI_PLL_CONTROL, 0, 0, 0);
@@ -5198,6 +5214,93 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev)
 	dss_unregister_output(out);
 }
 
+static struct register_field omap2_dsi_reg_fields[] = {
+	[FEAT_REG_DSIPLL_REGN]			= { 0, 0 },
+	[FEAT_REG_DSIPLL_REGM]			= { 0, 0 },
+	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 0, 0 },
+	[FEAT_REG_DSIPLL_REGM_DSI]		= { 0, 0 },
+};
+
+static struct register_field omap3_dsi_reg_fields[] = {
+	[FEAT_REG_DSIPLL_REGN]			= {  7,  1 },
+	[FEAT_REG_DSIPLL_REGM]			= { 18,  8 },
+	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 22, 19 },
+	[FEAT_REG_DSIPLL_REGM_DSI]		= { 26, 23 },
+};
+
+static struct register_field omap4_dsi_reg_fields[] = {
+	[FEAT_REG_DSIPLL_REGN]			= {  8,  1 },
+	[FEAT_REG_DSIPLL_REGM]			= { 20,  9 },
+	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
+	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
+};
+
+static struct register_field omap5_dsi_reg_fields[] = {
+	[FEAT_REG_DSIPLL_REGN]			= {  8,  1 },
+	[FEAT_REG_DSIPLL_REGM]			= { 20,  9 },
+	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
+	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
+};
+
+static const struct feats omap24xx_dsi_feats __initconst = {
+	.reg_fields		=	omap2_dsi_reg_fields,
+};
+
+static const struct feats omap34xx_dsi_feats __initconst = {
+	.reg_fields		=	omap3_dsi_reg_fields,
+};
+
+static const struct feats omap44xx_dsi_feats __initconst = {
+	.reg_fields		=	omap4_dsi_reg_fields,
+};
+
+static const struct feats omap54xx_dsi_feats __initconst = {
+	.reg_fields		=	omap5_dsi_reg_fields,
+};
+
+static int __init dsi_init_features(struct platform_device *dsidev)
+{
+	const struct feats *src;
+	struct feats *dst;
+
+	dst = devm_kzalloc(&dsidev->dev, sizeof(*dst), GFP_KERNEL);
+	if (!dst) {
+		dev_err(&dsidev->dev, "Failed to allocate DISPC Features\n");
+		return -ENOMEM;
+	}
+
+	switch (omapdss_get_version()) {
+	case OMAPDSS_VER_OMAP24xx:
+		src = &omap24xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP34xx_ES1:
+	case OMAPDSS_VER_OMAP34xx_ES3:
+	case OMAPDSS_VER_OMAP3630:
+	case OMAPDSS_VER_AM35xx:
+		src = &omap34xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP4430_ES1:
+	case OMAPDSS_VER_OMAP4430_ES2:
+	case OMAPDSS_VER_OMAP4:
+		src = &omap44xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP5:
+		src = &omap54xx_dsi_feats;
+		break;
+
+	default:
+		return -ENODEV;
+	}
+
+	memcpy(dst, src, sizeof(*dst));
+	dsi_feat = dst;
+
+	return 0;
+}
+
 /* DSI1 HW IP initialisation */
 static int __init omap_dsihw_probe(struct platform_device *dsidev)
 {
@@ -5206,6 +5309,10 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
 	struct resource *dsi_mem;
 	struct dsi_data *dsi;
 
+	r = dsi_init_features(dsidev);
+	if (r)
+		return r;
+
 	dsi = devm_kzalloc(&dsidev->dev, sizeof(*dsi), GFP_KERNEL);
 	if (!dsi)
 		return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 3a9d1df..8e6defb 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -61,34 +61,18 @@ static const struct omap_dss_features *omap_current_dss_features;
 
 static const struct dss_reg_field omap2_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGN]			= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM]			= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 0, 0 },
 };
 
 static const struct dss_reg_field omap3_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGN]			= { 7, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 18, 8 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 22, 19 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 26, 23 },
 };
 
 static const struct dss_reg_field omap4_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
-	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
 };
 
 static const struct dss_reg_field omap5_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
-	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
 };
 
 static const enum omap_display_type omap2_dss_supported_displays[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 40b98ff..3e82404 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -73,10 +73,6 @@ enum dss_feat_id {
 /* DSS register field id */
 enum dss_feat_reg_field {
 	FEAT_REG_DISPC_CLK_SWITCH,
-	FEAT_REG_DSIPLL_REGN,
-	FEAT_REG_DSIPLL_REGM,
-	FEAT_REG_DSIPLL_REGM_DISPC,
-	FEAT_REG_DSIPLL_REGM_DSI,
 };
 
 enum dss_range_param {
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 5/7] OMAPDSS: DSI: Move DSI specific dss_params to dsi_feats
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                   ` (3 preceding siblings ...)
  2012-11-28 10:53 ` [PATCH 4/7] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 6/7] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DSI specific dss_param_range are moved from struct omap_dss_features to
corresponding struct dsi_param_range, which is initialized in struct dsi_feats
thereby enabling local access.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dsi.c          |   70 ++++++++++++++++++++++++++++----
 drivers/video/omap2/dss/dss_features.c |   27 ------------
 drivers/video/omap2/dss/dss_features.h |    7 ----
 3 files changed, 62 insertions(+), 42 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 2d387cb..f1f617c 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -351,8 +351,19 @@ enum dsi_feat_reg_field {
 	FEAT_REG_DSIPLL_REGM_DSI,
 };
 
+enum dsi_range_param {
+	FEAT_PARAM_DSIPLL_REGN,
+	FEAT_PARAM_DSIPLL_REGM,
+	FEAT_PARAM_DSIPLL_REGM_DISPC,
+	FEAT_PARAM_DSIPLL_REGM_DSI,
+	FEAT_PARAM_DSIPLL_FINT,
+	FEAT_PARAM_DSIPLL_LPDIV,
+	FEAT_PARAM_DSI_FCK,
+};
+
 struct feats {
 	const struct register_field *reg_fields;
+	const struct param_range *params;
 };
 
 static const struct feats *dsi_feat;
@@ -1518,7 +1529,7 @@ static void dsi_pll_calc_dsi_fck(struct platform_device *dsidev,
 {
 	unsigned long max_dsi_fck;
 
-	max_dsi_fck = dss_feat_get_param_max(FEAT_PARAM_DSI_FCK);
+	max_dsi_fck = dsi_feat->params[FEAT_PARAM_DSI_FCK].max;
 
 	cinfo->regm_dsi = DIV_ROUND_UP(cinfo->clkin4ddr, max_dsi_fck);
 	cinfo->dsi_pll_hsdiv_dsi_clk = cinfo->clkin4ddr / cinfo->regm_dsi;
@@ -5082,14 +5093,14 @@ static void dsi_calc_clock_param_ranges(struct platform_device *dsidev)
 {
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
-	dsi->regn_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGN);
-	dsi->regm_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM);
+	dsi->regn_max = dsi_feat->params[FEAT_PARAM_DSIPLL_REGN].max;
+	dsi->regm_max = dsi_feat->params[FEAT_PARAM_DSIPLL_REGM].max;
 	dsi->regm_dispc_max -		dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DISPC);
-	dsi->regm_dsi_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DSI);
-	dsi->fint_min = dss_feat_get_param_min(FEAT_PARAM_DSIPLL_FINT);
-	dsi->fint_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_FINT);
-	dsi->lpdiv_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_LPDIV);
+		dsi_feat->params[FEAT_PARAM_DSIPLL_REGM_DISPC].max;
+	dsi->regm_dsi_max = dsi_feat->params[FEAT_PARAM_DSIPLL_REGM_DSI].max;
+	dsi->fint_min = dsi_feat->params[FEAT_PARAM_DSIPLL_FINT].min;
+	dsi->fint_max = dsi_feat->params[FEAT_PARAM_DSIPLL_FINT].max;
+	dsi->lpdiv_max = dsi_feat->params[FEAT_PARAM_DSIPLL_LPDIV].max;
 }
 
 static int dsi_get_clocks(struct platform_device *dsidev)
@@ -5242,20 +5253,63 @@ static struct register_field omap5_dsi_reg_fields[] = {
 	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
 };
 
+static struct param_range omap2_dsi_param_range[] = {
+	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
+	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
+	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
+	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, 0 },
+	[FEAT_PARAM_DSIPLL_FINT]		= { 0, 0 },
+	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, 0 },
+};
+
+static struct param_range omap3_dsi_param_range[] = {
+	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 4) - 1 },
+	[FEAT_PARAM_DSIPLL_FINT]		= { 750000, 2100000 },
+	[FEAT_PARAM_DSIPLL_LPDIV]		= { 1, (1 << 13) - 1},
+	[FEAT_PARAM_DSI_FCK]			= { 0, 173000000 },
+};
+
+static struct param_range omap4_dsi_param_range[] = {
+	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
+	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
+	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
+	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
+};
+
+static struct param_range omap5_dsi_param_range[] = {
+	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
+	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
+	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
+	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
+	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
+};
+
 static const struct feats omap24xx_dsi_feats __initconst = {
 	.reg_fields		=	omap2_dsi_reg_fields,
+	.params			=	omap2_dsi_param_range,
 };
 
 static const struct feats omap34xx_dsi_feats __initconst = {
 	.reg_fields		=	omap3_dsi_reg_fields,
+	.params			=	omap3_dsi_param_range,
 };
 
 static const struct feats omap44xx_dsi_feats __initconst = {
 	.reg_fields		=	omap4_dsi_reg_fields,
+	.params			=	omap4_dsi_param_range,
 };
 
 static const struct feats omap54xx_dsi_feats __initconst = {
 	.reg_fields		=	omap5_dsi_reg_fields,
+	.params			=	omap5_dsi_param_range,
 };
 
 static int __init dsi_init_features(struct platform_device *dsidev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 8e6defb..75dddb2 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -369,45 +369,18 @@ static const char * const omap5_dss_clk_source_names[] = {
 
 static const struct dss_param_range omap2_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, 0 },
 };
 
 static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 4) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 750000, 2100000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 1, (1 << 13) - 1},
-	[FEAT_PARAM_DSI_FCK]			= { 0, 173000000 },
 };
 
 static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
-	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
 };
 
 static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
-	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
 };
 
 static const enum dss_feat_id omap2_dss_feat_list[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 3e82404..d9f69c7 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -77,13 +77,6 @@ enum dss_feat_reg_field {
 
 enum dss_range_param {
 	FEAT_PARAM_DSS_FCK,
-	FEAT_PARAM_DSIPLL_REGN,
-	FEAT_PARAM_DSIPLL_REGM,
-	FEAT_PARAM_DSIPLL_REGM_DISPC,
-	FEAT_PARAM_DSIPLL_REGM_DSI,
-	FEAT_PARAM_DSIPLL_FINT,
-	FEAT_PARAM_DSIPLL_LPDIV,
-	FEAT_PARAM_DSI_FCK,
 };
 
 /* DSS Feature Functions */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 6/7] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                   ` (4 preceding siblings ...)
  2012-11-28 10:53 ` [PATCH 5/7] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-11-28 10:53 ` [PATCH 7/7] OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK Chandrabhanu Mahapatra
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  7 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The members fld_dispc_clk_switch and dss_fck_max are added to struct
dss_features and are initialized in corresponding dss_feats structure as per DSS
version. The reg_fields and num_reg_fields entries are removed from struct
omap_dss_features as they are no longer referenced.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dss.c          |   22 ++++++++----
 drivers/video/omap2/dss/dss_features.c |   57 --------------------------------
 drivers/video/omap2/dss/dss_features.h |    6 ----
 3 files changed, 16 insertions(+), 69 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 6ca69d5..4d74fbe 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -69,6 +69,8 @@ struct dss_features {
 	u8 dss_fck_multiplier;
 	const char *clk_name;
 	int (*dpi_select_source)(enum omap_channel channel);
+	struct register_field fld_dispc_clk_switch;
+	int dss_fck_max;
 };
 
 static struct {
@@ -308,7 +310,6 @@ static void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src)
 {
 	struct platform_device *dsidev;
 	int b;
-	u8 start, end;
 
 	switch (clk_src) {
 	case OMAP_DSS_CLK_SRC_FCK:
@@ -329,9 +330,8 @@ static void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src)
 		return;
 	}
 
-	dss_feat_get_reg_field(FEAT_REG_DISPC_CLK_SWITCH, &start, &end);
-
-	REG_FLD_MOD(DSS_CONTROL, b, start, end);	/* DISPC_CLK_SWITCH */
+	REG_FLD_MOD(DSS_CONTROL, b, dss.feat->fld_dispc_clk_switch.start,
+		dss.feat->fld_dispc_clk_switch.end);  /* DISPC_CLK_SWITCH */
 
 	dss.dispc_clk_source = clk_src;
 }
@@ -497,7 +497,7 @@ static int dss_setup_default_clock(void)
 	if (dss.dpll4_m4_ck = NULL)
 		return 0;
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dss.feat->dss_fck_max;
 
 	prate = dss_get_dpll4_rate();
 
@@ -533,7 +533,7 @@ int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
 
 	prate = dss_get_dpll4_rate();
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dss.feat->dss_fck_max;
 
 	fck = clk_get_rate(dss.dss_clk);
 	if (req_pck = dss.cache_req_pck && prate = dss.cache_prate &&
@@ -822,6 +822,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	2,
 	.clk_name		=	NULL,
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap34xx_dss_feats __initconst = {
@@ -829,6 +831,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	2,
 	.clk_name		=	"dpll4_m4_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap3630_dss_feats __initconst = {
@@ -836,6 +840,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll4_m4_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap44xx_dss_feats __initconst = {
@@ -843,6 +849,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll_per_m5x2_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap4,
+	.fld_dispc_clk_switch	=	{ 9, 8 },
+	.dss_fck_max		=	186000000,
 };
 
 static const struct dss_features omap54xx_dss_feats __initconst = {
@@ -850,6 +858,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll_per_h12x2_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap5,
+	.fld_dispc_clk_switch	=	{ 9, 7 },
+	.dss_fck_max		=	200000000,
 };
 
 static int __init dss_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 75dddb2..06c04f3 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -27,19 +27,11 @@
 #include "dss.h"
 #include "dss_features.h"
 
-/* Defines a generic omap register field */
-struct dss_reg_field {
-	u8 start, end;
-};
-
 struct dss_param_range {
 	int min, max;
 };
 
 struct omap_dss_features {
-	const struct dss_reg_field *reg_fields;
-	const int num_reg_fields;
-
 	const enum dss_feat_id *features;
 	const int num_features;
 
@@ -59,22 +51,6 @@ struct omap_dss_features {
 /* This struct is assigned to one of the below during initialization */
 static const struct omap_dss_features *omap_current_dss_features;
 
-static const struct dss_reg_field omap2_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-};
-
-static const struct dss_reg_field omap3_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-};
-
-static const struct dss_reg_field omap4_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
-};
-
-static const struct dss_reg_field omap5_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
-};
-
 static const enum omap_display_type omap2_dss_supported_displays[] = {
 	/* OMAP_DSS_CHANNEL_LCD */
 	OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI,
@@ -527,9 +503,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
 
 /* OMAP2 DSS Features */
 static const struct omap_dss_features omap2_dss_features = {
-	.reg_fields = omap2_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields),
-
 	.features = omap2_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap2_dss_feat_list),
 
@@ -546,9 +519,6 @@ static const struct omap_dss_features omap2_dss_features = {
 
 /* OMAP3 DSS Features */
 static const struct omap_dss_features omap3430_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = omap3430_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap3430_dss_feat_list),
 
@@ -568,9 +538,6 @@ static const struct omap_dss_features omap3430_dss_features = {
  * vdds_dsi regulator.
  */
 static const struct omap_dss_features am35xx_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = am35xx_dss_feat_list,
 	.num_features = ARRAY_SIZE(am35xx_dss_feat_list),
 
@@ -586,9 +553,6 @@ static const struct omap_dss_features am35xx_dss_features = {
 };
 
 static const struct omap_dss_features omap3630_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = omap3630_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap3630_dss_feat_list),
 
@@ -606,9 +570,6 @@ static const struct omap_dss_features omap3630_dss_features = {
 /* OMAP4 DSS Features */
 /* For OMAP4430 ES 1.0 revision */
 static const struct omap_dss_features omap4430_es1_0_dss_features  = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4430_es1_0_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4430_es1_0_dss_feat_list),
 
@@ -626,9 +587,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features  = {
 
 /* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */
 static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4430_es2_0_1_2_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4430_es2_0_1_2_dss_feat_list),
 
@@ -646,9 +604,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
 
 /* For all the other OMAP4 versions */
 static const struct omap_dss_features omap4_dss_features = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4_dss_feat_list),
 
@@ -666,9 +621,6 @@ static const struct omap_dss_features omap4_dss_features = {
 
 /* OMAP5 DSS Features */
 static const struct omap_dss_features omap5_dss_features = {
-	.reg_fields = omap5_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap5_dss_reg_fields),
-
 	.features = omap5_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap5_dss_feat_list),
 
@@ -801,15 +753,6 @@ bool dss_has_feature(enum dss_feat_id id)
 	return false;
 }
 
-void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end)
-{
-	if (id >= omap_current_dss_features->num_reg_fields)
-		BUG();
-
-	*start = omap_current_dss_features->reg_fields[id].start;
-	*end = omap_current_dss_features->reg_fields[id].end;
-}
-
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
 {
 	return omap_current_dss_features->supported_rotation_types & rot_type;
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index d9f69c7..97aecf9 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -70,11 +70,6 @@ enum dss_feat_id {
 	FEAT_DSI_PHY_DCC,
 };
 
-/* DSS register field id */
-enum dss_feat_reg_field {
-	FEAT_REG_DISPC_CLK_SWITCH,
-};
-
 enum dss_range_param {
 	FEAT_PARAM_DSS_FCK,
 };
@@ -96,7 +91,6 @@ const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id);
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
 
 bool dss_has_feature(enum dss_feat_id id);
-void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
 void dss_features_init(enum omapdss_version version);
 #if defined(CONFIG_OMAP4_DSS_HDMI)
 void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 7/7] OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                   ` (5 preceding siblings ...)
  2012-11-28 10:53 ` [PATCH 6/7] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
@ 2012-11-28 10:53 ` Chandrabhanu Mahapatra
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  7 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-28 10:53 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The FEAT_PARAM_DSS_FCK is added and initialized in corresponding DSS Version
specific struct dsi_param_range. As, the struct dss_param_range is no longer
used all its references are thereby removed from omap_dss_features.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dsi.c          |    9 ++++++--
 drivers/video/omap2/dss/dss_features.c |   39 --------------------------------
 drivers/video/omap2/dss/dss_features.h |    6 -----
 3 files changed, 7 insertions(+), 47 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f1f617c..3e0e9d7 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -352,6 +352,7 @@ enum dsi_feat_reg_field {
 };
 
 enum dsi_range_param {
+	FEAT_PARAM_DSS_FCK,
 	FEAT_PARAM_DSIPLL_REGN,
 	FEAT_PARAM_DSIPLL_REGM,
 	FEAT_PARAM_DSIPLL_REGM_DISPC,
@@ -1353,7 +1354,7 @@ int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
 
 	dss_sys_clk = clk_get_rate(dsi->sys_clk);
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dsi_feat->params[FEAT_PARAM_DSS_FCK].max;
 
 	if (req_pck = dsi->cache_req_pck &&
 			dsi->cache_cinfo.clkin = dss_sys_clk) {
@@ -1547,7 +1548,7 @@ static int dsi_pll_calc_dispc_fck(struct platform_device *dsidev,
 	struct dispc_clock_info best_dispc;
 	bool match;
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dsi_feat->params[FEAT_PARAM_DSS_FCK].max;
 
 	min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
 
@@ -5254,6 +5255,7 @@ static struct register_field omap5_dsi_reg_fields[] = {
 };
 
 static struct param_range omap2_dsi_param_range[] = {
+	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
@@ -5263,6 +5265,7 @@ static struct param_range omap2_dsi_param_range[] = {
 };
 
 static struct param_range omap3_dsi_param_range[] = {
+	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
@@ -5273,6 +5276,7 @@ static struct param_range omap3_dsi_param_range[] = {
 };
 
 static struct param_range omap4_dsi_param_range[] = {
+	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
@@ -5283,6 +5287,7 @@ static struct param_range omap4_dsi_param_range[] = {
 };
 
 static struct param_range omap5_dsi_param_range[] = {
+	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 06c04f3..e7fca28 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -27,10 +27,6 @@
 #include "dss.h"
 #include "dss_features.h"
 
-struct dss_param_range {
-	int min, max;
-};
-
 struct omap_dss_features {
 	const enum dss_feat_id *features;
 	const int num_features;
@@ -43,7 +39,6 @@ struct omap_dss_features {
 	const enum omap_color_mode *supported_color_modes;
 	const enum omap_overlay_caps *overlay_caps;
 	const char * const *clksrc_names;
-	const struct dss_param_range *dss_params;
 
 	const enum omap_dss_rotation_type supported_rotation_types;
 };
@@ -343,22 +338,6 @@ static const char * const omap5_dss_clk_source_names[] = {
 	[OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI]	= "DPLL_DSI1_C_CLK2",
 };
 
-static const struct dss_param_range omap2_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-};
-
-static const struct dss_param_range omap3_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-};
-
-static const struct dss_param_range omap4_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-};
-
-static const struct dss_param_range omap5_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-};
-
 static const enum dss_feat_id omap2_dss_feat_list[] = {
 	FEAT_LCDENABLEPOL,
 	FEAT_LCDENABLESIGNAL,
@@ -513,7 +492,6 @@ static const struct omap_dss_features omap2_dss_features = {
 	.supported_color_modes = omap2_dss_supported_color_modes,
 	.overlay_caps = omap2_dss_overlay_caps,
 	.clksrc_names = omap2_dss_clk_source_names,
-	.dss_params = omap2_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
@@ -529,7 +507,6 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3430_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
@@ -548,7 +525,6 @@ static const struct omap_dss_features am35xx_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3430_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
@@ -563,7 +539,6 @@ static const struct omap_dss_features omap3630_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3630_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
@@ -581,7 +556,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features  = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
@@ -598,7 +572,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
@@ -615,7 +588,6 @@ static const struct omap_dss_features omap4_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
@@ -631,7 +603,6 @@ static const struct omap_dss_features omap5_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap5_dss_clk_source_names,
-	.dss_params = omap5_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
@@ -696,16 +667,6 @@ int dss_feat_get_num_wbs(void)
 	return omap_current_dss_features->num_wbs;
 }
 
-unsigned long dss_feat_get_param_min(enum dss_range_param param)
-{
-	return omap_current_dss_features->dss_params[param].min;
-}
-
-unsigned long dss_feat_get_param_max(enum dss_range_param param)
-{
-	return omap_current_dss_features->dss_params[param].max;
-}
-
 enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel)
 {
 	return omap_current_dss_features->supported_displays[channel];
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 97aecf9..0b84484 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -70,16 +70,10 @@ enum dss_feat_id {
 	FEAT_DSI_PHY_DCC,
 };
 
-enum dss_range_param {
-	FEAT_PARAM_DSS_FCK,
-};
-
 /* DSS Feature Functions */
 int dss_feat_get_num_mgrs(void);
 int dss_feat_get_num_ovls(void);
 int dss_feat_get_num_wbs(void);
-unsigned long dss_feat_get_param_min(enum dss_range_param param);
-unsigned long dss_feat_get_param_max(enum dss_range_param param);
 enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
 enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel);
 enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features
  2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
@ 2012-11-29 12:01   ` Tomi Valkeinen
  0 siblings, 0 replies; 27+ messages in thread
From: Tomi Valkeinen @ 2012-11-29 12:01 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
> The burst_size and buffer_size being local data to DISPC are moved to
> dispc_features and so removed from struct omap_dss_features. The functions
> referring to burst and buffer size are also removed from dss_features.c as they
> are now accessed locally in dispc.c.
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c        |   21 +++++++++++++++++----
>  drivers/video/omap2/dss/dss_features.c |   29 -----------------------------
>  drivers/video/omap2/dss/dss_features.h |    3 ---
>  3 files changed, 17 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 3d0ff5b..9f259ba 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -104,6 +104,9 @@ struct dispc_features {
>  
>  	/* swap GFX & WB fifos */
>  	bool gfx_fifo_workaround:1;
> +
> +	u32 buffer_size_unit;
> +	u32 burst_size_unit;

Can you add the comments "in bytes" to these. Otherwise this looks good.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
@ 2012-11-29 12:05   ` Tomi Valkeinen
  2012-11-30 10:14     ` Chandrabhanu Mahapatra
  2012-11-29 12:18   ` Tomi Valkeinen
  1 sibling, 1 reply; 27+ messages in thread
From: Tomi Valkeinen @ 2012-11-29 12:05 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 3279 bytes --]

On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
> The register fields in dss_reg_fields specific to DISPC are moved from struct
> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
> dispc_features, thereby enabling local access.
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>  drivers/video/omap2/dss/dss.h          |    4 ++
>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>  drivers/video/omap2/dss/dss_features.h |    7 ---
>  4 files changed, 80 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 9f259ba..21fc522 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>  	unsigned irqs[32];
>  };
>  
> +enum dispc_feat_reg_field {
> +	FEAT_REG_FIRHINC,
> +	FEAT_REG_FIRVINC,
> +	FEAT_REG_FIFOLOWTHRESHOLD,
> +	FEAT_REG_FIFOHIGHTHRESHOLD,
> +	FEAT_REG_FIFOSIZE,
> +	FEAT_REG_HORIZONTALACCU,
> +	FEAT_REG_VERTICALACCU,
> +};
> +
>  struct dispc_features {
>  	u8 sw_start;
>  	u8 fp_start;
> @@ -107,6 +117,8 @@ struct dispc_features {
>  
>  	u32 buffer_size_unit;
>  	u32 burst_size_unit;
> +
> +	struct register_field *reg_fields;
>  };
>  
>  #define DISPC_MAX_NR_FIFOS 5
> @@ -1150,7 +1162,8 @@ static void dispc_init_fifos(void)
>  
>  	unit = dispc.feat->buffer_size_unit;
>  
> -	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
> +	start = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
> +	end = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].end;
>  
>  	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
>  		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
> @@ -1214,8 +1227,10 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>  	low /= unit;
>  	high /= unit;
>  
> -	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
> -	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
> +	hi_start = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].start;
> +	hi_end = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].end;
> +	lo_start = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].start;
> +	lo_end = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].end;

I think these are quite verbose. Perhaps a helper function which does
the same as dss_feat_get_reg_field() would be better. Or alternatively,
maybe something like:

const struct dss_reg_field *hi_field =
&dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD];

and then use "hi_field.start" instead of hi_start.

Or something else that makes the above easier to read.

> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 84a7f6a..aa273d8 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -143,6 +143,10 @@ struct reg_field {
>  	u8 low;
>  };
>  
> +struct register_field {
> +	u8 start, end;
> +};
> +

We already have the dss_reg_field struct. I think it's better to move
that to dss.h, and use it, instead of creating an exact duplicate.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params to dispc_features
  2012-11-28 10:53 ` [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
@ 2012-11-29 12:08   ` Tomi Valkeinen
  0 siblings, 0 replies; 27+ messages in thread
From: Tomi Valkeinen @ 2012-11-29 12:08 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
> The DISPC specific dss_param_range are moved from struct omap_dss_features to
> corresponding DSS version specific dispc_param_range struct, initialized in
> dispc_features thereby enabling local access. The mgr_width_max and
> mgr_height_max, members of dispc_features, are also moved to dispc_param_range.
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c        |   80 +++++++++++++++++++++++---------
>  drivers/video/omap2/dss/dss.h          |    4 ++
>  drivers/video/omap2/dss/dss_features.c |   16 -------
>  drivers/video/omap2/dss/dss_features.h |    3 --
>  4 files changed, 63 insertions(+), 40 deletions(-)

I think the exact same comments, as to the previous patch, apply here.
Instead of creating param_range, use the dss_param_range. And see if

dispc.feat->params[FEAT_PARAM_PCD].min

style lines can be simplified with helper func/pointer.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
  2012-11-29 12:05   ` Tomi Valkeinen
@ 2012-11-29 12:18   ` Tomi Valkeinen
  2012-12-03  6:41     ` Chandrabhanu Mahapatra
  1 sibling, 1 reply; 27+ messages in thread
From: Tomi Valkeinen @ 2012-11-29 12:18 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]

On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
> The register fields in dss_reg_fields specific to DISPC are moved from struct
> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
> dispc_features, thereby enabling local access.
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>  drivers/video/omap2/dss/dss.h          |    4 ++
>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>  drivers/video/omap2/dss/dss_features.h |    7 ---
>  4 files changed, 80 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index 9f259ba..21fc522 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>  	unsigned irqs[32];
>  };
>  
> +enum dispc_feat_reg_field {
> +	FEAT_REG_FIRHINC,
> +	FEAT_REG_FIRVINC,
> +	FEAT_REG_FIFOLOWTHRESHOLD,
> +	FEAT_REG_FIFOHIGHTHRESHOLD,
> +	FEAT_REG_FIFOSIZE,
> +	FEAT_REG_HORIZONTALACCU,
> +	FEAT_REG_VERTICALACCU,
> +};
> +
>  struct dispc_features {
>  	u8 sw_start;
>  	u8 fp_start;
> @@ -107,6 +117,8 @@ struct dispc_features {
>  
>  	u32 buffer_size_unit;
>  	u32 burst_size_unit;
> +
> +	struct register_field *reg_fields;
>  };

Hmm, would it be simpler to have an explicit struct for the reg fields.
I mean something like:

struct dispc_reg_fields {
	struct register_field firhinc;
	struct register_field firvinc;
	struct register_field fifo_low_threshold;
	...
};

Then accessing it would be

dispc.feat->reg_fields.firhinc.start;

instead of

dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;

Not a big difference, but I don't see any benefit in having an array of
reg fields here.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-29 12:05   ` Tomi Valkeinen
@ 2012-11-30 10:14     ` Chandrabhanu Mahapatra
  2012-11-30 10:25       ` Tomi Valkeinen
  0 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-11-30 10:14 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Thursday 29 November 2012 05:35 PM, Tomi Valkeinen wrote:
> On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
>> The register fields in dss_reg_fields specific to DISPC are moved from struct
>> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
>> dispc_features, thereby enabling local access.
>>
>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>> ---
>>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>>  drivers/video/omap2/dss/dss.h          |    4 ++
>>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>>  drivers/video/omap2/dss/dss_features.h |    7 ---
>>  4 files changed, 80 insertions(+), 46 deletions(-)
>>
>> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
>> index 9f259ba..21fc522 100644
>> --- a/drivers/video/omap2/dss/dispc.c
>> +++ b/drivers/video/omap2/dss/dispc.c
>> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>>  	unsigned irqs[32];
>>  };
>>  
>> +enum dispc_feat_reg_field {
>> +	FEAT_REG_FIRHINC,
>> +	FEAT_REG_FIRVINC,
>> +	FEAT_REG_FIFOLOWTHRESHOLD,
>> +	FEAT_REG_FIFOHIGHTHRESHOLD,
>> +	FEAT_REG_FIFOSIZE,
>> +	FEAT_REG_HORIZONTALACCU,
>> +	FEAT_REG_VERTICALACCU,
>> +};
>> +
>>  struct dispc_features {
>>  	u8 sw_start;
>>  	u8 fp_start;
>> @@ -107,6 +117,8 @@ struct dispc_features {
>>  
>>  	u32 buffer_size_unit;
>>  	u32 burst_size_unit;
>> +
>> +	struct register_field *reg_fields;
>>  };
>>  
>>  #define DISPC_MAX_NR_FIFOS 5
>> @@ -1150,7 +1162,8 @@ static void dispc_init_fifos(void)
>>  
>>  	unit = dispc.feat->buffer_size_unit;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
>> +	start = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
>> +	end = dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].end;
>>  
>>  	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
>>  		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
>> @@ -1214,8 +1227,10 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>>  	low /= unit;
>>  	high /= unit;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
>> +	hi_start = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].start;
>> +	hi_end = dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD].end;
>> +	lo_start = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].start;
>> +	lo_end = dispc.feat->reg_fields[FEAT_REG_FIFOLOWTHRESHOLD].end;
> 
> I think these are quite verbose. Perhaps a helper function which does
> the same as dss_feat_get_reg_field() would be better. Or alternatively,
> maybe something like:
> 
> const struct dss_reg_field *hi_field > &dispc.feat->reg_fields[FEAT_REG_FIFOHIGHTHRESHOLD];
> 
> and then use "hi_field.start" instead of hi_start.
> 
> Or something else that makes the above easier to read.

OK.

> 
>> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
>> index 84a7f6a..aa273d8 100644
>> --- a/drivers/video/omap2/dss/dss.h
>> +++ b/drivers/video/omap2/dss/dss.h
>> @@ -143,6 +143,10 @@ struct reg_field {
>>  	u8 low;
>>  };
>>  
>> +struct register_field {
>> +	u8 start, end;
>> +};
>> +
> 
> We already have the dss_reg_field struct. I think it's better to move
> that to dss.h, and use it, instead of creating an exact duplicate.
> 
>  Tomi
> 
> 

register_field appears to be a more generic a name rather than
dss_reg_field. Also I was thinking to initialise

struct dispc_reg_fields {
	struct register_field firhinc;
	struct register_field firvinc;
	struct register_field fifo_low_threshold;
	...
};
 similarly, dss_reg_fields and dsi_reg_fields from register_field.

-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-30 10:14     ` Chandrabhanu Mahapatra
@ 2012-11-30 10:25       ` Tomi Valkeinen
  0 siblings, 0 replies; 27+ messages in thread
From: Tomi Valkeinen @ 2012-11-30 10:25 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

On 2012-11-30 12:02, Chandrabhanu Mahapatra wrote:
> On Thursday 29 November 2012 05:35 PM, Tomi Valkeinen wrote:

>>> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
>>> index 84a7f6a..aa273d8 100644
>>> --- a/drivers/video/omap2/dss/dss.h
>>> +++ b/drivers/video/omap2/dss/dss.h
>>> @@ -143,6 +143,10 @@ struct reg_field {
>>>  	u8 low;
>>>  };
>>>  
>>> +struct register_field {
>>> +	u8 start, end;
>>> +};
>>> +
>>
>> We already have the dss_reg_field struct. I think it's better to move
>> that to dss.h, and use it, instead of creating an exact duplicate.
>>
>>  Tomi
>>
>>
> 
> register_field appears to be a more generic a name rather than
> dss_reg_field. Also I was thinking to initialise

Yes, register_field is a more generic name, and that's one reason I
don't suggest using it. There's a possibility of name clash if some
common linux framework would use a similar name. So dss_reg_field refers
to a register field, used by (omap)dss.

It could also be renamed to omapdss_reg_field, but that's a bit longer.
But perhaps naming it omapdss_reg_field would separate it better from
dss_reg_fields.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-11-29 12:18   ` Tomi Valkeinen
@ 2012-12-03  6:41     ` Chandrabhanu Mahapatra
  2012-12-04  8:16       ` Tomi Valkeinen
  0 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-03  6:41 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Thursday 29 November 2012 05:48 PM, Tomi Valkeinen wrote:
> On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
>> The register fields in dss_reg_fields specific to DISPC are moved from struct
>> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
>> dispc_features, thereby enabling local access.
>>
>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>> ---
>>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>>  drivers/video/omap2/dss/dss.h          |    4 ++
>>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>>  drivers/video/omap2/dss/dss_features.h |    7 ---
>>  4 files changed, 80 insertions(+), 46 deletions(-)
>>
>> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
>> index 9f259ba..21fc522 100644
>> --- a/drivers/video/omap2/dss/dispc.c
>> +++ b/drivers/video/omap2/dss/dispc.c
>> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>>  	unsigned irqs[32];
>>  };
>>  
>> +enum dispc_feat_reg_field {
>> +	FEAT_REG_FIRHINC,
>> +	FEAT_REG_FIRVINC,
>> +	FEAT_REG_FIFOLOWTHRESHOLD,
>> +	FEAT_REG_FIFOHIGHTHRESHOLD,
>> +	FEAT_REG_FIFOSIZE,
>> +	FEAT_REG_HORIZONTALACCU,
>> +	FEAT_REG_VERTICALACCU,
>> +};
>> +
>>  struct dispc_features {
>>  	u8 sw_start;
>>  	u8 fp_start;
>> @@ -107,6 +117,8 @@ struct dispc_features {
>>  
>>  	u32 buffer_size_unit;
>>  	u32 burst_size_unit;
>> +
>> +	struct register_field *reg_fields;
>>  };
> 
> Hmm, would it be simpler to have an explicit struct for the reg fields.
> I mean something like:
> 
> struct dispc_reg_fields {
> 	struct register_field firhinc;
> 	struct register_field firvinc;
> 	struct register_field fifo_low_threshold;
> 	...
> };
> 
> Then accessing it would be
> 
> dispc.feat->reg_fields.firhinc.start;
> 
> instead of
> 
> dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
> 
> Not a big difference, but I don't see any benefit in having an array of
> reg fields here.
> 
>  Tomi
> 
> 

I was thinking to move reg_fields into the dispc_feats structure as

	.burst_size_unit	=	8,
	.reg_fields		=	{
		.firhinc			= { 12,  0 },
		.firvinc			= { 28, 16 },
		.fifo_low_thresh		= { 11,  0 },
		.fifo_high_thresh		= { 27, 16 },
		.fifosize			= { 10,  0 },
		.hori_accu			= {  9,  0 },
		.vert_accu			= { 25, 16 },
	},

This would give us dispc.feat->reg_fields.firhinc.start;
but at the same time would create duplicate information for
omap34xx_rev1_0_dispc_feats and omap34xx_rev3_0_dispc_feats. However,
this duplication never occurs anywhere else in dss.c or dsi.c.

If we still go with the older approach of having dispc_reg_fields
outside dispc_feats the only way  it works is

.reg_fields		=	&omap2_dispc_reg_fields

which changes as dispc.feat->reg_fields->firhinc.start;

but avoids duplicate information. Both approaches seem good enough to me.


-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-12-03  6:41     ` Chandrabhanu Mahapatra
@ 2012-12-04  8:16       ` Tomi Valkeinen
  0 siblings, 0 replies; 27+ messages in thread
From: Tomi Valkeinen @ 2012-12-04  8:16 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 3273 bytes --]

On 2012-12-03 08:29, Chandrabhanu Mahapatra wrote:
> On Thursday 29 November 2012 05:48 PM, Tomi Valkeinen wrote:
>> On 2012-11-28 12:41, Chandrabhanu Mahapatra wrote:
>>> The register fields in dss_reg_fields specific to DISPC are moved from struct
>>> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
>>> dispc_features, thereby enabling local access.
>>>
>>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>>> ---
>>>  drivers/video/omap2/dss/dispc.c        |   87 ++++++++++++++++++++++++++++----
>>>  drivers/video/omap2/dss/dss.h          |    4 ++
>>>  drivers/video/omap2/dss/dss_features.c |   28 ----------
>>>  drivers/video/omap2/dss/dss_features.h |    7 ---
>>>  4 files changed, 80 insertions(+), 46 deletions(-)
>>>
>>> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
>>> index 9f259ba..21fc522 100644
>>> --- a/drivers/video/omap2/dss/dispc.c
>>> +++ b/drivers/video/omap2/dss/dispc.c
>>> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>>>  	unsigned irqs[32];
>>>  };
>>>  
>>> +enum dispc_feat_reg_field {
>>> +	FEAT_REG_FIRHINC,
>>> +	FEAT_REG_FIRVINC,
>>> +	FEAT_REG_FIFOLOWTHRESHOLD,
>>> +	FEAT_REG_FIFOHIGHTHRESHOLD,
>>> +	FEAT_REG_FIFOSIZE,
>>> +	FEAT_REG_HORIZONTALACCU,
>>> +	FEAT_REG_VERTICALACCU,
>>> +};
>>> +
>>>  struct dispc_features {
>>>  	u8 sw_start;
>>>  	u8 fp_start;
>>> @@ -107,6 +117,8 @@ struct dispc_features {
>>>  
>>>  	u32 buffer_size_unit;
>>>  	u32 burst_size_unit;
>>> +
>>> +	struct register_field *reg_fields;
>>>  };
>>
>> Hmm, would it be simpler to have an explicit struct for the reg fields.
>> I mean something like:
>>
>> struct dispc_reg_fields {
>> 	struct register_field firhinc;
>> 	struct register_field firvinc;
>> 	struct register_field fifo_low_threshold;
>> 	...
>> };
>>
>> Then accessing it would be
>>
>> dispc.feat->reg_fields.firhinc.start;
>>
>> instead of
>>
>> dispc.feat->reg_fields[FEAT_REG_FIFOSIZE].start;
>>
>> Not a big difference, but I don't see any benefit in having an array of
>> reg fields here.
>>
>>  Tomi
>>
>>
> 
> I was thinking to move reg_fields into the dispc_feats structure as
> 
> 	.burst_size_unit	=	8,
> 	.reg_fields		=	{
> 		.firhinc			= { 12,  0 },
> 		.firvinc			= { 28, 16 },
> 		.fifo_low_thresh		= { 11,  0 },
> 		.fifo_high_thresh		= { 27, 16 },
> 		.fifosize			= { 10,  0 },
> 		.hori_accu			= {  9,  0 },
> 		.vert_accu			= { 25, 16 },
> 	},
> 
> This would give us dispc.feat->reg_fields.firhinc.start;
> but at the same time would create duplicate information for
> omap34xx_rev1_0_dispc_feats and omap34xx_rev3_0_dispc_feats. However,
> this duplication never occurs anywhere else in dss.c or dsi.c.
> 
> If we still go with the older approach of having dispc_reg_fields
> outside dispc_feats the only way  it works is
> 
> .reg_fields		=	&omap2_dispc_reg_fields
> 
> which changes as dispc.feat->reg_fields->firhinc.start;
> 
> but avoids duplicate information. Both approaches seem good enough to me.

I would keep the pointer approach. We may add support for new DSS
versions, for AM3xxx or AM4xxx SoCs, which possibly may have the same
register fields as some other DSS versions.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features
  2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                   ` (6 preceding siblings ...)
  2012-11-28 10:53 ` [PATCH 7/7] OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK Chandrabhanu Mahapatra
@ 2012-12-05 10:28 ` Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
                     ` (5 more replies)
  7 siblings, 6 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

Hi everyone,
this patch series aims at cleaning up of dss_features.c by moving features to
respective submodule drivers.

The 1st patch
 * moved struct omap_dss_features members burst_size_unit and buffer_size_unit
   to dispc_features
The 2nd patch
 * added definition of struct omapdss_reg_field
 * moved data from dss_reg_fields to dispc_reg_fields
The 3rd patch
 * added definition of struct omapdss_param_range
 * moved data from dss_param_range to dispc_param_ranges
The 4th patch
 * created struct feats and initialized dsi_feats
 * moved data from dss_reg_fields to dsi_reg_fields
 * created dsi_init_features() to initialize dsi_feats
The 5th patch
 * moved data from dss_param_range to dsi_param_range
The 6th patch
 * added members fld_dispc_clk_switch and dss_fck_max to struct dss_features
   and initialized corresponding dss_feats
 * removed definition of dss_reg_field and dss_param_range and their respective
   initializations as omap2_dss_reg_fields, omap3_dss_reg_fields, etc.
 * removed members reg_fields and num_reg_fields from struct omap_dss_features
 * removed enum dss_feat_reg_field and dss_range_param and corresponding
   initializations omap2_dss_param_range, omap3_dss_param_range etc.
 * removed function dss_feat_get_reg_field(), dss_feat_get_param_min() and
   dss_feat_get_param_max()

Changes from V1
 * 1st patch: added comments "in bytes" for new members burst_size_unit and
		buffer_size_unit
 * 2nd patch: renamed register_field to omapdss_reg_field
	      removed definition of enum dispc_feat_reg_field
	      created and initialized struct dispc_reg_fields
 * 3rd patch: renamed struct param_range to omapdss_param_range
	      removed definition of enum dispc_range_param
	      created and initialized struct dispc_param_ranges
 * 4th patch: removed enum dsi_feat_reg_field
	      created and initialized struct dsi_reg_fields
 * 5th patch: removed enum dsi_range_param
	      created and initialized struct dsi_param_ranges
	      added member dss_fck corresponding to FEAT_PARAM_DSS_FCK
 * 6th patch: removed struct dss_param_range and enum dss_range_param
	      removed functions dss_feat_get_param_min() and
			dss_feat_get_param_max()
 * 7th patch has been removed

All your comments and suggestions are welcome.

I have based my patches on git://gitorious.org/linux-omap-dss2/linux.git master

Reference Tree:
git://gitorious.org/linux-omap-dss2/chandrabhanus-linux.git dss_cleanup

Regards,
Chandrabhanu

Chandrabhanu Mahapatra (6):
  OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features
  OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  OMAPDSS: DISPC: Move DISPC specific dss_params to dispc_features
  OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  OMAPDSS: DSI: Move DSI specific dss_params to dsi_feats
  OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max

 drivers/video/omap2/dss/dispc.c        |  218 +++++++++++++++++++++++---------
 drivers/video/omap2/dss/dsi.c          |  206 ++++++++++++++++++++++++++----
 drivers/video/omap2/dss/dss.c          |   22 +++-
 drivers/video/omap2/dss/dss.h          |    8 ++
 drivers/video/omap2/dss/dss_features.c |  212 -------------------------------
 drivers/video/omap2/dss/dss_features.h |   36 ------
 6 files changed, 368 insertions(+), 334 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The burst_size and buffer_size being local data to DISPC are moved to
dispc_features and so removed from struct omap_dss_features. The functions
referring to burst and buffer size are also removed from dss_features.c as they
are now accessed locally in dispc.c.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |   21 +++++++++++++++++----
 drivers/video/omap2/dss/dss_features.c |   29 -----------------------------
 drivers/video/omap2/dss/dss_features.h |    3 ---
 3 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ce594a1..bbba83f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -107,6 +107,9 @@ struct dispc_features {
 
 	/* no DISPC_IRQ_FRAMEDONETV on this SoC */
 	bool no_framedone_tv:1;
+
+	u32 buffer_size_unit; /* in bytes */
+	u32 burst_size_unit; /* in bytes */
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -1050,7 +1053,7 @@ static void dispc_configure_burst_sizes(void)
 
 static u32 dispc_ovl_get_burst_size(enum omap_plane plane)
 {
-	unsigned unit = dss_feat_get_burst_size_unit();
+	unsigned unit = dispc.feat->burst_size_unit;
 	/* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */
 	return unit * 8;
 }
@@ -1139,7 +1142,7 @@ static void dispc_init_fifos(void)
 	u8 start, end;
 	u32 unit;
 
-	unit = dss_feat_get_buffer_size_unit();
+	unit = dispc.feat->buffer_size_unit;
 
 	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
 
@@ -1197,7 +1200,7 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
 	u8 hi_start, hi_end, lo_start, lo_end;
 	u32 unit;
 
-	unit = dss_feat_get_buffer_size_unit();
+	unit = dispc.feat->buffer_size_unit;
 
 	WARN_ON(low % unit != 0);
 	WARN_ON(high % unit != 0);
@@ -1241,7 +1244,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
 	 * buffer_units, and the fifo thresholds must be buffer_unit aligned.
 	 */
 
-	unsigned buf_unit = dss_feat_get_buffer_size_unit();
+	unsigned buf_unit = dispc.feat->buffer_size_unit;
 	unsigned ovl_fifo_size, total_fifo_size, burst_size;
 	int i;
 
@@ -4060,6 +4063,8 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_24xx,
 	.num_fifos		=	3,
 	.no_framedone_tv	=	true,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4077,6 +4082,8 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
 	.no_framedone_tv	=	true,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4094,6 +4101,8 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
 	.no_framedone_tv	=	true,
+	.buffer_size_unit	=	1,
+	.burst_size_unit	=	8,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4111,6 +4120,8 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
 	.gfx_fifo_workaround	=	true,
+	.buffer_size_unit	=	16,
+	.burst_size_unit	=	16,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4128,6 +4139,8 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
 	.gfx_fifo_workaround	=	true,
+	.buffer_size_unit	=	16,
+	.burst_size_unit	=	16,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 1d125c6..092e21b 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -54,9 +54,6 @@ struct omap_dss_features {
 	const struct dss_param_range *dss_params;
 
 	const enum omap_dss_rotation_type supported_rotation_types;
-
-	const u32 buffer_size_unit;
-	const u32 burst_size_unit;
 };
 
 /* This struct is assigned to one of the below during initialization */
@@ -632,8 +629,6 @@ static const struct omap_dss_features omap2_dss_features = {
 	.clksrc_names = omap2_dss_clk_source_names,
 	.dss_params = omap2_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /* OMAP3 DSS Features */
@@ -653,8 +648,6 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /*
@@ -677,8 +670,6 @@ static const struct omap_dss_features am35xx_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 static const struct omap_dss_features omap3630_dss_features = {
@@ -697,8 +688,6 @@ static const struct omap_dss_features omap3630_dss_features = {
 	.clksrc_names = omap3_dss_clk_source_names,
 	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
-	.buffer_size_unit = 1,
-	.burst_size_unit = 8,
 };
 
 /* OMAP4 DSS Features */
@@ -720,8 +709,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features  = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */
@@ -742,8 +729,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* For all the other OMAP4 versions */
@@ -764,8 +749,6 @@ static const struct omap_dss_features omap4_dss_features = {
 	.clksrc_names = omap4_dss_clk_source_names,
 	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 /* OMAP5 DSS Features */
@@ -785,8 +768,6 @@ static const struct omap_dss_features omap5_dss_features = {
 	.clksrc_names = omap5_dss_clk_source_names,
 	.dss_params = omap5_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
-	.buffer_size_unit = 16,
-	.burst_size_unit = 16,
 };
 
 #if defined(CONFIG_OMAP4_DSS_HDMI)
@@ -892,16 +873,6 @@ const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id)
 	return omap_current_dss_features->clksrc_names[id];
 }
 
-u32 dss_feat_get_buffer_size_unit(void)
-{
-	return omap_current_dss_features->buffer_size_unit;
-}
-
-u32 dss_feat_get_burst_size_unit(void)
-{
-	return omap_current_dss_features->burst_size_unit;
-}
-
 /* DSS has_feature check */
 bool dss_has_feature(enum dss_feat_id id)
 {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 385b0af..16658e1 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -114,9 +114,6 @@ bool dss_feat_color_mode_supported(enum omap_plane plane,
 		enum omap_color_mode color_mode);
 const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id);
 
-u32 dss_feat_get_buffer_size_unit(void);	/* in bytes */
-u32 dss_feat_get_burst_size_unit(void);		/* in bytes */
-
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
 
 bool dss_has_feature(enum dss_feat_id id);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  2012-12-17 12:37     ` Tomi Valkeinen
  2012-12-05 10:28   ` [PATCH V2 3/6] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The register fields in dss_reg_fields specific to DISPC are moved from struct
omap_dss_features to corresponding dispc_reg_fields, initialized in struct
dispc_features, thereby enabling local access.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |  114 ++++++++++++++++++++++++--------
 drivers/video/omap2/dss/dss.h          |    4 ++
 drivers/video/omap2/dss/dss_features.c |   28 --------
 drivers/video/omap2/dss/dss_features.h |    7 --
 4 files changed, 89 insertions(+), 64 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index bbba83f..ee4b152 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -80,6 +80,16 @@ struct dispc_irq_stats {
 	unsigned irqs[32];
 };
 
+struct dispc_reg_fields {
+	struct omapdss_reg_field firhinc;
+	struct omapdss_reg_field firvinc;
+	struct omapdss_reg_field fifo_low_thresh;
+	struct omapdss_reg_field fifo_high_thresh;
+	struct omapdss_reg_field fifosize;
+	struct omapdss_reg_field hori_accu;
+	struct omapdss_reg_field vert_accu;
+};
+
 struct dispc_features {
 	u8 sw_start;
 	u8 fp_start;
@@ -110,6 +120,8 @@ struct dispc_features {
 
 	u32 buffer_size_unit; /* in bytes */
 	u32 burst_size_unit; /* in bytes */
+
+	struct dispc_reg_fields *reg_fields;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -1137,17 +1149,17 @@ static void dispc_mgr_set_size(enum omap_channel channel, u16 width,
 
 static void dispc_init_fifos(void)
 {
-	u32 size;
+	u32 size, unit;
 	int fifo;
-	u8 start, end;
-	u32 unit;
+	const struct omapdss_reg_field *fifo_field;
 
 	unit = dispc.feat->buffer_size_unit;
 
-	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
+	fifo_field = &dispc.feat->reg_fields->fifosize;
 
 	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
-		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
+		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo),
+					fifo_field->start, fifo_field->end);
 		size *= unit;
 		dispc.fifo_size[fifo] = size;
 
@@ -1197,8 +1209,8 @@ static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
 
 void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
 {
-	u8 hi_start, hi_end, lo_start, lo_end;
 	u32 unit;
+	const struct omapdss_reg_field *hi_field, *lo_field;
 
 	unit = dispc.feat->buffer_size_unit;
 
@@ -1208,20 +1220,20 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
 	low /= unit;
 	high /= unit;
 
-	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
-	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
+	hi_field = &dispc.feat->reg_fields->fifo_high_thresh;
+	lo_field = &dispc.feat->reg_fields->fifo_low_thresh;
 
 	DSSDBG("fifo(%d) threshold (bytes), old %u/%u, new %u/%u\n",
 			plane,
 			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
-				lo_start, lo_end) * unit,
+				lo_field->start, lo_field->end) * unit,
 			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
-				hi_start, hi_end) * unit,
+				hi_field->start, hi_field->end) * unit,
 			low * unit, high * unit);
 
 	dispc_write_reg(DISPC_OVL_FIFO_THRESHOLD(plane),
-			FLD_VAL(high, hi_start, hi_end) |
-			FLD_VAL(low, lo_start, lo_end));
+			FLD_VAL(high, hi_field->start, hi_field->end) |
+			FLD_VAL(low, lo_field->start, lo_field->end));
 }
 
 void dispc_enable_fifomerge(bool enable)
@@ -1289,14 +1301,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
 	u32 val;
 
 	if (color_comp = DISPC_COLOR_COMPONENT_RGB_Y) {
-		u8 hinc_start, hinc_end, vinc_start, vinc_end;
+		const struct omapdss_reg_field *hinc_field, *vinc_field;
 
-		dss_feat_get_reg_field(FEAT_REG_FIRHINC,
-					&hinc_start, &hinc_end);
-		dss_feat_get_reg_field(FEAT_REG_FIRVINC,
-					&vinc_start, &vinc_end);
-		val = FLD_VAL(vinc, vinc_start, vinc_end) |
-				FLD_VAL(hinc, hinc_start, hinc_end);
+		hinc_field = &dispc.feat->reg_fields->firhinc;
+		vinc_field = &dispc.feat->reg_fields->firvinc;
+
+		val = FLD_VAL(vinc, vinc_field->start, vinc_field->end) |
+			FLD_VAL(hinc, hinc_field->start, hinc_field->end);
 
 		dispc_write_reg(DISPC_OVL_FIR(plane), val);
 	} else {
@@ -1308,13 +1319,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
 static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
 {
 	u32 val;
-	u8 hor_start, hor_end, vert_start, vert_end;
+	const struct omapdss_reg_field *haccu_field, *vaccu_field;
 
-	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
-	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
+	haccu_field = &dispc.feat->reg_fields->hori_accu;
+	vaccu_field = &dispc.feat->reg_fields->vert_accu;
 
-	val = FLD_VAL(vaccu, vert_start, vert_end) |
-			FLD_VAL(haccu, hor_start, hor_end);
+	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
+		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
 
 	dispc_write_reg(DISPC_OVL_ACCU0(plane), val);
 }
@@ -1322,13 +1333,13 @@ static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
 static void dispc_ovl_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
 {
 	u32 val;
-	u8 hor_start, hor_end, vert_start, vert_end;
+	const struct omapdss_reg_field *haccu_field, *vaccu_field;
 
-	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
-	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
+	haccu_field = &dispc.feat->reg_fields->hori_accu;
+	vaccu_field = &dispc.feat->reg_fields->vert_accu;
 
-	val = FLD_VAL(vaccu, vert_start, vert_end) |
-			FLD_VAL(haccu, hor_start, hor_end);
+	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
+		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
 
 	dispc_write_reg(DISPC_OVL_ACCU1(plane), val);
 }
@@ -4048,6 +4059,46 @@ static void _omap_dispc_initial_config(void)
 	dispc_ovl_enable_zorder_planes();
 }
 
+static struct dispc_reg_fields omap2_dispc_reg_fields = {
+	.firhinc		=	{ 11,  0 },
+	.firvinc		=	{ 27, 16 },
+	.fifo_low_thresh	=	{  8,  0 },
+	.fifo_high_thresh	=	{ 24, 16 },
+	.fifosize		=	{  8,  0 },
+	.hori_accu		=	{  9,  0 },
+	.vert_accu		=	{ 25, 16 },
+};
+
+static struct dispc_reg_fields omap3_dispc_reg_fields = {
+	.firhinc		=	{ 12,  0 },
+	.firvinc		=	{ 28, 16 },
+	.fifo_low_thresh	=	{ 11,  0 },
+	.fifo_high_thresh	=	{ 27, 16 },
+	.fifosize		=	{ 10,  0 },
+	.hori_accu		=	{  9,  0 },
+	.vert_accu		=	{ 25, 16 },
+};
+
+static struct dispc_reg_fields omap4_dispc_reg_fields = {
+	.firhinc		=	{ 12,  0 },
+	.firvinc		=	{ 28, 16 },
+	.fifo_low_thresh	=	{ 15,  0 },
+	.fifo_high_thresh	=	{ 31, 16 },
+	.fifosize		=	{ 15,  0 },
+	.hori_accu		=	{ 10,  0 },
+	.vert_accu		=	{ 26, 16 },
+};
+
+static struct dispc_reg_fields omap5_dispc_reg_fields = {
+	.firhinc		=	{ 12,  0 },
+	.firvinc		=	{ 28, 16 },
+	.fifo_low_thresh	=	{ 15,  0 },
+	.fifo_high_thresh	=	{ 31, 16 },
+	.fifosize		=	{ 15,  0 },
+	.hori_accu		=	{ 10,  0 },
+	.vert_accu		=	{ 26, 16 },
+};
+
 static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.sw_start		=	5,
 	.fp_start		=	15,
@@ -4065,6 +4116,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.no_framedone_tv	=	true,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	&omap2_dispc_reg_fields,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4084,6 +4136,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.no_framedone_tv	=	true,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	&omap3_dispc_reg_fields,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4103,6 +4156,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.no_framedone_tv	=	true,
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
+	.reg_fields		=	&omap3_dispc_reg_fields,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4122,6 +4176,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.gfx_fifo_workaround	=	true,
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
+	.reg_fields		=	&omap4_dispc_reg_fields,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4141,6 +4196,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.gfx_fifo_workaround	=	true,
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
+	.reg_fields		=	&omap5_dispc_reg_fields,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9ee3c88..18842e2 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -143,6 +143,10 @@ struct reg_field {
 	u8 low;
 };
 
+struct omapdss_reg_field {
+	u8 start, end;
+};
+
 struct dss_lcd_mgr_config {
 	enum dss_io_pad_mode io_pad_mode;
 
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 092e21b..defdfc0 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -60,13 +60,6 @@ struct omap_dss_features {
 static const struct omap_dss_features *omap_current_dss_features;
 
 static const struct dss_reg_field omap2_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 11, 0 },
-	[FEAT_REG_FIRVINC]			= { 27, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 8, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 24, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 8, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGN]			= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGM]			= { 0, 0 },
@@ -75,13 +68,6 @@ static const struct dss_reg_field omap2_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap3_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 11, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 27, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 10, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 9, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 25, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
 	[FEAT_REG_DSIPLL_REGN]			= { 7, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 18, 8 },
@@ -90,13 +76,6 @@ static const struct dss_reg_field omap3_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap4_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
 	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
@@ -105,13 +84,6 @@ static const struct dss_reg_field omap4_dss_reg_fields[] = {
 };
 
 static const struct dss_reg_field omap5_dss_reg_fields[] = {
-	[FEAT_REG_FIRHINC]			= { 12, 0 },
-	[FEAT_REG_FIRVINC]			= { 28, 16 },
-	[FEAT_REG_FIFOLOWTHRESHOLD]		= { 15, 0 },
-	[FEAT_REG_FIFOHIGHTHRESHOLD]		= { 31, 16 },
-	[FEAT_REG_FIFOSIZE]			= { 15, 0 },
-	[FEAT_REG_HORIZONTALACCU]		= { 10, 0 },
-	[FEAT_REG_VERTICALACCU]			= { 26, 16 },
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
 	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
 	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 16658e1..42a1bd1 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -72,13 +72,6 @@ enum dss_feat_id {
 
 /* DSS register field id */
 enum dss_feat_reg_field {
-	FEAT_REG_FIRHINC,
-	FEAT_REG_FIRVINC,
-	FEAT_REG_FIFOHIGHTHRESHOLD,
-	FEAT_REG_FIFOLOWTHRESHOLD,
-	FEAT_REG_FIFOSIZE,
-	FEAT_REG_HORIZONTALACCU,
-	FEAT_REG_VERTICALACCU,
 	FEAT_REG_DISPC_CLK_SWITCH,
 	FEAT_REG_DSIPLL_REGN,
 	FEAT_REG_DSIPLL_REGM,
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH V2 3/6] OMAPDSS: DISPC: Move DISPC specific dss_params to dispc_features
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DISPC specific dss_param_range are moved from struct omap_dss_features to
corresponding DSS version specific dispc_param_range struct, initialized in
dispc_features thereby enabling local access. The mgr_width_max and
mgr_height_max, members of dispc_features, are also moved to dispc_param_range.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dispc.c        |   83 +++++++++++++++++++++++---------
 drivers/video/omap2/dss/dss.h          |    4 ++
 drivers/video/omap2/dss/dss_features.c |   16 ------
 drivers/video/omap2/dss/dss_features.h |    3 --
 4 files changed, 63 insertions(+), 43 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ee4b152..6a449a5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -90,6 +90,14 @@ struct dispc_reg_fields {
 	struct omapdss_reg_field vert_accu;
 };
 
+struct dispc_param_ranges {
+	struct omapdss_param_range pcd;
+	struct omapdss_param_range downscale;
+	struct omapdss_param_range linewidth;
+	struct omapdss_param_range mgr_width;
+	struct omapdss_param_range mgr_height;
+};
+
 struct dispc_features {
 	u8 sw_start;
 	u8 fp_start;
@@ -99,8 +107,6 @@ struct dispc_features {
 	u16 hp_max;
 	u8 mgr_width_start;
 	u8 mgr_height_start;
-	u16 mgr_width_max;
-	u16 mgr_height_max;
 	int (*calc_scaling) (unsigned long pclk, unsigned long lclk,
 		const struct omap_video_timings *mgr_timings,
 		u16 width, u16 height, u16 out_width, u16 out_height,
@@ -122,6 +128,7 @@ struct dispc_features {
 	u32 burst_size_unit; /* in bytes */
 
 	struct dispc_reg_fields *reg_fields;
+	struct dispc_param_ranges *params;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -2159,8 +2166,7 @@ static int dispc_ovl_calc_scaling_24xx(unsigned long pclk, unsigned long lclk,
 	int error;
 	u16 in_width, in_height;
 	int min_factor = min(*decim_x, *decim_y);
-	const int maxsinglelinewidth -			dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+	const int maxsinglelinewidth = dispc.feat->params->linewidth.max;
 
 	*five_taps = false;
 
@@ -2200,8 +2206,7 @@ static int dispc_ovl_calc_scaling_34xx(unsigned long pclk, unsigned long lclk,
 	int error;
 	u16 in_width, in_height;
 	int min_factor = min(*decim_x, *decim_y);
-	const int maxsinglelinewidth -			dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
+	const int maxsinglelinewidth = dispc.feat->params->linewidth.max;
 
 	do {
 		in_height = DIV_ROUND_UP(height, *decim_y);
@@ -2266,9 +2271,8 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
 	u16 in_width, in_width_max;
 	int decim_x_min = *decim_x;
 	u16 in_height = DIV_ROUND_UP(height, *decim_y);
-	const int maxsinglelinewidth -				dss_feat_get_param_max(FEAT_PARAM_LINEWIDTH);
-	const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+	const int maxsinglelinewidth = dispc.feat->params->linewidth.max;
+	const int maxdownscale = dispc.feat->params->downscale.max;
 
 	if (mem_to_mem) {
 		in_width_max = out_width * maxdownscale;
@@ -2306,7 +2310,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk,
 		int *x_predecim, int *y_predecim, u16 pos_x,
 		enum omap_dss_rotation_type rotation_type, bool mem_to_mem)
 {
-	const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE);
+	const int maxdownscale = dispc.feat->params->downscale.max;
 	const int max_decim_limit = 16;
 	unsigned long core_clk = 0;
 	int decim_x, decim_y, ret;
@@ -2974,8 +2978,8 @@ void dispc_mgr_set_lcd_config(enum omap_channel channel,
 
 static bool _dispc_mgr_size_ok(u16 width, u16 height)
 {
-	return width <= dispc.feat->mgr_width_max &&
-		height <= dispc.feat->mgr_height_max;
+	return width <= dispc.feat->params->mgr_width.max &&
+		height <= dispc.feat->params->mgr_height.max;
 }
 
 static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
@@ -3547,8 +3551,8 @@ void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
 	u16 best_ld, cur_ld;
 	u16 best_pd, cur_pd;
 
-	pcd_min = dss_feat_get_param_min(FEAT_PARAM_DSS_PCD);
-	pcd_max = dss_feat_get_param_max(FEAT_PARAM_DSS_PCD);
+	pcd_min = dispc.feat->params->pcd.min;
+	pcd_max = dispc.feat->params->pcd.max;
 
 	best_pck = 0;
 	best_ld = 0;
@@ -4099,6 +4103,42 @@ static struct dispc_reg_fields omap5_dispc_reg_fields = {
 	.vert_accu		=	{ 26, 16 },
 };
 
+static struct dispc_param_ranges omap2_dispc_param_ranges = {
+	.pcd			=	{ 2,  255 },
+	.downscale		=	{ 1,    2 },
+	/*
+	 * Assuming the line width buffer to be 768 pixels as OMAP2 DISPC
+	 * scaler cannot scale a image with width more than 768.
+	 */
+	.linewidth		=	{ 1,  768 },
+	.mgr_width		=	{ 1, 2048 },
+	.mgr_height		=	{ 1, 2048 },
+};
+
+static struct dispc_param_ranges omap3_dispc_param_ranges = {
+	.pcd			=	{ 1,  255 },
+	.downscale		=	{ 1,    4 },
+	.linewidth		=	{ 1, 1024 },
+	.mgr_width		=	{ 1, 2048 },
+	.mgr_height		=	{ 1, 2048 },
+};
+
+static struct dispc_param_ranges omap4_dispc_param_ranges = {
+	.pcd			=	{ 1,  255 },
+	.downscale		=	{ 1,    4 },
+	.linewidth		=	{ 1, 2048 },
+	.mgr_width		=	{ 1, 2048 },
+	.mgr_height		=	{ 1, 2048 },
+};
+
+static struct dispc_param_ranges omap5_dispc_param_ranges = {
+	.pcd			=	{ 1,  255 },
+	.downscale		=	{ 1,    4 },
+	.linewidth		=	{ 1, 2048 },
+	.mgr_width		=	{ 1, 2048 },
+	.mgr_height		=	{ 1, 2048 },
+};
+
 static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.sw_start		=	5,
 	.fp_start		=	15,
@@ -4108,8 +4148,6 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.hp_max			=	256,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_24xx,
 	.calc_core_clk		=	calc_core_clk_24xx,
 	.num_fifos		=	3,
@@ -4117,6 +4155,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	&omap2_dispc_reg_fields,
+	.params			=	&omap2_dispc_param_ranges,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
@@ -4128,8 +4167,6 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.hp_max			=	256,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
@@ -4137,6 +4174,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	&omap3_dispc_reg_fields,
+	.params			=	&omap3_dispc_param_ranges,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
@@ -4148,8 +4186,6 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_34xx,
 	.calc_core_clk		=	calc_core_clk_34xx,
 	.num_fifos		=	3,
@@ -4157,6 +4193,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
 	.buffer_size_unit	=	1,
 	.burst_size_unit	=	8,
 	.reg_fields		=	&omap3_dispc_reg_fields,
+	.params			=	&omap3_dispc_param_ranges,
 };
 
 static const struct dispc_features omap44xx_dispc_feats __initconst = {
@@ -4168,8 +4205,6 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	10,
 	.mgr_height_start	=	26,
-	.mgr_width_max		=	2048,
-	.mgr_height_max		=	2048,
 	.calc_scaling		=	dispc_ovl_calc_scaling_44xx,
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
@@ -4177,6 +4212,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
 	.reg_fields		=	&omap4_dispc_reg_fields,
+	.params			=	&omap4_dispc_param_ranges,
 };
 
 static const struct dispc_features omap54xx_dispc_feats __initconst = {
@@ -4188,8 +4224,6 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.hp_max			=	4096,
 	.mgr_width_start	=	11,
 	.mgr_height_start	=	27,
-	.mgr_width_max		=	4096,
-	.mgr_height_max		=	4096,
 	.calc_scaling		=	dispc_ovl_calc_scaling_44xx,
 	.calc_core_clk		=	calc_core_clk_44xx,
 	.num_fifos		=	5,
@@ -4197,6 +4231,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
 	.buffer_size_unit	=	16,
 	.burst_size_unit	=	16,
 	.reg_fields		=	&omap5_dispc_reg_fields,
+	.params			=	&omap5_dispc_param_ranges,
 };
 
 static int __init dispc_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 18842e2..0b68001 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -147,6 +147,10 @@ struct omapdss_reg_field {
 	u8 start, end;
 };
 
+struct omapdss_param_range {
+	int min, max;
+};
+
 struct dss_lcd_mgr_config {
 	enum dss_io_pad_mode io_pad_mode;
 
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index defdfc0..3a9d1df 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -385,24 +385,16 @@ static const char * const omap5_dss_clk_source_names[] = {
 
 static const struct dss_param_range omap2_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 2, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_FINT]		= { 0, 0 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, 0 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 2 },
-	/*
-	 * Assuming the line width buffer to be 768 pixels as OMAP2 DISPC
-	 * scaler cannot scale a image with width more than 768.
-	 */
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 768 },
 };
 
 static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
@@ -410,13 +402,10 @@ static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 750000, 2100000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 1, (1 << 13) - 1},
 	[FEAT_PARAM_DSI_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 1024 },
 };
 
 static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
@@ -424,13 +413,10 @@ static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
 	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
 };
 
 static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-	[FEAT_PARAM_DSS_PCD]			= { 1, 255 },
 	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
 	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
@@ -438,8 +424,6 @@ static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
 	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
 	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
-	[FEAT_PARAM_DOWNSCALE]			= { 1, 4 },
-	[FEAT_PARAM_LINEWIDTH]			= { 1, 2048 },
 };
 
 static const enum dss_feat_id omap2_dss_feat_list[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 42a1bd1..40b98ff 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -81,7 +81,6 @@ enum dss_feat_reg_field {
 
 enum dss_range_param {
 	FEAT_PARAM_DSS_FCK,
-	FEAT_PARAM_DSS_PCD,
 	FEAT_PARAM_DSIPLL_REGN,
 	FEAT_PARAM_DSIPLL_REGM,
 	FEAT_PARAM_DSIPLL_REGM_DISPC,
@@ -89,8 +88,6 @@ enum dss_range_param {
 	FEAT_PARAM_DSIPLL_FINT,
 	FEAT_PARAM_DSIPLL_LPDIV,
 	FEAT_PARAM_DSI_FCK,
-	FEAT_PARAM_DOWNSCALE,
-	FEAT_PARAM_LINEWIDTH,
 };
 
 /* DSS Feature Functions */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                     ` (2 preceding siblings ...)
  2012-12-05 10:28   ` [PATCH V2 3/6] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  2012-12-17 12:23     ` Tomi Valkeinen
  2012-12-05 10:28   ` [PATCH V2 5/6] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 6/6] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
  5 siblings, 1 reply; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DSI specific dss_reg_fields are moved to corresponding dsi_reg_fields
initialized in dsi_feats. The dsi_feats structure is initialized as per
corresponding DSS version in dsi_init_features().

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dsi.c          |  126 +++++++++++++++++++++++++++++---
 drivers/video/omap2/dss/dss_features.c |   16 ----
 drivers/video/omap2/dss/dss_features.h |    4 -
 3 files changed, 114 insertions(+), 32 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index cf32dc7..472cdb4 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -344,6 +344,19 @@ struct dsi_packet_sent_handler_data {
 	struct completion *completion;
 };
 
+struct dsi_reg_fields {
+	struct omapdss_reg_field regn;
+	struct omapdss_reg_field regm;
+	struct omapdss_reg_field regm_dispc;
+	struct omapdss_reg_field regm_dsi;
+};
+
+struct feats {
+	const struct dsi_reg_fields *reg_fields;
+};
+
+static const struct feats *dsi_feat;
+
 #ifdef DEBUG
 static bool dsi_perf;
 module_param(dsi_perf, bool, 0644);
@@ -1602,8 +1615,8 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev,
 	int r = 0;
 	u32 l;
 	int f = 0;
-	u8 regn_start, regn_end, regm_start, regm_end;
-	u8 regm_dispc_start, regm_dispc_end, regm_dsi_start, regm_dsi_end;
+	const struct omapdss_reg_field *regn_field, *regm_field;
+	const struct omapdss_reg_field *regm_dispc_field, *regm_dsi_field;
 
 	DSSDBG("DSI PLL clock config starts");
 
@@ -1645,12 +1658,10 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev,
 		dss_feat_get_clk_source_name(OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI),
 		cinfo->dsi_pll_hsdiv_dsi_clk);
 
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGN, &regn_start, &regn_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM, &regm_start, &regm_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM_DISPC, &regm_dispc_start,
-			&regm_dispc_end);
-	dss_feat_get_reg_field(FEAT_REG_DSIPLL_REGM_DSI, &regm_dsi_start,
-			&regm_dsi_end);
+	regn_field = &dsi_feat->reg_fields->regn;
+	regm_field = &dsi_feat->reg_fields->regm;
+	regm_dispc_field = &dsi_feat->reg_fields->regm_dispc;
+	regm_dsi_field = &dsi_feat->reg_fields->regm_dsi;
 
 	/* DSI_PLL_AUTOMODE = manual */
 	REG_FLD_MOD(dsidev, DSI_PLL_CONTROL, 0, 0, 0);
@@ -1658,15 +1669,15 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev,
 	l = dsi_read_reg(dsidev, DSI_PLL_CONFIGURATION1);
 	l = FLD_MOD(l, 1, 0, 0);		/* DSI_PLL_STOPMODE */
 	/* DSI_PLL_REGN */
-	l = FLD_MOD(l, cinfo->regn - 1, regn_start, regn_end);
+	l = FLD_MOD(l, cinfo->regn - 1, regn_field->start, regn_field->end);
 	/* DSI_PLL_REGM */
-	l = FLD_MOD(l, cinfo->regm, regm_start, regm_end);
+	l = FLD_MOD(l, cinfo->regm, regm_field->start, regm_field->end);
 	/* DSI_CLOCK_DIV */
 	l = FLD_MOD(l, cinfo->regm_dispc > 0 ? cinfo->regm_dispc - 1 : 0,
-			regm_dispc_start, regm_dispc_end);
+			regm_dispc_field->start, regm_dispc_field->end);
 	/* DSIPROTO_CLOCK_DIV */
 	l = FLD_MOD(l, cinfo->regm_dsi > 0 ? cinfo->regm_dsi - 1 : 0,
-			regm_dsi_start, regm_dsi_end);
+			regm_dsi_field->start, regm_dsi_field->end);
 	dsi_write_reg(dsidev, DSI_PLL_CONFIGURATION1, l);
 
 	BUG_ON(cinfo->fint < dsi->fint_min || cinfo->fint > dsi->fint_max);
@@ -5198,6 +5209,93 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev)
 	dss_unregister_output(out);
 }
 
+static struct dsi_reg_fields omap2_dsi_reg_fields = {
+	.regn			=	{ 0, 0 },
+	.regm			=	{ 0, 0 },
+	.regm_dispc		=	{ 0, 0 },
+	.regm_dsi		=	{ 0, 0 },
+};
+
+static struct dsi_reg_fields omap3_dsi_reg_fields = {
+	.regn			=	{  7,  1 },
+	.regm			=	{ 18,  8 },
+	.regm_dispc		=	{ 22, 19 },
+	.regm_dsi		=	{ 26, 23 },
+};
+
+static struct dsi_reg_fields omap4_dsi_reg_fields = {
+	.regn			=	{  8,  1 },
+	.regm			=	{ 20,  9 },
+	.regm_dispc		=	{ 25, 21 },
+	.regm_dsi		=	{ 30, 26 },
+};
+
+static struct dsi_reg_fields omap5_dsi_reg_fields = {
+	.regn			=	{  8,  1 },
+	.regm			=	{ 20,  9 },
+	.regm_dispc		=	{ 25, 21 },
+	.regm_dsi		=	{ 30, 26 },
+};
+
+static const struct feats omap24xx_dsi_feats __initconst = {
+	.reg_fields		=	&omap2_dsi_reg_fields,
+};
+
+static const struct feats omap34xx_dsi_feats __initconst = {
+	.reg_fields		=	&omap3_dsi_reg_fields,
+};
+
+static const struct feats omap44xx_dsi_feats __initconst = {
+	.reg_fields		=	&omap4_dsi_reg_fields,
+};
+
+static const struct feats omap54xx_dsi_feats __initconst = {
+	.reg_fields		=	&omap5_dsi_reg_fields,
+};
+
+static int __init dsi_init_features(struct platform_device *dsidev)
+{
+	const struct feats *src;
+	struct feats *dst;
+
+	dst = devm_kzalloc(&dsidev->dev, sizeof(*dst), GFP_KERNEL);
+	if (!dst) {
+		dev_err(&dsidev->dev, "Failed to allocate DISPC Features\n");
+		return -ENOMEM;
+	}
+
+	switch (omapdss_get_version()) {
+	case OMAPDSS_VER_OMAP24xx:
+		src = &omap24xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP34xx_ES1:
+	case OMAPDSS_VER_OMAP34xx_ES3:
+	case OMAPDSS_VER_OMAP3630:
+	case OMAPDSS_VER_AM35xx:
+		src = &omap34xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP4430_ES1:
+	case OMAPDSS_VER_OMAP4430_ES2:
+	case OMAPDSS_VER_OMAP4:
+		src = &omap44xx_dsi_feats;
+		break;
+
+	case OMAPDSS_VER_OMAP5:
+		src = &omap54xx_dsi_feats;
+		break;
+
+	default:
+		return -ENODEV;
+	}
+
+	memcpy(dst, src, sizeof(*dst));
+	dsi_feat = dst;
+
+	return 0;
+}
+
 /* DSI1 HW IP initialisation */
 static int __init omap_dsihw_probe(struct platform_device *dsidev)
 {
@@ -5206,6 +5304,10 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
 	struct resource *dsi_mem;
 	struct dsi_data *dsi;
 
+	r = dsi_init_features(dsidev);
+	if (r)
+		return r;
+
 	dsi = devm_kzalloc(&dsidev->dev, sizeof(*dsi), GFP_KERNEL);
 	if (!dsi)
 		return -ENOMEM;
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 3a9d1df..8e6defb 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -61,34 +61,18 @@ static const struct omap_dss_features *omap_current_dss_features;
 
 static const struct dss_reg_field omap2_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGN]			= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM]			= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 0, 0 },
 };
 
 static const struct dss_reg_field omap3_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-	[FEAT_REG_DSIPLL_REGN]			= { 7, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 18, 8 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 22, 19 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 26, 23 },
 };
 
 static const struct dss_reg_field omap4_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
-	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
 };
 
 static const struct dss_reg_field omap5_dss_reg_fields[] = {
 	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
-	[FEAT_REG_DSIPLL_REGN]			= { 8, 1 },
-	[FEAT_REG_DSIPLL_REGM]			= { 20, 9 },
-	[FEAT_REG_DSIPLL_REGM_DISPC]		= { 25, 21 },
-	[FEAT_REG_DSIPLL_REGM_DSI]		= { 30, 26 },
 };
 
 static const enum omap_display_type omap2_dss_supported_displays[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 40b98ff..3e82404 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -73,10 +73,6 @@ enum dss_feat_id {
 /* DSS register field id */
 enum dss_feat_reg_field {
 	FEAT_REG_DISPC_CLK_SWITCH,
-	FEAT_REG_DSIPLL_REGN,
-	FEAT_REG_DSIPLL_REGM,
-	FEAT_REG_DSIPLL_REGM_DISPC,
-	FEAT_REG_DSIPLL_REGM_DSI,
 };
 
 enum dss_range_param {
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH V2 5/6] OMAPDSS: DSI: Move DSI specific dss_params to dsi_feats
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                     ` (3 preceding siblings ...)
  2012-12-05 10:28   ` [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  2012-12-05 10:28   ` [PATCH V2 6/6] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
  5 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The DSI specific dss_param_range are moved from struct omap_dss_features to
corresponding struct dsi_param_range, which is initialized in struct dsi_feats
thereby enabling local access.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dsi.c          |   80 +++++++++++++++++++++++++++-----
 drivers/video/omap2/dss/dss_features.c |   27 -----------
 drivers/video/omap2/dss/dss_features.h |    7 ---
 3 files changed, 69 insertions(+), 45 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 472cdb4..a1ea5ac 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -351,8 +351,20 @@ struct dsi_reg_fields {
 	struct omapdss_reg_field regm_dsi;
 };
 
+struct dsi_param_ranges {
+	struct omapdss_param_range regn;
+	struct omapdss_param_range regm;
+	struct omapdss_param_range regm_dispc;
+	struct omapdss_param_range regm_dsi;
+	struct omapdss_param_range fint;
+	struct omapdss_param_range lpdiv;
+	struct omapdss_param_range dsi_fck;
+	struct omapdss_param_range dss_fck;
+};
+
 struct feats {
 	const struct dsi_reg_fields *reg_fields;
+	const struct dsi_param_ranges *params;
 };
 
 static const struct feats *dsi_feat;
@@ -1342,7 +1354,7 @@ int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
 
 	dss_sys_clk = clk_get_rate(dsi->sys_clk);
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dsi_feat->params->dss_fck.max;
 
 	if (req_pck = dsi->cache_req_pck &&
 			dsi->cache_cinfo.clkin = dss_sys_clk) {
@@ -1518,7 +1530,7 @@ static void dsi_pll_calc_dsi_fck(struct platform_device *dsidev,
 {
 	unsigned long max_dsi_fck;
 
-	max_dsi_fck = dss_feat_get_param_max(FEAT_PARAM_DSI_FCK);
+	max_dsi_fck = dsi_feat->params->dsi_fck.max;
 
 	cinfo->regm_dsi = DIV_ROUND_UP(cinfo->clkin4ddr, max_dsi_fck);
 	cinfo->dsi_pll_hsdiv_dsi_clk = cinfo->clkin4ddr / cinfo->regm_dsi;
@@ -1536,7 +1548,7 @@ static int dsi_pll_calc_dispc_fck(struct platform_device *dsidev,
 	struct dispc_clock_info best_dispc;
 	bool match;
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dsi_feat->params->dss_fck.max;
 
 	min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
 
@@ -5077,14 +5089,13 @@ static void dsi_calc_clock_param_ranges(struct platform_device *dsidev)
 {
 	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
 
-	dsi->regn_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGN);
-	dsi->regm_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM);
-	dsi->regm_dispc_max -		dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DISPC);
-	dsi->regm_dsi_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DSI);
-	dsi->fint_min = dss_feat_get_param_min(FEAT_PARAM_DSIPLL_FINT);
-	dsi->fint_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_FINT);
-	dsi->lpdiv_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_LPDIV);
+	dsi->regn_max = dsi_feat->params->regn.max;
+	dsi->regm_max = dsi_feat->params->regm.max;
+	dsi->regm_dispc_max = dsi_feat->params->regm_dispc.max;
+	dsi->regm_dsi_max = dsi_feat->params->regm_dsi.max;
+	dsi->fint_min = dsi_feat->params->fint.min;
+	dsi->fint_max = dsi_feat->params->fint.max;
+	dsi->lpdiv_max = dsi_feat->params->lpdiv.max;
 }
 
 static int dsi_get_clocks(struct platform_device *dsidev)
@@ -5237,20 +5248,67 @@ static struct dsi_reg_fields omap5_dsi_reg_fields = {
 	.regm_dsi		=	{ 30, 26 },
 };
 
+static struct dsi_param_ranges omap2_dsi_param_ranges = {
+	.regn			=	{ 0, 0 },
+	.regm			=	{ 0, 0 },
+	.regm_dispc		=	{ 0, 0 },
+	.regm_dsi		=	{ 0, 0 },
+	.fint			=	{ 0, 0 },
+	.lpdiv			=	{ 0, 0 },
+	.dss_fck		=	{ 0, 173000000 },
+};
+
+static struct dsi_param_ranges omap3_dsi_param_ranges = {
+	.regn			=	{ 0, (1 << 7) - 1 },
+	.regm			=	{ 0, (1 << 11) - 1 },
+	.regm_dispc		=	{ 0, (1 << 4) - 1 },
+	.regm_dsi		=	{ 0, (1 << 4) - 1 },
+	.fint			=	{ 750000, 2100000 },
+	.lpdiv			=	{ 1, (1 << 13) - 1},
+	.dsi_fck		=	{ 0, 173000000 },
+	.dss_fck		=	{ 0, 173000000 },
+};
+
+static struct dsi_param_ranges omap4_dsi_param_ranges = {
+	.regn			=	{ 0, (1 << 8) - 1 },
+	.regm			=	{ 0, (1 << 12) - 1 },
+	.regm_dispc		=	{ 0, (1 << 5) - 1 },
+	.regm_dsi		=	{ 0, (1 << 5) - 1 },
+	.fint			=	{ 500000, 2500000 },
+	.lpdiv			=	{ 0, (1 << 13) - 1 },
+	.dsi_fck		=	{ 0, 170000000 },
+	.dss_fck		=	{ 0, 186000000 },
+};
+
+static struct dsi_param_ranges omap5_dsi_param_ranges = {
+	.regn			=	{ 0, (1 << 8) - 1 },
+	.regm			=	{ 0, (1 << 12) - 1 },
+	.regm_dispc		=	{ 0, (1 << 5) - 1 },
+	.regm_dsi		=	{ 0, (1 << 5) - 1 },
+	.fint			=	{ 500000, 2500000 },
+	.lpdiv			=	{ 0, (1 << 13) - 1 },
+	.dsi_fck		=	{ 0, 170000000 },
+	.dss_fck		=	{ 0, 200000000 },
+};
+
 static const struct feats omap24xx_dsi_feats __initconst = {
 	.reg_fields		=	&omap2_dsi_reg_fields,
+	.params			=	&omap2_dsi_param_ranges,
 };
 
 static const struct feats omap34xx_dsi_feats __initconst = {
 	.reg_fields		=	&omap3_dsi_reg_fields,
+	.params			=	&omap3_dsi_param_ranges,
 };
 
 static const struct feats omap44xx_dsi_feats __initconst = {
 	.reg_fields		=	&omap4_dsi_reg_fields,
+	.params			=	&omap4_dsi_param_ranges,
 };
 
 static const struct feats omap54xx_dsi_feats __initconst = {
 	.reg_fields		=	&omap5_dsi_reg_fields,
+	.params			=	&omap5_dsi_param_ranges,
 };
 
 static int __init dsi_init_features(struct platform_device *dsidev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 8e6defb..75dddb2 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -369,45 +369,18 @@ static const char * const omap5_dss_clk_source_names[] = {
 
 static const struct dss_param_range omap2_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 0, 0 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, 0 },
 };
 
 static const struct dss_param_range omap3_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 7) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 11) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 4) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 4) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 750000, 2100000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 1, (1 << 13) - 1},
-	[FEAT_PARAM_DSI_FCK]			= { 0, 173000000 },
 };
 
 static const struct dss_param_range omap4_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
-	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
 };
 
 static const struct dss_param_range omap5_dss_param_range[] = {
 	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-	[FEAT_PARAM_DSIPLL_REGN]		= { 0, (1 << 8) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM]		= { 0, (1 << 12) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DISPC]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_REGM_DSI]		= { 0, (1 << 5) - 1 },
-	[FEAT_PARAM_DSIPLL_FINT]		= { 500000, 2500000 },
-	[FEAT_PARAM_DSIPLL_LPDIV]		= { 0, (1 << 13) - 1 },
-	[FEAT_PARAM_DSI_FCK]			= { 0, 170000000 },
 };
 
 static const enum dss_feat_id omap2_dss_feat_list[] = {
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 3e82404..d9f69c7 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -77,13 +77,6 @@ enum dss_feat_reg_field {
 
 enum dss_range_param {
 	FEAT_PARAM_DSS_FCK,
-	FEAT_PARAM_DSIPLL_REGN,
-	FEAT_PARAM_DSIPLL_REGM,
-	FEAT_PARAM_DSIPLL_REGM_DISPC,
-	FEAT_PARAM_DSIPLL_REGM_DSI,
-	FEAT_PARAM_DSIPLL_FINT,
-	FEAT_PARAM_DSIPLL_LPDIV,
-	FEAT_PARAM_DSI_FCK,
 };
 
 /* DSS Feature Functions */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH V2 6/6] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max
  2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
                     ` (4 preceding siblings ...)
  2012-12-05 10:28   ` [PATCH V2 5/6] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
@ 2012-12-05 10:28   ` Chandrabhanu Mahapatra
  5 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-05 10:28 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra

The members fld_dispc_clk_switch and dss_fck_max are added to struct
dss_features and are initialized in corresponding dss_feats structure as per DSS
version. The reg_fields, num_reg_fields and dss_params entries are removed from
struct omap_dss_features as they are no longer referenced.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
 drivers/video/omap2/dss/dss.c          |   22 ++++++--
 drivers/video/omap2/dss/dss_features.c |   96 --------------------------------
 drivers/video/omap2/dss/dss_features.h |   12 ----
 3 files changed, 16 insertions(+), 114 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 6ca69d5..ef005e2 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -69,6 +69,8 @@ struct dss_features {
 	u8 dss_fck_multiplier;
 	const char *clk_name;
 	int (*dpi_select_source)(enum omap_channel channel);
+	struct omapdss_reg_field fld_dispc_clk_switch;
+	int dss_fck_max;
 };
 
 static struct {
@@ -308,7 +310,6 @@ static void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src)
 {
 	struct platform_device *dsidev;
 	int b;
-	u8 start, end;
 
 	switch (clk_src) {
 	case OMAP_DSS_CLK_SRC_FCK:
@@ -329,9 +330,8 @@ static void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src)
 		return;
 	}
 
-	dss_feat_get_reg_field(FEAT_REG_DISPC_CLK_SWITCH, &start, &end);
-
-	REG_FLD_MOD(DSS_CONTROL, b, start, end);	/* DISPC_CLK_SWITCH */
+	REG_FLD_MOD(DSS_CONTROL, b, dss.feat->fld_dispc_clk_switch.start,
+		dss.feat->fld_dispc_clk_switch.end);  /* DISPC_CLK_SWITCH */
 
 	dss.dispc_clk_source = clk_src;
 }
@@ -497,7 +497,7 @@ static int dss_setup_default_clock(void)
 	if (dss.dpll4_m4_ck = NULL)
 		return 0;
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dss.feat->dss_fck_max;
 
 	prate = dss_get_dpll4_rate();
 
@@ -533,7 +533,7 @@ int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
 
 	prate = dss_get_dpll4_rate();
 
-	max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+	max_dss_fck = dss.feat->dss_fck_max;
 
 	fck = clk_get_rate(dss.dss_clk);
 	if (req_pck = dss.cache_req_pck && prate = dss.cache_prate &&
@@ -822,6 +822,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	2,
 	.clk_name		=	NULL,
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap34xx_dss_feats __initconst = {
@@ -829,6 +831,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	2,
 	.clk_name		=	"dpll4_m4_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap3630_dss_feats __initconst = {
@@ -836,6 +840,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll4_m4_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap2_omap3,
+	.fld_dispc_clk_switch	=	{ 0, 0 },
+	.dss_fck_max		=	173000000,
 };
 
 static const struct dss_features omap44xx_dss_feats __initconst = {
@@ -843,6 +849,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll_per_m5x2_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap4,
+	.fld_dispc_clk_switch	=	{ 9, 8 },
+	.dss_fck_max		=	186000000,
 };
 
 static const struct dss_features omap54xx_dss_feats __initconst = {
@@ -850,6 +858,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
 	.dss_fck_multiplier	=	1,
 	.clk_name		=	"dpll_per_h12x2_ck",
 	.dpi_select_source	=	&dss_dpi_select_source_omap5,
+	.fld_dispc_clk_switch	=	{ 9, 7 },
+	.dss_fck_max		=	200000000,
 };
 
 static int __init dss_init_features(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 75dddb2..e7fca28 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -27,19 +27,7 @@
 #include "dss.h"
 #include "dss_features.h"
 
-/* Defines a generic omap register field */
-struct dss_reg_field {
-	u8 start, end;
-};
-
-struct dss_param_range {
-	int min, max;
-};
-
 struct omap_dss_features {
-	const struct dss_reg_field *reg_fields;
-	const int num_reg_fields;
-
 	const enum dss_feat_id *features;
 	const int num_features;
 
@@ -51,7 +39,6 @@ struct omap_dss_features {
 	const enum omap_color_mode *supported_color_modes;
 	const enum omap_overlay_caps *overlay_caps;
 	const char * const *clksrc_names;
-	const struct dss_param_range *dss_params;
 
 	const enum omap_dss_rotation_type supported_rotation_types;
 };
@@ -59,22 +46,6 @@ struct omap_dss_features {
 /* This struct is assigned to one of the below during initialization */
 static const struct omap_dss_features *omap_current_dss_features;
 
-static const struct dss_reg_field omap2_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-};
-
-static const struct dss_reg_field omap3_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 0, 0 },
-};
-
-static const struct dss_reg_field omap4_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 8 },
-};
-
-static const struct dss_reg_field omap5_dss_reg_fields[] = {
-	[FEAT_REG_DISPC_CLK_SWITCH]		= { 9, 7 },
-};
-
 static const enum omap_display_type omap2_dss_supported_displays[] = {
 	/* OMAP_DSS_CHANNEL_LCD */
 	OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI,
@@ -367,22 +338,6 @@ static const char * const omap5_dss_clk_source_names[] = {
 	[OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI]	= "DPLL_DSI1_C_CLK2",
 };
 
-static const struct dss_param_range omap2_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-};
-
-static const struct dss_param_range omap3_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 173000000 },
-};
-
-static const struct dss_param_range omap4_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 186000000 },
-};
-
-static const struct dss_param_range omap5_dss_param_range[] = {
-	[FEAT_PARAM_DSS_FCK]			= { 0, 200000000 },
-};
-
 static const enum dss_feat_id omap2_dss_feat_list[] = {
 	FEAT_LCDENABLEPOL,
 	FEAT_LCDENABLESIGNAL,
@@ -527,9 +482,6 @@ static const enum dss_feat_id omap5_dss_feat_list[] = {
 
 /* OMAP2 DSS Features */
 static const struct omap_dss_features omap2_dss_features = {
-	.reg_fields = omap2_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields),
-
 	.features = omap2_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap2_dss_feat_list),
 
@@ -540,15 +492,11 @@ static const struct omap_dss_features omap2_dss_features = {
 	.supported_color_modes = omap2_dss_supported_color_modes,
 	.overlay_caps = omap2_dss_overlay_caps,
 	.clksrc_names = omap2_dss_clk_source_names,
-	.dss_params = omap2_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
 /* OMAP3 DSS Features */
 static const struct omap_dss_features omap3430_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = omap3430_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap3430_dss_feat_list),
 
@@ -559,7 +507,6 @@ static const struct omap_dss_features omap3430_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3430_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
@@ -568,9 +515,6 @@ static const struct omap_dss_features omap3430_dss_features = {
  * vdds_dsi regulator.
  */
 static const struct omap_dss_features am35xx_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = am35xx_dss_feat_list,
 	.num_features = ARRAY_SIZE(am35xx_dss_feat_list),
 
@@ -581,14 +525,10 @@ static const struct omap_dss_features am35xx_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3430_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
 static const struct omap_dss_features omap3630_dss_features = {
-	.reg_fields = omap3_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
-
 	.features = omap3630_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap3630_dss_feat_list),
 
@@ -599,16 +539,12 @@ static const struct omap_dss_features omap3630_dss_features = {
 	.supported_color_modes = omap3_dss_supported_color_modes,
 	.overlay_caps = omap3630_dss_overlay_caps,
 	.clksrc_names = omap3_dss_clk_source_names,
-	.dss_params = omap3_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_VRFB,
 };
 
 /* OMAP4 DSS Features */
 /* For OMAP4430 ES 1.0 revision */
 static const struct omap_dss_features omap4430_es1_0_dss_features  = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4430_es1_0_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4430_es1_0_dss_feat_list),
 
@@ -620,15 +556,11 @@ static const struct omap_dss_features omap4430_es1_0_dss_features  = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
 /* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */
 static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4430_es2_0_1_2_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4430_es2_0_1_2_dss_feat_list),
 
@@ -640,15 +572,11 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
 /* For all the other OMAP4 versions */
 static const struct omap_dss_features omap4_dss_features = {
-	.reg_fields = omap4_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
-
 	.features = omap4_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap4_dss_feat_list),
 
@@ -660,15 +588,11 @@ static const struct omap_dss_features omap4_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap4_dss_clk_source_names,
-	.dss_params = omap4_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
 /* OMAP5 DSS Features */
 static const struct omap_dss_features omap5_dss_features = {
-	.reg_fields = omap5_dss_reg_fields,
-	.num_reg_fields = ARRAY_SIZE(omap5_dss_reg_fields),
-
 	.features = omap5_dss_feat_list,
 	.num_features = ARRAY_SIZE(omap5_dss_feat_list),
 
@@ -679,7 +603,6 @@ static const struct omap_dss_features omap5_dss_features = {
 	.supported_color_modes = omap4_dss_supported_color_modes,
 	.overlay_caps = omap4_dss_overlay_caps,
 	.clksrc_names = omap5_dss_clk_source_names,
-	.dss_params = omap5_dss_param_range,
 	.supported_rotation_types = OMAP_DSS_ROT_DMA | OMAP_DSS_ROT_TILER,
 };
 
@@ -744,16 +667,6 @@ int dss_feat_get_num_wbs(void)
 	return omap_current_dss_features->num_wbs;
 }
 
-unsigned long dss_feat_get_param_min(enum dss_range_param param)
-{
-	return omap_current_dss_features->dss_params[param].min;
-}
-
-unsigned long dss_feat_get_param_max(enum dss_range_param param)
-{
-	return omap_current_dss_features->dss_params[param].max;
-}
-
 enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel)
 {
 	return omap_current_dss_features->supported_displays[channel];
@@ -801,15 +714,6 @@ bool dss_has_feature(enum dss_feat_id id)
 	return false;
 }
 
-void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end)
-{
-	if (id >= omap_current_dss_features->num_reg_fields)
-		BUG();
-
-	*start = omap_current_dss_features->reg_fields[id].start;
-	*end = omap_current_dss_features->reg_fields[id].end;
-}
-
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
 {
 	return omap_current_dss_features->supported_rotation_types & rot_type;
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index d9f69c7..0b84484 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -70,21 +70,10 @@ enum dss_feat_id {
 	FEAT_DSI_PHY_DCC,
 };
 
-/* DSS register field id */
-enum dss_feat_reg_field {
-	FEAT_REG_DISPC_CLK_SWITCH,
-};
-
-enum dss_range_param {
-	FEAT_PARAM_DSS_FCK,
-};
-
 /* DSS Feature Functions */
 int dss_feat_get_num_mgrs(void);
 int dss_feat_get_num_ovls(void);
 int dss_feat_get_num_wbs(void);
-unsigned long dss_feat_get_param_min(enum dss_range_param param);
-unsigned long dss_feat_get_param_max(enum dss_range_param param);
 enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
 enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel);
 enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
@@ -96,7 +85,6 @@ const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id);
 bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);
 
 bool dss_has_feature(enum dss_feat_id id);
-void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
 void dss_features_init(enum omapdss_version version);
 #if defined(CONFIG_OMAP4_DSS_HDMI)
 void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  2012-12-05 10:28   ` [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
@ 2012-12-17 12:23     ` Tomi Valkeinen
  2012-12-19  9:10       ` Chandrabhanu Mahapatra
  0 siblings, 1 reply; 27+ messages in thread
From: Tomi Valkeinen @ 2012-12-17 12:23 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]

Hi,

On 2012-12-05 12:16, Chandrabhanu Mahapatra wrote:
> The DSI specific dss_reg_fields are moved to corresponding dsi_reg_fields
> initialized in dsi_feats. The dsi_feats structure is initialized as per
> corresponding DSS version in dsi_init_features().
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dsi.c          |  126 +++++++++++++++++++++++++++++---
>  drivers/video/omap2/dss/dss_features.c |   16 ----
>  drivers/video/omap2/dss/dss_features.h |    4 -
>  3 files changed, 114 insertions(+), 32 deletions(-)
> 

> +static int __init dsi_init_features(struct platform_device *dsidev)
> +{
> +	const struct feats *src;
> +	struct feats *dst;
> +
> +	dst = devm_kzalloc(&dsidev->dev, sizeof(*dst), GFP_KERNEL);
> +	if (!dst) {
> +		dev_err(&dsidev->dev, "Failed to allocate DISPC Features\n");
> +		return -ENOMEM;
> +	}
> +
> +	switch (omapdss_get_version()) {
> +	case OMAPDSS_VER_OMAP24xx:
> +		src = &omap24xx_dsi_feats;
> +		break;
> +
> +	case OMAPDSS_VER_OMAP34xx_ES1:
> +	case OMAPDSS_VER_OMAP34xx_ES3:
> +	case OMAPDSS_VER_OMAP3630:
> +	case OMAPDSS_VER_AM35xx:
> +		src = &omap34xx_dsi_feats;
> +		break;
> +
> +	case OMAPDSS_VER_OMAP4430_ES1:
> +	case OMAPDSS_VER_OMAP4430_ES2:
> +	case OMAPDSS_VER_OMAP4:
> +		src = &omap44xx_dsi_feats;
> +		break;
> +
> +	case OMAPDSS_VER_OMAP5:
> +		src = &omap54xx_dsi_feats;
> +		break;
> +
> +	default:
> +		return -ENODEV;
> +	}

There's no DSI on OMAP2, so that case can be left out.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-12-05 10:28   ` [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
@ 2012-12-17 12:37     ` Tomi Valkeinen
  2012-12-19  9:39       ` Chandrabhanu Mahapatra
  0 siblings, 1 reply; 27+ messages in thread
From: Tomi Valkeinen @ 2012-12-17 12:37 UTC (permalink / raw)
  To: Chandrabhanu Mahapatra; +Cc: linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 10254 bytes --]

On 2012-12-05 12:16, Chandrabhanu Mahapatra wrote:
> The register fields in dss_reg_fields specific to DISPC are moved from struct
> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
> dispc_features, thereby enabling local access.
> 
> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
> ---
>  drivers/video/omap2/dss/dispc.c        |  114 ++++++++++++++++++++++++--------
>  drivers/video/omap2/dss/dss.h          |    4 ++
>  drivers/video/omap2/dss/dss_features.c |   28 --------
>  drivers/video/omap2/dss/dss_features.h |    7 --
>  4 files changed, 89 insertions(+), 64 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index bbba83f..ee4b152 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>  	unsigned irqs[32];
>  };
>  
> +struct dispc_reg_fields {
> +	struct omapdss_reg_field firhinc;
> +	struct omapdss_reg_field firvinc;
> +	struct omapdss_reg_field fifo_low_thresh;
> +	struct omapdss_reg_field fifo_high_thresh;
> +	struct omapdss_reg_field fifosize;
> +	struct omapdss_reg_field hori_accu;
> +	struct omapdss_reg_field vert_accu;
> +};
> +
>  struct dispc_features {
>  	u8 sw_start;
>  	u8 fp_start;
> @@ -110,6 +120,8 @@ struct dispc_features {
>  
>  	u32 buffer_size_unit; /* in bytes */
>  	u32 burst_size_unit; /* in bytes */
> +
> +	struct dispc_reg_fields *reg_fields;

This can be pointer to const.

>  };
>  
>  #define DISPC_MAX_NR_FIFOS 5
> @@ -1137,17 +1149,17 @@ static void dispc_mgr_set_size(enum omap_channel channel, u16 width,
>  
>  static void dispc_init_fifos(void)
>  {
> -	u32 size;
> +	u32 size, unit;
>  	int fifo;
> -	u8 start, end;
> -	u32 unit;
> +	const struct omapdss_reg_field *fifo_field;
>  
>  	unit = dispc.feat->buffer_size_unit;
>  
> -	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
> +	fifo_field = &dispc.feat->reg_fields->fifosize;
>  
>  	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
> -		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
> +		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo),
> +					fifo_field->start, fifo_field->end);
>  		size *= unit;
>  		dispc.fifo_size[fifo] = size;
>  
> @@ -1197,8 +1209,8 @@ static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
>  
>  void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>  {
> -	u8 hi_start, hi_end, lo_start, lo_end;
>  	u32 unit;
> +	const struct omapdss_reg_field *hi_field, *lo_field;
>  
>  	unit = dispc.feat->buffer_size_unit;
>  
> @@ -1208,20 +1220,20 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>  	low /= unit;
>  	high /= unit;
>  
> -	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
> -	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
> +	hi_field = &dispc.feat->reg_fields->fifo_high_thresh;
> +	lo_field = &dispc.feat->reg_fields->fifo_low_thresh;
>  
>  	DSSDBG("fifo(%d) threshold (bytes), old %u/%u, new %u/%u\n",
>  			plane,
>  			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
> -				lo_start, lo_end) * unit,
> +				lo_field->start, lo_field->end) * unit,
>  			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
> -				hi_start, hi_end) * unit,
> +				hi_field->start, hi_field->end) * unit,
>  			low * unit, high * unit);
>  
>  	dispc_write_reg(DISPC_OVL_FIFO_THRESHOLD(plane),
> -			FLD_VAL(high, hi_start, hi_end) |
> -			FLD_VAL(low, lo_start, lo_end));
> +			FLD_VAL(high, hi_field->start, hi_field->end) |
> +			FLD_VAL(low, lo_field->start, lo_field->end));
>  }
>  
>  void dispc_enable_fifomerge(bool enable)
> @@ -1289,14 +1301,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
>  	u32 val;
>  
>  	if (color_comp == DISPC_COLOR_COMPONENT_RGB_Y) {
> -		u8 hinc_start, hinc_end, vinc_start, vinc_end;
> +		const struct omapdss_reg_field *hinc_field, *vinc_field;
>  
> -		dss_feat_get_reg_field(FEAT_REG_FIRHINC,
> -					&hinc_start, &hinc_end);
> -		dss_feat_get_reg_field(FEAT_REG_FIRVINC,
> -					&vinc_start, &vinc_end);
> -		val = FLD_VAL(vinc, vinc_start, vinc_end) |
> -				FLD_VAL(hinc, hinc_start, hinc_end);
> +		hinc_field = &dispc.feat->reg_fields->firhinc;
> +		vinc_field = &dispc.feat->reg_fields->firvinc;
> +
> +		val = FLD_VAL(vinc, vinc_field->start, vinc_field->end) |
> +			FLD_VAL(hinc, hinc_field->start, hinc_field->end);
>  
>  		dispc_write_reg(DISPC_OVL_FIR(plane), val);
>  	} else {
> @@ -1308,13 +1319,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
>  static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
>  {
>  	u32 val;
> -	u8 hor_start, hor_end, vert_start, vert_end;
> +	const struct omapdss_reg_field *haccu_field, *vaccu_field;
>  
> -	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
> -	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
> +	haccu_field = &dispc.feat->reg_fields->hori_accu;
> +	vaccu_field = &dispc.feat->reg_fields->vert_accu;
>  
> -	val = FLD_VAL(vaccu, vert_start, vert_end) |
> -			FLD_VAL(haccu, hor_start, hor_end);
> +	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
> +		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
>  
>  	dispc_write_reg(DISPC_OVL_ACCU0(plane), val);
>  }
> @@ -1322,13 +1333,13 @@ static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
>  static void dispc_ovl_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
>  {
>  	u32 val;
> -	u8 hor_start, hor_end, vert_start, vert_end;
> +	const struct omapdss_reg_field *haccu_field, *vaccu_field;
>  
> -	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
> -	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
> +	haccu_field = &dispc.feat->reg_fields->hori_accu;
> +	vaccu_field = &dispc.feat->reg_fields->vert_accu;
>  
> -	val = FLD_VAL(vaccu, vert_start, vert_end) |
> -			FLD_VAL(haccu, hor_start, hor_end);
> +	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
> +		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
>  
>  	dispc_write_reg(DISPC_OVL_ACCU1(plane), val);
>  }
> @@ -4048,6 +4059,46 @@ static void _omap_dispc_initial_config(void)
>  	dispc_ovl_enable_zorder_planes();
>  }
>  
> +static struct dispc_reg_fields omap2_dispc_reg_fields = {
> +	.firhinc		=	{ 11,  0 },
> +	.firvinc		=	{ 27, 16 },
> +	.fifo_low_thresh	=	{  8,  0 },
> +	.fifo_high_thresh	=	{ 24, 16 },
> +	.fifosize		=	{  8,  0 },
> +	.hori_accu		=	{  9,  0 },
> +	.vert_accu		=	{ 25, 16 },
> +};

And these tables can be consts.

> +static struct dispc_reg_fields omap3_dispc_reg_fields = {
> +	.firhinc		=	{ 12,  0 },
> +	.firvinc		=	{ 28, 16 },
> +	.fifo_low_thresh	=	{ 11,  0 },
> +	.fifo_high_thresh	=	{ 27, 16 },
> +	.fifosize		=	{ 10,  0 },
> +	.hori_accu		=	{  9,  0 },
> +	.vert_accu		=	{ 25, 16 },
> +};
> +
> +static struct dispc_reg_fields omap4_dispc_reg_fields = {
> +	.firhinc		=	{ 12,  0 },
> +	.firvinc		=	{ 28, 16 },
> +	.fifo_low_thresh	=	{ 15,  0 },
> +	.fifo_high_thresh	=	{ 31, 16 },
> +	.fifosize		=	{ 15,  0 },
> +	.hori_accu		=	{ 10,  0 },
> +	.vert_accu		=	{ 26, 16 },
> +};
> +
> +static struct dispc_reg_fields omap5_dispc_reg_fields = {
> +	.firhinc		=	{ 12,  0 },
> +	.firvinc		=	{ 28, 16 },
> +	.fifo_low_thresh	=	{ 15,  0 },
> +	.fifo_high_thresh	=	{ 31, 16 },
> +	.fifosize		=	{ 15,  0 },
> +	.hori_accu		=	{ 10,  0 },
> +	.vert_accu		=	{ 26, 16 },
> +};
> +
>  static const struct dispc_features omap24xx_dispc_feats __initconst = {
>  	.sw_start		=	5,
>  	.fp_start		=	15,
> @@ -4065,6 +4116,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
>  	.no_framedone_tv	=	true,
>  	.buffer_size_unit	=	1,
>  	.burst_size_unit	=	8,
> +	.reg_fields		=	&omap2_dispc_reg_fields,
>  };
>  
>  static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
> @@ -4084,6 +4136,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
>  	.no_framedone_tv	=	true,
>  	.buffer_size_unit	=	1,
>  	.burst_size_unit	=	8,
> +	.reg_fields		=	&omap3_dispc_reg_fields,
>  };
>  
>  static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
> @@ -4103,6 +4156,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
>  	.no_framedone_tv	=	true,
>  	.buffer_size_unit	=	1,
>  	.burst_size_unit	=	8,
> +	.reg_fields		=	&omap3_dispc_reg_fields,
>  };
>  
>  static const struct dispc_features omap44xx_dispc_feats __initconst = {
> @@ -4122,6 +4176,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
>  	.gfx_fifo_workaround	=	true,
>  	.buffer_size_unit	=	16,
>  	.burst_size_unit	=	16,
> +	.reg_fields		=	&omap4_dispc_reg_fields,
>  };
>  
>  static const struct dispc_features omap54xx_dispc_feats __initconst = {
> @@ -4141,6 +4196,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
>  	.gfx_fifo_workaround	=	true,
>  	.buffer_size_unit	=	16,
>  	.burst_size_unit	=	16,
> +	.reg_fields		=	&omap5_dispc_reg_fields,
>  };

There's one thing to note here (and the same applies to DSI patches).
The *_dispc_feats tables above are __initconst, and we make a copy of
the needed table at probe time, so that the unneeded tables can be
discarded. Now you add new tables, but they are not handled the same
way. This is not a bug, but it's a bit inconsistent.

So I think we have three options:

- Make the new tables also __initconst, and create a copy of the needed
tables, and fix up the pointers to point to the copied tables.

- Embed the new tables into the *_dispc_feats table, as you suggested
previously. This would mean multiple copies of the same data in some cases.

- Remove the __initconst and the copy code.

I'm not sure which one to pick. The first one feels a bit complex, but
perhaps it should be tried first to see how the actual code would look
like. If it's just a few lines per table, I guess it's ok.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats
  2012-12-17 12:23     ` Tomi Valkeinen
@ 2012-12-19  9:10       ` Chandrabhanu Mahapatra
  0 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-19  9:10 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Monday 17 December 2012 05:53 PM, Tomi Valkeinen wrote:
> Hi,
> 
> On 2012-12-05 12:16, Chandrabhanu Mahapatra wrote:
>> The DSI specific dss_reg_fields are moved to corresponding dsi_reg_fields
>> initialized in dsi_feats. The dsi_feats structure is initialized as per
>> corresponding DSS version in dsi_init_features().
>>
>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>> ---
>>  drivers/video/omap2/dss/dsi.c          |  126 +++++++++++++++++++++++++++++---
>>  drivers/video/omap2/dss/dss_features.c |   16 ----
>>  drivers/video/omap2/dss/dss_features.h |    4 -
>>  3 files changed, 114 insertions(+), 32 deletions(-)
>>
> 
>> +static int __init dsi_init_features(struct platform_device *dsidev)
>> +{
>> +	const struct feats *src;
>> +	struct feats *dst;
>> +
>> +	dst = devm_kzalloc(&dsidev->dev, sizeof(*dst), GFP_KERNEL);
>> +	if (!dst) {
>> +		dev_err(&dsidev->dev, "Failed to allocate DISPC Features\n");
>> +		return -ENOMEM;
>> +	}
>> +
>> +	switch (omapdss_get_version()) {
>> +	case OMAPDSS_VER_OMAP24xx:
>> +		src = &omap24xx_dsi_feats;
>> +		break;
>> +
>> +	case OMAPDSS_VER_OMAP34xx_ES1:
>> +	case OMAPDSS_VER_OMAP34xx_ES3:
>> +	case OMAPDSS_VER_OMAP3630:
>> +	case OMAPDSS_VER_AM35xx:
>> +		src = &omap34xx_dsi_feats;
>> +		break;
>> +
>> +	case OMAPDSS_VER_OMAP4430_ES1:
>> +	case OMAPDSS_VER_OMAP4430_ES2:
>> +	case OMAPDSS_VER_OMAP4:
>> +		src = &omap44xx_dsi_feats;
>> +		break;
>> +
>> +	case OMAPDSS_VER_OMAP5:
>> +		src = &omap54xx_dsi_feats;
>> +		break;
>> +
>> +	default:
>> +		return -ENODEV;
>> +	}
> 
> There's no DSI on OMAP2, so that case can be left out.
> 
>  Tomi
> 
> 

Ok. Forgot to see that in dss_features.

-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields to dispc_features
  2012-12-17 12:37     ` Tomi Valkeinen
@ 2012-12-19  9:39       ` Chandrabhanu Mahapatra
  0 siblings, 0 replies; 27+ messages in thread
From: Chandrabhanu Mahapatra @ 2012-12-19  9:39 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev

On Monday 17 December 2012 06:07 PM, Tomi Valkeinen wrote:
> On 2012-12-05 12:16, Chandrabhanu Mahapatra wrote:
>> The register fields in dss_reg_fields specific to DISPC are moved from struct
>> omap_dss_features to corresponding dispc_reg_fields, initialized in struct
>> dispc_features, thereby enabling local access.
>>
>> Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
>> ---
>>  drivers/video/omap2/dss/dispc.c        |  114 ++++++++++++++++++++++++--------
>>  drivers/video/omap2/dss/dss.h          |    4 ++
>>  drivers/video/omap2/dss/dss_features.c |   28 --------
>>  drivers/video/omap2/dss/dss_features.h |    7 --
>>  4 files changed, 89 insertions(+), 64 deletions(-)
>>
>> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
>> index bbba83f..ee4b152 100644
>> --- a/drivers/video/omap2/dss/dispc.c
>> +++ b/drivers/video/omap2/dss/dispc.c
>> @@ -80,6 +80,16 @@ struct dispc_irq_stats {
>>  	unsigned irqs[32];
>>  };
>>  
>> +struct dispc_reg_fields {
>> +	struct omapdss_reg_field firhinc;
>> +	struct omapdss_reg_field firvinc;
>> +	struct omapdss_reg_field fifo_low_thresh;
>> +	struct omapdss_reg_field fifo_high_thresh;
>> +	struct omapdss_reg_field fifosize;
>> +	struct omapdss_reg_field hori_accu;
>> +	struct omapdss_reg_field vert_accu;
>> +};
>> +
>>  struct dispc_features {
>>  	u8 sw_start;
>>  	u8 fp_start;
>> @@ -110,6 +120,8 @@ struct dispc_features {
>>  
>>  	u32 buffer_size_unit; /* in bytes */
>>  	u32 burst_size_unit; /* in bytes */
>> +
>> +	struct dispc_reg_fields *reg_fields;
> 
> This can be pointer to const.
> 

Yes, the same thing can also be done in other dispc and dsi reg_fields
and param_ranges.

>>  };
>>  
>>  #define DISPC_MAX_NR_FIFOS 5
>> @@ -1137,17 +1149,17 @@ static void dispc_mgr_set_size(enum omap_channel channel, u16 width,
>>  
>>  static void dispc_init_fifos(void)
>>  {
>> -	u32 size;
>> +	u32 size, unit;
>>  	int fifo;
>> -	u8 start, end;
>> -	u32 unit;
>> +	const struct omapdss_reg_field *fifo_field;
>>  
>>  	unit = dispc.feat->buffer_size_unit;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end);
>> +	fifo_field = &dispc.feat->reg_fields->fifosize;
>>  
>>  	for (fifo = 0; fifo < dispc.feat->num_fifos; ++fifo) {
>> -		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo), start, end);
>> +		size = REG_GET(DISPC_OVL_FIFO_SIZE_STATUS(fifo),
>> +					fifo_field->start, fifo_field->end);
>>  		size *= unit;
>>  		dispc.fifo_size[fifo] = size;
>>  
>> @@ -1197,8 +1209,8 @@ static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
>>  
>>  void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>>  {
>> -	u8 hi_start, hi_end, lo_start, lo_end;
>>  	u32 unit;
>> +	const struct omapdss_reg_field *hi_field, *lo_field;
>>  
>>  	unit = dispc.feat->buffer_size_unit;
>>  
>> @@ -1208,20 +1220,20 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high)
>>  	low /= unit;
>>  	high /= unit;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end);
>> -	dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end);
>> +	hi_field = &dispc.feat->reg_fields->fifo_high_thresh;
>> +	lo_field = &dispc.feat->reg_fields->fifo_low_thresh;
>>  
>>  	DSSDBG("fifo(%d) threshold (bytes), old %u/%u, new %u/%u\n",
>>  			plane,
>>  			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
>> -				lo_start, lo_end) * unit,
>> +				lo_field->start, lo_field->end) * unit,
>>  			REG_GET(DISPC_OVL_FIFO_THRESHOLD(plane),
>> -				hi_start, hi_end) * unit,
>> +				hi_field->start, hi_field->end) * unit,
>>  			low * unit, high * unit);
>>  
>>  	dispc_write_reg(DISPC_OVL_FIFO_THRESHOLD(plane),
>> -			FLD_VAL(high, hi_start, hi_end) |
>> -			FLD_VAL(low, lo_start, lo_end));
>> +			FLD_VAL(high, hi_field->start, hi_field->end) |
>> +			FLD_VAL(low, lo_field->start, lo_field->end));
>>  }
>>  
>>  void dispc_enable_fifomerge(bool enable)
>> @@ -1289,14 +1301,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
>>  	u32 val;
>>  
>>  	if (color_comp = DISPC_COLOR_COMPONENT_RGB_Y) {
>> -		u8 hinc_start, hinc_end, vinc_start, vinc_end;
>> +		const struct omapdss_reg_field *hinc_field, *vinc_field;
>>  
>> -		dss_feat_get_reg_field(FEAT_REG_FIRHINC,
>> -					&hinc_start, &hinc_end);
>> -		dss_feat_get_reg_field(FEAT_REG_FIRVINC,
>> -					&vinc_start, &vinc_end);
>> -		val = FLD_VAL(vinc, vinc_start, vinc_end) |
>> -				FLD_VAL(hinc, hinc_start, hinc_end);
>> +		hinc_field = &dispc.feat->reg_fields->firhinc;
>> +		vinc_field = &dispc.feat->reg_fields->firvinc;
>> +
>> +		val = FLD_VAL(vinc, vinc_field->start, vinc_field->end) |
>> +			FLD_VAL(hinc, hinc_field->start, hinc_field->end);
>>  
>>  		dispc_write_reg(DISPC_OVL_FIR(plane), val);
>>  	} else {
>> @@ -1308,13 +1319,13 @@ static void dispc_ovl_set_fir(enum omap_plane plane,
>>  static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
>>  {
>>  	u32 val;
>> -	u8 hor_start, hor_end, vert_start, vert_end;
>> +	const struct omapdss_reg_field *haccu_field, *vaccu_field;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
>> -	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
>> +	haccu_field = &dispc.feat->reg_fields->hori_accu;
>> +	vaccu_field = &dispc.feat->reg_fields->vert_accu;
>>  
>> -	val = FLD_VAL(vaccu, vert_start, vert_end) |
>> -			FLD_VAL(haccu, hor_start, hor_end);
>> +	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
>> +		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
>>  
>>  	dispc_write_reg(DISPC_OVL_ACCU0(plane), val);
>>  }
>> @@ -1322,13 +1333,13 @@ static void dispc_ovl_set_vid_accu0(enum omap_plane plane, int haccu, int vaccu)
>>  static void dispc_ovl_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
>>  {
>>  	u32 val;
>> -	u8 hor_start, hor_end, vert_start, vert_end;
>> +	const struct omapdss_reg_field *haccu_field, *vaccu_field;
>>  
>> -	dss_feat_get_reg_field(FEAT_REG_HORIZONTALACCU, &hor_start, &hor_end);
>> -	dss_feat_get_reg_field(FEAT_REG_VERTICALACCU, &vert_start, &vert_end);
>> +	haccu_field = &dispc.feat->reg_fields->hori_accu;
>> +	vaccu_field = &dispc.feat->reg_fields->vert_accu;
>>  
>> -	val = FLD_VAL(vaccu, vert_start, vert_end) |
>> -			FLD_VAL(haccu, hor_start, hor_end);
>> +	val = FLD_VAL(vaccu, vaccu_field->start, vaccu_field->end) |
>> +		FLD_VAL(haccu, haccu_field->start, haccu_field->end);
>>  
>>  	dispc_write_reg(DISPC_OVL_ACCU1(plane), val);
>>  }
>> @@ -4048,6 +4059,46 @@ static void _omap_dispc_initial_config(void)
>>  	dispc_ovl_enable_zorder_planes();
>>  }
>>  
>> +static struct dispc_reg_fields omap2_dispc_reg_fields = {
>> +	.firhinc		=	{ 11,  0 },
>> +	.firvinc		=	{ 27, 16 },
>> +	.fifo_low_thresh	=	{  8,  0 },
>> +	.fifo_high_thresh	=	{ 24, 16 },
>> +	.fifosize		=	{  8,  0 },
>> +	.hori_accu		=	{  9,  0 },
>> +	.vert_accu		=	{ 25, 16 },
>> +};
> 
> And these tables can be consts.
> 
>> +static struct dispc_reg_fields omap3_dispc_reg_fields = {
>> +	.firhinc		=	{ 12,  0 },
>> +	.firvinc		=	{ 28, 16 },
>> +	.fifo_low_thresh	=	{ 11,  0 },
>> +	.fifo_high_thresh	=	{ 27, 16 },
>> +	.fifosize		=	{ 10,  0 },
>> +	.hori_accu		=	{  9,  0 },
>> +	.vert_accu		=	{ 25, 16 },
>> +};
>> +
>> +static struct dispc_reg_fields omap4_dispc_reg_fields = {
>> +	.firhinc		=	{ 12,  0 },
>> +	.firvinc		=	{ 28, 16 },
>> +	.fifo_low_thresh	=	{ 15,  0 },
>> +	.fifo_high_thresh	=	{ 31, 16 },
>> +	.fifosize		=	{ 15,  0 },
>> +	.hori_accu		=	{ 10,  0 },
>> +	.vert_accu		=	{ 26, 16 },
>> +};
>> +
>> +static struct dispc_reg_fields omap5_dispc_reg_fields = {
>> +	.firhinc		=	{ 12,  0 },
>> +	.firvinc		=	{ 28, 16 },
>> +	.fifo_low_thresh	=	{ 15,  0 },
>> +	.fifo_high_thresh	=	{ 31, 16 },
>> +	.fifosize		=	{ 15,  0 },
>> +	.hori_accu		=	{ 10,  0 },
>> +	.vert_accu		=	{ 26, 16 },
>> +};
>> +
>>  static const struct dispc_features omap24xx_dispc_feats __initconst = {
>>  	.sw_start		=	5,
>>  	.fp_start		=	15,
>> @@ -4065,6 +4116,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
>>  	.no_framedone_tv	=	true,
>>  	.buffer_size_unit	=	1,
>>  	.burst_size_unit	=	8,
>> +	.reg_fields		=	&omap2_dispc_reg_fields,
>>  };
>>  
>>  static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
>> @@ -4084,6 +4136,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
>>  	.no_framedone_tv	=	true,
>>  	.buffer_size_unit	=	1,
>>  	.burst_size_unit	=	8,
>> +	.reg_fields		=	&omap3_dispc_reg_fields,
>>  };
>>  
>>  static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
>> @@ -4103,6 +4156,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
>>  	.no_framedone_tv	=	true,
>>  	.buffer_size_unit	=	1,
>>  	.burst_size_unit	=	8,
>> +	.reg_fields		=	&omap3_dispc_reg_fields,
>>  };
>>  
>>  static const struct dispc_features omap44xx_dispc_feats __initconst = {
>> @@ -4122,6 +4176,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
>>  	.gfx_fifo_workaround	=	true,
>>  	.buffer_size_unit	=	16,
>>  	.burst_size_unit	=	16,
>> +	.reg_fields		=	&omap4_dispc_reg_fields,
>>  };
>>  
>>  static const struct dispc_features omap54xx_dispc_feats __initconst = {
>> @@ -4141,6 +4196,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
>>  	.gfx_fifo_workaround	=	true,
>>  	.buffer_size_unit	=	16,
>>  	.burst_size_unit	=	16,
>> +	.reg_fields		=	&omap5_dispc_reg_fields,
>>  };
> 
> There's one thing to note here (and the same applies to DSI patches).
> The *_dispc_feats tables above are __initconst, and we make a copy of
> the needed table at probe time, so that the unneeded tables can be
> discarded. Now you add new tables, but they are not handled the same
> way. This is not a bug, but it's a bit inconsistent.
> 
> So I think we have three options:
> 
> - Make the new tables also __initconst, and create a copy of the needed
> tables, and fix up the pointers to point to the copied tables.
> 
> - Embed the new tables into the *_dispc_feats table, as you suggested
> previously. This would mean multiple copies of the same data in some cases.
> 
> - Remove the __initconst and the copy code.
> 
> I'm not sure which one to pick. The first one feels a bit complex, but
> perhaps it should be tried first to see how the actual code would look
> like. If it's just a few lines per table, I guess it's ok.
> 
>  Tomi
> 
> 

I would like to go with first approach. The code will look like this

static int __init dispc_init_features(struct platform_device *pdev)
{
.....................................
	const struct dispc_param_ranges *src_param;
	struct dispc_param_ranges *dst_param;

	dst_param = devm_kzalloc(&pdev->dev, sizeof(*dst_param), 	GFP_KERNEL);
	if (!dst_param) {
		dev_err(&pdev->dev, "Failed to allocate DISPC Param Ranges\n");
		return -ENOMEM;
	}

	switch (omapdss_get_version()) {
 	case OMAPDSS_VER_OMAP24xx:
 		src = &omap24xx_dispc_feats;
		src_param = &omap2_dispc_param_ranges;
 		break;
.............................
	}

	memcpy(dst, src, sizeof(*dst));
	memcpy(dst_param, src_param, sizeof(*dst_param));
	dst->params = dst_param;

 	dispc.feat = dst;

	return 0;
}

Yes, the code looks a bit complex but still well manageable.

-- 
Chandrabhanu Mahapatra
Texas Instruments India Pvt. Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2012-12-19  9:39 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 10:53 [PATCH 0/7] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
2012-11-29 12:01   ` Tomi Valkeinen
2012-11-28 10:53 ` [PATCH 2/7] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
2012-11-29 12:05   ` Tomi Valkeinen
2012-11-30 10:14     ` Chandrabhanu Mahapatra
2012-11-30 10:25       ` Tomi Valkeinen
2012-11-29 12:18   ` Tomi Valkeinen
2012-12-03  6:41     ` Chandrabhanu Mahapatra
2012-12-04  8:16       ` Tomi Valkeinen
2012-11-28 10:53 ` [PATCH 3/7] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
2012-11-29 12:08   ` Tomi Valkeinen
2012-11-28 10:53 ` [PATCH 4/7] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 5/7] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 6/7] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra
2012-11-28 10:53 ` [PATCH 7/7] OMAPDSS: DSI: Add FEAT_PARAM_DSS_FCK Chandrabhanu Mahapatra
2012-12-05 10:28 ` [PATCH V2 0/6] OMAPDSS: Cleanup omap_dss_features Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 1/6] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 2/6] OMAPDSS: DISPC: Move DISPC specific dss_reg_fields " Chandrabhanu Mahapatra
2012-12-17 12:37     ` Tomi Valkeinen
2012-12-19  9:39       ` Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 3/6] OMAPDSS: DISPC: Move DISPC specific dss_params " Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 4/6] OMAPDSS: DSI: Move DSI specific reg_fields to dsi_feats Chandrabhanu Mahapatra
2012-12-17 12:23     ` Tomi Valkeinen
2012-12-19  9:10       ` Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 5/6] OMAPDSS: DSI: Move DSI specific dss_params " Chandrabhanu Mahapatra
2012-12-05 10:28   ` [PATCH V2 6/6] OMAPDSS: DSS: Add members fld_dispc_clk_switch and dss_fck_max Chandrabhanu Mahapatra

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).