summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-10-06 00:17:03 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-10-06 00:23:57 +0100
commitd1925deedd70c6c4374e42de5aa44989fe328b58 (patch)
tree33f51d26b621013264d0b2da42b7a5295f31f185
parent4bf2182bf9ee64795e2bf524fedf7b6c36f3cd03 (diff)
Clear pixmap->devPrivate.ptr [regression from 7c7294e]
ModifyPixmapHeader(pixdata = NULL) does not clear the pixmap->devPrivate.ptr, instead the NULL value is interpreted as meaning to keep the current value. (This is similar to the interpretation of the other invalid values like depth=-1 which also mean not to change the current property). However pixadata=NULL is indeed a valid value, and in 7c7294e, devPrivate.ptr == NULL was used to differentiate a bo pixmap from a system pixmap. Except that we never did clear the ptr as intended, and so X would immediately crash. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_dri.c1
-rw-r--r--src/intel_uxa.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 1527dba1..7d109e9d 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -91,6 +91,7 @@ static PixmapPtr get_front_buffer(DrawablePtr drawable, DrawablePtr *ret)
0, 0,
intel->front_pitch,
NULL);
+ pixmap->devPrivate.ptr = NULL;
intel_set_pixmap_bo(pixmap, intel->front_buffer);
}
} else if (intel_get_pixmap_bo(pixmap)) {
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index d964a951..34649b85 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -796,6 +796,7 @@ static Bool intel_uxa_put_image(PixmapPtr pixmap,
w, h,
0, 0,
stride, NULL);
+ pixmap->devPrivate.ptr = NULL;
intel_set_pixmap_bo(pixmap, bo);
dri_bo_unreference(bo);
@@ -1039,6 +1040,7 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
list_del(&priv->in_flight);
screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL);
+ pixmap->devPrivate.ptr = NULL;
intel_set_pixmap_private(pixmap, priv);
return pixmap;
}
@@ -1072,6 +1074,7 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
priv->tiling = tiling;
screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL);
+ pixmap->devPrivate.ptr = NULL;
list_init(&priv->batch);
list_init(&priv->flush);
@@ -1108,6 +1111,7 @@ void intel_uxa_create_screen_resources(ScreenPtr screen)
-1, -1,
intel->front_pitch,
NULL);
+ pixmap->devPrivate.ptr = NULL;
}
scrn->displayWidth = intel->front_pitch / intel->cpp;
}