diff options
author | Keith Whitwell <[email protected]> | 2004-01-16 13:41:18 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2004-01-16 13:41:18 +0000 |
commit | 4a53f7bc74fbbd84a3d0a28fc3316cdf5e826121 (patch) | |
tree | 82c002b0bf793dd70fe1bad95b57f0e1acb31371 /src | |
parent | 48e89df25bb3f54a719f4c11fb51254206fc71a6 (diff) |
Respect the 'in_use' field in the global LRU as a marker for
kernel-reserved memory regions.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/common/texmem.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 4ed05219db9..53e87b95930 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -246,7 +246,6 @@ void driUpdateTextureLRU( driTextureObject * t ) for (i = start ; i <= end ; i++) { - list[i].in_use = 1; list[i].age = heap->local_age; /* remove_from_list(i) @@ -374,7 +373,7 @@ void driDestroyTextureObject( driTextureObject * t ) * \param heap Heap whose state is to be updated * \param offset Byte offset in the heap that has been stolen * \param size Size, in bytes, of the stolen block - * \param in_use Non-zero if the block is in-use by another context + * \param in_use Non-zero if the block is pinned/reserved by the kernel */ static void driTexturesGone( driTexHeap * heap, int offset, int size, @@ -396,19 +395,13 @@ static void driTexturesGone( driTexHeap * heap, int offset, int size, driSwapOutTextureObject( t ); } else { - if ( in_use && - offset == t->memBlock->ofs && size == t->memBlock->size ) { - /* Matching placeholder already exists */ - return; - } else { - driDestroyTextureObject( t ); - } + driDestroyTextureObject( t ); } } } - if ( in_use ) { + { t = (driTextureObject *) CALLOC( heap->texture_object_size ); if ( t == NULL ) return; @@ -420,6 +413,8 @@ static void driTexturesGone( driTexHeap * heap, int offset, int size, return; } t->heap = heap; + if (in_use) + t->bound = 99; insert_at_head( & heap->texture_objects, t ); } } @@ -673,7 +668,7 @@ driCreateTextureHeap( unsigned heap_id, void * context, unsigned size, heap->destroy_texture_object = destroy_tex_obj; /* Force global heap init */ - if (heap->global_age == 0) + if (heap->global_age[0] == 0) heap->local_age = ~0; else heap->local_age = 0; |