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