From patchwork Wed Nov 28 10:41:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrabhanu Mahapatra X-Patchwork-Id: 1815341 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 386BA3FC54 for ; Wed, 28 Nov 2012 10:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754224Ab2K1KqW (ORCPT ); Wed, 28 Nov 2012 05:46:22 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:47803 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754232Ab2K1KqV (ORCPT ); Wed, 28 Nov 2012 05:46:21 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id qASAkLWN017637; Wed, 28 Nov 2012 04:46:21 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qASAkLsf008717; Wed, 28 Nov 2012 04:46:21 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 28 Nov 2012 04:46:21 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id qASAkLuK030010; Wed, 28 Nov 2012 04:46:21 -0600 Received: from localhost (uda0131936.apr.dhcp.ti.com [172.24.137.243]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id qASAkJw03385; Wed, 28 Nov 2012 04:46:19 -0600 (CST) From: Chandrabhanu Mahapatra To: CC: , , Chandrabhanu Mahapatra Subject: [PATCH 1/7] OMAPDSS: DISPC: Move burst_size and buffer_size to dispc_features Date: Wed, 28 Nov 2012 16:11:24 +0530 Message-ID: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 --- 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);