49a3f51dfe
This patch replaces the vmap/vunmap's use of raw pointers in GEM object functions with instances of struct dma_buf_map. GEM backends are converted as well. For most of them, this simply changes the returned type. TTM-based drivers now return information about the location of the memory, either system or I/O memory. GEM VRAM helpers and qxl now use ttm_bo_vmap() et al. Amdgpu, nouveau and radeon use drm_gem_ttm_vmap() et al instead of implementing their own vmap callbacks. v7: * init QXL cursor to mapped BO buffer (kernel test robot) v5: * update vkms after switch to shmem v4: * use ttm_bo_vmap(), drm_gem_ttm_vmap(), et al. (Daniel, Christian) * fix a trailing { in drm_gem_vmap() * remove several empty functions instead of converting them (Daniel) * comment uses of raw pointers with a TODO (Daniel) * TODO list: convert more helpers to use struct dma_buf_map Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Christian König <christian.koenig@amd.com> Tested-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201103093015.1063-7-tzimmermann@suse.de
48 lines
1.3 KiB
C
48 lines
1.3 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
|
|
|
|
struct dma_buf_attachment;
|
|
struct dma_buf_map;
|
|
struct drm_device;
|
|
struct drm_gem_object;
|
|
struct file;
|
|
struct sg_table;
|
|
struct vm_area_struct;
|
|
|
|
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);
|
|
|
|
int xen_drm_front_gem_prime_vmap(struct drm_gem_object *gem_obj,
|
|
struct dma_buf_map *map);
|
|
|
|
void xen_drm_front_gem_prime_vunmap(struct drm_gem_object *gem_obj,
|
|
struct dma_buf_map *map);
|
|
|
|
int xen_drm_front_gem_prime_mmap(struct drm_gem_object *gem_obj,
|
|
struct vm_area_struct *vma);
|
|
|
|
#endif /* __XEN_DRM_FRONT_GEM_H */
|