Commit da460a29 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Pin framebuffer BO during dirty update

Another explicit lock operation of a GEM VRAM BO is located in AST's
framebuffer update code. Instead of locking the BO, we pin it to wherever
it is.

v2:
	* update with pin flag of 0
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190613073041.29350-6-tzimmermann@suse.de
parent 27072152
...@@ -48,30 +48,30 @@ static void ast_dirty_update(struct ast_fbdev *afbdev, ...@@ -48,30 +48,30 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
int x, int y, int width, int height) int x, int y, int width, int height)
{ {
int i; int i;
struct drm_gem_object *obj;
struct drm_gem_vram_object *gbo; struct drm_gem_vram_object *gbo;
int src_offset, dst_offset; int src_offset, dst_offset;
int bpp = afbdev->afb.base.format->cpp[0]; int bpp = afbdev->afb.base.format->cpp[0];
int ret = -EBUSY; int ret;
u8 *dst; u8 *dst;
bool unmap = false; bool unmap = false;
bool store_for_later = false; bool store_for_later = false;
int x2, y2; int x2, y2;
unsigned long flags; unsigned long flags;
obj = afbdev->afb.obj; gbo = drm_gem_vram_of_gem(afbdev->afb.obj);
gbo = drm_gem_vram_of_gem(obj);
/* Try to lock the BO. If we fail with -EBUSY then if (drm_can_sleep()) {
* the BO is being moved and we should store up the /* We pin the BO so it won't be moved during the
* damage until later. * update. The actual location, video RAM or system
* memory, is not important.
*/ */
if (drm_can_sleep()) ret = drm_gem_vram_pin(gbo, 0);
ret = drm_gem_vram_lock(gbo, true);
if (ret) { if (ret) {
if (ret != -EBUSY) if (ret != -EBUSY)
return; return;
store_for_later = true;
}
} else {
store_for_later = true; store_for_later = true;
} }
...@@ -126,7 +126,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev, ...@@ -126,7 +126,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev,
drm_gem_vram_kunmap(gbo); drm_gem_vram_kunmap(gbo);
out: out:
drm_gem_vram_unlock(gbo); drm_gem_vram_unpin(gbo);
} }
static void ast_fillrect(struct fb_info *info, static void ast_fillrect(struct fb_info *info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment