From c8908bde0dbd35145f2cb6894e742aec84674af7 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Wed, 11 Sep 2019 14:03:50 +0200 Subject: drm/vram: Provide vmap and vunmap operations for GEM VRAM objects The implementation of vmap and vunmap for GEM VRAM helpers is already in PRIME helpers. The patch moves the operations to separate functions and exports them for general use. v3: * remove v2's obsolete note on ref-counting v2: * fix documentation * add cross references to function documentation * document (the lack of) ref-counting for GEM VRAM BO mappings Signed-off-by: Thomas Zimmermann Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20190911120352.20084-2-tzimmermann@suse.de --- include/drm/drm_gem_vram_helper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/drm/drm_gem_vram_helper.h') diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index 9aaef4f8c327..418eb1122861 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -43,7 +43,8 @@ struct vm_area_struct; * operations. So a buffer object that has been pinned N times with * drm_gem_vram_pin() must be unpinned N times with * drm_gem_vram_unpin(). The same applies to pairs of - * drm_gem_vram_kmap() and drm_gem_vram_kunmap(). + * drm_gem_vram_kmap() and drm_gem_vram_kunmap(), as well as pairs of + * drm_gem_vram_vmap() and drm_gem_vram_vunmap(). */ struct drm_gem_vram_object { struct ttm_buffer_object bo; @@ -101,6 +102,8 @@ int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo); void *drm_gem_vram_kmap(struct drm_gem_vram_object *gbo, bool map, bool *is_iomem); void drm_gem_vram_kunmap(struct drm_gem_vram_object *gbo); +void *drm_gem_vram_vmap(struct drm_gem_vram_object *gbo); +void drm_gem_vram_vunmap(struct drm_gem_vram_object *gbo, void *vaddr); int drm_gem_vram_fill_create_dumb(struct drm_file *file, struct drm_device *dev, -- cgit