Skip to content

Commit

Permalink
drm: rcar-du: Do not assume VSP has IOMMU
Browse files Browse the repository at this point in the history
While running under Xen all the IOMMUs belong to
the hypervisor, thus the assumption that VSP is backed
by the IOMMU is wrong. Use CMA helper for this use-case then.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
  • Loading branch information
Oleksandr Andrushchenko committed Aug 22, 2018
1 parent d6ea261 commit 178d2a7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/gpu/drm/rcar-du/rcar_du_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ struct drm_gem_object *rcar_du_gem_prime_import_sg_table(struct drm_device *dev,
struct dma_buf_attachment *attach,
struct sg_table *sgt)
{
#ifdef CONFIG_XEN
/*
* While running under Xen all the IOMMUs belong to
* the hypervisor, thus the assumption that VSP is backed
* by the IOMMU is wrong. Use CMA helper for this use-case then.
*/
return drm_gem_cma_prime_import_sg_table(dev, attach, sgt);
#else
struct rcar_du_device *rcdu = dev->dev_private;
struct drm_gem_cma_object *cma_obj;
struct drm_gem_object *gem_obj;
Expand Down Expand Up @@ -216,6 +224,7 @@ struct drm_gem_object *rcar_du_gem_prime_import_sg_table(struct drm_device *dev,
error:
kfree(cma_obj);
return ERR_PTR(ret);
#endif
}

int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev,
Expand Down

0 comments on commit 178d2a7

Please sign in to comment.