mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
Relax the requirement in pool_takedown in the intel batch buffer pool,
that all allocated buffes should've been handed back before releasing the pool. This is to account for the case where whe app calls DestroyScreen() without first destroying all contexts.
This commit is contained in:
parent
6a33e6d221
commit
0d646ea3a8
3 changed files with 17 additions and 1 deletions
|
|
@ -140,6 +140,12 @@ intel_batchbuffer_alloc(struct intel_context *intel)
|
|||
void
|
||||
intel_batchbuffer_free(struct intel_batchbuffer *batch)
|
||||
{
|
||||
if (batch->last_fence) {
|
||||
driFenceFinish(batch->last_fence,
|
||||
DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
|
||||
driFenceUnReference(batch->last_fence);
|
||||
batch->last_fence = NULL;
|
||||
}
|
||||
if (batch->map) {
|
||||
driBOUnmap(batch->buffer);
|
||||
batch->map = NULL;
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ pool_takedown(struct _DriBufferPool *pool)
|
|||
*/
|
||||
|
||||
_glthread_LOCK_MUTEX(p->mutex);
|
||||
while (p->numFree < p->numTot) {
|
||||
while ((p->numFree < p->numTot) && p->numDelayed) {
|
||||
_glthread_UNLOCK_MUTEX(p->mutex);
|
||||
sched_yield();
|
||||
pool_checkFree(p, GL_TRUE);
|
||||
|
|
|
|||
|
|
@ -575,6 +575,16 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
|
|||
intel->Fallback = 0; /* don't call _swrast_Flush later */
|
||||
|
||||
intel_batchbuffer_free(intel->batch);
|
||||
if (intel->last_swap_fence) {
|
||||
driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
|
||||
driFenceUnReference(intel->last_swap_fence);
|
||||
intel->last_swap_fence = NULL;
|
||||
}
|
||||
if (intel->first_swap_fence) {
|
||||
driFenceFinish(intel->first_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
|
||||
driFenceUnReference(intel->first_swap_fence);
|
||||
intel->first_swap_fence = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (release_texture_heaps) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue