All of lore.kernel.org
 help / color / mirror / Atom feed
* DMA, CMA and SWIOTLB
@ 2016-06-29  9:52 Jose Abreu
  2016-07-01 15:03 ` Liviu Dudau
  0 siblings, 1 reply; 2+ messages in thread
From: Jose Abreu @ 2016-06-29  9:52 UTC (permalink / raw)
  To: dmaengine, dri-devel

Hi all,

I am writing a very simple KMS driver that uses Xilinx VDMA to
transfer data between the host and a FPGA. To handle memory
allocation for DMA I am using the CMA helpers available in the
DRM subsystem. When setting for low video modes (small memory
requirements) everything works fine, but if I try to set a large
video mode (specifically a 4k HDMI mode) I get SWIOTLB errors
saying the buffer is full.

The distinction between CMA and SWIOTLB is not clear to me, but
these are two different allocation engines, right?

One important aspect in my configuration is that the Xilinx VDMA
can only access up to 28 bits of the host memory so I set the DMA
mask to 28 bits and force the CMA region to be allocated bellow
these 28 bits. I also tried increasing the CMA size and the
SWIOTLB size without success.

Any comments on this?

Thanks in advance for your help.

Best regards,
Jose Miguel Abreu
_______________________________________________
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

* Re: DMA, CMA and SWIOTLB
  2016-06-29  9:52 DMA, CMA and SWIOTLB Jose Abreu
@ 2016-07-01 15:03 ` Liviu Dudau
  0 siblings, 0 replies; 2+ messages in thread
From: Liviu Dudau @ 2016-07-01 15:03 UTC (permalink / raw)
  To: Jose Abreu; +Cc: dmaengine, dri-devel

On Wed, Jun 29, 2016 at 10:52:02AM +0100, Jose Abreu wrote:
> Hi all,
> 
> I am writing a very simple KMS driver that uses Xilinx VDMA to
> transfer data between the host and a FPGA. To handle memory
> allocation for DMA I am using the CMA helpers available in the
> DRM subsystem. When setting for low video modes (small memory
> requirements) everything works fine, but if I try to set a large
> video mode (specifically a 4k HDMI mode) I get SWIOTLB errors
> saying the buffer is full.
> 
> The distinction between CMA and SWIOTLB is not clear to me, but
> these are two different allocation engines, right?
> 
> One important aspect in my configuration is that the Xilinx VDMA
> can only access up to 28 bits of the host memory so I set the DMA
> mask to 28 bits and force the CMA region to be allocated bellow
> these 28 bits. I also tried increasing the CMA size and the
> SWIOTLB size without success.
> 
> Any comments on this?

You're not telling us which architecture you are using. For AArch64,
for example, the CMA expects DMA-able memory for the buffers. If
the driver does not call the dma_set_mask_and_coherent() function then
the arch core code will assume that the driver can't directly access
that memory and will use the SWIOTLB area for bouncing buffers around.
When the size of the buffers you are using for framebuffers increases,
you are likely to run out of SWIOTLB space.

Best regards,
Liviu

> 
> Thanks in advance for your help.
> 
> Best regards,
> Jose Miguel Abreu
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
-------------------
   .oooO
   (   )
    \ (  Oooo.
     \_) (   )
          ) /
         (_/

 One small step
   for me ...
_______________________________________________
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:[~2016-07-01 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29  9:52 DMA, CMA and SWIOTLB Jose Abreu
2016-07-01 15:03 ` Liviu Dudau

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.