Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-30 Thread Vivek Gautam
Hi Tomasz, On Wed, Nov 28, 2018 at 8:39 AM Tomasz Figa wrote: > > Hi Vivek, > > On Tue, Nov 27, 2018 at 6:37 AM Vivek Gautam > wrote: > > > > dma_map_sg() expects a DMA domain. However, the drm devices > > have been traditionally using unmanaged iommu domain which > > is non-dma type. Using dma

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-30 Thread Vivek Gautam
On Wed, Nov 28, 2018 at 6:09 PM Rob Clark wrote: > > On Wed, Nov 28, 2018 at 2:39 AM Christoph Hellwig wrote: > > > > > + /* > > > + * dma_sync_sg_*() flush the physical pages, so point > > > + * sg->dma_address to the physical ones for the right > > > behav

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-29 Thread Vivek Gautam
Hi Christoph , On Wed, Nov 28, 2018 at 1:10 PM Christoph Hellwig wrote: > > > + /* > > + * dma_sync_sg_*() flush the physical pages, so point > > + * sg->dma_address to the physical ones for the right > > behavior. > > + */ > > + for

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-28 Thread Lukas Wunner
On Tue, Nov 27, 2018 at 11:39:40PM -0800, Christoph Hellwig wrote: > > + /* > > +* dma_sync_sg_*() flush the physical pages, so point > > +* sg->dma_address to the physical ones for the right behavior. > > +*/ > > + for_each_sg(msm_obj->sgt->s

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-28 Thread Rob Clark
On Wed, Nov 28, 2018 at 2:39 AM Christoph Hellwig wrote: > > > + /* > > + * dma_sync_sg_*() flush the physical pages, so point > > + * sg->dma_address to the physical ones for the right > > behavior. > > + */ > > + for_each_sg(msm_obj

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-27 Thread Christoph Hellwig
> + /* > + * dma_sync_sg_*() flush the physical pages, so point > + * sg->dma_address to the physical ones for the right behavior. > + */ > + for_each_sg(msm_obj->sgt->sgl, s, msm_obj->sgt->nents, i) > + sg_dma_addre

Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-27 Thread Tomasz Figa
Hi Vivek, On Tue, Nov 27, 2018 at 6:37 AM Vivek Gautam wrote: > > dma_map_sg() expects a DMA domain. However, the drm devices > have been traditionally using unmanaged iommu domain which > is non-dma type. Using dma mapping APIs with that domain is bad. > > Replace dma_map_sg() calls with dma_syn

[PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*

2018-11-27 Thread Vivek Gautam
dma_map_sg() expects a DMA domain. However, the drm devices have been traditionally using unmanaged iommu domain which is non-dma type. Using dma mapping APIs with that domain is bad. Replace dma_map_sg() calls with dma_sync_sg_for_device{|cpu}() to do the cache maintenance. Signed-off-by: Vivek