All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: select CMA and DMA_CMA if available
@ 2017-07-14 14:38 Lucas Stach
  2017-07-14 18:32 ` Joshua Clayton
  2017-07-16 15:29 ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: Lucas Stach @ 2017-07-14 14:38 UTC (permalink / raw)
  To: dri-devel; +Cc: etnaviv, kernel, Russell King

While this is no build dependency, etnaviv will only work correctly on most
systems if CMA and DMA_CMA are enabled. Select both options if available to
avoid users ending up with a non-working GPU due to a lacking kernel config.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/etnaviv/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig
index 71cee4e9fefb..38b477b5fbf9 100644
--- a/drivers/gpu/drm/etnaviv/Kconfig
+++ b/drivers/gpu/drm/etnaviv/Kconfig
@@ -10,6 +10,8 @@ config DRM_ETNAVIV
 	select IOMMU_API
 	select IOMMU_SUPPORT
 	select WANT_DEV_COREDUMP
+	select CMA if HAVE_DMA_CONTIGUOUS
+	select DMA_CMA if HAVE_DMA_CONTIGUOUS
 	help
 	  DRM driver for Vivante GPUs.
 
-- 
2.11.0

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

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

* Re: [PATCH] drm/etnaviv: select CMA and DMA_CMA if available
  2017-07-14 14:38 [PATCH] drm/etnaviv: select CMA and DMA_CMA if available Lucas Stach
@ 2017-07-14 18:32 ` Joshua Clayton
  2017-07-17  8:52   ` Lucas Stach
  2017-07-16 15:29 ` Russell King - ARM Linux
  1 sibling, 1 reply; 5+ messages in thread
From: Joshua Clayton @ 2017-07-14 18:32 UTC (permalink / raw)
  To: etnaviv; +Cc: Russell King, kernel, dri-devel

On Friday, July 14, 2017 7:38:01 AM PDT Lucas Stach wrote:
> While this is no build dependency, etnaviv will only work correctly on most
> systems if CMA and DMA_CMA are enabled. Select both options if available to
> avoid users ending up with a non-working GPU due to a lacking kernel config.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/etnaviv/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/etnaviv/Kconfig
> b/drivers/gpu/drm/etnaviv/Kconfig index 71cee4e9fefb..38b477b5fbf9 100644
> --- a/drivers/gpu/drm/etnaviv/Kconfig
> +++ b/drivers/gpu/drm/etnaviv/Kconfig
> @@ -10,6 +10,8 @@ config DRM_ETNAVIV
>  	select IOMMU_API
>  	select IOMMU_SUPPORT
>  	select WANT_DEV_COREDUMP
> +	select CMA if HAVE_DMA_CONTIGUOUS
> +	select DMA_CMA if HAVE_DMA_CONTIGUOUS
>  	help
>  	  DRM driver for Vivante GPUs.
IIRC, This at least half solves it.
Does the user of systems with > 2 GiB  need to explicitly specify cma size for 
it to work?

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

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

* Re: [PATCH] drm/etnaviv: select CMA and DMA_CMA if available
  2017-07-14 14:38 [PATCH] drm/etnaviv: select CMA and DMA_CMA if available Lucas Stach
  2017-07-14 18:32 ` Joshua Clayton
@ 2017-07-16 15:29 ` Russell King - ARM Linux
  2017-07-17  8:49   ` Lucas Stach
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2017-07-16 15:29 UTC (permalink / raw)
  To: Lucas Stach; +Cc: kernel, etnaviv, dri-devel

On Fri, Jul 14, 2017 at 04:38:01PM +0200, Lucas Stach wrote:
> While this is no build dependency, etnaviv will only work correctly on most
> systems if CMA and DMA_CMA are enabled. Select both options if available to
> avoid users ending up with a non-working GPU due to a lacking kernel config.

How does merely selecting CMA solve this problem?  Does CMA guarantee
that GPU command buffers will always be allocated in the lower 2G of
physical address space?

I suspect that's what you hope will happen, rather than a guarantee.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/etnaviv: select CMA and DMA_CMA if available
  2017-07-16 15:29 ` Russell King - ARM Linux
@ 2017-07-17  8:49   ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2017-07-17  8:49 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: kernel, etnaviv, dri-devel

Am Sonntag, den 16.07.2017, 16:29 +0100 schrieb Russell King - ARM
Linux:
> On Fri, Jul 14, 2017 at 04:38:01PM +0200, Lucas Stach wrote:
> > While this is no build dependency, etnaviv will only work correctly on most
> > systems if CMA and DMA_CMA are enabled. Select both options if available to
> > avoid users ending up with a non-working GPU due to a lacking kernel config.
> 
> How does merely selecting CMA solve this problem?  Does CMA guarantee
> that GPU command buffers will always be allocated in the lower 2G of
> physical address space?

No, but CMA guarantees that commandbuffers will be allocated from the
region and with the default CMA configuration dma_get_required_mask()
will return the correct location of the CMA area, so we can move the
linear memory window accordingly.
There are no guarantees, but at least with a CMA area no larger than 2GB
things will work for the average user, which is a lot better than
leaving them with a non-working GPU due to a simple missing kernel
configuration option.

Regards,
Lucas

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

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

* Re: [PATCH] drm/etnaviv: select CMA and DMA_CMA if available
  2017-07-14 18:32 ` Joshua Clayton
@ 2017-07-17  8:52   ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2017-07-17  8:52 UTC (permalink / raw)
  To: Joshua Clayton; +Cc: dri-devel, etnaviv, kernel, Russell King

Am Freitag, den 14.07.2017, 11:32 -0700 schrieb Joshua Clayton:
> On Friday, July 14, 2017 7:38:01 AM PDT Lucas Stach wrote:
> > While this is no build dependency, etnaviv will only work correctly on most
> > systems if CMA and DMA_CMA are enabled. Select both options if available to
> > avoid users ending up with a non-working GPU due to a lacking kernel config.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  drivers/gpu/drm/etnaviv/Kconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/Kconfig
> > b/drivers/gpu/drm/etnaviv/Kconfig index 71cee4e9fefb..38b477b5fbf9 100644
> > --- a/drivers/gpu/drm/etnaviv/Kconfig
> > +++ b/drivers/gpu/drm/etnaviv/Kconfig
> > @@ -10,6 +10,8 @@ config DRM_ETNAVIV
> >  	select IOMMU_API
> >  	select IOMMU_SUPPORT
> >  	select WANT_DEV_COREDUMP
> > +	select CMA if HAVE_DMA_CONTIGUOUS
> > +	select DMA_CMA if HAVE_DMA_CONTIGUOUS
> >  	help
> >  	  DRM driver for Vivante GPUs.
> IIRC, This at least half solves it.
> Does the user of systems with > 2 GiB  need to explicitly specify cma size for 
> it to work?

No, we move the linear memory window to the location of the CMA area,
which means as long as the user doesn't explicitly specify a CMA size
> 2GB things will just work.

Regards,
Lucas

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

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

end of thread, other threads:[~2017-07-17  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-14 14:38 [PATCH] drm/etnaviv: select CMA and DMA_CMA if available Lucas Stach
2017-07-14 18:32 ` Joshua Clayton
2017-07-17  8:52   ` Lucas Stach
2017-07-16 15:29 ` Russell King - ARM Linux
2017-07-17  8:49   ` Lucas Stach

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.