mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 03:30:36 +02:00
winsys/radeon: remove local variable reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
3384a41aa9
commit
b0fca0a378
1 changed files with 2 additions and 5 deletions
|
|
@ -201,19 +201,16 @@ static INLINE void update_reloc(struct drm_radeon_cs_reloc *reloc,
|
|||
|
||||
int radeon_get_reloc(struct radeon_cs_context *csc, struct radeon_bo *bo)
|
||||
{
|
||||
struct drm_radeon_cs_reloc *reloc = NULL;
|
||||
unsigned hash = bo->handle & (sizeof(csc->is_handle_added)-1);
|
||||
int i = -1;
|
||||
|
||||
if (csc->is_handle_added[hash]) {
|
||||
i = csc->reloc_indices_hashlist[hash];
|
||||
reloc = &csc->relocs[i];
|
||||
|
||||
if (reloc->handle != bo->handle) {
|
||||
if (csc->relocs_bo[i] != bo) {
|
||||
/* Hash collision, look for the BO in the list of relocs linearly. */
|
||||
for (i = csc->crelocs - 1; i >= 0; i--) {
|
||||
reloc = &csc->relocs[i];
|
||||
if (reloc->handle == bo->handle) {
|
||||
if (csc->relocs_bo[i] == bo) {
|
||||
/* Put this reloc in the hash list.
|
||||
* This will prevent additional hash collisions if there are
|
||||
* several consecutive get_reloc calls for the same buffer.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue