[PATCH 2/3] drm/etnaviv: allow to request specific virtual address for gem mapping

Philipp Zabel p.zabel at pengutronix.de
Mon Aug 5 08:21:55 UTC 2019


On Fri, 2019-08-02 at 19:29 +0200, Lucas Stach wrote:
> Allow the mapping code to request a specific virtual address for the gem
> mapping. If the virtual address is zero we fall back to the old mode of
> allocating a virtual address for the mapping.
> 
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel at pengutronix.de>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_gem.h |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 16 ++++++++++++++--
>  drivers/gpu/drm/etnaviv/etnaviv_mmu.h |  2 +-
>  4 files changed, 17 insertions(+), 5 deletions(-)
> 
[...]
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> index 99c20094295c..c344dde2fa05 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> @@ -220,9 +220,16 @@ static int etnaviv_iommu_find_iova(struct etnaviv_iommu_context *context,
>  	return ret;
>  }
>  
> +static int etnaviv_iommu_insert_exact(struct etnaviv_iommu_context *context,
> +		   struct drm_mm_node *node, size_t size, u64 va)
> +{
> +	return drm_mm_insert_node_in_range(&context->mm, node, size, 0, 0, va,
> +					   va + size, DRM_MM_INSERT_LOW);

We are only looking for an exact match, this could use
DRM_MM_INSERT_LOWEST.

regards
Philipp


More information about the dri-devel mailing list