The GEM VRAM functions with kmap-object argument are not requried any longer. Remove them. Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx> --- drivers/gpu/drm/drm_gem_vram_helper.c | 50 +++++---------------------- include/drm/drm_gem_vram_helper.h | 4 --- 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 4cae52054e61..4de782ca26b2 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -279,12 +279,11 @@ int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) EXPORT_SYMBOL(drm_gem_vram_unpin); /** - * drm_gem_vram_kmap_at() - Maps a GEM VRAM object into kernel address space + * drm_gem_vram_kmap() - Maps a GEM VRAM object into kernel address space * @gbo: the GEM VRAM object * @map: establish a mapping if necessary * @is_iomem: returns true if the mapped memory is I/O memory, or false \ otherwise; can be NULL - * @kmap: the mapping's kmap object * * This function maps the buffer object into the kernel's address space * or returns the current mapping. If the parameter map is false, the @@ -296,10 +295,11 @@ EXPORT_SYMBOL(drm_gem_vram_unpin); * NULL if not mapped, or * an ERR_PTR()-encoded error code otherwise. */ -void *drm_gem_vram_kmap_at(struct drm_gem_vram_object *gbo, bool map, - bool *is_iomem, struct ttm_bo_kmap_obj *kmap) +void *drm_gem_vram_kmap(struct drm_gem_vram_object *gbo, bool map, + bool *is_iomem) { int ret; + struct ttm_bo_kmap_obj *kmap = &gbo->kmap; if (kmap->virtual || !map) goto out; @@ -317,56 +317,22 @@ void *drm_gem_vram_kmap_at(struct drm_gem_vram_object *gbo, bool map, } return ttm_kmap_obj_virtual(kmap, is_iomem); } -EXPORT_SYMBOL(drm_gem_vram_kmap_at); - -/** - * drm_gem_vram_kmap() - Maps a GEM VRAM object into kernel address space - * @gbo: the GEM VRAM object - * @map: establish a mapping if necessary - * @is_iomem: returns true if the mapped memory is I/O memory, or false \ - otherwise; can be NULL - * - * This function maps the buffer object into the kernel's address space - * or returns the current mapping. If the parameter map is false, the - * function only queries the current mapping, but does not establish a - * new one. - * - * Returns: - * The buffers virtual address if mapped, or - * NULL if not mapped, or - * an ERR_PTR()-encoded error code otherwise. - */ -void *drm_gem_vram_kmap(struct drm_gem_vram_object *gbo, bool map, - bool *is_iomem) -{ - return drm_gem_vram_kmap_at(gbo, map, is_iomem, &gbo->kmap); -} EXPORT_SYMBOL(drm_gem_vram_kmap); /** - * drm_gem_vram_kunmap_at() - Unmaps a GEM VRAM object + * drm_gem_vram_kunmap() - Unmaps a GEM VRAM object * @gbo: the GEM VRAM object - * @kmap: the mapping's kmap object */ -void drm_gem_vram_kunmap_at(struct drm_gem_vram_object *gbo, - struct ttm_bo_kmap_obj *kmap) +void drm_gem_vram_kunmap(struct drm_gem_vram_object *gbo) { + struct ttm_bo_kmap_obj *kmap = &gbo->kmap; + if (!kmap->virtual) return; ttm_bo_kunmap(kmap); kmap->virtual = NULL; } -EXPORT_SYMBOL(drm_gem_vram_kunmap_at); - -/** - * drm_gem_vram_kunmap() - Unmaps a GEM VRAM object - * @gbo: the GEM VRAM object - */ -void drm_gem_vram_kunmap(struct drm_gem_vram_object *gbo) -{ - drm_gem_vram_kunmap_at(gbo, &gbo->kmap); -} EXPORT_SYMBOL(drm_gem_vram_kunmap); /** diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index 1d4aa87f8dfa..9581ea0a4f7e 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -81,12 +81,8 @@ u64 drm_gem_vram_mmap_offset(struct drm_gem_vram_object *gbo); s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo); int drm_gem_vram_pin(struct drm_gem_vram_object *gbo, unsigned long pl_flag); int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo); -void *drm_gem_vram_kmap_at(struct drm_gem_vram_object *gbo, bool map, - bool *is_iomem, struct ttm_bo_kmap_obj *kmap); void *drm_gem_vram_kmap(struct drm_gem_vram_object *gbo, bool map, bool *is_iomem); -void drm_gem_vram_kunmap_at(struct drm_gem_vram_object *gbo, - struct ttm_bo_kmap_obj *kmap); void drm_gem_vram_kunmap(struct drm_gem_vram_object *gbo); int drm_gem_vram_fill_create_dumb(struct drm_file *file, -- 2.21.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel