unsigned hash = bo->handle & (sizeof(csc->is_handle_added)-1);
if (csc->is_handle_added[hash]) {
- reloc = csc->relocs_hashlist[hash];
+ i = csc->reloc_indices_hashlist[hash];
+ reloc = &csc->relocs[i];
if (reloc->handle == bo->handle) {
- return csc->reloc_indices_hashlist[hash];
+ return i;
}
/* Hash collision, look for the BO in the list of relocs linearly. */
* AAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCC
* will collide here: ^ and here: ^,
* meaning that we should get very few collisions in the end. */
- csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = i;
/*printf("write_reloc collision, hash: %i, handle: %i\n", hash, bo->handle);*/
return i;
enum radeon_bo_domain wd = usage & RADEON_USAGE_WRITE ? domains : 0;
if (csc->is_handle_added[hash]) {
- reloc = csc->relocs_hashlist[hash];
+ i = csc->reloc_indices_hashlist[hash];
+ reloc = &csc->relocs[i];
if (reloc->handle == bo->handle) {
update_reloc_domains(reloc, rd, wd, added_domains);
- return csc->reloc_indices_hashlist[hash];
+ return i;
}
/* Hash collision, look for the BO in the list of relocs linearly. */
if (reloc->handle == bo->handle) {
update_reloc_domains(reloc, rd, wd, added_domains);
- csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = i;
/*printf("write_reloc collision, hash: %i, handle: %i\n", hash, bo->handle);*/
return i;
reloc->flags = 0;
csc->is_handle_added[hash] = TRUE;
- csc->relocs_hashlist[hash] = reloc;
csc->reloc_indices_hashlist[hash] = csc->crelocs;
csc->chunks[1].length_dw += RELOC_DWORDS;