aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-01-13 06:17:01 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-01-25 06:46:19 -0500
commit83fa2f2e940dc21a204cff697d84d37214a91708 (patch)
treeeacddc1ef46bf0dbd917667eb4d22b84d9e7b54f /drivers
parent3cb5d966e233167fcbeb7c7d7a66294e13ee9d90 (diff)
OMAPDSS: DISPC: move fifo threhold calc to dispc.c
Move fifo threshold calculation into dispc.c, as the thresholds are really dispc internal thing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/apply.c34
-rw-r--r--drivers/video/omap2/dss/dispc.c22
-rw-r--r--drivers/video/omap2/dss/display.c10
-rw-r--r--drivers/video/omap2/dss/dsi.c8
-rw-r--r--drivers/video/omap2/dss/dss.h10
5 files changed, 24 insertions, 60 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 6f7b213e096e..b0264a164652 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -907,7 +907,6 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl,
907{ 907{
908 struct ovl_priv_data *op = get_ovl_priv(ovl); 908 struct ovl_priv_data *op = get_ovl_priv(ovl);
909 struct omap_dss_device *dssdev; 909 struct omap_dss_device *dssdev;
910 u32 size, burst_size;
911 u32 fifo_low, fifo_high; 910 u32 fifo_low, fifo_high;
912 911
913 if (!op->enabled && !op->enabling) 912 if (!op->enabled && !op->enabling)
@@ -915,37 +914,8 @@ static void dss_ovl_setup_fifo(struct omap_overlay *ovl,
915 914
916 dssdev = ovl->manager->device; 915 dssdev = ovl->manager->device;
917 916
918 if (use_fifo_merge) { 917 dispc_ovl_compute_fifo_thresholds(ovl->id, &fifo_low, &fifo_high,
919 int i; 918 use_fifo_merge);
920
921 size = 0;
922
923 for (i = 0; i < omap_dss_get_num_overlays(); ++i)
924 size += dispc_ovl_get_fifo_size(i);
925 } else {
926 size = dispc_ovl_get_fifo_size(ovl->id);
927 }
928
929 burst_size = dispc_ovl_get_burst_size(ovl->id);
930
931 switch (dssdev->type) {
932 case OMAP_DISPLAY_TYPE_DPI:
933 case OMAP_DISPLAY_TYPE_DBI:
934 case OMAP_DISPLAY_TYPE_SDI:
935 case OMAP_DISPLAY_TYPE_VENC:
936 case OMAP_DISPLAY_TYPE_HDMI:
937 default_get_overlay_fifo_thresholds(ovl->id, size,
938 burst_size, &fifo_low, &fifo_high);
939 break;
940#ifdef CONFIG_OMAP2_DSS_DSI
941 case OMAP_DISPLAY_TYPE_DSI:
942 dsi_get_overlay_fifo_thresholds(ovl->id, size,
943 burst_size, &fifo_low, &fifo_high);
944 break;
945#endif
946 default:
947 BUG();
948 }
949 919
950 dss_apply_ovl_fifo_thresholds(ovl, fifo_low, fifo_high); 920 dss_apply_ovl_fifo_thresholds(ovl, fifo_low, fifo_high);
951} 921}
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ba907bd60099..a75972250a20 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -909,7 +909,7 @@ static void dispc_configure_burst_sizes(void)
909 dispc_ovl_set_burst_size(i, burst_size); 909 dispc_ovl_set_burst_size(i, burst_size);
910} 910}
911 911
912u32 dispc_ovl_get_burst_size(enum omap_plane plane) 912static u32 dispc_ovl_get_burst_size(enum omap_plane plane)
913{ 913{
914 unsigned unit = dss_feat_get_burst_size_unit(); 914 unsigned unit = dss_feat_get_burst_size_unit();
915 /* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */ 915 /* burst multiplier is always x8 (see dispc_configure_burst_sizes()) */
@@ -1018,7 +1018,7 @@ static void dispc_read_plane_fifo_sizes(void)
1018 } 1018 }
1019} 1019}
1020 1020
1021u32 dispc_ovl_get_fifo_size(enum omap_plane plane) 1021static u32 dispc_ovl_get_fifo_size(enum omap_plane plane)
1022{ 1022{
1023 return dispc.fifo_size[plane]; 1023 return dispc.fifo_size[plane];
1024} 1024}
@@ -1063,6 +1063,24 @@ void dispc_enable_fifomerge(bool enable)
1063 REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 14, 14); 1063 REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 14, 14);
1064} 1064}
1065 1065
1066void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
1067 u32 *fifo_low, u32 *fifo_high, bool use_fifomerge)
1068{
1069 /*
1070 * All sizes are in bytes. Both the buffer and burst are made of
1071 * buffer_units, and the fifo thresholds must be buffer_unit aligned.
1072 */
1073
1074 unsigned buf_unit = dss_feat_get_buffer_size_unit();
1075 unsigned fifo_size, burst_size;
1076
1077 burst_size = dispc_ovl_get_burst_size(plane);
1078 fifo_size = dispc_ovl_get_fifo_size(plane);
1079
1080 *fifo_low = fifo_size - burst_size;
1081 *fifo_high = fifo_size - buf_unit;
1082}
1083
1066static void dispc_ovl_set_fir(enum omap_plane plane, 1084static void dispc_ovl_set_fir(enum omap_plane plane,
1067 int hinc, int vinc, 1085 int hinc, int vinc,
1068 enum omap_color_component color_comp) 1086 enum omap_color_component color_comp)
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index be331dc5a61b..4424c198dbcd 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -279,16 +279,6 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
279} 279}
280EXPORT_SYMBOL(omapdss_default_get_resolution); 280EXPORT_SYMBOL(omapdss_default_get_resolution);
281 281
282void default_get_overlay_fifo_thresholds(enum omap_plane plane,
283 u32 fifo_size, u32 burst_size,
284 u32 *fifo_low, u32 *fifo_high)
285{
286 unsigned buf_unit = dss_feat_get_buffer_size_unit();
287
288 *fifo_high = fifo_size - buf_unit;
289 *fifo_low = fifo_size - burst_size;
290}
291
292int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev) 282int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
293{ 283{
294 switch (dssdev->type) { 284 switch (dssdev->type) {
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d4d676c82c12..a4b9d58e8b46 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4524,14 +4524,6 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
4524} 4524}
4525EXPORT_SYMBOL(omapdss_dsi_enable_te); 4525EXPORT_SYMBOL(omapdss_dsi_enable_te);
4526 4526
4527void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
4528 u32 fifo_size, u32 burst_size,
4529 u32 *fifo_low, u32 *fifo_high)
4530{
4531 *fifo_high = fifo_size - burst_size;
4532 *fifo_low = fifo_size - burst_size * 2;
4533}
4534
4535int dsi_init_display(struct omap_dss_device *dssdev) 4527int dsi_init_display(struct omap_dss_device *dssdev)
4536{ 4528{
4537 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4529 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 32ff69fb3333..d4b3dff2ead3 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -202,9 +202,6 @@ void dss_uninit_device(struct platform_device *pdev,
202 struct omap_dss_device *dssdev); 202 struct omap_dss_device *dssdev);
203bool dss_use_replication(struct omap_dss_device *dssdev, 203bool dss_use_replication(struct omap_dss_device *dssdev,
204 enum omap_color_mode mode); 204 enum omap_color_mode mode);
205void default_get_overlay_fifo_thresholds(enum omap_plane plane,
206 u32 fifo_size, u32 burst_size,
207 u32 *fifo_low, u32 *fifo_high);
208 205
209/* manager */ 206/* manager */
210int dss_init_overlay_managers(struct platform_device *pdev); 207int dss_init_overlay_managers(struct platform_device *pdev);
@@ -313,9 +310,6 @@ int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev, bool is_tft,
313int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk, 310int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
314 bool enable_hsdiv); 311 bool enable_hsdiv);
315void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes); 312void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes);
316void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
317 u32 fifo_size, u32 burst_size,
318 u32 *fifo_low, u32 *fifo_high);
319void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev); 313void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev);
320void dsi_wait_pll_hsdiv_dsi_active(struct platform_device *dsidev); 314void dsi_wait_pll_hsdiv_dsi_active(struct platform_device *dsidev);
321struct platform_device *dsi_get_dsidev_from_id(int module); 315struct platform_device *dsi_get_dsidev_from_id(int module);
@@ -429,8 +423,8 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
429 423
430 424
431void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high); 425void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
432u32 dispc_ovl_get_fifo_size(enum omap_plane plane); 426void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
433u32 dispc_ovl_get_burst_size(enum omap_plane plane); 427 u32 *fifo_low, u32 *fifo_high, bool use_fifomerge);
434int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, 428int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
435 bool ilace, bool replication); 429 bool ilace, bool replication);
436int dispc_ovl_enable(enum omap_plane plane, bool enable); 430int dispc_ovl_enable(enum omap_plane plane, bool enable);