dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/stm: drv: Improve data transfers
@ 2018-01-30 10:42 Philippe Cornu
  2018-01-30 10:51 ` Benjamin Gaignard
  2018-01-30 14:58 ` Laurent Pinchart
  0 siblings, 2 replies; 7+ messages in thread
From: Philippe Cornu @ 2018-01-30 10:42 UTC (permalink / raw)
  To: Yannick Fertre, Philippe Cornu, Benjamin Gaignard,
	Vincent Abriou, David Airlie, dri-devel, linux-kernel,
	Archit Taneja, Andrzej Hajda, Laurent Pinchart
  Cc: Maxime Coquelin, Mickael Reulier, Ludovic Barre, Fabien Dessenne,
	Alexandre Torgue

To optimize data transfers, align pitch on 128 bytes & height
on 4 bytes. This optimization is not applicable on hw without MMU.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
  move CONFIG_MMU inside the function following comments from Benjamin
  Gaignard.

 drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 8fe954c27fba..8bc7e8418b8d 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs drv_mode_config_funcs = {
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
+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);
+
+	/*
+	 * in order to optimize data transfer, pitch is aligned on
+	 * 128 bytes, height is aligned on 4 bytes
+	 */
+	args->pitch = roundup(min_pitch, 128);
+	args->height = roundup(args->height, 4);
+#endif
+
+	return drm_gem_cma_dumb_create_internal(file, dev, args);
+}
+
 DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
 
 static struct drm_driver drv_driver = {
@@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
 	.minor = 0,
 	.patchlevel = 0,
 	.fops = &drv_driver_fops,
-	.dumb_create = drm_gem_cma_dumb_create,
+	.dumb_create = stm_gem_cma_dumb_create,
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
-- 
2.15.1

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

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 10:42 [PATCH v2] drm/stm: drv: Improve data transfers Philippe Cornu
@ 2018-01-30 10:51 ` Benjamin Gaignard
  2018-01-30 15:01   ` Laurent Pinchart
  2018-01-30 14:58 ` Laurent Pinchart
  1 sibling, 1 reply; 7+ messages in thread
From: Benjamin Gaignard @ 2018-01-30 10:51 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Alexandre Torgue, David Airlie, Linux Kernel Mailing List,
	dri-devel, Yannick Fertre, Laurent Pinchart, Maxime Coquelin,
	Mickael Reulier, Vincent Abriou, Ludovic Barre, Fabien Dessenne

2018-01-30 11:42 GMT+01:00 Philippe Cornu <philippe.cornu@st.com>:
> To optimize data transfers, align pitch on 128 bytes & height
> on 4 bytes. This optimization is not applicable on hw without MMU.
>
> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>

Applied on drm-misc-next.

Regards,
Benjamin
> ---
> Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
>   move CONFIG_MMU inside the function following comments from Benjamin
>   Gaignard.
>
>  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 8fe954c27fba..8bc7e8418b8d 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs drv_mode_config_funcs = {
>         .atomic_commit = drm_atomic_helper_commit,
>  };
>
> +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);
> +
> +       /*
> +        * in order to optimize data transfer, pitch is aligned on
> +        * 128 bytes, height is aligned on 4 bytes
> +        */
> +       args->pitch = roundup(min_pitch, 128);
> +       args->height = roundup(args->height, 4);
> +#endif
> +
> +       return drm_gem_cma_dumb_create_internal(file, dev, args);
> +}
> +
>  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
>
>  static struct drm_driver drv_driver = {
> @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
>         .minor = 0,
>         .patchlevel = 0,
>         .fops = &drv_driver_fops,
> -       .dumb_create = drm_gem_cma_dumb_create,
> +       .dumb_create = stm_gem_cma_dumb_create,
>         .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>         .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
>         .gem_free_object_unlocked = drm_gem_cma_free_object,
> --
> 2.15.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 10:42 [PATCH v2] drm/stm: drv: Improve data transfers Philippe Cornu
  2018-01-30 10:51 ` Benjamin Gaignard
@ 2018-01-30 14:58 ` Laurent Pinchart
  2018-01-30 15:08   ` Benjamin Gaignard
  1 sibling, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2018-01-30 14:58 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Maxime Coquelin, Alexandre Torgue, David Airlie, linux-kernel,
	dri-devel, Yannick Fertre, Fabien Dessenne, Mickael Reulier,
	Vincent Abriou, Ludovic Barre

Hi Philippe,

Thank you for the patch.

On Tuesday, 30 January 2018 12:42:00 EET Philippe Cornu wrote:
> To optimize data transfers, align pitch on 128 bytes & height
> on 4 bytes. This optimization is not applicable on hw without MMU.
> 
> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
>   move CONFIG_MMU inside the function following comments from Benjamin
>   Gaignard.
> 
>  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 8fe954c27fba..8bc7e8418b8d 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs
> drv_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit,
>  };
> 
> +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);
> +
> +	/*
> +	 * in order to optimize data transfer, pitch is aligned on
> +	 * 128 bytes, height is aligned on 4 bytes
> +	 */
> +	args->pitch = roundup(min_pitch, 128);
> +	args->height = roundup(args->height, 4);
> +#endif
> +
> +	return drm_gem_cma_dumb_create_internal(file, dev, args);

