aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-05-28 05:21:56 -0400
committerDave Airlie <airlied@redhat.com>2010-05-31 19:37:09 -0400
commit04e9e94dba3e564ce810cedab88e957dfd681b4a (patch)
tree7a016ce4e2c754786bff24a9b0342662c09d2e2e
parent6a591a96d7315fbe81acc33e20bab4956d1f02a3 (diff)
drm/vmwgfx: Make sure to unpin old and pin new framebuffer.
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index a348fec2213..e1b3cf539b4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -150,6 +150,15 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
150 struct vmw_legacy_display_unit *entry; 150 struct vmw_legacy_display_unit *entry;
151 struct list_head *at; 151 struct list_head *at;
152 152
153 BUG_ON(!ld->num_active && ld->fb);
154 if (vfb != ld->fb) {
155 if (ld->fb && ld->fb->unpin)
156 ld->fb->unpin(ld->fb);
157 if (vfb->pin)
158 vfb->pin(vfb);
159 ld->fb = vfb;
160 }
161
153 if (!list_empty(&ldu->active)) 162 if (!list_empty(&ldu->active))
154 return 0; 163 return 0;
155 164
@@ -162,12 +171,8 @@ static int vmw_ldu_add_active(struct vmw_private *vmw_priv,
162 } 171 }
163 172
164 list_add(&ldu->active, at); 173 list_add(&ldu->active, at);
165 if (ld->num_active++ == 0) { 174
166 BUG_ON(ld->fb); 175 ld->num_active++;
167 if (vfb->pin)
168 vfb->pin(vfb);
169 ld->fb = vfb;
170 }
171 176
172 return 0; 177 return 0;
173} 178}