util: remove LIST_INITHEAD macro

Just use the inlined function directly. The macro was replaced with
the function in ebe304fa54.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
This commit is contained in:
Timothy Arceri
2019-10-28 09:49:39 +11:00
parent 15e7f94278
commit 7ae1be1028
39 changed files with 79 additions and 80 deletions
@@ -190,7 +190,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags)
ws->use_local_bos = perftest_flags & RADV_PERFTEST_LOCAL_BOS;
ws->zero_all_vram_allocs = debug_flags & RADV_DEBUG_ZERO_VRAM;
ws->batchchain = !(perftest_flags & RADV_PERFTEST_NO_BATCHCHAIN);
LIST_INITHEAD(&ws->global_bo_list);
list_inithead(&ws->global_bo_list);
pthread_mutex_init(&ws->global_bo_list_lock, NULL);
ws->base.query_info = radv_amdgpu_winsys_query_info;
ws->base.query_value = radv_amdgpu_winsys_query_value;
+2 -2
View File
@@ -898,7 +898,7 @@ hud_pane_create(struct hud_context *hud,
pane->sort_items = sort_items;
pane->initial_max_value = max_value;
hud_pane_set_max_value(pane, max_value);
LIST_INITHEAD(&pane->graph_list);
list_inithead(&pane->graph_list);
return pane;
}
@@ -1885,7 +1885,7 @@ hud_create(struct cso_context *cso, struct hud_context *share)
hud->constbuf.buffer_size = sizeof(hud->constants);
hud->constbuf.user_buffer = &hud->constants;
LIST_INITHEAD(&hud->pane_list);
list_inithead(&hud->pane_list);
/* setup sig handler once for all hud contexts */
#ifdef PIPE_OS_UNIX
@@ -1027,10 +1027,10 @@ fenced_bufmgr_create(struct pb_manager *provider,
fenced_mgr->max_buffer_size = max_buffer_size;
fenced_mgr->max_cpu_total_size = max_cpu_total_size;
LIST_INITHEAD(&fenced_mgr->fenced);
list_inithead(&fenced_mgr->fenced);
fenced_mgr->num_fenced = 0;
LIST_INITHEAD(&fenced_mgr->unfenced);
list_inithead(&fenced_mgr->unfenced);
fenced_mgr->num_unfenced = 0;
(void) mtx_init(&fenced_mgr->mutex, mtx_plain);
@@ -477,7 +477,7 @@ pb_debug_manager_create(struct pb_manager *provider,
mgr->overflow_size = overflow_size;
(void) mtx_init(&mgr->mutex, mtx_plain);
LIST_INITHEAD(&mgr->list);
list_inithead(&mgr->list);
return &mgr->base;
}
@@ -333,8 +333,8 @@ pb_slab_create(struct pb_slab_manager *mgr)
goto out_err1;
}
LIST_INITHEAD(&slab->head);
LIST_INITHEAD(&slab->freeBuffers);
list_inithead(&slab->head);
list_inithead(&slab->freeBuffers);
slab->numBuffers = numBuffers;
slab->numFree = 0;
slab->mgr = mgr;
@@ -470,7 +470,7 @@ pb_slab_manager_create(struct pb_manager *provider,
mgr->slabSize = slabSize;
mgr->desc = *desc;
LIST_INITHEAD(&mgr->slabs);
list_inithead(&mgr->slabs);
(void) mtx_init(&mgr->mutex, mtx_plain);
+1 -1
View File
@@ -290,7 +290,7 @@ pb_cache_init(struct pb_cache *mgr, uint num_heaps,
return;
for (i = 0; i < num_heaps; i++)
LIST_INITHEAD(&mgr->buckets[i]);
list_inithead(&mgr->buckets[i]);
(void) mtx_init(&mgr->mutex, mtx_plain);
mgr->cache_size = 0;
+2 -2
View File
@@ -212,7 +212,7 @@ pb_slabs_init(struct pb_slabs *slabs,
slabs->slab_alloc = slab_alloc;
slabs->slab_free = slab_free;
LIST_INITHEAD(&slabs->reclaim);
list_inithead(&slabs->reclaim);
num_groups = slabs->num_orders * slabs->num_heaps;
slabs->groups = CALLOC(num_groups, sizeof(*slabs->groups));
@@ -221,7 +221,7 @@ pb_slabs_init(struct pb_slabs *slabs,
for (i = 0; i < num_groups; ++i) {
struct pb_slab_group *group = &slabs->groups[i];
LIST_INITHEAD(&group->slabs);
list_inithead(&group->slabs);
}
(void) mtx_init(&slabs->mutex, mtx_plain);
@@ -50,7 +50,7 @@ struct util_dirty_surface
static inline void
util_dirty_surfaces_init(struct util_dirty_surfaces *ds)
{
LIST_INITHEAD(&ds->dirty_list);
list_inithead(&ds->dirty_list);
}
static inline void
@@ -93,7 +93,7 @@ util_dirty_surfaces_use_for_sampling_with(struct pipe_context *pipe, struct util
static inline void
util_dirty_surface_init(struct util_dirty_surface *ds)
{
LIST_INITHEAD(&ds->dirty_list);
list_inithead(&ds->dirty_list);
}
static inline boolean
@@ -2627,7 +2627,7 @@ threaded_context_create(struct pipe_context *pipe,
util_queue_fence_init(&tc->batch_slots[i].fence);
}
LIST_INITHEAD(&tc->unflushed_queries);
list_inithead(&tc->unflushed_queries);
slab_create_child(&tc->pool_transfers, parent_transfer_pool);
+1 -1
View File
@@ -38,7 +38,7 @@ nouveau_fence_new(struct nouveau_screen *screen, struct nouveau_fence **fence)
(*fence)->screen = screen;
(*fence)->ref = 1;
LIST_INITHEAD(&(*fence)->work);
list_inithead(&(*fence)->work);
return true;
}
+4 -4
View File
@@ -142,7 +142,7 @@ mm_slab_new(struct nouveau_mman *cache, int chunk_order)
return PIPE_ERROR_OUT_OF_MEMORY;
}
LIST_INITHEAD(&slab->head);
list_inithead(&slab->head);
slab->cache = cache;
slab->order = chunk_order;
@@ -255,9 +255,9 @@ nouveau_mm_create(struct nouveau_device *dev, uint32_t domain,
cache->allocated = 0;
for (i = 0; i < MM_NUM_BUCKETS; ++i) {
LIST_INITHEAD(&cache->bucket[i].free);
LIST_INITHEAD(&cache->bucket[i].used);
LIST_INITHEAD(&cache->bucket[i].full);
list_inithead(&cache->bucket[i].free);
list_inithead(&cache->bucket[i].used);
list_inithead(&cache->bucket[i].full);
}
return cache;
@@ -655,7 +655,7 @@ nv30_screen_create(struct nouveau_device *dev)
if (ret)
FAIL_SCREEN_INIT("error creating query heap: %d\n", ret);
LIST_INITHEAD(&screen->queries);
list_inithead(&screen->queries);
/* Vertex program resources (code/data), currently 6 of the constant
* slots are reserved to implement user clipping planes
+15 -15
View File
@@ -54,11 +54,11 @@ static struct r600_bytecode_cf *r600_bytecode_cf(void)
if (!cf)
return NULL;
LIST_INITHEAD(&cf->list);
LIST_INITHEAD(&cf->alu);
LIST_INITHEAD(&cf->vtx);
LIST_INITHEAD(&cf->tex);
LIST_INITHEAD(&cf->gds);
list_inithead(&cf->list);
list_inithead(&cf->alu);
list_inithead(&cf->vtx);
list_inithead(&cf->tex);
list_inithead(&cf->gds);
return cf;
}
@@ -68,7 +68,7 @@ static struct r600_bytecode_alu *r600_bytecode_alu(void)
if (!alu)
return NULL;
LIST_INITHEAD(&alu->list);
list_inithead(&alu->list);
return alu;
}
@@ -78,7 +78,7 @@ static struct r600_bytecode_vtx *r600_bytecode_vtx(void)
if (!vtx)
return NULL;
LIST_INITHEAD(&vtx->list);
list_inithead(&vtx->list);
return vtx;
}
@@ -88,7 +88,7 @@ static struct r600_bytecode_tex *r600_bytecode_tex(void)
if (!tex)
return NULL;
LIST_INITHEAD(&tex->list);
list_inithead(&tex->list);
return tex;
}
@@ -98,7 +98,7 @@ static struct r600_bytecode_gds *r600_bytecode_gds(void)
if (gds == NULL)
return NULL;
LIST_INITHEAD(&gds->list);
list_inithead(&gds->list);
return gds;
}
@@ -154,7 +154,7 @@ void r600_bytecode_init(struct r600_bytecode *bc,
bc->r6xx_nop_after_rel_dst = 0;
}
LIST_INITHEAD(&bc->cf);
list_inithead(&bc->cf);
bc->chip_class = chip_class;
bc->family = family;
bc->has_compressed_msaa_texturing = has_compressed_msaa_texturing;
@@ -1867,30 +1867,30 @@ void r600_bytecode_clear(struct r600_bytecode *bc)
free(alu);
}
LIST_INITHEAD(&cf->alu);
list_inithead(&cf->alu);
LIST_FOR_EACH_ENTRY_SAFE(tex, next_tex, &cf->tex, list) {
free(tex);
}
LIST_INITHEAD(&cf->tex);
list_inithead(&cf->tex);
LIST_FOR_EACH_ENTRY_SAFE(vtx, next_vtx, &cf->vtx, list) {
free(vtx);
}
LIST_INITHEAD(&cf->vtx);
list_inithead(&cf->vtx);
LIST_FOR_EACH_ENTRY_SAFE(gds, next_gds, &cf->gds, list) {
free(gds);
}
LIST_INITHEAD(&cf->gds);
list_inithead(&cf->gds);
free(cf);
}
LIST_INITHEAD(&cf->list);
list_inithead(&cf->list);
}
static int print_swizzle(unsigned swz)
+1 -1
View File
@@ -155,7 +155,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen,
goto fail;
rctx->screen = rscreen;
LIST_INITHEAD(&rctx->texture_buffers);
list_inithead(&rctx->texture_buffers);
r600_init_blit_functions(rctx);
+1 -1
View File
@@ -2125,7 +2125,7 @@ void r600_query_init(struct r600_common_context *rctx)
if (((struct r600_common_screen*)rctx->b.screen)->info.num_render_backends > 0)
rctx->b.render_condition = r600_render_condition;
LIST_INITHEAD(&rctx->active_queries);
list_inithead(&rctx->active_queries);
}
void r600_init_screen_query_functions(struct r600_common_screen *rscreen)
+1 -1
View File
@@ -97,7 +97,7 @@ static void reset_cpb(struct rvce_encoder *enc)
{
unsigned i;
LIST_INITHEAD(&enc->cpb_slots);
list_inithead(&enc->cpb_slots);
for (i = 0; i < enc->cpb_num; ++i) {
struct rvce_cpb_slot *slot = &enc->cpb_array[i];
slot->index = i;
+1 -1
View File
@@ -91,7 +91,7 @@ static void reset_cpb(struct rvce_encoder *enc)
{
unsigned i;
LIST_INITHEAD(&enc->cpb_slots);
list_inithead(&enc->cpb_slots);
for (i = 0; i < enc->cpb_num; ++i) {
struct rvce_cpb_slot *slot = &enc->cpb_array[i];
slot->index = i;
+1 -1
View File
@@ -504,7 +504,7 @@ struct pipe_query *gfx10_sh_query_create(struct si_screen *screen,
void gfx10_init_query(struct si_context *sctx)
{
LIST_INITHEAD(&sctx->shader_query_buffers);
list_inithead(&sctx->shader_query_buffers);
sctx->atoms.s.shader_query.emit = emit_shader_query;
}
+1 -1
View File
@@ -1923,7 +1923,7 @@ void si_init_query_functions(struct si_context *sctx)
sctx->b.render_condition = si_render_condition;
}
LIST_INITHEAD(&sctx->active_queries);
list_inithead(&sctx->active_queries);
}
void si_init_screen_query_functions(struct si_screen *sscreen)
+1 -1
View File
@@ -136,7 +136,7 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags)
if (!svga)
goto done;
LIST_INITHEAD(&svga->dirty_buffers);
list_inithead(&svga->dirty_buffers);
svga->pipe.screen = screen;
svga->pipe.priv = priv;
@@ -442,7 +442,7 @@ svga_buffer_create(struct pipe_screen *screen,
sbuf->b.b.screen = screen;
bind_flags = template->bind & ~PIPE_BIND_CUSTOM;
LIST_INITHEAD(&sbuf->surfaces);
list_inithead(&sbuf->surfaces);
if (bind_flags & PIPE_BIND_CONSTANT_BUFFER) {
/* Constant buffers can only have the PIPE_BIND_CONSTANT_BUFFER
+5 -5
View File
@@ -436,15 +436,15 @@ svga_screen_cache_init(struct svga_screen *svgascreen)
(void) mtx_init(&cache->mutex, mtx_plain);
for (i = 0; i < SVGA_HOST_SURFACE_CACHE_BUCKETS; ++i)
LIST_INITHEAD(&cache->bucket[i]);
list_inithead(&cache->bucket[i]);
LIST_INITHEAD(&cache->unused);
list_inithead(&cache->unused);
LIST_INITHEAD(&cache->validated);
list_inithead(&cache->validated);
LIST_INITHEAD(&cache->invalidated);
list_inithead(&cache->invalidated);
LIST_INITHEAD(&cache->empty);
list_inithead(&cache->empty);
for (i = 0; i < SVGA_HOST_SURFACE_CACHE_SIZE; ++i)
LIST_ADDTAIL(&cache->entries[i].head, &cache->empty);
@@ -49,7 +49,7 @@ void vid_dec_h264_Init(vid_dec_PrivateType *priv)
priv->EndFrame = vid_dec_h264_EndFrame;
priv->Flush = vid_dec_h264_Flush;
LIST_INITHEAD(&priv->codec_data.h264.dpb_list);
list_inithead(&priv->codec_data.h264.dpb_list);
priv->picture.h264.field_order_cnt[0] = priv->picture.h264.field_order_cnt[1] = INT_MAX;
priv->first_buf_in_frame = true;
}
@@ -1002,7 +1002,7 @@ void vid_dec_h265_Init(vid_dec_PrivateType *priv)
{
priv->picture.base.profile = PIPE_VIDEO_PROFILE_HEVC_MAIN;
LIST_INITHEAD(&priv->codec_data.h265.dpb_list);
list_inithead(&priv->codec_data.h265.dpb_list);
priv->codec_data.h265.ref_pic_set_list = (struct ref_pic_set *)
CALLOC(MAX_NUM_REF_PICS, sizeof(struct ref_pic_set));
@@ -235,10 +235,10 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
priv->scale.xWidth = OMX_VID_ENC_SCALING_WIDTH_DEFAULT;
priv->scale.xHeight = OMX_VID_ENC_SCALING_WIDTH_DEFAULT;
LIST_INITHEAD(&priv->free_tasks);
LIST_INITHEAD(&priv->used_tasks);
LIST_INITHEAD(&priv->b_frames);
LIST_INITHEAD(&priv->stacked_tasks);
list_inithead(&priv->free_tasks);
list_inithead(&priv->used_tasks);
list_inithead(&priv->b_frames);
list_inithead(&priv->stacked_tasks);
return OMX_ErrorNone;
}
@@ -658,7 +658,7 @@ static OMX_ERRORTYPE vid_enc_AllocateInBuffer(omx_base_PortType *port, OMX_INOUT
return OMX_ErrorInsufficientResources;
}
LIST_INITHEAD(&inp->tasks);
list_inithead(&inp->tasks);
FREE((*buf)->pBuffer);
r = enc_AllocateBackTexture(port, &inp->resource, &inp->transfer, &(*buf)->pBuffer);
@@ -687,7 +687,7 @@ static OMX_ERRORTYPE vid_enc_UseInBuffer(omx_base_PortType *port, OMX_BUFFERHEAD
return OMX_ErrorInsufficientResources;
}
LIST_INITHEAD(&inp->tasks);
list_inithead(&inp->tasks);
return OMX_ErrorNone;
}
@@ -432,7 +432,7 @@ static OMX_ERRORTYPE h264d_prc_allocate_resources(void *ap_obj, OMX_U32 a_pid)
return OMX_ErrorInsufficientResources;
}
LIST_INITHEAD(&priv->codec_data.h264.dpb_list);
list_inithead(&priv->codec_data.h264.dpb_list);
priv->video_buffer_map = util_hash_table_create(handle_hash, handle_compare);
@@ -112,7 +112,7 @@ static OMX_ERRORTYPE h264e_inport_AllocateBuffer(const void * ap_obj, OMX_HANDLE
return OMX_ErrorInsufficientResources;
}
LIST_INITHEAD(&inp->tasks);
list_inithead(&inp->tasks);
r = enc_AllocateBackTexture(ap_hdl, idx, &inp->resource, &inp->transfer, &(*buf)->pBuffer);
@@ -143,7 +143,7 @@ static OMX_ERRORTYPE h264e_inport_UseBuffer(const void * ap_obj, OMX_HANDLETYPE
return OMX_ErrorInsufficientResources;
}
LIST_INITHEAD(&inp->tasks);
list_inithead(&inp->tasks);
return OMX_ErrorNone;
}
@@ -426,10 +426,10 @@ static OMX_ERRORTYPE h264e_prc_create_encoder(void *ap_obj)
if (!priv->t_pipe)
return OMX_ErrorInsufficientResources;
LIST_INITHEAD(&priv->free_tasks);
LIST_INITHEAD(&priv->used_tasks);
LIST_INITHEAD(&priv->b_frames);
LIST_INITHEAD(&priv->stacked_tasks);
list_inithead(&priv->free_tasks);
list_inithead(&priv->used_tasks);
list_inithead(&priv->b_frames);
list_inithead(&priv->stacked_tasks);
return OMX_ErrorNone;
}
@@ -50,7 +50,7 @@ void enc_MoveTasks(struct list_head *from, struct list_head *to)
from->next->prev = to->prev;
from->prev->next = to;
to->prev = from->prev;
LIST_INITHEAD(from);
list_inithead(from);
}
static void enc_GetPictureParamPreset(struct pipe_h264_enc_picture_desc *picture)
+2 -2
View File
@@ -664,7 +664,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsigned heap,
if (!slab->entries)
goto fail_buffer;
LIST_INITHEAD(&slab->base.free);
list_inithead(&slab->base.free);
base_id = __sync_fetch_and_add(&ws->next_bo_unique_id, slab->base.num_entries);
@@ -1017,7 +1017,7 @@ amdgpu_bo_sparse_create(struct amdgpu_winsys *ws, uint64_t size,
if (!bo->u.sparse.commitments)
goto error_alloc_commitments;
LIST_INITHEAD(&bo->u.sparse.backing);
list_inithead(&bo->u.sparse.backing);
/* For simplicity, we always map a multiple of the page size. */
map_size = align64(size, RADEON_SPARSE_PAGE_SIZE);
@@ -383,7 +383,7 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
/* init reference */
pipe_reference_init(&aws->reference, 1);
LIST_INITHEAD(&aws->global_bo_list);
list_inithead(&aws->global_bo_list);
aws->bo_export_table = util_hash_table_create(hash_pointer, compare_pointers);
(void) simple_mtx_init(&aws->global_bo_list_lock, mtx_plain);
@@ -796,7 +796,7 @@ struct pb_slab *radeon_bo_slab_alloc(void *priv, unsigned heap,
if (!slab->entries)
goto fail_buffer;
LIST_INITHEAD(&slab->base.free);
list_inithead(&slab->base.free);
base_hash = __sync_fetch_and_add(&ws->next_bo_hash, slab->base.num_entries);
@@ -835,10 +835,10 @@ simple_fenced_bufmgr_create(struct pb_manager *provider,
fenced_mgr->provider = provider;
fenced_mgr->ops = ops;
LIST_INITHEAD(&fenced_mgr->fenced);
list_inithead(&fenced_mgr->fenced);
fenced_mgr->num_fenced = 0;
LIST_INITHEAD(&fenced_mgr->unfenced);
list_inithead(&fenced_mgr->unfenced);
fenced_mgr->num_unfenced = 0;
(void) mtx_init(&fenced_mgr->mutex, mtx_plain);
+2 -2
View File
@@ -215,7 +215,7 @@ vmw_fence_create(struct pb_fence_ops *fence_ops, uint32_t handle,
if (vmw_fence_seq_is_signaled(seqno, ops->last_signaled, seqno)) {
p_atomic_set(&fence->signalled, 1);
LIST_INITHEAD(&fence->ops_list);
list_inithead(&fence->ops_list);
} else {
p_atomic_set(&fence->signalled, 0);
LIST_ADDTAIL(&fence->ops_list, &ops->not_signaled);
@@ -486,7 +486,7 @@ vmw_fence_ops_create(struct vmw_winsys_screen *vws)
return NULL;
(void) mtx_init(&ops->mutex, mtx_plain);
LIST_INITHEAD(&ops->not_signaled);
list_inithead(&ops->not_signaled);
ops->base.destroy = &vmw_fence_ops_destroy;
ops->base.fence_reference = &vmw_fence_ops_fence_reference;
ops->base.fence_signalled = &vmw_fence_ops_fence_signalled;
@@ -70,7 +70,7 @@ virgl_resource_cache_init(struct virgl_resource_cache *cache,
virgl_resource_cache_entry_release_func destroy_func,
void *user_data)
{
LIST_INITHEAD(&cache->resources);
list_inithead(&cache->resources);
cache->timeout_usecs = timeout_usecs;
cache->entry_is_busy_func = is_busy_func;
cache->entry_release_func = destroy_func;
+3 -3
View File
@@ -805,11 +805,11 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
st_init_driver_flags(st);
/* Initialize context's winsys buffers list */
LIST_INITHEAD(&st->winsys_buffers);
list_inithead(&st->winsys_buffers);
LIST_INITHEAD(&st->zombie_sampler_views.list.node);
list_inithead(&st->zombie_sampler_views.list.node);
simple_mtx_init(&st->zombie_sampler_views.mutex, mtx_plain);
LIST_INITHEAD(&st->zombie_shaders.list.node);
list_inithead(&st->zombie_shaders.list.node);
simple_mtx_init(&st->zombie_shaders.mutex, mtx_plain);
return st;
-1
View File
@@ -158,7 +158,6 @@ static inline void list_validate(const struct list_head *list)
assert(node->next->prev == node && node->prev->next == node);
}
#define LIST_INITHEAD(__item) list_inithead(__item)
#define LIST_ADD(__item, __list) list_add(__item, __list)
#define LIST_ADDTAIL(__item, __list) list_addtail(__item, __list)
#define LIST_REPLACE(__from, __to) list_replace(__from, __to)
+1 -1
View File
@@ -67,7 +67,7 @@ atexit_handler(void)
static void
global_init(void)
{
LIST_INITHEAD(&queue_list);
list_inithead(&queue_list);
atexit(atexit_handler);
}
+1 -1
View File
@@ -368,7 +368,7 @@ static struct queue_data *new_queue_data(VkQueue queue,
data->flags = family_props->queueFlags;
data->timestamp_mask = (1ull << family_props->timestampValidBits) - 1;
data->family_index = family_index;
LIST_INITHEAD(&data->running_command_buffer);
list_inithead(&data->running_command_buffer);
map_object(HKEY(data->queue), data);
/* Fence synchronizing access to queries on that queue. */