linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 1/2] video: s3c-fb: add alpha value width setting
Date: Mon, 30 Jan 2012 05:23:52 +0000	[thread overview]
Message-ID: <4F262968.2000606@gmx.de> (raw)
In-Reply-To: <007d01ccdcb7$24131ce0$6c3956a0$%han@samsung.com>

On 01/27/2012 05:47 AM, Jingoo Han wrote:
> 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>

Applied both patches of this series.


Thanks,

Florian Tobias Schandinat

> ---
>  arch/arm/plat-samsung/include/plat/regs-fb.h |    6 ++++++
>  drivers/video/s3c-fb.c                       |   18 ++++++++++++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
> index 8f39aa5..6bf68ed 100644
> --- a/arch/arm/plat-samsung/include/plat/regs-fb.h
> +++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
> @@ -384,3 +384,9 @@
>  #define WPALCON_W0PAL_16BPP_A555		(0x5 << 0)
>  #define WPALCON_W0PAL_16BPP_565			(0x6 << 0)
>  
> +/* Blending equation control */
> +#define BLENDCON				(0x260)
> +#define BLENDCON_NEW_MASK			(1 << 0)
> +#define BLENDCON_NEW_8BIT_ALPHA_VALUE		(1 << 0)
> +#define BLENDCON_NEW_4BIT_ALPHA_VALUE		(0 << 0)
> +
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 0c63b69..e92be55 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -81,6 +81,7 @@ struct s3c_fb;
>   * @palette: Address of palette memory, or 0 if none.
>   * @has_prtcon: Set if has PRTCON register.
>   * @has_shadowcon: Set if has SHADOWCON register.
> + * @has_blendcon: Set if has BLENDCON register.
>   * @has_clksel: Set if VIDCON0 register has CLKSEL bit.
>   */
>  struct s3c_fb_variant {
> @@ -99,6 +100,7 @@ struct s3c_fb_variant {
>  
>  	unsigned int	has_prtcon:1;
>  	unsigned int	has_shadowcon:1;
> +	unsigned int	has_blendcon:1;
>  	unsigned int	has_clksel:1;
>  };
>  
> @@ -692,6 +694,17 @@ static int s3c_fb_set_par(struct fb_info *info)
>  	writel(data, regs + sfb->variant.wincon + (win_no * 4));
>  	writel(0x0, regs + sfb->variant.winmap + (win_no * 4));
>  
> +	/* Set alpha value width */
> +	if (sfb->variant.has_blendcon) {
> +		data = readl(sfb->regs + BLENDCON);
> +		data &= ~BLENDCON_NEW_MASK;
> +		if (var->transp.length > 4)
> +			data |= BLENDCON_NEW_8BIT_ALPHA_VALUE;
> +		else
> +			data |= BLENDCON_NEW_4BIT_ALPHA_VALUE;
> +		writel(data, sfb->regs + BLENDCON);
> +	}
> +
>  	shadow_protect_win(win, 0);
>  
>  	pm_runtime_put_sync(sfb->dev);
> @@ -1819,6 +1832,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pc100 = {
>  		},
>  
>  		.has_prtcon	= 1,
> +		.has_blendcon	= 1,
>  		.has_clksel	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_s5p_wins[0],
> @@ -1850,6 +1864,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 = {
>  		},
>  
>  		.has_shadowcon	= 1,
> +		.has_blendcon	= 1,
>  		.has_clksel	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_s5p_wins[0],
> @@ -1881,6 +1896,7 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
>  		},
>  
>  		.has_shadowcon	= 1,
> +		.has_blendcon	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_s5p_wins[0],
>  	.win[1]	= &s3c_fb_data_s5p_wins[1],
> @@ -1944,6 +1960,8 @@ static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = {
>  			[1] = 0x2800,
>  			[2] = 0x2c00,
>  		},
> +
> +		.has_blendcon	= 1,
>  	},
>  	.win[0] = &s3c_fb_data_s5p_wins[0],
>  	.win[1] = &s3c_fb_data_s5p_wins[1],


      reply	other threads:[~2012-01-30  5:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  5:47 [PATCH 1/2] video: s3c-fb: add alpha value width setting Jingoo Han
2012-01-30  5:23 ` Florian Tobias Schandinat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F262968.2000606@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).