aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/manager.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-21 02:35:36 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-07-01 05:07:14 -0400
commit5ed8cf5b8e053832a3d0552e0a9681a3ff0325ee (patch)
tree7b344de5b36f8720cc03a762c28931b6126b212f /drivers/video/omap2/dss/manager.c
parent15ffa1dac53820bb712851d329ba465f74b00f76 (diff)
OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4
The DMA FIFO threshold registers and burst size registers have changed for OMAP4. The current code only handles OMAP2/3 case, and so the values are a bit off for OMAP4. A summary of the differences between OMAP2/3 and OMAP4: Burst size: OMAP2/3: 4 x 32 bits / 8 x 32 bits / 16 x 32 bits OMAP4: 2 x 128 bits / 4 x 128 bits / 8 x 128 bits Threshold size: OMAP2/3: in bytes (8 bit units) OMAP4: in 128bit units This patch fixes the issue by creating two new helper functions in dss_features: dss_feat_get_buffer_size_unit() and dss_feat_get_burst_size_unit(). These return (in bytes) the unit size for threshold registers and unit size for burst size register, respectively, and are used to calculate correct values. For the threshold size the usage is straightforward. However, the burst size register has different multipliers for OMAP2/3 and OMAP4. This patch solves the problem by defining the multipliers for the burst size as 2x, 4x and 8x, which fit fine for the OMAP4 burst size definition (i.e. burst size unit for OMAP4 is 128bits), but requires a slight twist on OMAP2/3 by defining the burst size unit as 64bit. As the driver in practice always uses the maximum burst size, and no use case currently exists where we would want to use a smaller burst size, this patch changes the driver to hardcode the burst size when initializing DISPC. This makes the threshold configuration code somewhat simpler. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/manager.c')
-rw-r--r--drivers/video/omap2/dss/manager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 7ebaa40d3b56..49c0d77a5f24 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -507,7 +507,6 @@ struct overlay_cache_data {
507 bool replication; 507 bool replication;
508 bool ilace; 508 bool ilace;
509 509
510 enum omap_burst_size burst_size;
511 u32 fifo_low; 510 u32 fifo_low;
512 u32 fifo_high; 511 u32 fifo_high;
513}; 512};
@@ -947,8 +946,7 @@ static int configure_overlay(enum omap_plane plane)
947 946
948 dispc_enable_replication(plane, c->replication); 947 dispc_enable_replication(plane, c->replication);
949 948
950 dispc_set_burst_size(plane, c->burst_size); 949 dispc_set_fifo_threshold(plane, c->fifo_low, c->fifo_high);
951 dispc_setup_plane_fifo(plane, c->fifo_low, c->fifo_high);
952 950
953 dispc_enable_plane(plane, 1); 951 dispc_enable_plane(plane, 1);
954 952
@@ -1417,7 +1415,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1417 /* Configure overlay fifos */ 1415 /* Configure overlay fifos */
1418 for (i = 0; i < omap_dss_get_num_overlays(); ++i) { 1416 for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
1419 struct omap_dss_device *dssdev; 1417 struct omap_dss_device *dssdev;
1420 u32 size; 1418 u32 size, burst_size;
1421 1419
1422 ovl = omap_dss_get_overlay(i); 1420 ovl = omap_dss_get_overlay(i);
1423 1421
@@ -1435,6 +1433,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1435 if (use_fifomerge) 1433 if (use_fifomerge)
1436 size *= 3; 1434 size *= 3;
1437 1435
1436 burst_size = dispc_get_burst_size(ovl->id);
1437
1438 switch (dssdev->type) { 1438 switch (dssdev->type) {
1439 case OMAP_DISPLAY_TYPE_DPI: 1439 case OMAP_DISPLAY_TYPE_DPI:
1440 case OMAP_DISPLAY_TYPE_DBI: 1440 case OMAP_DISPLAY_TYPE_DBI:
@@ -1442,13 +1442,13 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1442 case OMAP_DISPLAY_TYPE_VENC: 1442 case OMAP_DISPLAY_TYPE_VENC:
1443 case OMAP_DISPLAY_TYPE_HDMI: 1443 case OMAP_DISPLAY_TYPE_HDMI:
1444 default_get_overlay_fifo_thresholds(ovl->id, size, 1444 default_get_overlay_fifo_thresholds(ovl->id, size,
1445 &oc->burst_size, &oc->fifo_low, 1445 burst_size, &oc->fifo_low,
1446 &oc->fifo_high); 1446 &oc->fifo_high);
1447 break; 1447 break;
1448#ifdef CONFIG_OMAP2_DSS_DSI 1448#ifdef CONFIG_OMAP2_DSS_DSI
1449 case OMAP_DISPLAY_TYPE_DSI: 1449 case OMAP_DISPLAY_TYPE_DSI:
1450 dsi_get_overlay_fifo_thresholds(ovl->id, size, 1450 dsi_get_overlay_fifo_thresholds(ovl->id, size,
1451 &oc->burst_size, &oc->fifo_low, 1451 burst_size, &oc->fifo_low,
1452 &oc->fifo_high); 1452 &oc->fifo_high);
1453 break; 1453 break;
1454#endif 1454#endif