linux/drivers/gpu/drm/xen/xen_drm_front_gem.h
Oleksandr Andrushchenko 4394e96423 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 998fb1a0f4
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
2018-04-18 10:18:27 +03:00

41 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/*
* Xen para-virtual DRM device
*
* Copyright (C) 2016-2018 EPAM Systems Inc.
*
* Author: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
*/
#ifndef __XEN_DRM_FRONT_GEM_H
#define __XEN_DRM_FRONT_GEM_H
#include <drm/drmP.h>
struct drm_gem_object *xen_drm_front_gem_create(struct drm_device *dev,
size_t size);
struct drm_gem_object *
xen_drm_front_gem_import_sg_table(struct drm_device *dev,
struct dma_buf_attachment *attach,
struct sg_table *sgt);
struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj);
struct page **xen_drm_front_gem_get_pages(struct drm_gem_object *obj);
void xen_drm_front_gem_free_object_unlocked(struct drm_gem_object *gem_obj);
int xen_drm_front_gem_mmap(struct file *filp, struct vm_area_struct *vma);
void *xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj);
void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
void *vaddr);
int xen_drm_front_gem_prime_mmap(struct drm_gem_object *gem_obj,
struct vm_area_struct *vma);
#endif /* __XEN_DRM_FRONT_GEM_H */