In the !CONFIG_MMU case you now bypass the pitch and size calculations 
performed by drm_gem_cma_dumb_create(), allowing userspace to allocate 
arbitrarily large buffers. Is that intentional ?

> +}
> +
>  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
> 
>  static struct drm_driver drv_driver = {
> @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
>  	.minor = 0,
>  	.patchlevel = 0,
>  	.fops = &drv_driver_fops,
> -	.dumb_create = drm_gem_cma_dumb_create,
> +	.dumb_create = stm_gem_cma_dumb_create,
>  	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>  	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
>  	.gem_free_object_unlocked = drm_gem_cma_free_object,

-- 
Regards,

Laurent Pinchart

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

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 10:51 ` Benjamin Gaignard
@ 2018-01-30 15:01   ` Laurent Pinchart
  2018-01-30 15:28     ` Jani Nikula
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2018-01-30 15:01 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: Alexandre Torgue, David Airlie, Philippe Cornu, dri-devel,
	Linux Kernel Mailing List, Yannick Fertre, Fabien Dessenne,
	Maxime Coquelin, Mickael Reulier, Vincent Abriou, Ludovic Barre

Hi Benjamin,

On Tuesday, 30 January 2018 12:51:25 EET Benjamin Gaignard wrote:
> 2018-01-30 11:42 GMT+01:00 Philippe Cornu <philippe.cornu@st.com>:
> > To optimize data transfers, align pitch on 128 bytes & height
> > on 4 bytes. This optimization is not applicable on hw without MMU.
> > 
> > Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> > Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> > Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> 
> Applied on drm-misc-next.

A 9 minutes review window is pretty small... I've been told before that I 
should then review v1 instead of complaining about short review times for v2, 
but in this case v2 introduces a bug that wasn't present in v1.

> > ---
> > Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
> > 
> >   move CONFIG_MMU inside the function following comments from Benjamin
> >   Gaignard.
> >  
> >  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
> >  1 file changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> > index 8fe954c27fba..8bc7e8418b8d 100644
> > --- a/drivers/gpu/drm/stm/drv.c
> > +++ b/drivers/gpu/drm/stm/drv.c
> > @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs
> > drv_mode_config_funcs = {> 
> >         .atomic_commit = drm_atomic_helper_commit,
> >  
> >  };
> > 
> > +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);
> > +
> > +       /*
> > +        * in order to optimize data transfer, pitch is aligned on
> > +        * 128 bytes, height is aligned on 4 bytes
> > +        */
> > +       args->pitch = roundup(min_pitch, 128);
> > +       args->height = roundup(args->height, 4);
> > +#endif
> > +
> > +       return drm_gem_cma_dumb_create_internal(file, dev, args);
> > +}
> > +
> > 
> >  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
> >  
> >  static struct drm_driver drv_driver = {
> > 
> > @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
> > 
> >         .minor = 0,
> >         .patchlevel = 0,
> >         .fops = &drv_driver_fops,
> > 
> > -       .dumb_create = drm_gem_cma_dumb_create,
> > +       .dumb_create = stm_gem_cma_dumb_create,
> > 
> >         .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
> >         .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> >         .gem_free_object_unlocked = drm_gem_cma_free_object,
> > 
> > --
> > 2.15.1

-- 
Regards,

Laurent Pinchart

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

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 14:58 ` Laurent Pinchart
@ 2018-01-30 15:08   ` Benjamin Gaignard
  2018-01-30 15:10     ` Laurent Pinchart
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Gaignard @ 2018-01-30 15:08 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Philippe Cornu, Yannick Fertre, Vincent Abriou, David Airlie,
	dri-devel, Linux Kernel Mailing List, Archit Taneja,
	Andrzej Hajda, Fabien Dessenne, Mickael Reulier, Ludovic Barre,
	Alexandre Torgue, Maxime Coquelin

2018-01-30 15:58 GMT+01:00 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Philippe,
>
> Thank you for the patch.
>
> On Tuesday, 30 January 2018 12:42:00 EET Philippe Cornu wrote:
>> To optimize data transfers, align pitch on 128 bytes & height
>> on 4 bytes. This optimization is not applicable on hw without MMU.
>>
>> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
>> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>> Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
>>   move CONFIG_MMU inside the function following comments from Benjamin
>>   Gaignard.
>>
>>  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
>>  1 file changed, 19 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
>> index 8fe954c27fba..8bc7e8418b8d 100644
>> --- a/drivers/gpu/drm/stm/drv.c
>> +++ b/drivers/gpu/drm/stm/drv.c
>> @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs
>> drv_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit,
>>  };
>>
>> +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);
>> +
>> +     /*
>> +      * in order to optimize data transfer, pitch is aligned on
>> +      * 128 bytes, height is aligned on 4 bytes
>> +      */
>> +     args->pitch = roundup(min_pitch, 128);
>> +     args->height = roundup(args->height, 4);
>> +#endif
>> +
>> +     return drm_gem_cma_dumb_create_internal(file, dev, args);
>
> In the !CONFIG_MMU case you now bypass the pitch and size calculations
> performed by drm_gem_cma_dumb_create(), allowing userspace to allocate
> arbitrarily large buffers. Is that intentional ?

