diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-09-11 14:03:51 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-09-17 13:10:47 +0200 |
commit | 820d6606e9c27d7e52bd065a2798e09cc7a35532 (patch) | |
tree | c131cd3e3008e757d92854d44e965f7495a97d85 /drivers/gpu/drm/ast | |
parent | drm/vram: Provide vmap and vunmap operations for GEM VRAM objects (diff) | |
download | linux-820d6606e9c27d7e52bd065a2798e09cc7a35532.tar.xz linux-820d6606e9c27d7e52bd065a2798e09cc7a35532.zip |
drm/ast: Use drm_gem_vram_{vmap,vunmap}() to map cursor source BO
The VRAM helper's vmap interfaces provide pinning and mapping of BO
memory. This patch replaces the respective code in ast cursor handling.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190911120352.20084-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r-- | drivers/gpu/drm/ast/ast_mode.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index b0fa05143c88..c191e8eca7f3 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -1167,26 +1167,22 @@ static int ast_cursor_set(struct drm_crtc *crtc, return -ENOENT; } gbo = drm_gem_vram_of_gem(obj); - - ret = drm_gem_vram_pin(gbo, 0); - if (ret) - goto err_drm_gem_object_put_unlocked; - src = drm_gem_vram_kmap(gbo, true, NULL); + src = drm_gem_vram_vmap(gbo); if (IS_ERR(src)) { ret = PTR_ERR(src); - goto err_drm_gem_vram_unpin; + goto err_drm_gem_object_put_unlocked; } dst = drm_gem_vram_kmap(drm_gem_vram_of_gem(ast->cursor_cache), false, NULL); if (IS_ERR(dst)) { ret = PTR_ERR(dst); - goto err_drm_gem_vram_kunmap; + goto err_drm_gem_vram_vunmap; } dst_gpu = drm_gem_vram_offset(drm_gem_vram_of_gem(ast->cursor_cache)); if (dst_gpu < 0) { ret = (int)dst_gpu; - goto err_drm_gem_vram_kunmap; + goto err_drm_gem_vram_vunmap; } dst += (AST_HWC_SIZE + AST_HWC_SIGNATURE_SIZE)*ast->next_cursor; @@ -1221,16 +1217,13 @@ static int ast_cursor_set(struct drm_crtc *crtc, ast_show_cursor(crtc); - drm_gem_vram_kunmap(gbo); - drm_gem_vram_unpin(gbo); + drm_gem_vram_vunmap(gbo, src); drm_gem_object_put_unlocked(obj); return 0; -err_drm_gem_vram_kunmap: - drm_gem_vram_kunmap(gbo); -err_drm_gem_vram_unpin: - drm_gem_vram_unpin(gbo); +err_drm_gem_vram_vunmap: + drm_gem_vram_vunmap(gbo, src); err_drm_gem_object_put_unlocked: drm_gem_object_put_unlocked(obj); return ret; |