mirror of
https://github.com/X11Libre/xf86-video-intel.git
synced 2026-03-24 01:24:12 +00:00
intel-virtual-output: Check for errors whilst creating ShmPixmaps
Creating a ShmPixmap may cause an asynchronous BadAccess error, so wrap the construction with XSync and check for an error before proceeding. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
This commit is contained in:
@@ -827,6 +827,9 @@ static void output_init_xfer(struct clone *clone, struct output *output)
|
||||
{
|
||||
if (output->use_shm_pixmap) {
|
||||
DBG(("%s-%s: creating shm pixmap\n", DisplayString(output->dpy), output->name));
|
||||
XSync(output->dpy, False);
|
||||
_x_error_occurred = 0;
|
||||
|
||||
if (output->pixmap)
|
||||
XFreePixmap(output->dpy, output->pixmap);
|
||||
output->pixmap = XShmCreatePixmap(output->dpy, output->window,
|
||||
@@ -836,6 +839,13 @@ static void output_init_xfer(struct clone *clone, struct output *output)
|
||||
XRenderFreePicture(output->dpy, output->pix_picture);
|
||||
output->pix_picture = None;
|
||||
}
|
||||
|
||||
XSync(output->dpy, False);
|
||||
if (_x_error_occurred) {
|
||||
XFreePixmap(output->dpy, output->pixmap);
|
||||
output->pixmap = None;
|
||||
output->use_shm_pixmap = 0;
|
||||
}
|
||||
}
|
||||
if (output->use_render) {
|
||||
DBG(("%s-%s: creating picture\n", DisplayString(output->dpy), output->name));
|
||||
|
||||
Reference in New Issue
Block a user