[PATCH 1/3] drm/vc4: Set premultiplied for alpha formats

Eric Anholt eric at anholt.net
Tue Mar 6 11:35:36 PST 2018


Stefan Schake <stschake at gmail.com> writes:

> Alpha formats in DRM are assumed to be premultiplied, so we should be
> setting the PREMULT bit in the plane configuration for HVS.
>
> Signed-off-by: Stefan Schake <stschake at gmail.com>
> ---
>  drivers/gpu/drm/vc4/vc4_plane.c | 3 ++-
>  drivers/gpu/drm/vc4/vc4_regs.h  | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index c4c7af1..3d0c8a2 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -618,13 +618,14 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
>  					      SCALER_POS1_SCL_HEIGHT));
>  	}
>  
> -	/* Position Word 2: Source Image Size, Alpha Mode */
> +	/* Position Word 2: Source Image Size, Alpha */
>  	vc4_state->pos2_offset = vc4_state->dlist_count;
>  	vc4_dlist_write(vc4_state,
>  			VC4_SET_FIELD(fb->format->has_alpha ?
>  				      SCALER_POS2_ALPHA_MODE_PIPELINE :
>  				      SCALER_POS2_ALPHA_MODE_FIXED,
>  				      SCALER_POS2_ALPHA_MODE) |
> +			(format->has_alpha ? SCALER_POS2_ALPHA_PREMULT : 0) |

Looks like you meant fb->format->has_alpha here.  I can fix that up when
applying -- everything else looks good to me.  I'll let this sit on the
list for a day or two in case anyone else has feedback.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rpi-kernel/attachments/20180306/d458db99/attachment.sig>


More information about the linux-rpi-kernel mailing list