diff mbox series

[4/8] drm/ast: Use drm_gem_vram_vmap_unlocked() in ast_cursor_show()

Message ID 20201130120433.7205-5-tzimmermann@suse.de (mailing list archive)
State New, archived
Headers show
Series drm/vram-helper: Lock GEM BOs while they are mapped | expand

Commit Message

Thomas Zimmermann Nov. 30, 2020, 12:04 p.m. UTC
This change avoids to pin the source BO when showing the cursor, and
instead acquires the BO's reservation lock. Prevents concurrent access
during the buffer update.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_cursor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
index c5892827b220..7a56838fb703 100644
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ b/drivers/gpu/drm/ast/ast_cursor.c
@@ -254,8 +254,8 @@  void ast_cursor_show(struct ast_private *ast, int x, int y,
 	u8 jreg;
 	int ret;
 
-	ret = drm_gem_vram_vmap(gbo, &map);
-	if (drm_WARN_ONCE(dev, ret, "drm_gem_vram_vmap() failed, ret=%d\n", ret))
+	ret = drm_gem_vram_vmap_unlocked(gbo, &map, NULL);
+	if (drm_WARN_ONCE(dev, ret, "drm_gem_vram_vmap_unlocked() failed, ret=%d\n", ret))
 		return;
 	dst = map.vaddr_iomem; /* TODO: Use mapping abstraction properly */
 
@@ -263,7 +263,7 @@  void ast_cursor_show(struct ast_private *ast, int x, int y,
 	writel(x, sig + AST_HWC_SIGNATURE_X);
 	writel(y, sig + AST_HWC_SIGNATURE_Y);
 
-	drm_gem_vram_vunmap(gbo, &map);
+	drm_gem_vram_vunmap_unlocked(gbo, &map);
 
 	if (x < 0) {
 		x_offset = (-x) + offset_x;