Browse Source

Enable uncached TTMs by default.

Allocate batchbuffers from a 1MB local TTM pool =>
multiple clients.
tags/texman_0_1_20060325
Thomas Hellström 20 years ago
parent
commit
7ad0c51f48
1 changed files with 7 additions and 18 deletions
  1. 7
    18
      src/mesa/drivers/dri/i915/bufmgr_fake.c

+ 7
- 18
src/mesa/drivers/dri/i915/bufmgr_fake.c View File

* Backdoor mapping will very probably fix this. (texdown-pool) * Backdoor mapping will very probably fix this. (texdown-pool)
*/ */


#define CACHED_TTMS
#undef CACHED_TTMS


/* /*
* Batchbuffer memory location: * Batchbuffer memory location:
* for a while, depending on application. multiarb works fine for example. * for a while, depending on application. multiarb works fine for example.
*/ */


#define BATCH_LOCATION 0
#define BATCH_LOCATION 1


#if (BATCH_LOCATION == 2) #if (BATCH_LOCATION == 2)
#warning Batch buffers using dynamic TTMS. Making TTMS uncached. #warning Batch buffers using dynamic TTMS. Making TTMS uncached.
#warning Replacing pool 0 with a large uncached pinned TTM. #warning Replacing pool 0 with a large uncached pinned TTM.
int ret; int ret;
drmAddress ttmAddress; drmAddress ttmAddress;
DBG("Creating Pinned ttm.\n");
size = 1024*1024;
DBG("Creating Pinned ttm, size %d\n", size);
pool->drm_ttm.op = ttm_add; pool->drm_ttm.op = ttm_add;
pool->drm_ttm.size = size; pool->drm_ttm.size = size;
ret = ioctl(bm->intel->driFd, DRM_IOCTL_TTM, &pool->drm_ttm); ret = ioctl(bm->intel->driFd, DRM_IOCTL_TTM, &pool->drm_ttm);
* better without more infrastucture... Which is coming - hooray! * better without more infrastucture... Which is coming - hooray!
*/ */


while (!move_buffers(bm, bufs, list->nr, flags)) {

/*
* We should never get here. The kernel handles this.
*/
assert(0);
if (!delayed_free(bm) &&
!evict_lru(bm, flags))
return 0;
_mesa_printf("couldn't allocate sufficient texture memory\n");
exit(1);
}
while (!move_buffers(bm, bufs, list->nr, flags))
delayed_free(bm);


for (i = 0; i < list->nr; i++) { for (i = 0; i < list->nr; i++) {
if (bufs[i]->block->has_ttm > 1) { if (bufs[i]->block->has_ttm > 1) {

Loading…
Cancel
Save