Don't place buffer objects on unfenced list when newly created.
Fix a buffer object wait-for-idle deadlock.
void
driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
{
- assert(buf->private != NULL);
+ struct _DriBufferPool *pool;
+ void *priv;
_glthread_LOCK_MUTEX(buf->mutex);
- BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy));
+ pool = buf->pool;
+ priv = buf->private;
_glthread_UNLOCK_MUTEX(buf->mutex);
+
+ assert(priv != NULL);
+ BM_CKFATAL(buf->pool->waitIdle(pool, priv, lazy));
}
void *
pool->destroy(pool, buf->private);
if (!flags)
flags = buf->flags;
- buf->private = pool->create(pool, size, flags, 0, buf->alignment);
+ buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+ buf->alignment);
if (!buf->private)
BM_CKFATAL(-ENOMEM);
BM_CKFATAL(pool->map(pool, buf->private,
return NULL;
ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
- flags, 0, buf);
+ flags, DRM_BO_HINT_DONT_FENCE, buf);
if (ret) {
free(buf);
_glthread_INIT_MUTEX(p->mutex);
if (drmBOCreate(fd, 0, numBufs * bufSize, 0, NULL, drm_bo_type_dc,
- flags, 0, &p->kernelBO)) {
+ flags, DRM_BO_HINT_DONT_FENCE, &p->kernelBO)) {
free(p->bufs);
free(p);
return NULL;
*/
driGenBuffers(intel->intelScreen->regionPool,
"buffer object", 1, &intel_obj->buffer, 64, 0, 0);
+ LOCK_HARDWARE(intel);
driBOData(intel_obj->buffer, intel_obj->Base.Size, NULL, 0);
+ UNLOCK_HARDWARE(intel);
}
/* Break the COW tie to the region. Both the pbo and the region end
if (intel_obj->region)
intel_bufferobj_release_region(intel, intel_obj);
+ LOCK_HARDWARE(intel);
driBOData(intel_obj->buffer, size, data, 0);
+ UNLOCK_HARDWARE(intel);
}
GLuint cpp, GLuint pitch, GLuint height)
{
struct intel_region *region = calloc(sizeof(*region), 1);
+ struct intel_context *intel = intelScreenContext(intelScreen);
DBG("%s\n", __FUNCTION__);
0,
#endif
0);
+ LOCK_HARDWARE(intel);
driBOData(region->buffer, pitch * cpp * height, NULL, 0);
+ UNLOCK_HARDWARE(intel);
return region;
}
intel_region_release_pbo(intelScreenPrivate *intelScreen,
struct intel_region *region)
{
+ struct intel_context *intel = intelScreenContext(intelScreen);
+
assert(region->buffer == region->pbo->buffer);
region->pbo->region = NULL;
region->pbo = NULL;
driGenBuffers(intelScreen->regionPool,
"region", 1, ®ion->buffer, 64, 0, 0);
+
+ LOCK_HARDWARE(intel);
driBOData(region->buffer,
region->cpp * region->pitch * region->height, NULL, 0);
+ UNLOCK_HARDWARE(intel);
}
/* Break the COW tie to the pbo. Both the pbo and the region end up
static const __DRIversion ddx_expected = { 1, 5, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 7, 0 };
+ int tmpContextID;
+ GLuint tmpContext;
dri_interface = interface;
+ if (!(*dri_interface->createContext)(dpy, modes->screen,
+ modes->fbconfigID,
+ &tmpContextID, &tmpContext)) {
+ fprintf(stderr, "Could not create temporary context.\n");
+ return NULL;
+ }
+ DRM_LIGHT_LOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext);
+
if (!driCheckDriDdxDrmVersions2("i915",
dri_version, &dri_expected,
ddx_version, &ddx_expected,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
internal_api_version, &intelAPI);
+
+ DRM_UNLOCK(fd, &((drm_sarea_t *)pSAREA)->lock, tmpContext);
+ (void) (*dri_interface->destroyContext)(dpy, modes->screen, tmpContextID);
+
if (psp != NULL) {
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = intelFillInModes(dri_priv->cpp * 8,