Commit 04e9e94d authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Dave Airlie

drm/vmwgfx: Make sure to unpin old and pin new framebuffer.

Signed-off-by: default avatarJakob Bornecrantz <jakob@vmware.com>
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6a591a96
...@@ -150,6 +150,15 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv, ...@@ -150,6 +150,15 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
struct vmw_legacy_display_unit *entry; struct vmw_legacy_display_unit *entry;
struct list_head *at; struct list_head *at;
BUG_ON(!ld->num_active && ld->fb);
if (vfb != ld->fb) {
if (ld->fb && ld->fb->unpin)
ld->fb->unpin(ld->fb);
if (vfb->pin)
vfb->pin(vfb);
ld->fb = vfb;
}
if (!list_empty(&ldu->active)) if (!list_empty(&ldu->active))
return 0; return 0;
...@@ -162,12 +171,8 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv, ...@@ -162,12 +171,8 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
} }
list_add(&ldu->active, at); list_add(&ldu->active, at);
if (ld->num_active++ == 0) {
BUG_ON(ld->fb); ld->num_active++;
if (vfb->pin)
vfb->pin(vfb);
ld->fb = vfb;
}
return 0; return 0;
} }
......
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