diff options
author | Archit Taneja <archit@ti.com> | 2011-09-14 02:22:54 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-09-30 09:17:25 -0400 |
commit | c3d92529c3c2d7b511903d98efc1537081e62eca (patch) | |
tree | ec5d614c8b03da53feb43fd4112aafa6caa8ab75 | |
parent | a4273b7cca6fe7ee3807229ba256adb6cfaba0c3 (diff) |
OMAPDSS: DISPC: Pass overlay params as arguments to dispc_ovl_setup()
dispc_ovl_enable_replication() and dispc_ovl_set_fifo_threshold() are currently
called in configure_overlay(). These are the only functions which cause DISPC
register writes of overlay parameters outside of dispc_ovl_setup().
Move these to dispc_ovl_setup() and pass replication, fifo_low and fifo_high
thresholds as arguments to dispc_ovl_setup() in order to be aligned with other
overlay parameters. No functional changes are made.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 20 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 5 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 7 |
3 files changed, 17 insertions, 15 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index f01a26df4af..fbcefcef29e 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -971,7 +971,7 @@ static void dispc_ovl_set_vid_color_conv(enum omap_plane plane, bool enable) | |||
971 | dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), val); | 971 | dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), val); |
972 | } | 972 | } |
973 | 973 | ||
974 | void dispc_ovl_enable_replication(enum omap_plane plane, bool enable) | 974 | static void dispc_ovl_enable_replication(enum omap_plane plane, bool enable) |
975 | { | 975 | { |
976 | static const unsigned shifts[] = { 5, 10, 10 }; | 976 | static const unsigned shifts[] = { 5, 10, 10 }; |
977 | int shift; | 977 | int shift; |
@@ -1019,7 +1019,8 @@ u32 dispc_ovl_get_fifo_size(enum omap_plane plane) | |||
1019 | return dispc.fifo_size[plane]; | 1019 | return dispc.fifo_size[plane]; |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high) | 1022 | static void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, |
1023 | u32 high) | ||
1023 | { | 1024 | { |
1024 | u8 hi_start, hi_end, lo_start, lo_end; | 1025 | u8 hi_start, hi_end, lo_start, lo_end; |
1025 | u32 unit; | 1026 | u32 unit; |
@@ -1675,7 +1676,8 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width, | |||
1675 | } | 1676 | } |
1676 | 1677 | ||
1677 | int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, | 1678 | int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, |
1678 | bool ilace, enum omap_channel channel) | 1679 | bool ilace, enum omap_channel channel, bool replication, |
1680 | u32 fifo_low, u32 fifo_high) | ||
1679 | { | 1681 | { |
1680 | const int maxdownscale = cpu_is_omap34xx() ? 4 : 2; | 1682 | const int maxdownscale = cpu_is_omap34xx() ? 4 : 2; |
1681 | bool five_taps = 0; | 1683 | bool five_taps = 0; |
@@ -1688,10 +1690,11 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, | |||
1688 | unsigned int field_offset = 0; | 1690 | unsigned int field_offset = 0; |
1689 | 1691 | ||
1690 | DSSDBG("dispc_ovl_setup %d, pa %x, pa_uv %x, sw %d, %d,%d, %dx%d -> " | 1692 | DSSDBG("dispc_ovl_setup %d, pa %x, pa_uv %x, sw %d, %d,%d, %dx%d -> " |
1691 | "%dx%d, cmode %x, rot %d, mir %d, ilace %d chan %d\n", | 1693 | "%dx%d, cmode %x, rot %d, mir %d, ilace %d chan %d repl %d " |
1692 | plane, oi->paddr, oi->p_uv_addr, oi->screen_width, oi->pos_x, | 1694 | "fifo_low %d fifo high %d\n", plane, oi->paddr, oi->p_uv_addr, |
1693 | oi->pos_y, oi->width, oi->height, oi->out_width, oi->out_height, | 1695 | oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height, |
1694 | oi->color_mode, oi->rotation, oi->mirror, ilace, channel); | 1696 | oi->out_width, oi->out_height, oi->color_mode, oi->rotation, |
1697 | oi->mirror, ilace, channel, replication, fifo_low, fifo_high); | ||
1695 | 1698 | ||
1696 | if (oi->paddr == 0) | 1699 | if (oi->paddr == 0) |
1697 | return -EINVAL; | 1700 | return -EINVAL; |
@@ -1839,6 +1842,9 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, | |||
1839 | 1842 | ||
1840 | dispc_ovl_set_channel_out(plane, channel); | 1843 | dispc_ovl_set_channel_out(plane, channel); |
1841 | 1844 | ||
1845 | dispc_ovl_enable_replication(plane, replication); | ||
1846 | dispc_ovl_set_fifo_threshold(plane, fifo_low, fifo_high); | ||
1847 | |||
1842 | return 0; | 1848 | return 0; |
1843 | } | 1849 | } |
1844 | 1850 | ||
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index bcc9c4e83cc..dff9b799d51 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -400,12 +400,11 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate, | |||
400 | 400 | ||
401 | 401 | ||
402 | u32 dispc_ovl_get_fifo_size(enum omap_plane plane); | 402 | u32 dispc_ovl_get_fifo_size(enum omap_plane plane); |
403 | void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high); | ||
404 | u32 dispc_ovl_get_burst_size(enum omap_plane plane); | 403 | u32 dispc_ovl_get_burst_size(enum omap_plane plane); |
405 | int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, | 404 | int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, |
406 | bool ilace, enum omap_channel channel); | 405 | bool ilace, enum omap_channel channel, bool replication, |
406 | u32 fifo_low, u32 fifo_high); | ||
407 | int dispc_ovl_enable(enum omap_plane plane, bool enable); | 407 | int dispc_ovl_enable(enum omap_plane plane, bool enable); |
408 | void dispc_ovl_enable_replication(enum omap_plane plane, bool enable); | ||
409 | 408 | ||
410 | 409 | ||
411 | void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable); | 410 | void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable); |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index f1c334c275e..fdbbeebcd75 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -940,7 +940,8 @@ static int configure_overlay(enum omap_plane plane) | |||
940 | new_oi.out_height = outh; | 940 | new_oi.out_height = outh; |
941 | new_oi.paddr = paddr; | 941 | new_oi.paddr = paddr; |
942 | 942 | ||
943 | r = dispc_ovl_setup(plane, &new_oi, c->ilace, c->channel); | 943 | r = dispc_ovl_setup(plane, &new_oi, c->ilace, c->channel, |
944 | c->replication, c->fifo_low, c->fifo_high); | ||
944 | if (r) { | 945 | if (r) { |
945 | /* this shouldn't happen */ | 946 | /* this shouldn't happen */ |
946 | DSSERR("dispc_ovl_setup failed for ovl %d\n", plane); | 947 | DSSERR("dispc_ovl_setup failed for ovl %d\n", plane); |
@@ -948,10 +949,6 @@ static int configure_overlay(enum omap_plane plane) | |||
948 | return r; | 949 | return r; |
949 | } | 950 | } |
950 | 951 | ||
951 | dispc_ovl_enable_replication(plane, c->replication); | ||
952 | |||
953 | dispc_ovl_set_fifo_threshold(plane, c->fifo_low, c->fifo_high); | ||
954 | |||
955 | dispc_ovl_enable(plane, 1); | 952 | dispc_ovl_enable(plane, 1); |
956 | 953 | ||
957 | return 0; | 954 | return 0; |