From 4394e96423444c1b37c8bb1ed0b1de8391dedafa Mon Sep 17 00:00:00 2001 From: Oleksandr Andrushchenko Date: Tue, 17 Apr 2018 10:40:12 +0300 Subject: 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 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 Suggested-by: Daniel Vetter Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20180417074012.21311-1-andr2000@gmail.com --- drivers/gpu/drm/xen/xen_drm_front.h | 42 ++++++------------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'drivers/gpu/drm/xen/xen_drm_front.h') diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h index 16554b2463d8..2c2479b571ae 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.h +++ b/drivers/gpu/drm/xen/xen_drm_front.h @@ -23,40 +23,14 @@ * * Depending on the requirements for the para-virtualized environment, namely * requirements dictated by the accompanying DRM/(v)GPU drivers running in both - * host and guest environments, number of operating modes of para-virtualized - * display driver are supported: - * - * - display buffers can be allocated by either frontend driver or backend - * - display buffers can be allocated to be contiguous in memory or not - * - * Note! Frontend driver itself has no dependency on contiguous memory for - * its operation. + * host and guest environments, display buffers can be allocated by either + * frontend driver or backend. */ /** * DOC: Buffers allocated by the frontend driver * - * The below modes of operation are configured at compile-time via - * frontend driver's kernel configuration: - */ - -/** - * DOC: With GEM CMA helpers - * - * This use-case is useful when used with accompanying DRM/vGPU driver in - * guest domain which was designed to only work with contiguous buffers, - * e.g. DRM driver based on GEM CMA helpers: such drivers can only import - * contiguous PRIME buffers, thus requiring frontend driver to provide - * such. In order to implement this mode of operation para-virtualized - * frontend driver can be configured to use GEM CMA helpers. - */ - -/** - * DOC: Without GEM CMA helpers - * - * If accompanying drivers can cope with non-contiguous memory then, to - * lower pressure on CMA subsystem of the kernel, driver can allocate - * buffers from system memory. + * In this mode of operation driver allocates buffers from system memory. * * Note! If used with accompanying DRM/(v)GPU drivers this mode of operation * may require IOMMU support on the platform, so accompanying DRM/vGPU @@ -164,13 +138,9 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline, u32 x, u32 y, u32 width, u32 height, u32 bpp, u64 fb_cookie); -int xen_drm_front_dbuf_create_from_sgt(struct xen_drm_front_info *front_info, - u64 dbuf_cookie, u32 width, u32 height, - u32 bpp, u64 size, struct sg_table *sgt); - -int xen_drm_front_dbuf_create_from_pages(struct xen_drm_front_info *front_info, - u64 dbuf_cookie, u32 width, u32 height, - u32 bpp, u64 size, struct page **pages); +int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, + u64 dbuf_cookie, u32 width, u32 height, + u32 bpp, u64 size, struct page **pages); int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info, u64 dbuf_cookie, u64 fb_cookie, u32 width, -- cgit v1.2.3