diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 7db9ce936a5..5154a560048 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -970,7 +970,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch, if (!out_sync && dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) { drmSyncobjCreate(dev->fd, 0, &out_sync); - our_sync = false; + our_sync = true; } submit.out_sync = out_sync; @@ -1003,6 +1003,9 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch, if (dev->debug & PAN_DBG_MSGS) fprintf(stderr, "Error submitting: %m\n"); + if (our_sync) + drmSyncobjDestroy(dev->fd, out_sync); + return errno; }