aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2016-05-17 09:25:44 -0400
committerJan Vesely <[email protected]>2016-05-17 15:28:04 -0400
commit47b390fe45e5e6f982c60b58985892438959cd8e (patch)
tree61a26199f85287a7e918c6c52db243280b6a3cba /src/gallium/winsys
parent322cd2457ccf66a0a88d92f0b0dec1cb3f93eae4 (diff)
Treewide: Remove Elements() macro
Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c8
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index a5d703347c7..29692cdb035 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -306,7 +306,7 @@ static boolean amdgpu_init_cs_context(struct amdgpu_cs *cs,
return FALSE;
}
- for (i = 0; i < Elements(cs->buffer_indices_hashlist); i++) {
+ for (i = 0; i < ARRAY_SIZE(cs->buffer_indices_hashlist); i++) {
cs->buffer_indices_hashlist[i] = -1;
}
return TRUE;
@@ -327,7 +327,7 @@ static void amdgpu_cs_context_cleanup(struct amdgpu_cs *cs)
cs->used_gart = 0;
cs->used_vram = 0;
- for (i = 0; i < Elements(cs->buffer_indices_hashlist); i++) {
+ for (i = 0; i < ARRAY_SIZE(cs->buffer_indices_hashlist); i++) {
cs->buffer_indices_hashlist[i] = -1;
}
}
@@ -427,7 +427,7 @@ amdgpu_cs_add_const_preamble_ib(struct radeon_winsys_cs *rcs)
int amdgpu_lookup_buffer(struct amdgpu_cs *cs, struct amdgpu_winsys_bo *bo)
{
- unsigned hash = bo->unique_id & (Elements(cs->buffer_indices_hashlist)-1);
+ unsigned hash = bo->unique_id & (ARRAY_SIZE(cs->buffer_indices_hashlist)-1);
int i = cs->buffer_indices_hashlist[hash];
/* not found or found */
@@ -461,7 +461,7 @@ static unsigned amdgpu_add_buffer(struct amdgpu_cs *cs,
enum radeon_bo_domain *added_domains)
{
struct amdgpu_cs_buffer *buffer;
- unsigned hash = bo->unique_id & (Elements(cs->buffer_indices_hashlist)-1);
+ unsigned hash = bo->unique_id & (ARRAY_SIZE(cs->buffer_indices_hashlist)-1);
int i = -1;
assert(priority < 64);
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 9ac50816f86..acf16f2bfbb 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -128,7 +128,7 @@ static boolean radeon_init_cs_context(struct radeon_cs_context *csc,
csc->cs.chunks = (uint64_t)(uintptr_t)csc->chunk_array;
- for (i = 0; i < Elements(csc->reloc_indices_hashlist); i++) {
+ for (i = 0; i < ARRAY_SIZE(csc->reloc_indices_hashlist); i++) {
csc->reloc_indices_hashlist[i] = -1;
}
return TRUE;
@@ -150,7 +150,7 @@ static void radeon_cs_context_cleanup(struct radeon_cs_context *csc)
csc->used_gart = 0;
csc->used_vram = 0;
- for (i = 0; i < Elements(csc->reloc_indices_hashlist); i++) {
+ for (i = 0; i < ARRAY_SIZE(csc->reloc_indices_hashlist); i++) {
csc->reloc_indices_hashlist[i] = -1;
}
}
@@ -221,7 +221,7 @@ static inline void update_reloc(struct drm_radeon_cs_reloc *reloc,
int radeon_lookup_buffer(struct radeon_cs_context *csc, struct radeon_bo *bo)
{
- unsigned hash = bo->handle & (Elements(csc->reloc_indices_hashlist)-1);
+ unsigned hash = bo->handle & (ARRAY_SIZE(csc->reloc_indices_hashlist)-1);
int i = csc->reloc_indices_hashlist[hash];
/* not found or found */
@@ -256,7 +256,7 @@ static unsigned radeon_add_buffer(struct radeon_drm_cs *cs,
{
struct radeon_cs_context *csc = cs->csc;
struct drm_radeon_cs_reloc *reloc;
- unsigned hash = bo->handle & (Elements(csc->reloc_indices_hashlist)-1);
+ unsigned hash = bo->handle & (ARRAY_SIZE(csc->reloc_indices_hashlist)-1);
enum radeon_bo_domain rd = usage & RADEON_USAGE_READ ? domains : 0;
enum radeon_bo_domain wd = usage & RADEON_USAGE_WRITE ? domains : 0;
int i = -1;