mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Ayan Halder <ayan.halder@arm.com>
Cc: brian.starkey@arm.com, malidp@foss.arm.com, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	nd@arm.com
Subject: Re: [PATCH] drm/arm/malidp: Disable pixel alpha blending for colors that do not have alpha
Date: Fri, 12 Jan 2018 17:06:36 +0000	[thread overview]
Message-ID: <20180112170636.GE11192@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <1515774787-19324-1-git-send-email-ayan.halder@arm.com>

Hi Ayan,

On Fri, Jan 12, 2018 at 04:33:07PM +0000, Ayan Halder wrote:
> Mali dp needs to disable pixel alpha blending (use layer alpha blending) to
> display color formats that do not contain alpha bits per pixel

In the future, please mention any dependencies on other patches that are
not part of a series. In this case one needs your other patch, "drm: add
drm_format_alpha_bits".

Anyway, looks good to me.

Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>

Many thanks,
Liviu

> 
> Signed-off-by: Ayan Kumar Halder <ayan.halder@arm.com>
> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index e741979..4d7d564 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -35,6 +35,9 @@
>  #define   LAYER_COMP_MASK		(0x3 << 12)
>  #define   LAYER_COMP_PIXEL		(0x3 << 12)
>  #define   LAYER_COMP_PLANE		(0x2 << 12)
> +#define   LAYER_ALPHA_OFFSET	(16)
> +#define   LAYER_ALPHA_MASK		(0xff)
> +#define	  LAYER_ALPHA(x)		(((x) & LAYER_ALPHA_MASK) << LAYER_ALPHA_OFFSET)
>  #define MALIDP_LAYER_COMPOSE		0x008
>  #define MALIDP_LAYER_SIZE		0x00c
>  #define   LAYER_H_VAL(x)		(((x) & 0x1fff) << 0)
> @@ -268,6 +271,7 @@ static void malidp_de_plane_update(struct drm_plane *plane,
>  	struct malidp_plane_state *ms = to_malidp_plane_state(plane->state);
>  	u32 src_w, src_h, dest_w, dest_h, val;
>  	int i;
> +	u8 alpha_bits = plane->state->fb->format->alpha;
>  
>  	mp = to_malidp_plane(plane);
>  
> @@ -319,12 +323,25 @@ static void malidp_de_plane_update(struct drm_plane *plane,
>  	if (plane->state->rotation & DRM_MODE_REFLECT_Y)
>  		val |= LAYER_V_FLIP;
>  
> -	/*
> -	 * always enable pixel alpha blending until we have a way to change
> -	 * blend modes
> -	 */
>  	val &= ~LAYER_COMP_MASK;
> -	val |= LAYER_COMP_PIXEL;
> +	if (alpha_bits > 0) {
> +
> +		/*
> +		 * always enable pixel alpha blending until we have a way to change
> +		 * blend modes
> +		 */
> +		val |= LAYER_COMP_PIXEL;
> +	} else {
> +
> +		/*
> +		 * do not enable pixel alpha blending as the color channel does not
> +		 * have any alpha information
> +		 */
> +		val |= LAYER_COMP_PLANE;
> +
> +		/* Set layer alpha coefficient to 0xff ie fully opaque */
> +		val |= LAYER_ALPHA(0xff);
> +	}
>  
>  	val &= ~LAYER_FLOWCFG(LAYER_FLOWCFG_MASK);
>  	if (plane->state->crtc) {
> -- 
> 2.7.4
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

  reply	other threads:[~2018-01-17 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 16:33 Ayan Halder
2018-01-12 17:06 ` Liviu Dudau [this message]
2018-01-15  6:29 ` kbuild test robot

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=20180112170636.GE11192@e110455-lin.cambridge.arm.com \
    --to=liviu.dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=ayan.halder@arm.com \
    --cc=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malidp@foss.arm.com \
    --cc=nd@arm.com \
    /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

all inboxes | Powered by JetHome®