summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-21 22:48:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-21 22:54:02 +0000
commit9f8e86800345d19785eae2dd2099dd7d61a7a3b3 (patch)
tree20eb50f0fb0478e17b29eff68ce467d309cca02a
parent4adebfed415cf58599b22e873f32e7ce2eaa6542 (diff)
sna/dri: Disable assertion and associated bookkeeping
Due to long standing ignored bugs in DRI2, we have to accept breakage in the driver. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62614 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c1
-rw-r--r--src/sna/sna_dri.c24
2 files changed, 15 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a2528f6c..011b50f5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1719,6 +1719,7 @@ skip_inplace_map:
if (priv->cpu_bo) {
DBG(("%s: syncing CPU bo\n", __FUNCTION__));
kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
+ assert(pixmap->devPrivate.ptr == ((unsigned long)priv->cpu_bo->map) & ~3);
}
if (priv->clear_color == 0 || pixmap->drawable.bitsPerPixel == 8) {
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 1a02449e..0962e25e 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -872,10 +872,10 @@ sna_dri_copy(struct sna *sna, DrawablePtr draw, RegionPtr region,
}
static bool
-can_blit(struct sna * sna,
+can_blit(struct sna *sna,
DrawablePtr draw,
- DRI2BufferPtr front,
- DRI2BufferPtr back)
+ DRI2BufferPtr dst,
+ DRI2BufferPtr src)
{
RegionPtr clip;
int w, h;
@@ -884,28 +884,34 @@ can_blit(struct sna * sna,
if (draw->type == DRAWABLE_PIXMAP)
return true;
- if (get_private(front)->pixmap != get_drawable_pixmap(draw)) {
- DBG(("%s: reject as front pixmap=%ld, but expecting pixmap=%ld\n",
+#if 0
+ if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) {
+ DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n",
__FUNCTION__,
- get_private(front)->pixmap ? get_private(front)->pixmap->drawable.serialNumber : 0,
+ get_private(dst)->pixmap ? get_private(dst)->pixmap->drawable.serialNumber : 0,
get_drawable_pixmap(draw)->drawable.serialNumber));
return false;
}
+ assert(sna_pixmap(get_private(dst)->pixmap)->flush);
+#endif
+ assert(get_private(dst)->bo->flush);
+ assert(get_private(src)->bo->flush);
+
clip = &((WindowPtr)draw)->clipList;
w = clip->extents.x2 - draw->x;
h = clip->extents.y2 - draw->y;
if ((w|h) < 0)
return false;
- s = get_private(front)->size;
+ s = get_private(dst)->size;
if ((s>>16) < h || (s&0xffff) < w) {
DBG(("%s: reject front size (%dx%d) < (%dx%d)\n", __func__,
s&0xffff, s>>16, w, h));
return false;
}
- s = get_private(back)->size;
+ s = get_private(src)->size;
if ((s>>16) < h || (s&0xffff) < w) {
DBG(("%s:reject back size (%dx%d) < (%dx%d)\n", __func__,
s&0xffff, s>>16, w, h));
@@ -945,8 +951,6 @@ sna_dri_copy_region(DrawablePtr draw,
if (!can_blit(sna, draw, dst_buffer, src_buffer))
return;
- assert(sna_pixmap(pixmap)->flush);
-
if (dst_buffer->attachment == DRI2BufferFrontLeft) {
dst = sna_pixmap_get_bo(pixmap);
copy = (void *)sna_dri_copy_to_front;