aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-03 11:03:44 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:26 -0500
commit2cc5d1af5ad0a130fa5812f99bca18e0cdadbd36 (patch)
tree67d36ccc07db2e30f7f91e8f5c276bacf4bd6b17 /drivers/video
parentf38545da53d98055d8b2f58fe156c86626f3427e (diff)
OMAPDSS: separate overlay channel from ovl_setup
Overlay channel is configured with ovl_setup, with all the other overlay attriutes. This patch separates overlay channel setup so that we can later configure the channel only when needed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c40
-rw-r--r--drivers/video/omap2/dss/dss.h2
-rw-r--r--drivers/video/omap2/dss/manager.c4
3 files changed, 41 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 094bb6e4179e..b66cf154f64e 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -922,6 +922,39 @@ void dispc_ovl_set_channel_out(enum omap_plane plane, enum omap_channel channel)
922 dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), val); 922 dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), val);
923} 923}
924 924
925static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
926{
927 int shift;
928 u32 val;
929 enum omap_channel channel;
930
931 switch (plane) {
932 case OMAP_DSS_GFX:
933 shift = 8;
934 break;
935 case OMAP_DSS_VIDEO1:
936 case OMAP_DSS_VIDEO2:
937 case OMAP_DSS_VIDEO3:
938 shift = 16;
939 break;
940 default:
941 BUG();
942 }
943
944 val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane));
945
946 if (dss_has_feature(FEAT_MGR_LCD2)) {
947 if (FLD_GET(val, 31, 30) == 0)
948 channel = FLD_GET(val, shift, shift);
949 else
950 channel = OMAP_DSS_CHANNEL_LCD2;
951 } else {
952 channel = FLD_GET(val, shift, shift);
953 }
954
955 return channel;
956}
957
925static void dispc_ovl_set_burst_size(enum omap_plane plane, 958static void dispc_ovl_set_burst_size(enum omap_plane plane,
926 enum omap_burst_size burst_size) 959 enum omap_burst_size burst_size)
927{ 960{
@@ -1769,7 +1802,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
1769} 1802}
1770 1803
1771int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, 1804int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
1772 bool ilace, enum omap_channel channel, bool replication) 1805 bool ilace, bool replication)
1773{ 1806{
1774 struct omap_overlay *ovl = omap_dss_get_overlay(plane); 1807 struct omap_overlay *ovl = omap_dss_get_overlay(plane);
1775 bool five_taps = false; 1808 bool five_taps = false;
@@ -1781,6 +1814,9 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
1781 u16 frame_height = oi->height; 1814 u16 frame_height = oi->height;
1782 unsigned int field_offset = 0; 1815 unsigned int field_offset = 0;
1783 u16 outw, outh; 1816 u16 outw, outh;
1817 enum omap_channel channel;
1818
1819 channel = dispc_ovl_get_channel_out(plane);
1784 1820
1785 DSSDBG("dispc_ovl_setup %d, pa %x, pa_uv %x, sw %d, %d,%d, %dx%d -> " 1821 DSSDBG("dispc_ovl_setup %d, pa %x, pa_uv %x, sw %d, %d,%d, %dx%d -> "
1786 "%dx%d, cmode %x, rot %d, mir %d, ilace %d chan %d repl %d\n", 1822 "%dx%d, cmode %x, rot %d, mir %d, ilace %d chan %d repl %d\n",
@@ -1892,8 +1928,6 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
1892 dispc_ovl_set_pre_mult_alpha(plane, oi->pre_mult_alpha); 1928 dispc_ovl_set_pre_mult_alpha(plane, oi->pre_mult_alpha);
1893 dispc_ovl_setup_global_alpha(plane, oi->global_alpha); 1929 dispc_ovl_setup_global_alpha(plane, oi->global_alpha);
1894 1930
1895 dispc_ovl_set_channel_out(plane, channel);
1896
1897 dispc_ovl_enable_replication(plane, replication); 1931 dispc_ovl_enable_replication(plane, replication);
1898 1932
1899 return 0; 1933 return 0;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index d56e916ca129..11c72d15ead2 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -397,7 +397,7 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
397u32 dispc_ovl_get_fifo_size(enum omap_plane plane); 397u32 dispc_ovl_get_fifo_size(enum omap_plane plane);
398u32 dispc_ovl_get_burst_size(enum omap_plane plane); 398u32 dispc_ovl_get_burst_size(enum omap_plane plane);
399int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, 399int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
400 bool ilace, enum omap_channel channel, bool replication); 400 bool ilace, bool replication);
401int dispc_ovl_enable(enum omap_plane plane, bool enable); 401int dispc_ovl_enable(enum omap_plane plane, bool enable);
402void dispc_ovl_set_channel_out(enum omap_plane plane, 402void dispc_ovl_set_channel_out(enum omap_plane plane,
403 enum omap_channel channel); 403 enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 31637ba58f5f..ec98e177aec0 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -777,7 +777,9 @@ static int configure_overlay(enum omap_plane plane)
777 777
778 ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC; 778 ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC;
779 779
780 r = dispc_ovl_setup(plane, oi, ilace, c->channel, replication); 780 dispc_ovl_set_channel_out(plane, c->channel);
781
782 r = dispc_ovl_setup(plane, oi, ilace, replication);
781 if (r) { 783 if (r) {
782 /* this shouldn't happen */ 784 /* this shouldn't happen */
783 DSSERR("dispc_ovl_setup failed for ovl %d\n", plane); 785 DSSERR("dispc_ovl_setup failed for ovl %d\n", plane);