diff options
author | Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> | 2018-04-17 10:40:12 +0300 |
---|---|---|
committer | Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> | 2018-04-18 10:18:27 +0300 |
commit | 4394e96423444c1b37c8bb1ed0b1de8391dedafa (patch) | |
tree | e8cf2a3432f881fa3a37636a955a3aa5fed0263c /drivers/gpu/drm/xen/xen_drm_front_shbuf.c | |
parent | 02edfd9c1f63cfd9535009419177148758b20df4 (diff) | |
download | linux-4394e96423444c1b37c8bb1ed0b1de8391dedafa.tar.bz2 |
drm/xen-front: Remove CMA support
It turns out this was only needed to paper over a bug in the CMA
helpers, which was addressed in
commit 998fb1a0f478b83492220ff79583bf9ad538bdd8
Author: Liviu Dudau <Liviu.Dudau@arm.com>
Date: Fri Nov 10 13:33:10 2017 +0000
drm: gem_cma_helper.c: Allow importing of contiguous scatterlists with nents > 1
Without this the following pipeline didn't work:
domU:
1. xen-front allocates a non-contig buffer
2. creates grants out of it
dom0:
3. converts the grants into a dma-buf. Since they're non-contig, the
scatter-list is huge.
4. imports it into rcar-du, which requires dma-contig memory for
scanout.
-> On this given platform there's an IOMMU, so in theory this should
work. But in practice this failed, because of the huge number of sg
entries, even though the IOMMU driver mapped it all into a dma-contig
range.
With a guest-contig buffer allocated in step 1, this problem doesn't
exist. But there's technically no reason to require guest-contig
memory for xen buffer sharing using grants.
Given all that, the xen-front cma support is not needed and should be
removed.
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180417074012.21311-1-andr2000@gmail.com
Diffstat (limited to 'drivers/gpu/drm/xen/xen_drm_front_shbuf.c')
-rw-r--r-- | drivers/gpu/drm/xen/xen_drm_front_shbuf.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index 19914dde4b3d..d5705251a0d6 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c +++ b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c @@ -89,10 +89,6 @@ void xen_drm_front_shbuf_free(struct xen_drm_front_shbuf *buf) } kfree(buf->grefs); kfree(buf->directory); - if (buf->sgt) { - sg_free_table(buf->sgt); - kvfree(buf->pages); - } kfree(buf); } @@ -350,17 +346,6 @@ static int grant_references(struct xen_drm_front_shbuf *buf) static int alloc_storage(struct xen_drm_front_shbuf *buf) { - if (buf->sgt) { - buf->pages = kvmalloc_array(buf->num_pages, - sizeof(struct page *), GFP_KERNEL); - if (!buf->pages) - return -ENOMEM; - - if (drm_prime_sg_to_page_addr_arrays(buf->sgt, buf->pages, - NULL, buf->num_pages) < 0) - return -EINVAL; - } - buf->grefs = kcalloc(buf->num_grefs, sizeof(*buf->grefs), GFP_KERNEL); if (!buf->grefs) return -ENOMEM; @@ -396,12 +381,6 @@ xen_drm_front_shbuf_alloc(struct xen_drm_front_shbuf_cfg *cfg) struct xen_drm_front_shbuf *buf; int ret; - /* either pages or sgt, not both */ - if (unlikely(cfg->pages && cfg->sgt)) { - DRM_ERROR("Cannot handle buffer allocation with both pages and sg table provided\n"); - return NULL; - } - buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf) return NULL; @@ -413,7 +392,6 @@ xen_drm_front_shbuf_alloc(struct xen_drm_front_shbuf_cfg *cfg) buf->xb_dev = cfg->xb_dev; buf->num_pages = DIV_ROUND_UP(cfg->size, PAGE_SIZE); - buf->sgt = cfg->sgt; buf->pages = cfg->pages; buf->ops->calc_num_grefs(buf); |