diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-04 12:14:20 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 01:54:27 -0500 |
commit | c64dca40c5cf1cc61355411dcfb90949e57afdf0 (patch) | |
tree | 345c78502c37fd0014c84e6c922033824d9fc942 | |
parent | 2cc5d1af5ad0a130fa5812f99bca18e0cdadbd36 (diff) |
OMAPDSS: setup manager with dispc_mgr_setup()
Change manager configuration to be similar to overlay configuration by
creating dispc_mgr_setup() which takes omap_overlay_manager_info as
parameter.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 26 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 11 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 9 |
3 files changed, 23 insertions, 23 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index b66cf154f64e..9c070a22867b 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -996,7 +996,7 @@ void dispc_enable_gamma_table(bool enable) | |||
996 | REG_FLD_MOD(DISPC_CONFIG, enable, 9, 9); | 996 | REG_FLD_MOD(DISPC_CONFIG, enable, 9, 9); |
997 | } | 997 | } |
998 | 998 | ||
999 | void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable) | 999 | static void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable) |
1000 | { | 1000 | { |
1001 | u16 reg; | 1001 | u16 reg; |
1002 | 1002 | ||
@@ -1010,7 +1010,7 @@ void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable) | |||
1010 | REG_FLD_MOD(reg, enable, 15, 15); | 1010 | REG_FLD_MOD(reg, enable, 15, 15); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | void dispc_mgr_set_cpr_coef(enum omap_channel channel, | 1013 | static void dispc_mgr_set_cpr_coef(enum omap_channel channel, |
1014 | struct omap_dss_cpr_coefs *coefs) | 1014 | struct omap_dss_cpr_coefs *coefs) |
1015 | { | 1015 | { |
1016 | u32 coef_r, coef_g, coef_b; | 1016 | u32 coef_r, coef_g, coef_b; |
@@ -2164,7 +2164,7 @@ void dispc_set_loadmode(enum omap_dss_load_mode mode) | |||
2164 | } | 2164 | } |
2165 | 2165 | ||
2166 | 2166 | ||
2167 | void dispc_mgr_set_default_color(enum omap_channel channel, u32 color) | 2167 | static void dispc_mgr_set_default_color(enum omap_channel channel, u32 color) |
2168 | { | 2168 | { |
2169 | dispc_write_reg(DISPC_DEFAULT_COLOR(channel), color); | 2169 | dispc_write_reg(DISPC_DEFAULT_COLOR(channel), color); |
2170 | } | 2170 | } |
@@ -2182,7 +2182,7 @@ u32 dispc_mgr_get_default_color(enum omap_channel channel) | |||
2182 | return l; | 2182 | return l; |
2183 | } | 2183 | } |
2184 | 2184 | ||
2185 | void dispc_mgr_set_trans_key(enum omap_channel ch, | 2185 | static void dispc_mgr_set_trans_key(enum omap_channel ch, |
2186 | enum omap_dss_trans_key_type type, | 2186 | enum omap_dss_trans_key_type type, |
2187 | u32 trans_key) | 2187 | u32 trans_key) |
2188 | { | 2188 | { |
@@ -2215,7 +2215,7 @@ void dispc_mgr_get_trans_key(enum omap_channel ch, | |||
2215 | *trans_key = dispc_read_reg(DISPC_TRANS_COLOR(ch)); | 2215 | *trans_key = dispc_read_reg(DISPC_TRANS_COLOR(ch)); |
2216 | } | 2216 | } |
2217 | 2217 | ||
2218 | void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable) | 2218 | static void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable) |
2219 | { | 2219 | { |
2220 | if (ch == OMAP_DSS_CHANNEL_LCD) | 2220 | if (ch == OMAP_DSS_CHANNEL_LCD) |
2221 | REG_FLD_MOD(DISPC_CONFIG, enable, 10, 10); | 2221 | REG_FLD_MOD(DISPC_CONFIG, enable, 10, 10); |
@@ -2225,7 +2225,8 @@ void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable) | |||
2225 | REG_FLD_MOD(DISPC_CONFIG2, enable, 10, 10); | 2225 | REG_FLD_MOD(DISPC_CONFIG2, enable, 10, 10); |
2226 | } | 2226 | } |
2227 | 2227 | ||
2228 | void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool enable) | 2228 | static void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, |
2229 | bool enable) | ||
2229 | { | 2230 | { |
2230 | if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) | 2231 | if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) |
2231 | return; | 2232 | return; |
@@ -2269,6 +2270,19 @@ bool dispc_mgr_trans_key_enabled(enum omap_channel ch) | |||
2269 | return enabled; | 2270 | return enabled; |
2270 | } | 2271 | } |
2271 | 2272 | ||
2273 | void dispc_mgr_setup(enum omap_channel channel, | ||
2274 | struct omap_overlay_manager_info *info) | ||
2275 | { | ||
2276 | dispc_mgr_set_default_color(channel, info->default_color); | ||
2277 | dispc_mgr_set_trans_key(channel, info->trans_key_type, info->trans_key); | ||
2278 | dispc_mgr_enable_trans_key(channel, info->trans_enabled); | ||
2279 | dispc_mgr_enable_alpha_fixed_zorder(channel, | ||
2280 | info->partial_alpha_enabled); | ||
2281 | if (dss_has_feature(FEAT_CPR)) { | ||
2282 | dispc_mgr_enable_cpr(channel, info->cpr_enable); | ||
2283 | dispc_mgr_set_cpr_coef(channel, &info->cpr_coefs); | ||
2284 | } | ||
2285 | } | ||
2272 | 2286 | ||
2273 | void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines) | 2287 | void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines) |
2274 | { | 2288 | { |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 11c72d15ead2..a8022578c603 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -405,9 +405,6 @@ void dispc_ovl_set_channel_out(enum omap_plane plane, | |||
405 | 405 | ||
406 | void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable); | 406 | void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable); |
407 | void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, u16 height); | 407 | void dispc_mgr_set_lcd_size(enum omap_channel channel, u16 width, u16 height); |
408 | void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable); | ||
409 | void dispc_mgr_set_cpr_coef(enum omap_channel channel, | ||
410 | struct omap_dss_cpr_coefs *coefs); | ||
411 | bool dispc_mgr_go_busy(enum omap_channel channel); | 408 | bool dispc_mgr_go_busy(enum omap_channel channel); |
412 | void dispc_mgr_go(enum omap_channel channel); | 409 | void dispc_mgr_go(enum omap_channel channel); |
413 | bool dispc_mgr_is_enabled(enum omap_channel channel); | 410 | bool dispc_mgr_is_enabled(enum omap_channel channel); |
@@ -418,16 +415,10 @@ void dispc_mgr_enable_stallmode(enum omap_channel channel, bool enable); | |||
418 | void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines); | 415 | void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines); |
419 | void dispc_mgr_set_lcd_display_type(enum omap_channel channel, | 416 | void dispc_mgr_set_lcd_display_type(enum omap_channel channel, |
420 | enum omap_lcd_display_type type); | 417 | enum omap_lcd_display_type type); |
421 | void dispc_mgr_set_default_color(enum omap_channel channel, u32 color); | ||
422 | u32 dispc_mgr_get_default_color(enum omap_channel channel); | 418 | u32 dispc_mgr_get_default_color(enum omap_channel channel); |
423 | void dispc_mgr_set_trans_key(enum omap_channel ch, | ||
424 | enum omap_dss_trans_key_type type, | ||
425 | u32 trans_key); | ||
426 | void dispc_mgr_get_trans_key(enum omap_channel ch, | 419 | void dispc_mgr_get_trans_key(enum omap_channel ch, |
427 | enum omap_dss_trans_key_type *type, | 420 | enum omap_dss_trans_key_type *type, |
428 | u32 *trans_key); | 421 | u32 *trans_key); |
429 | void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable); | ||
430 | void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool enable); | ||
431 | bool dispc_mgr_trans_key_enabled(enum omap_channel ch); | 422 | bool dispc_mgr_trans_key_enabled(enum omap_channel ch); |
432 | bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch); | 423 | bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch); |
433 | void dispc_mgr_set_lcd_timings(enum omap_channel channel, | 424 | void dispc_mgr_set_lcd_timings(enum omap_channel channel, |
@@ -440,6 +431,8 @@ int dispc_mgr_set_clock_div(enum omap_channel channel, | |||
440 | struct dispc_clock_info *cinfo); | 431 | struct dispc_clock_info *cinfo); |
441 | int dispc_mgr_get_clock_div(enum omap_channel channel, | 432 | int dispc_mgr_get_clock_div(enum omap_channel channel, |
442 | struct dispc_clock_info *cinfo); | 433 | struct dispc_clock_info *cinfo); |
434 | void dispc_mgr_setup(enum omap_channel channel, | ||
435 | struct omap_overlay_manager_info *info); | ||
443 | 436 | ||
444 | /* VENC */ | 437 | /* VENC */ |
445 | #ifdef CONFIG_OMAP2_DSS_VENC | 438 | #ifdef CONFIG_OMAP2_DSS_VENC |
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index ec98e177aec0..3421955c63bb 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -803,14 +803,7 @@ static void configure_manager(enum omap_channel channel) | |||
803 | /* picking info from the cache */ | 803 | /* picking info from the cache */ |
804 | mi = &dss_cache.manager_cache[channel].info; | 804 | mi = &dss_cache.manager_cache[channel].info; |
805 | 805 | ||
806 | dispc_mgr_set_default_color(channel, mi->default_color); | 806 | dispc_mgr_setup(channel, mi); |
807 | dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key); | ||
808 | dispc_mgr_enable_trans_key(channel, mi->trans_enabled); | ||
809 | dispc_mgr_enable_alpha_fixed_zorder(channel, mi->partial_alpha_enabled); | ||
810 | if (dss_has_feature(FEAT_CPR)) { | ||
811 | dispc_mgr_enable_cpr(channel, mi->cpr_enable); | ||
812 | dispc_mgr_set_cpr_coef(channel, &mi->cpr_coefs); | ||
813 | } | ||
814 | } | 807 | } |
815 | 808 | ||
816 | /* configure_dispc() tries to write values from cache to shadow registers. | 809 | /* configure_dispc() tries to write values from cache to shadow registers. |