My bad, I will send a fix

>
>> +}
>> +
>>  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
>>
>>  static struct drm_driver drv_driver = {
>> @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
>>       .minor = 0,
>>       .patchlevel = 0,
>>       .fops = &drv_driver_fops,
>> -     .dumb_create = drm_gem_cma_dumb_create,
>> +     .dumb_create = stm_gem_cma_dumb_create,
>>       .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>>       .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
>>       .gem_free_object_unlocked = drm_gem_cma_free_object,
>
> --
> Regards,
>
> Laurent Pinchart
>

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 15:08   ` Benjamin Gaignard
@ 2018-01-30 15:10     ` Laurent Pinchart
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2018-01-30 15:10 UTC (permalink / raw)
  To: Benjamin Gaignard
  Cc: Philippe Cornu, Yannick Fertre, Vincent Abriou, David Airlie,
	dri-devel, Linux Kernel Mailing List, Archit Taneja,
	Andrzej Hajda, Fabien Dessenne, Mickael Reulier, Ludovic Barre,
	Alexandre Torgue, Maxime Coquelin

Hi Benjamin,

On Tuesday, 30 January 2018 17:08:48 EET Benjamin Gaignard wrote:
> 2018-01-30 15:58 GMT+01:00 Laurent Pinchart:
> > On Tuesday, 30 January 2018 12:42:00 EET Philippe Cornu wrote:
> >> To optimize data transfers, align pitch on 128 bytes & height
> >> on 4 bytes. This optimization is not applicable on hw without MMU.
> >> 
> >> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> >> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
> >> 
> >>   move CONFIG_MMU inside the function following comments from Benjamin
> >>   Gaignard.
> >>  
> >>  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
> >>  1 file changed, 19 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> >> index 8fe954c27fba..8bc7e8418b8d 100644
> >> --- a/drivers/gpu/drm/stm/drv.c
> >> +++ b/drivers/gpu/drm/stm/drv.c
> >> @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs
> >> drv_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit,
> >> 
> >>  };
> >> 
> >> +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);
> >> +
> >> +     /*
> >> +      * in order to optimize data transfer, pitch is aligned on
> >> +      * 128 bytes, height is aligned on 4 bytes
> >> +      */
> >> +     args->pitch = roundup(min_pitch, 128);
> >> +     args->height = roundup(args->height, 4);
> >> +#endif
> >> +
> >> +     return drm_gem_cma_dumb_create_internal(file, dev, args);
> > 
> > In the !CONFIG_MMU case you now bypass the pitch and size calculations
> > performed by drm_gem_cma_dumb_create(), allowing userspace to allocate
> > arbitrarily large buffers. Is that intentional ?
> 
> My bad, I will send a fix

Thank you.

