diff mbox series

[v2] drm/stm: check pitch and size calculations even if !CONFIG_MMU

Message ID 20180131080508.14356-1-benjamin.gaignard@linaro.org
State Accepted
Commit 879659bb87a87a7a23b190e211d33bdd6763c746
Headers show
Series [v2] drm/stm: check pitch and size calculations even if !CONFIG_MMU | expand

Commit Message

Benjamin Gaignard Jan. 31, 2018, 8:05 a.m. UTC
In all cases we have to check pitch and size calculations to speed up
data transfer.

Fixes: 21f815bf773c ("drm/stm: drv: Improve data transfers")

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

---
 drivers/gpu/drm/stm/drv.c | 2 --
 1 file changed, 2 deletions(-)

-- 
2.15.0

Comments

Philippe CORNU Jan. 31, 2018, 3:55 p.m. UTC | #1
Hi Benjamin,
Great, Many thanks,

Tested-by: Philippe Cornu <philippe.cornu@st.com>


Philippe :-)


On 01/31/2018 09:05 AM, Benjamin Gaignard wrote:
> In all cases we have to check pitch and size calculations to speed up

> data transfer.

> 

> Fixes: 21f815bf773c ("drm/stm: drv: Improve data transfers")

> 

> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

> ---

>   drivers/gpu/drm/stm/drv.c | 2 --

>   1 file changed, 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c

> index 8bc7e8418b8d..9ab00a87f7cc 100644

> --- a/drivers/gpu/drm/stm/drv.c

> +++ b/drivers/gpu/drm/stm/drv.c

> @@ -35,7 +35,6 @@ static int stm_gem_cma_dumb_create(struct drm_file *file,

>   				   struct drm_device *dev,

>   				   struct drm_mode_create_dumb *args)

>   {

> -#ifdef CONFIG_MMU

>   	unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);

>   

>   	/*

> @@ -44,7 +43,6 @@ static int stm_gem_cma_dumb_create(struct drm_file *file,

>   	 */

>   	args->pitch = roundup(min_pitch, 128);

>   	args->height = roundup(args->height, 4);

> -#endif

>   

>   	return drm_gem_cma_dumb_create_internal(file, dev, args);

>   }

>
Philippe CORNU Feb. 23, 2018, 8:33 a.m. UTC | #2
Hi Benjamin,

On 01/31/2018 09:05 AM, Benjamin Gaignard wrote:
> In all cases we have to check pitch and size calculations to speed up

> data transfer.

> 

> Fixes: 21f815bf773c ("drm/stm: drv: Improve data transfers")

> 

> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

> ---

>   drivers/gpu/drm/stm/drv.c | 2 --

>   1 file changed, 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c

> index 8bc7e8418b8d..9ab00a87f7cc 100644

> --- a/drivers/gpu/drm/stm/drv.c

> +++ b/drivers/gpu/drm/stm/drv.c

> @@ -35,7 +35,6 @@ static int stm_gem_cma_dumb_create(struct drm_file *file,

>   				   struct drm_device *dev,

>   				   struct drm_mode_create_dumb *args)

>   {

> -#ifdef CONFIG_MMU

>   	unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);

>   

>   	/*

> @@ -44,7 +43,6 @@ static int stm_gem_cma_dumb_create(struct drm_file *file,

>   	 */

>   	args->pitch = roundup(min_pitch, 128);

>   	args->height = roundup(args->height, 4);

> -#endif


Reviewed-by: Philippe Cornu <philippe.cornu@st.com>


Many thanks,
Philippe :-)

>   

>   	return drm_gem_cma_dumb_create_internal(file, dev, args);

>   }

>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 8bc7e8418b8d..9ab00a87f7cc 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -35,7 +35,6 @@  static int stm_gem_cma_dumb_create(struct drm_file *file,
 				   struct drm_device *dev,
 				   struct drm_mode_create_dumb *args)
 {
-#ifdef CONFIG_MMU
 	unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
 
 	/*
@@ -44,7 +43,6 @@  static int stm_gem_cma_dumb_create(struct drm_file *file,
 	 */
 	args->pitch = roundup(min_pitch, 128);
 	args->height = roundup(args->height, 4);
-#endif
 
 	return drm_gem_cma_dumb_create_internal(file, dev, args);
 }