1 From 6c56dc10226c84f41917ac2117b0e654fa080d40 Mon Sep 17 00:00:00 2001
2 From: Hardik Shah <hardik.shah@ti.com>
3 Date: Thu, 16 Apr 2009 19:00:11 +0530
4 Subject: [PATCH] DSS2: Added support for setting and querying alpha blending.
6 Signed-off-by: Hardik Shah <hardik.shah@ti.com>
8 arch/arm/plat-omap/include/mach/display.h | 3 +++
9 drivers/video/omap2/dss/dispc.c | 26 ++++++++++++++++++++++++++
10 drivers/video/omap2/dss/dss.h | 2 ++
11 drivers/video/omap2/dss/manager.c | 14 ++++++++++++++
12 4 files changed, 45 insertions(+), 0 deletions(-)
14 diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
15 index 073cdda..e1f615a 100644
16 --- a/arch/arm/plat-omap/include/mach/display.h
17 +++ b/arch/arm/plat-omap/include/mach/display.h
18 @@ -415,11 +415,14 @@ struct omap_overlay_manager {
20 void (*set_default_color)(struct omap_overlay_manager *mgr, u32 color);
21 u32 (*get_default_color)(struct omap_overlay_manager *mgr);
22 + bool (*get_alpha_blending_status)(struct omap_overlay_manager *mgr);
23 void (*set_trans_key)(struct omap_overlay_manager *mgr,
24 enum omap_dss_color_key_type type,
26 void (*enable_trans_key)(struct omap_overlay_manager *mgr,
28 + void (*enable_alpha_blending)(struct omap_overlay_manager *mgr,
32 enum omap_display_caps {
33 diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
34 index b631dd8..7e551c2 100644
35 --- a/drivers/video/omap2/dss/dispc.c
36 +++ b/drivers/video/omap2/dss/dispc.c
37 @@ -1847,6 +1847,32 @@ void dispc_enable_trans_key(enum omap_channel ch, bool enable)
38 REG_FLD_MOD(DISPC_CONFIG, enable, 12, 12);
41 +void dispc_enable_alpha_blending(enum omap_channel ch, bool enable)
44 + if (ch == OMAP_DSS_CHANNEL_LCD)
45 + REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
46 + else /* OMAP_DSS_CHANNEL_DIGIT */
47 + REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
50 +bool dispc_alpha_blending_enabled(enum omap_channel ch)
55 + if (ch == OMAP_DSS_CHANNEL_LCD)
56 + enabled = REG_GET(DISPC_CONFIG, 18, 18);
57 + else if (ch == OMAP_DSS_CHANNEL_DIGIT)
58 + enabled = REG_GET(DISPC_CONFIG, 18, 18);
68 bool dispc_trans_key_enabled(enum omap_channel ch)
70 diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
71 index 584dce6..1d01ff6 100644
72 --- a/drivers/video/omap2/dss/dss.h
73 +++ b/drivers/video/omap2/dss/dss.h
74 @@ -294,7 +294,9 @@ void dispc_get_trans_key(enum omap_channel ch,
75 enum omap_dss_color_key_type *type,
77 void dispc_enable_trans_key(enum omap_channel ch, bool enable);
78 +void dispc_enable_alpha_blending(enum omap_channel ch, bool enable);
79 bool dispc_trans_key_enabled(enum omap_channel ch);
80 +bool dispc_alpha_blending_enabled(enum omap_channel ch);
82 void dispc_set_lcd_timings(struct omap_video_timings *timings);
83 unsigned long dispc_fclk_rate(void);
84 diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
85 index 12cf7b0..90acd28 100644
86 --- a/drivers/video/omap2/dss/manager.c
87 +++ b/drivers/video/omap2/dss/manager.c
88 @@ -468,6 +468,16 @@ static void omap_dss_mgr_enable_trans_key(struct omap_overlay_manager *mgr,
90 dispc_enable_trans_key(mgr->id, enable);
92 +static void omap_dss_mgr_enable_alpha_blending(struct omap_overlay_manager *mgr,
95 + dispc_enable_alpha_blending(mgr->id, enable);
97 +static bool omap_dss_mgr_get_alpha_blending_status(
98 + struct omap_overlay_manager *mgr)
100 + return dispc_alpha_blending_enabled(mgr->id);
102 static u32 omap_dss_mgr_get_default_color(struct omap_overlay_manager *mgr)
104 return dispc_get_default_color(mgr->id);
105 @@ -514,6 +524,10 @@ int dss_init_overlay_managers(struct platform_device *pdev)
106 mgr->set_default_color = &omap_dss_mgr_set_def_color,
107 mgr->set_trans_key = &omap_dss_mgr_set_trans_key,
108 mgr->enable_trans_key = &omap_dss_mgr_enable_trans_key,
109 + mgr->enable_alpha_blending =
110 + &omap_dss_mgr_enable_alpha_blending;
111 + mgr->get_alpha_blending_status =
112 + omap_dss_mgr_get_alpha_blending_status;
113 mgr->get_default_color = &omap_dss_mgr_get_default_color;
114 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC,