All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/sti: fix GDP size to support up to UHD resolution
@ 2017-03-23 14:44 Vincent Abriou
  2017-04-12 15:51 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Abriou @ 2017-03-23 14:44 UTC (permalink / raw)
  To: dri-devel; +Cc: Yannick Fertre, Vincent Abriou, Fabien Dessenne

On stih407-410 chip family the GDP layers are able to support up to UHD
resolution (3840 x 2160).

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
---
 drivers/gpu/drm/sti/sti_gdp.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 86279f5..88f16cd 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -66,7 +66,9 @@ static struct gdp_format_to_str {
 #define GAM_GDP_ALPHARANGE_255  BIT(5)
 #define GAM_GDP_AGC_FULL_RANGE  0x00808080
 #define GAM_GDP_PPT_IGNORE      (BIT(1) | BIT(0))
-#define GAM_GDP_SIZE_MAX        0x7FF
+
+#define GAM_GDP_SIZE_MAX_WIDTH  3840
+#define GAM_GDP_SIZE_MAX_HEIGHT 2160
 
 #define GDP_NODE_NB_BANK        2
 #define GDP_NODE_PER_FIELD      2
@@ -632,8 +634,8 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
 	/* src_x are in 16.16 format */
 	src_x = state->src_x >> 16;
 	src_y = state->src_y >> 16;
-	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX);
-	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX);
+	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH);
+	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT);
 
 	format = sti_gdp_fourcc2format(fb->format->format);
 	if (format == -1) {
@@ -741,8 +743,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
 	/* src_x are in 16.16 format */
 	src_x = state->src_x >> 16;
 	src_y = state->src_y >> 16;
-	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX);
-	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX);
+	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH);
+	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT);
 
 	list = sti_gdp_get_free_nodes(gdp);
 	top_field = list->top_field;
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: drm/sti: fix GDP size to support up to UHD resolution
  2017-03-23 14:44 [PATCH] drm/sti: fix GDP size to support up to UHD resolution Vincent Abriou
@ 2017-04-12 15:51 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2017-04-12 15:51 UTC (permalink / raw)
  To: Vincent Abriou; +Cc: Yannick Fertre, Fabien Dessenne, dri-devel

On Thu, 23 Mar 2017, Vincent Abriou wrote:
> On stih407-410 chip family the GDP layers are able to support up to UHD
> resolution (3840 x 2160).
> 
> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> ---
>  drivers/gpu/drm/sti/sti_gdp.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)

Please ensure this patch makes its way into v4.12.  Without it, large 
monitors will be artificially clipped, which negatively affects the
user experience.

Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 86279f5..88f16cd 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -66,7 +66,9 @@ static struct gdp_format_to_str {
>  #define GAM_GDP_ALPHARANGE_255  BIT(5)
>  #define GAM_GDP_AGC_FULL_RANGE  0x00808080
>  #define GAM_GDP_PPT_IGNORE      (BIT(1) | BIT(0))
> -#define GAM_GDP_SIZE_MAX        0x7FF
> +
> +#define GAM_GDP_SIZE_MAX_WIDTH  3840
> +#define GAM_GDP_SIZE_MAX_HEIGHT 2160
>  
>  #define GDP_NODE_NB_BANK        2
>  #define GDP_NODE_PER_FIELD      2
> @@ -632,8 +634,8 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
>  	/* src_x are in 16.16 format */
>  	src_x = state->src_x >> 16;
>  	src_y = state->src_y >> 16;
> -	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX);
> -	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX);
> +	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH);
> +	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT);
>  
>  	format = sti_gdp_fourcc2format(fb->format->format);
>  	if (format == -1) {
> @@ -741,8 +743,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
>  	/* src_x are in 16.16 format */
>  	src_x = state->src_x >> 16;
>  	src_y = state->src_y >> 16;
> -	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX);
> -	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX);
> +	src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH);
> +	src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT);
>  
>  	list = sti_gdp_get_free_nodes(gdp);
>  	top_field = list->top_field;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-04-12 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 14:44 [PATCH] drm/sti: fix GDP size to support up to UHD resolution Vincent Abriou
2017-04-12 15:51 ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.