> >> +}
> >> +
> >> 
> >>  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
> >>  
> >>  static struct drm_driver drv_driver = {
> >> 
> >> @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
> >> 
> >>       .minor = 0,
> >>       .patchlevel = 0,
> >>       .fops = &drv_driver_fops,
> >> 
> >> -     .dumb_create = drm_gem_cma_dumb_create,
> >> +     .dumb_create = stm_gem_cma_dumb_create,
> >> 
> >>       .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
> >>       .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
> >>       .gem_free_object_unlocked = drm_gem_cma_free_object,

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2] drm/stm: drv: Improve data transfers
  2018-01-30 15:01   ` Laurent Pinchart
@ 2018-01-30 15:28     ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2018-01-30 15:28 UTC (permalink / raw)
  To: Laurent Pinchart, Benjamin Gaignard
  Cc: Alexandre Torgue, David Airlie, Linux Kernel Mailing List,
	dri-devel, Philippe Cornu, Yannick Fertre, Fabien Dessenne,
	Maxime Coquelin, Mickael Reulier, Vincent Abriou, Ludovic Barre

On Tue, 30 Jan 2018, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:
> Hi Benjamin,
>
> On Tuesday, 30 January 2018 12:51:25 EET Benjamin Gaignard wrote:
>> 2018-01-30 11:42 GMT+01:00 Philippe Cornu <philippe.cornu@st.com>:
>> > To optimize data transfers, align pitch on 128 bytes & height
>> > on 4 bytes. This optimization is not applicable on hw without MMU.
>> > 
>> > Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
>> > Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
>> > Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> 
>> Applied on drm-misc-next.
>
> A 9 minutes review window is pretty small... I've been told before that I 
> should then review v1 instead of complaining about short review times for v2, 
> but in this case v2 introduces a bug that wasn't present in v1.

IMO no patch ever needs to be applied this fast. Give more eyeballs a
chance.

BR,
Jani.


>
>> > ---
>> > Changes in v2: Rename stm_dumb_create() to stm_gem_cma_dumb_create() and
>> > 
>> >   move CONFIG_MMU inside the function following comments from Benjamin
>> >   Gaignard.
>> >  
>> >  drivers/gpu/drm/stm/drv.c | 20 +++++++++++++++++++-
>> >  1 file changed, 19 insertions(+), 1 deletion(-)
>> > 
>> > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
>> > index 8fe954c27fba..8bc7e8418b8d 100644
>> > --- a/drivers/gpu/drm/stm/drv.c
>> > +++ b/drivers/gpu/drm/stm/drv.c
>> > @@ -31,6 +31,24 @@ static const struct drm_mode_config_funcs
>> > drv_mode_config_funcs = {> 
>> >         .atomic_commit = drm_atomic_helper_commit,
>> >  
>> >  };
>> > 
>> > +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);
>> > +
>> > +       /*
>> > +        * in order to optimize data transfer, pitch is aligned on
>> > +        * 128 bytes, height is aligned on 4 bytes
>> > +        */
>> > +       args->pitch = roundup(min_pitch, 128);
>> > +       args->height = roundup(args->height, 4);
>> > +#endif
>> > +
>> > +       return drm_gem_cma_dumb_create_internal(file, dev, args);
>> > +}
>> > +
>> > 
>> >  DEFINE_DRM_GEM_CMA_FOPS(drv_driver_fops);
>> >  
>> >  static struct drm_driver drv_driver = {
>> > 
>> > @@ -44,7 +62,7 @@ static struct drm_driver drv_driver = {
>> > 
>> >         .minor = 0,
>> >         .patchlevel = 0,
>> >         .fops = &drv_driver_fops,
>> > 
>> > -       .dumb_create = drm_gem_cma_dumb_create,
>> > +       .dumb_create = stm_gem_cma_dumb_create,
>> > 
>> >         .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>> >         .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
>> >         .gem_free_object_unlocked = drm_gem_cma_free_object,
>> > 
>> > --
>> > 2.15.1

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-01-30 15:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 10:42 [PATCH v2] drm/stm: drv: Improve data transfers Philippe Cornu
2018-01-30 10:51 ` Benjamin Gaignard
2018-01-30 15:01   ` Laurent Pinchart
2018-01-30 15:28     ` Jani Nikula
2018-01-30 14:58 ` Laurent Pinchart
2018-01-30 15:08   ` Benjamin Gaignard
2018-01-30 15:10     ` Laurent Pinchart

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