> -----Original Message----- > From: linux-sunxi@googlegroups.com [mailto:linux- > su...@googlegroups.com] On Behalf Of Hans de Goede > Sent: Friday, December 27, 2013 5:58 PM > To: linux-sunxi@googlegroups.com > Subject: Re: [linux-sunxi] [PATCH 3.4] sunxi: Enable ZONE_DMA for sun4i and > sun5i (dma_zone_size=256MB) > > Hi, > > On 12/27/2013 01:29 AM, Siarhei Siamashka wrote: > > On Wed, 25 Dec 2013 10:14:54 +0100 > > Hans de Goede <hdego...@redhat.com> wrote: > > > >> Hi, > >> > >> On 12/25/2013 04:36 AM, Siarhei Siamashka wrote: > >>> Previously only sun7i had ZONE_DMA enabled, which is originating > >>> from the Allwinner linux-3.3 code drop. But there should be no > >>> reason to have it different for sun4i and sun5i. > >>> > >>> The practical effect of setting the dma_zone_size is that it affects > >>> the placement of the CMA area in physical RAM (if CMA is enabled in > >>> the kernel). And we want to have it placed in the first 256MB of > >>> physical RAM because the Cedar VPU is going to be unhappy otherwise. > >>> For example, the encoding of the address in MACC_MPEG_VLD_ADDR > >>> register is a bit tricky for anything that needs more than 28 bits: > >>> http://linux-sunxi.org/VE_Register_guide#MACC_MPEG_VLD_ADDR > >>> The low 4 bits might be supposed to store the high part of the > >>> address, but in practice the video playback is currently broken (in > >>> the proprietary libve and in the open source libvdpau-sunxi) if > >>> Cedar memory buffer is allocated at a physical address above 256MB. > >>> > >>> TL;DR this workarounds Cedar VPU issues in the case if CMA is > >>> enabled. > >> > >> Looks good: > >> > >> Acked-by: Hans de Goede <hdego...@redhat.com> > >> > >> Can you also write a similar patch for upstream and send it to Maxime > >> Ripard, with the relevant lists in the CC? We are bound to hit the > >> same problems upstream sooner or later too. > >> > >> Not 100% sure this is the right solution for upstream, but if nothing > >> else it will be good to start a discussion. > > > > It would make sense to get a better understanding about the addressing > > limitations of different sunxi peripherals. So far it looks like only > > Cedar VPU is affected. But even with Cedar, we are not completely sure > > that the hardware really can't handle it. Also according to the > > documentation, G2D seems to support 36-bit addressing (which looks > > strange and excessive for a 32-bit system). The display controller > > works fine with the buffers reserved above 256MB too. > > > > So unless we get some feedback directly from Allwinner about why > > ZONE_DMA had been configured this way for sun7i (was it also a hack > > specifically for something like Cedar?), it's difficult to see what > > can be done or discussed. > > Ok, thanks for the long answer. I was thinking along the same lines myself. > We may need to add a better way to pin cma allocations below 256M for > cedar upstream, without limiting dma access by the other peripherals to > 256M too. > > Maybe just send a mail to the relevant upstream list explaining we've an ip > block which (seems) to be limited to dma below 256MB and needs cma, so > we want a cma block below 256MB, but we don't want to set the DMA_ZONE > for the entire system to that as other ip blocks in the SoC don't have this limit, > and see what kind of solutions get suggested ?
Seem dma_declare_contiguous is the right way > > Note I realize we won't have cedar support upstream any time soon, but it > seems like a good idea to get this discussion started, and maybe a solution > created, well before we even start looking into upstream cedar support. > > Regards, > > Hans > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to linux-sunxi+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.