diff options
author | Archit Taneja <archit@ti.com> | 2012-08-24 07:29:26 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-26 07:58:51 -0400 |
commit | 9e4a0fc76549e1105fd4a2c7e03871c31110387e (patch) | |
tree | dbe31accae359704b7ac65821fec99fbafa794fb /drivers/video | |
parent | 749feffa6b697c15f6016063994ca9d0ec300235 (diff) |
OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup()
Configure some of the writeback specific parameters in dispc_wb_setup(). The
writeback parameters configured are:
truncation: This needs to be set if the color depth input to writeback is more
than the color depth of the color mode we want to store in memory.
writeback mode: This configures whether we want to use writeback in mem to mem
or capture mode. This information will be directly passed by APPLY later.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 28 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 2 |
2 files changed, 27 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 4d8e04583873..9f083a952747 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -2482,13 +2482,15 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, | |||
2482 | } | 2482 | } |
2483 | 2483 | ||
2484 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, | 2484 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, |
2485 | const struct omap_video_timings *mgr_timings) | 2485 | bool mem_to_mem, const struct omap_video_timings *mgr_timings) |
2486 | { | 2486 | { |
2487 | int r; | 2487 | int r; |
2488 | u32 l; | ||
2488 | enum omap_plane plane = OMAP_DSS_WB; | 2489 | enum omap_plane plane = OMAP_DSS_WB; |
2489 | const int pos_x = 0, pos_y = 0; | 2490 | const int pos_x = 0, pos_y = 0; |
2490 | const u8 zorder = 0, global_alpha = 0; | 2491 | const u8 zorder = 0, global_alpha = 0; |
2491 | const bool replication = false; | 2492 | const bool replication = false; |
2493 | bool truncation; | ||
2492 | int in_width = mgr_timings->x_res; | 2494 | int in_width = mgr_timings->x_res; |
2493 | int in_height = mgr_timings->y_res; | 2495 | int in_height = mgr_timings->y_res; |
2494 | enum omap_overlay_caps caps = | 2496 | enum omap_overlay_caps caps = |
@@ -2503,7 +2505,29 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, | |||
2503 | wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width, | 2505 | wi->buf_width, pos_x, pos_y, in_width, in_height, wi->width, |
2504 | wi->height, wi->color_mode, wi->rotation, wi->mirror, zorder, | 2506 | wi->height, wi->color_mode, wi->rotation, wi->mirror, zorder, |
2505 | wi->pre_mult_alpha, global_alpha, wi->rotation_type, | 2507 | wi->pre_mult_alpha, global_alpha, wi->rotation_type, |
2506 | replication, mgr_timings, false); | 2508 | replication, mgr_timings, mem_to_mem); |
2509 | |||
2510 | switch (wi->color_mode) { | ||
2511 | case OMAP_DSS_COLOR_RGB16: | ||
2512 | case OMAP_DSS_COLOR_RGB24P: | ||
2513 | case OMAP_DSS_COLOR_ARGB16: | ||
2514 | case OMAP_DSS_COLOR_RGBA16: | ||
2515 | case OMAP_DSS_COLOR_RGB12U: | ||
2516 | case OMAP_DSS_COLOR_ARGB16_1555: | ||
2517 | case OMAP_DSS_COLOR_XRGB16_1555: | ||
2518 | case OMAP_DSS_COLOR_RGBX16: | ||
2519 | truncation = true; | ||
2520 | break; | ||
2521 | default: | ||
2522 | truncation = false; | ||
2523 | break; | ||
2524 | } | ||
2525 | |||
2526 | /* setup extra DISPC_WB_ATTRIBUTES */ | ||
2527 | l = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); | ||
2528 | l = FLD_MOD(l, truncation, 10, 10); /* TRUNCATIONENABLE */ | ||
2529 | l = FLD_MOD(l, mem_to_mem, 19, 19); /* WRITEBACKMODE */ | ||
2530 | dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), l); | ||
2507 | 2531 | ||
2508 | return r; | 2532 | return r; |
2509 | } | 2533 | } |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 3f9208e88203..8677f5157318 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -488,7 +488,7 @@ void dispc_mgr_setup(enum omap_channel channel, | |||
488 | 488 | ||
489 | void dispc_wb_set_channel_in(enum dss_writeback_channel channel); | 489 | void dispc_wb_set_channel_in(enum dss_writeback_channel channel); |
490 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, | 490 | int dispc_wb_setup(const struct omap_dss_writeback_info *wi, |
491 | const struct omap_video_timings *timings); | 491 | bool mem_to_mem, const struct omap_video_timings *timings); |
492 | 492 | ||
493 | /* VENC */ | 493 | /* VENC */ |
494 | #ifdef CONFIG_OMAP2_DSS_VENC | 494 | #ifdef CONFIG_OMAP2_DSS_VENC |