LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm/stm: ltdc: add layer alpha support
@ 2021-09-07 15:12 Raphael Gallais-Pou
  0 siblings, 0 replies; 3+ messages in thread
From: Raphael Gallais-Pou @ 2021-09-07 15:12 UTC (permalink / raw)
  To: Yannick Fertre, Philippe Cornu, Benjamin Gaignard
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre Torgue,
	dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	Raphael Gallais-Pou, Raphael Gallais-Pou

Android Hardware Composer supports alpha values applied to layers.
Enabling non-opaque layers for the STM CRTC could help offload GPU
resources for screen composition.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
 drivers/gpu/drm/stm/ltdc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 195de30eb90c..e0fef8bacfa8 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -845,7 +845,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
 			LXCFBLR_CFBLL | LXCFBLR_CFBP, val);
 
 	/* Specifies the constant alpha value */
-	val = CONSTA_MAX;
+	val = newstate->alpha >> 8;
 	reg_update_bits(ldev->regs, LTDC_L1CACR + lofs, LXCACR_CONSTA, val);
 
 	/* Specifies the blending factors */
@@ -997,6 +997,8 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
 
 	drm_plane_helper_add(plane, &ltdc_plane_helper_funcs);
 
+	drm_plane_create_alpha_property(plane);
+
 	DRM_DEBUG_DRIVER("plane:%d created\n", plane->base.id);
 
 	return plane;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/stm: ltdc: add layer alpha support
  2021-09-03  8:58 Raphael GALLAIS-POU - foss
@ 2021-09-07  6:55 ` yannick Fertre
  0 siblings, 0 replies; 3+ messages in thread
From: yannick Fertre @ 2021-09-07  6:55 UTC (permalink / raw)
  To: Raphael GALLAIS-POU - foss, Philippe CORNU - foss, Benjamin Gaignard
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin,
	Alexandre TORGUE - foss, dri-devel, linux-stm32,
	linux-arm-kernel, linux-kernel, Raphael GALLAIS-POU

Hi Raphael,
thanks for the patch.

Acked-by: Yannick Fertre <yannick.fertre@foss.st.com>
Reviewed-by: Yannick Fertre <yannick.fertre@foss.st.com>

On 9/3/21 10:58 AM, Raphael GALLAIS-POU - foss wrote:
> Android Hardware Composer supports alpha values applied to layers.
> Enabling non-opaque layers for the STM CRTC could help offload GPU
> resources for screen composition.
> 
> Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 195de30eb90c..e0fef8bacfa8 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -845,7 +845,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
>   			LXCFBLR_CFBLL | LXCFBLR_CFBP, val);
>   
>   	/* Specifies the constant alpha value */
> -	val = CONSTA_MAX;
> +	val = newstate->alpha >> 8;
>   	reg_update_bits(ldev->regs, LTDC_L1CACR + lofs, LXCACR_CONSTA, val);
>   
>   	/* Specifies the blending factors */
> @@ -997,6 +997,8 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
>   
>   	drm_plane_helper_add(plane, &ltdc_plane_helper_funcs);
>   
> +	drm_plane_create_alpha_property(plane);
> +
>   	DRM_DEBUG_DRIVER("plane:%d created\n", plane->base.id);
>   
>   	return plane;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] drm/stm: ltdc: add layer alpha support
@ 2021-09-03  8:58 Raphael GALLAIS-POU - foss
  2021-09-07  6:55 ` yannick Fertre
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael GALLAIS-POU - foss @ 2021-09-03  8:58 UTC (permalink / raw)
  To: Yannick FERTRE - foss, Philippe CORNU - foss, Benjamin Gaignard
  Cc: David Airlie, Daniel Vetter, Maxime Coquelin,
	Alexandre TORGUE - foss, dri-devel, linux-stm32,
	linux-arm-kernel, linux-kernel, Raphael GALLAIS-POU - foss,
	Raphael GALLAIS-POU

Android Hardware Composer supports alpha values applied to layers.
Enabling non-opaque layers for the STM CRTC could help offload GPU
resources for screen composition.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
---
 drivers/gpu/drm/stm/ltdc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 195de30eb90c..e0fef8bacfa8 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -845,7 +845,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
 			LXCFBLR_CFBLL | LXCFBLR_CFBP, val);
 
 	/* Specifies the constant alpha value */
-	val = CONSTA_MAX;
+	val = newstate->alpha >> 8;
 	reg_update_bits(ldev->regs, LTDC_L1CACR + lofs, LXCACR_CONSTA, val);
 
 	/* Specifies the blending factors */
@@ -997,6 +997,8 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
 
 	drm_plane_helper_add(plane, &ltdc_plane_helper_funcs);
 
+	drm_plane_create_alpha_property(plane);
+
 	DRM_DEBUG_DRIVER("plane:%d created\n", plane->base.id);
 
 	return plane;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-07 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 15:12 [PATCH] drm/stm: ltdc: add layer alpha support Raphael Gallais-Pou
  -- strict thread matches above, loose matches on Subject: below --
2021-09-03  8:58 Raphael GALLAIS-POU - foss
2021-09-07  6:55 ` yannick Fertre

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).