Re: [Mesa-dev] [PATCH 07/13] util: Move gallium's linked list to util
Isn't this the same as src/util/simple_list.h? On 04/27/2015 09:03 PM, Jason Ekstrand wrote: The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. --- src/gallium/auxiliary/Makefile.sources | 1 - src/gallium/auxiliary/hud/hud_private.h| 2 +- .../auxiliary/pipebuffer/pb_buffer_fenced.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +- src/gallium/auxiliary/util/u_debug_flush.c | 2 +- src/gallium/auxiliary/util/u_debug_memory.c| 2 +- src/gallium/auxiliary/util/u_dirty_surfaces.h | 2 +- src/gallium/auxiliary/util/u_double_list.h | 146 - src/gallium/drivers/freedreno/freedreno_context.h | 2 +- src/gallium/drivers/freedreno/freedreno_query_hw.h | 2 +- src/gallium/drivers/freedreno/freedreno_resource.h | 2 +- src/gallium/drivers/ilo/ilo_common.h | 2 +- src/gallium/drivers/nouveau/nouveau_buffer.h | 2 +- src/gallium/drivers/nouveau/nouveau_fence.c| 2 - src/gallium/drivers/nouveau/nouveau_fence.h| 2 +- src/gallium/drivers/nouveau/nouveau_mm.c | 2 +- src/gallium/drivers/nouveau/nv30/nv30_screen.h | 2 +- src/gallium/drivers/nouveau/nv50/nv50_resource.h | 2 +- src/gallium/drivers/r600/compute_memory_pool.c | 2 +- src/gallium/drivers/r600/evergreen_compute.c | 2 +- src/gallium/drivers/r600/r600_llvm.c | 2 +- src/gallium/drivers/r600/r600_pipe.h | 2 +- src/gallium/drivers/radeon/r600_pipe_common.h | 2 +- src/gallium/drivers/radeon/radeon_vce.h| 2 +- src/gallium/drivers/svga/svga_context.h| 2 +- src/gallium/drivers/svga/svga_resource_buffer.h| 2 - .../drivers/svga/svga_resource_buffer_upload.c | 1 - src/gallium/drivers/svga/svga_screen_cache.h | 2 +- src/gallium/state_trackers/nine/basetexture9.h | 2 +- src/gallium/state_trackers/nine/device9.h | 2 +- src/gallium/state_trackers/nine/nine_state.h | 2 +- src/gallium/state_trackers/nine/surface9.h | 2 +- src/gallium/state_trackers/omx/vid_dec.h | 2 +- src/gallium/state_trackers/omx/vid_enc.h | 2 +- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 2 +- .../winsys/svga/drm/pb_buffer_simple_fenced.c | 2 +- src/gallium/winsys/svga/drm/vmw_fence.c| 2 +- src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 2 +- src/util/Makefile.sources | 1 + src/util/list.h| 146 + 44 files changed, 184 insertions(+), 189 deletions(-) delete mode 100644 src/gallium/auxiliary/util/u_double_list.h create mode 100644 src/util/list.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index ec7547c..62e6b94 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -197,7 +197,6 @@ C_SOURCES := \ util/u_dirty_surfaces.h \ util/u_dl.c \ util/u_dl.h \ - util/u_double_list.h \ util/u_draw.c \ util/u_draw.h \ util/u_draw_quad.c \ diff --git a/src/gallium/auxiliary/hud/hud_private.h b/src/gallium/auxiliary/hud/hud_private.h index 1606ada..c74dc3b 100644 --- a/src/gallium/auxiliary/hud/hud_private.h +++ b/src/gallium/auxiliary/hud/hud_private.h @@ -29,7 +29,7 @@ #define HUD_PRIVATE_H #include pipe/p_context.h -#include util/u_double_list.h +#include util/list.h struct hud_graph { /* initialized by common code */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 9e0cace..7840467 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -46,7 +46,7 @@ #include util/u_debug.h #include os/os_thread.h #include util/u_memory.h -#include util/u_double_list.h +#include util/list.h #include pb_buffer.h #include pb_buffer_fenced.h diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 5eb8d06..5023687 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -38,7 +38,7 @@ #include util/u_debug.h #include os/os_thread.h #include util/u_memory.h -#include util/u_double_list.h +#include util/list.h #include util/u_time.h #include
Re: [Mesa-dev] [PATCH 07/13] util: Move gallium's linked list to util
On Thu, May 7, 2015 at 5:30 PM, Ian Romanick i...@freedesktop.org wrote: Isn't this the same as src/util/simple_list.h? In terms of being a two-pointer circularly linked list, yes. In terms of having a decent API, no. 1) Nothing in simple_list is namespaced in any way 2) it's all macros with do-while around them instead of static inlines 3) It assumes that you just put prev and next pointers in the structure you're putting in the list rather than having a node you embed. While this provides the type saftey claimed at the top of simple_list.h, it requires that, if you want a list of struct foo's, you to use an entire struct foo as the sentinel instead of a 2 or 3 pointer list structure. 4) Point 3 isn't quite true because there is a simple_node structure. However, it looks like a complete after-thought because none of the iterators or manipulators do anything with it. I could probably extend the list, but I think you get the point. Sure, I could improve simple_list, but why do so when there's a perfectly good list in gallium that does everything simple_list does and more. I did start working on replacing simple_list with the gallium list to get us down to two lists, but we use it in things like swrast and tnl so it turned into quite the spider-web. Eventually, I'd like to see simple_list die but if we can at least restrict it back to the older parts of the code and remove it from util, that would make me happy enough for now. --Jason On 04/27/2015 09:03 PM, Jason Ekstrand wrote: The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. --- src/gallium/auxiliary/Makefile.sources | 1 - src/gallium/auxiliary/hud/hud_private.h| 2 +- .../auxiliary/pipebuffer/pb_buffer_fenced.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +- src/gallium/auxiliary/util/u_debug_flush.c | 2 +- src/gallium/auxiliary/util/u_debug_memory.c| 2 +- src/gallium/auxiliary/util/u_dirty_surfaces.h | 2 +- src/gallium/auxiliary/util/u_double_list.h | 146 - src/gallium/drivers/freedreno/freedreno_context.h | 2 +- src/gallium/drivers/freedreno/freedreno_query_hw.h | 2 +- src/gallium/drivers/freedreno/freedreno_resource.h | 2 +- src/gallium/drivers/ilo/ilo_common.h | 2 +- src/gallium/drivers/nouveau/nouveau_buffer.h | 2 +- src/gallium/drivers/nouveau/nouveau_fence.c| 2 - src/gallium/drivers/nouveau/nouveau_fence.h| 2 +- src/gallium/drivers/nouveau/nouveau_mm.c | 2 +- src/gallium/drivers/nouveau/nv30/nv30_screen.h | 2 +- src/gallium/drivers/nouveau/nv50/nv50_resource.h | 2 +- src/gallium/drivers/r600/compute_memory_pool.c | 2 +- src/gallium/drivers/r600/evergreen_compute.c | 2 +- src/gallium/drivers/r600/r600_llvm.c | 2 +- src/gallium/drivers/r600/r600_pipe.h | 2 +- src/gallium/drivers/radeon/r600_pipe_common.h | 2 +- src/gallium/drivers/radeon/radeon_vce.h| 2 +- src/gallium/drivers/svga/svga_context.h| 2 +- src/gallium/drivers/svga/svga_resource_buffer.h| 2 - .../drivers/svga/svga_resource_buffer_upload.c | 1 - src/gallium/drivers/svga/svga_screen_cache.h | 2 +- src/gallium/state_trackers/nine/basetexture9.h | 2 +- src/gallium/state_trackers/nine/device9.h | 2 +- src/gallium/state_trackers/nine/nine_state.h | 2 +- src/gallium/state_trackers/nine/surface9.h | 2 +- src/gallium/state_trackers/omx/vid_dec.h | 2 +- src/gallium/state_trackers/omx/vid_enc.h | 2 +- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 2 +- .../winsys/svga/drm/pb_buffer_simple_fenced.c | 2 +- src/gallium/winsys/svga/drm/vmw_fence.c| 2 +- src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 2 +- src/util/Makefile.sources | 1 + src/util/list.h| 146 + 44 files changed, 184 insertions(+), 189 deletions(-) delete mode 100644 src/gallium/auxiliary/util/u_double_list.h create mode 100644 src/util/list.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index ec7547c..62e6b94 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -197,7 +197,6 @@ C_SOURCES := \ util/u_dirty_surfaces.h \ util/u_dl.c \ util/u_dl.h \ - util/u_double_list.h \
[Mesa-dev] [PATCH 07/13] util: Move gallium's linked list to util
The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. --- src/gallium/auxiliary/Makefile.sources | 1 - src/gallium/auxiliary/hud/hud_private.h| 2 +- .../auxiliary/pipebuffer/pb_buffer_fenced.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c| 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +- src/gallium/auxiliary/util/u_debug_flush.c | 2 +- src/gallium/auxiliary/util/u_debug_memory.c| 2 +- src/gallium/auxiliary/util/u_dirty_surfaces.h | 2 +- src/gallium/auxiliary/util/u_double_list.h | 146 - src/gallium/drivers/freedreno/freedreno_context.h | 2 +- src/gallium/drivers/freedreno/freedreno_query_hw.h | 2 +- src/gallium/drivers/freedreno/freedreno_resource.h | 2 +- src/gallium/drivers/ilo/ilo_common.h | 2 +- src/gallium/drivers/nouveau/nouveau_buffer.h | 2 +- src/gallium/drivers/nouveau/nouveau_fence.c| 2 - src/gallium/drivers/nouveau/nouveau_fence.h| 2 +- src/gallium/drivers/nouveau/nouveau_mm.c | 2 +- src/gallium/drivers/nouveau/nv30/nv30_screen.h | 2 +- src/gallium/drivers/nouveau/nv50/nv50_resource.h | 2 +- src/gallium/drivers/r600/compute_memory_pool.c | 2 +- src/gallium/drivers/r600/evergreen_compute.c | 2 +- src/gallium/drivers/r600/r600_llvm.c | 2 +- src/gallium/drivers/r600/r600_pipe.h | 2 +- src/gallium/drivers/radeon/r600_pipe_common.h | 2 +- src/gallium/drivers/radeon/radeon_vce.h| 2 +- src/gallium/drivers/svga/svga_context.h| 2 +- src/gallium/drivers/svga/svga_resource_buffer.h| 2 - .../drivers/svga/svga_resource_buffer_upload.c | 1 - src/gallium/drivers/svga/svga_screen_cache.h | 2 +- src/gallium/state_trackers/nine/basetexture9.h | 2 +- src/gallium/state_trackers/nine/device9.h | 2 +- src/gallium/state_trackers/nine/nine_state.h | 2 +- src/gallium/state_trackers/nine/surface9.h | 2 +- src/gallium/state_trackers/omx/vid_dec.h | 2 +- src/gallium/state_trackers/omx/vid_enc.h | 2 +- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 2 +- .../winsys/svga/drm/pb_buffer_simple_fenced.c | 2 +- src/gallium/winsys/svga/drm/vmw_fence.c| 2 +- src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 2 +- src/util/Makefile.sources | 1 + src/util/list.h| 146 + 44 files changed, 184 insertions(+), 189 deletions(-) delete mode 100644 src/gallium/auxiliary/util/u_double_list.h create mode 100644 src/util/list.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index ec7547c..62e6b94 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -197,7 +197,6 @@ C_SOURCES := \ util/u_dirty_surfaces.h \ util/u_dl.c \ util/u_dl.h \ - util/u_double_list.h \ util/u_draw.c \ util/u_draw.h \ util/u_draw_quad.c \ diff --git a/src/gallium/auxiliary/hud/hud_private.h b/src/gallium/auxiliary/hud/hud_private.h index 1606ada..c74dc3b 100644 --- a/src/gallium/auxiliary/hud/hud_private.h +++ b/src/gallium/auxiliary/hud/hud_private.h @@ -29,7 +29,7 @@ #define HUD_PRIVATE_H #include pipe/p_context.h -#include util/u_double_list.h +#include util/list.h struct hud_graph { /* initialized by common code */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 9e0cace..7840467 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -46,7 +46,7 @@ #include util/u_debug.h #include os/os_thread.h #include util/u_memory.h -#include util/u_double_list.h +#include util/list.h #include pb_buffer.h #include pb_buffer_fenced.h diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 5eb8d06..5023687 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -38,7 +38,7 @@ #include util/u_debug.h #include os/os_thread.h #include util/u_memory.h -#include util/u_double_list.h +#include util/list.h #include util/u_time.h #include pb_buffer.h diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index e5d8118..6236afb 100644 ---