summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-09 20:34:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-09 20:36:24 +0100
commita83d90ee61be44a2a36b56ad24bbc6544320448f (patch)
tree256575346255d965d15d17760f4679c164ed45e5 /src/sna/sna_display.c
parentd5200510b8f2a0ccb2e0c45dfebc659f8360780c (diff)
sna: Avoid randomly changing domains of active bo
After attaching the bo to the scanout, mark it as retired in order to update its domains so that the assertion during retirement later is correct. Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49526 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r--src/sna/sna_display.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 65d1992f..3f8beeaa 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -495,7 +495,7 @@ sna_crtc_restore(struct sna *sna)
return;
}
- bo->domain = DOMAIN_NONE;
+ kgem_bo_retire(&sna->kgem, bo);
scrn->displayWidth = bo->pitch / sna->mode.cpp;
sna->mode.fb_pixmap = sna->front->drawable.serialNumber;
}
@@ -659,7 +659,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
int saved_x, saved_y;
Rotation saved_rotation;
DisplayModeRec saved_mode;
- int ret = TRUE;
DBG(("%s(rotation=%d, x=%d, y=%d, mode=%dx%d@%d)\n",
__FUNCTION__, rotation, x, y,
@@ -690,7 +689,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
DBG(("%s: handle %d attached to fb %d\n",
__FUNCTION__, bo->handle, sna_mode->fb_id));
- bo->domain = DOMAIN_NONE;
sna_mode->fb_pixmap = sna->front->drawable.serialNumber;
}
@@ -797,7 +795,6 @@ sna_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
DBG(("%s: attached handle %d to fb %d\n",
__FUNCTION__, bo->handle, sna_crtc->shadow_fb_id));
- bo->domain = DOMAIN_NONE;
return sna_crtc->shadow = shadow;
}
@@ -810,7 +807,6 @@ sna_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
static void
sna_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr pixmap, void *data)
{
- struct sna *sna = to_sna(crtc->scrn);
struct sna_crtc *sna_crtc = crtc->driver_private;
/* We may have not called shadow_create() on the data yet and
@@ -1727,7 +1723,8 @@ sna_crtc_resize(ScrnInfoPtr scrn, int width, int height)
if (!sna_crtc_apply(crtc))
goto fail;
}
- bo->domain = DOMAIN_NONE;
+
+ kgem_bo_retire(&sna->kgem, bo);
scrn->virtualX = width;
scrn->virtualY = height;
@@ -1859,9 +1856,7 @@ sna_page_flip(struct sna *sna,
*/
count = do_page_flip(sna, data, ref_crtc_hw_id);
DBG(("%s: page flipped %d crtcs\n", __FUNCTION__, count));
- if (count)
- bo->domain = DOMAIN_NONE;
- else
+ if (count == 0)
mode->fb_id = *old_fb;
return count;