2018-01-31 08:41:24

by Benjamin Gaignard

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

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 <[email protected]>
---
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);
}
--
2.15.0



2018-01-31 16:21:06

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH v2] drm/stm: check pitch and size calculations even if !CONFIG_MMU

Hi Benjamin,
Great, Many thanks,

Tested-by: Philippe Cornu <[email protected]>

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 <[email protected]>
> ---
> 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);
> }
>

2018-02-23 08:34:50

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH v2] drm/stm: check pitch and size calculations even if !CONFIG_MMU

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 <[email protected]>
> ---
> 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 <[email protected]>

Many thanks,
Philippe :-)

>
> return drm_gem_cma_dumb_create_internal(file, dev, args);
> }
>

2018-02-23 09:06:34

by Benjamin Gaignard

[permalink] [raw]
Subject: Re: [PATCH v2] drm/stm: check pitch and size calculations even if !CONFIG_MMU

2018-02-23 9:33 GMT+01:00 Philippe CORNU <[email protected]>:
> 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 <[email protected]>
>> ---
>> 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 <[email protected]>

Applied on drm-misc-next.

Regards,
Benjamin

>
> Many thanks,
> Philippe :-)
>
>>
>> return drm_gem_cma_dumb_create_internal(file, dev, args);
>> }
>>