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>
This commit is contained in:
Chris Wilson 2010-10-06 00:17:03 +01:00
parent 4bf2182bf9
commit d1925deedd
2 changed files with 5 additions and 0 deletions

View File

@ -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)) {

View File

@ -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;
}