aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-01-27 00:47:22 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-01-28 15:58:09 -0500
commitf7f31e505aa79d91b979a38789b1608744361bdc (patch)
tree27dba9088af5473eeefeb2f40b75a64b1ac855da /drivers/video/s3c-fb.c
parent05e52b4bfba0d1fa4195abbc4ac29c24033c8e96 (diff)
video: s3c-fb: add alpha value width setting
This patch adds alpha value width setting according to transparency value of each window format, using BLENDCON register. When alpha value is 8 bits, BLENDCON will set alpha value width as 8 bits. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 389189a9e775..9af6c1849c24 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -82,6 +82,7 @@ struct s3c_fb;
82 * @palette: Address of palette memory, or 0 if none. 82 * @palette: Address of palette memory, or 0 if none.
83 * @has_prtcon: Set if has PRTCON register. 83 * @has_prtcon: Set if has PRTCON register.
84 * @has_shadowcon: Set if has SHADOWCON register. 84 * @has_shadowcon: Set if has SHADOWCON register.
85 * @has_blendcon: Set if has BLENDCON register.
85 * @has_clksel: Set if VIDCON0 register has CLKSEL bit. 86 * @has_clksel: Set if VIDCON0 register has CLKSEL bit.
86 */ 87 */
87struct s3c_fb_variant { 88struct s3c_fb_variant {
@@ -100,6 +101,7 @@ struct s3c_fb_variant {
100 101
101 unsigned int has_prtcon:1; 102 unsigned int has_prtcon:1;
102 unsigned int has_shadowcon:1; 103 unsigned int has_shadowcon:1;
104 unsigned int has_blendcon:1;
103 unsigned int has_clksel:1; 105 unsigned int has_clksel:1;
104}; 106};
105 107
@@ -691,6 +693,17 @@ static int s3c_fb_set_par(struct fb_info *info)
691 writel(data, regs + sfb->variant.wincon + (win_no * 4)); 693 writel(data, regs + sfb->variant.wincon + (win_no * 4));
692 writel(0x0, regs + sfb->variant.winmap + (win_no * 4)); 694 writel(0x0, regs + sfb->variant.winmap + (win_no * 4));
693 695
696 /* Set alpha value width */
697 if (sfb->variant.has_blendcon) {
698 data = readl(sfb->regs + BLENDCON);
699 data &= ~BLENDCON_NEW_MASK;
700 if (var->transp.length > 4)
701 data |= BLENDCON_NEW_8BIT_ALPHA_VALUE;
702 else
703 data |= BLENDCON_NEW_4BIT_ALPHA_VALUE;
704 writel(data, sfb->regs + BLENDCON);
705 }
706
694 shadow_protect_win(win, 0); 707 shadow_protect_win(win, 0);
695 708
696 pm_runtime_put_sync(sfb->dev); 709 pm_runtime_put_sync(sfb->dev);
@@ -1798,6 +1811,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pc100 = {
1798 }, 1811 },
1799 1812
1800 .has_prtcon = 1, 1813 .has_prtcon = 1,
1814 .has_blendcon = 1,
1801 .has_clksel = 1, 1815 .has_clksel = 1,
1802 }, 1816 },
1803 .win[0] = &s3c_fb_data_s5p_wins[0], 1817 .win[0] = &s3c_fb_data_s5p_wins[0],
@@ -1829,6 +1843,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 = {
1829 }, 1843 },
1830 1844
1831 .has_shadowcon = 1, 1845 .has_shadowcon = 1,
1846 .has_blendcon = 1,
1832 .has_clksel = 1, 1847 .has_clksel = 1,
1833 }, 1848 },
1834 .win[0] = &s3c_fb_data_s5p_wins[0], 1849 .win[0] = &s3c_fb_data_s5p_wins[0],
@@ -1860,6 +1875,7 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
1860 }, 1875 },
1861 1876
1862 .has_shadowcon = 1, 1877 .has_shadowcon = 1,
1878 .has_blendcon = 1,
1863 }, 1879 },
1864 .win[0] = &s3c_fb_data_s5p_wins[0], 1880 .win[0] = &s3c_fb_data_s5p_wins[0],
1865 .win[1] = &s3c_fb_data_s5p_wins[1], 1881 .win[1] = &s3c_fb_data_s5p_wins[1],
@@ -1923,6 +1939,8 @@ static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = {
1923 [1] = 0x2800, 1939 [1] = 0x2800,
1924 [2] = 0x2c00, 1940 [2] = 0x2c00,
1925 }, 1941 },
1942
1943 .has_blendcon = 1,
1926 }, 1944 },
1927 .win[0] = &s3c_fb_data_s5p_wins[0], 1945 .win[0] = &s3c_fb_data_s5p_wins[0],
1928 .win[1] = &s3c_fb_data_s5p_wins[1], 1946 .win[1] = &s3c_fb_data_s5p_wins[1],