dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
  • * [PATCH 07/13] drm/msm: Use sychronized interface of the IOMMU-API
           [not found] <1502974596-23835-1-git-send-email-joro@8bytes.org>
           [not found] ` <1502974596-23835-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
    @ 2017-08-17 12:56 ` Joerg Roedel
      2017-08-19 15:39   ` Rob Clark
      2017-08-17 12:56 ` [PATCH 09/13] drm/rockchip: " Joerg Roedel
      2 siblings, 1 reply; 15+ messages in thread
    From: Joerg Roedel @ 2017-08-17 12:56 UTC (permalink / raw)
      To: iommu
      Cc: linux-kernel, Suravee Suthikulpanit, Joerg Roedel, Rob Clark,
    	David Airlie, linux-arm-msm, dri-devel, freedreno
    
    From: Joerg Roedel <jroedel@suse.de>
    
    The map and unmap functions of the IOMMU-API changed their
    semantics: They do no longer guarantee that the hardware
    TLBs are synchronized with the page-table updates they made.
    
    To make conversion easier, new synchronized functions have
    been introduced which give these guarantees again until the
    code is converted to use the new TLB-flush interface of the
    IOMMU-API, which allows certain optimizations.
    
    But for now, just convert this code to use the synchronized
    functions so that it will behave as before.
    
    Cc: Rob Clark <robdclark@gmail.com>
    Cc: David Airlie <airlied@linux.ie>
    Cc: linux-arm-msm@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: freedreno@lists.freedesktop.org
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    ---
     drivers/gpu/drm/msm/msm_iommu.c | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
    index b23d336..b3525b7 100644
    --- a/drivers/gpu/drm/msm/msm_iommu.c
    +++ b/drivers/gpu/drm/msm/msm_iommu.c
    @@ -64,7 +64,8 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
     	size_t ret;
     
     //	pm_runtime_get_sync(mmu->dev);
    -	ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot);
    +	ret = iommu_map_sg_sync(iommu->domain, iova, sgt->sgl,
    +				sgt->nents, prot);
     //	pm_runtime_put_sync(mmu->dev);
     	WARN_ON(ret < 0);
     
    @@ -77,7 +78,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova,
     	struct msm_iommu *iommu = to_msm_iommu(mmu);
     
     	pm_runtime_get_sync(mmu->dev);
    -	iommu_unmap(iommu->domain, iova, len);
    +	iommu_unmap_sync(iommu->domain, iova, len);
     	pm_runtime_put_sync(mmu->dev);
     
     	return 0;
    -- 
    2.7.4
    
    ^ permalink raw reply related	[flat|nested] 15+ messages in thread
  • * [PATCH 09/13] drm/rockchip: Use sychronized interface of the IOMMU-API
           [not found] <1502974596-23835-1-git-send-email-joro@8bytes.org>
           [not found] ` <1502974596-23835-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
      2017-08-17 12:56 ` [PATCH 07/13] drm/msm: " Joerg Roedel
    @ 2017-08-17 12:56 ` Joerg Roedel
      2 siblings, 0 replies; 15+ messages in thread
    From: Joerg Roedel @ 2017-08-17 12:56 UTC (permalink / raw)
      To: iommu
      Cc: linux-kernel, Suravee Suthikulpanit, Joerg Roedel, Mark Yao,
    	David Airlie, Heiko Stuebner, dri-devel, linux-arm-kernel,
    	linux-rockchip
    
    From: Joerg Roedel <jroedel@suse.de>
    
    The map and unmap functions of the IOMMU-API changed their
    semantics: They do no longer guarantee that the hardware
    TLBs are synchronized with the page-table updates they made.
    
    To make conversion easier, new synchronized functions have
    been introduced which give these guarantees again until the
    code is converted to use the new TLB-flush interface of the
    IOMMU-API, which allows certain optimizations.
    
    But for now, just convert this code to use the synchronized
    functions so that it will behave as before.
    
    Cc: Mark Yao <mark.yao@rock-chips.com>
    Cc: David Airlie <airlied@linux.ie>
    Cc: Heiko Stuebner <heiko@sntech.de>
    Cc: dri-devel@lists.freedesktop.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-rockchip@lists.infradead.org
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    ---
     drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
    index b74ac71..6d28224 100644
    --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
    +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
    @@ -41,8 +41,8 @@ static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj)
     
     	rk_obj->dma_addr = rk_obj->mm.start;
     
    -	ret = iommu_map_sg(private->domain, rk_obj->dma_addr, rk_obj->sgt->sgl,
    -			   rk_obj->sgt->nents, prot);
    +	ret = iommu_map_sg_sync(private->domain, rk_obj->dma_addr,
    +				rk_obj->sgt->sgl, rk_obj->sgt->nents, prot);
     	if (ret < rk_obj->base.size) {
     		DRM_ERROR("failed to map buffer: size=%zd request_size=%zd\n",
     			  ret, rk_obj->base.size);
    @@ -67,7 +67,7 @@ static int rockchip_gem_iommu_unmap(struct rockchip_gem_object *rk_obj)
     	struct drm_device *drm = rk_obj->base.dev;
     	struct rockchip_drm_private *private = drm->dev_private;
     
    -	iommu_unmap(private->domain, rk_obj->dma_addr, rk_obj->size);
    +	iommu_unmap_sync(private->domain, rk_obj->dma_addr, rk_obj->size);
     
     	mutex_lock(&private->mm_lock);
     
    -- 
    2.7.4
    
    ^ permalink raw reply related	[flat|nested] 15+ messages in thread

  • end of thread, other threads:[~2017-08-19 15:39 UTC | newest]
    
    Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1502974596-23835-1-git-send-email-joro@8bytes.org>
         [not found] ` <1502974596-23835-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
    2017-08-17 12:56   ` [PATCH 06/13] drm/etnaviv: Use sychronized interface of the IOMMU-API Joerg Roedel
         [not found]     ` <1502974596-23835-7-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
    2017-08-17 13:32       ` Lucas Stach
         [not found]         ` <1502976758.19806.25.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
    2017-08-17 13:45           ` Joerg Roedel
    2017-08-17 14:03             ` Lucas Stach
         [not found]               ` <1502978634.19806.27.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
    2017-08-17 14:18                 ` Joerg Roedel
         [not found]                   ` <20170817141858.GG16908-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
    2017-08-17 14:30                     ` Lucas Stach
    2017-08-17 14:35                       ` Joerg Roedel
    2017-08-17 12:56   ` [PATCH 08/13] drm/nouveau/imem/gk20a: " Joerg Roedel
    2017-08-17 12:56   ` [PATCH 10/13] drm/tegra: " Joerg Roedel
    2017-08-17 13:28     ` Thierry Reding
    2017-08-17 12:56   ` [PATCH 11/13] gpu: host1x: " Joerg Roedel
         [not found]     ` <1502974596-23835-12-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
    2017-08-17 13:29       ` Thierry Reding
    2017-08-17 12:56 ` [PATCH 07/13] drm/msm: " Joerg Roedel
    2017-08-19 15:39   ` Rob Clark
    2017-08-17 12:56 ` [PATCH 09/13] drm/rockchip: " Joerg Roedel
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox