diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:38:44 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-03 19:39:29 +0100 |
commit | e89ec05b7390bfcfa00613b10d3521e7cd839393 (patch) | |
tree | f419743c6641f59fb078d9a5e6f9a6868b1ae6ac | |
parent | 5466e1f901955a724c12f5831e7e80f4cf73d9aa (diff) |
util: move os_time.[ch] to src/util
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
57 files changed, 76 insertions, 78 deletions
diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 0502a2c44f..4fb7a30613 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -83,8 +83,6 @@ C_SOURCES := \ os/os_process.c \ os/os_process.h \ os/os_thread.h \ - os/os_time.c \ - os/os_time.h \ pipebuffer/pb_buffer_fenced.c \ pipebuffer/pb_buffer_fenced.h \ pipebuffer/pb_buffer.h \ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index c456a97eb6..6ddc509a81 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -32,7 +32,7 @@ #include "util/u_debug.h" #include "util/u_memory.h" #include "util/simple_list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "lp_bld.h" #include "lp_bld_debug.h" #include "lp_bld_misc.h" diff --git a/src/gallium/auxiliary/hud/hud_cpu.c b/src/gallium/auxiliary/hud/hud_cpu.c index 4caaab6977..581dad6df0 100644 --- a/src/gallium/auxiliary/hud/hud_cpu.c +++ b/src/gallium/auxiliary/hud/hud_cpu.c @@ -29,7 +29,7 @@ */ #include "hud/hud_private.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "os/os_thread.h" #include "util/u_memory.h" #include "util/u_queue.h" diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c b/src/gallium/auxiliary/hud/hud_cpufreq.c index abb930d7e2..2b881a850e 100644 --- a/src/gallium/auxiliary/hud/hud_cpufreq.c +++ b/src/gallium/auxiliary/hud/hud_cpufreq.c @@ -35,7 +35,7 @@ #include "hud/hud_private.h" #include "util/list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "os/os_thread.h" #include "util/u_memory.h" #include <stdio.h> diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c index df86abd12d..53b32baef2 100644 --- a/src/gallium/auxiliary/hud/hud_diskstat.c +++ b/src/gallium/auxiliary/hud/hud_diskstat.c @@ -34,7 +34,7 @@ #include "hud/hud_private.h" #include "util/list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "os/os_thread.h" #include "util/u_memory.h" #include <stdio.h> diff --git a/src/gallium/auxiliary/hud/hud_driver_query.c b/src/gallium/auxiliary/hud/hud_driver_query.c index 76104b5b49..8b1e4e104a 100644 --- a/src/gallium/auxiliary/hud/hud_driver_query.c +++ b/src/gallium/auxiliary/hud/hud_driver_query.c @@ -33,7 +33,7 @@ #include "hud/hud_private.h" #include "pipe/p_screen.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_math.h" #include "util/u_memory.h" #include <stdio.h> diff --git a/src/gallium/auxiliary/hud/hud_fps.c b/src/gallium/auxiliary/hud/hud_fps.c index 8aa7a665a3..aecbaf0f6b 100644 --- a/src/gallium/auxiliary/hud/hud_fps.c +++ b/src/gallium/auxiliary/hud/hud_fps.c @@ -29,7 +29,7 @@ */ #include "hud/hud_private.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_memory.h" struct fps_info { diff --git a/src/gallium/auxiliary/hud/hud_nic.c b/src/gallium/auxiliary/hud/hud_nic.c index 835f92e2e0..bb29a90dbc 100644 --- a/src/gallium/auxiliary/hud/hud_nic.c +++ b/src/gallium/auxiliary/hud/hud_nic.c @@ -34,7 +34,7 @@ #include "hud/hud_private.h" #include "util/list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "os/os_thread.h" #include "util/u_memory.h" #include <stdio.h> diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c index 29ee257ce8..7ae6f71b55 100644 --- a/src/gallium/auxiliary/hud/hud_sensors_temp.c +++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c @@ -31,7 +31,7 @@ #include "hud/hud_private.h" #include "util/list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "os/os_thread.h" #include "util/u_memory.h" #include <stdio.h> diff --git a/src/gallium/auxiliary/meson.build b/src/gallium/auxiliary/meson.build index 948fb86b3b..d8fdd3510f 100644 --- a/src/gallium/auxiliary/meson.build +++ b/src/gallium/auxiliary/meson.build @@ -103,8 +103,6 @@ files_libgallium = files( 'os/os_process.c', 'os/os_process.h', 'os/os_thread.h', - 'os/os_time.c', - 'os/os_time.h', 'pipebuffer/pb_buffer_fenced.c', 'pipebuffer/pb_buffer_fenced.h', 'pipebuffer/pb_buffer.h', diff --git a/src/gallium/auxiliary/util/u_time.h b/src/gallium/auxiliary/util/u_time.h index a5017d6bce..99fa140051 100644 --- a/src/gallium/auxiliary/util/u_time.h +++ b/src/gallium/auxiliary/util/u_time.h @@ -38,7 +38,7 @@ #include "pipe/p_config.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_compiler.h" diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c index aec9332d90..a15801beb1 100644 --- a/src/gallium/drivers/ddebug/dd_draw.c +++ b/src/gallium/drivers/ddebug/dd_draw.c @@ -35,7 +35,7 @@ #include "util/u_memory.h" #include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_scan.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <inttypes.h> diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_sw.c b/src/gallium/drivers/etnaviv/etnaviv_query_sw.c index dd9bac3850..2e65065b28 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_sw.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_sw.c @@ -25,7 +25,7 @@ * Christian Gmeiner <christian.gmeiner@gmail.com> */ -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_state.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 68973be5c7..342fa8162f 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -38,7 +38,7 @@ #include "etnaviv_resource.h" #include "etnaviv_translate.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/freedreno/freedreno_query_sw.c b/src/gallium/drivers/freedreno/freedreno_query_sw.c index dfa8987239..5096516114 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_sw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_sw.c @@ -30,7 +30,7 @@ #include "util/u_string.h" #include "util/u_memory.h" #include "util/u_inlines.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "freedreno_query_sw.h" #include "freedreno_context.h" diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 30b2dede11..7a64ea28c3 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -38,7 +38,7 @@ #include "util/u_string.h" #include "util/u_debug.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <stdio.h> #include <errno.h> diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index 7b81903b41..ad11d8ca53 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -33,7 +33,7 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" #include "util/u_memory.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "lp_context.h" #include "lp_flush.h" #include "lp_fence.h" diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 9e2780ca1d..939944aa79 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -34,7 +34,7 @@ #include "util/u_string.h" #include "util/u_thread.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "lp_scene_queue.h" #include "lp_context.h" diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index fc11317687..c0e683a22a 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -38,7 +38,7 @@ #include "gallivm/lp_bld_type.h" #include "os/os_misc.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "lp_texture.h" #include "lp_fence.h" #include "lp_jit.h" diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 2be6fc033d..c157323133 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -41,7 +41,7 @@ #include "util/u_pack_color.h" #include "util/u_viewport.h" #include "draw/draw_pipe.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "lp_context.h" #include "lp_memory.h" #include "lp_scene.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 9223ce63e3..0daf7aecf6 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -67,7 +67,7 @@ #include "util/u_string.h" #include "util/simple_list.h" #include "util/u_dual_blend.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_shader_tokens.h" #include "draw/draw_context.h" #include "tgsi/tgsi_dump.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index 6b0df21b8a..77c7ac1bbd 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -29,7 +29,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "util/simple_list.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "gallivm/lp_bld_arit.h" #include "gallivm/lp_bld_bitarit.h" #include "gallivm/lp_bld_const.h" diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c index 6c299cbc6a..d14c59b2dd 100644 --- a/src/gallium/drivers/nouveau/nouveau_fence.c +++ b/src/gallium/drivers/nouveau/nouveau_fence.c @@ -23,7 +23,7 @@ #include "nouveau_screen.h" #include "nouveau_winsys.h" #include "nouveau_fence.h" -#include "os/os_time.h" +#include "util/os_time.h" #ifdef PIPE_OS_UNIX #include <sched.h> diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index ea68809c6e..c144b39b2d 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -8,7 +8,7 @@ #include "util/u_format_s3tc.h" #include "util/u_string.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <stdio.h> #include <errno.h> diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 6f4231d76e..b55fb63f00 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -26,7 +26,7 @@ #include "util/u_sampler.h" #include "util/simple_list.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c index 54108d1cdf..7fabd13f3d 100644 --- a/src/gallium/drivers/r300/r300_flush.c +++ b/src/gallium/drivers/r300/r300_flush.c @@ -27,7 +27,7 @@ #include "util/simple_list.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "r300_context.h" #include "r300_cs.h" diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index a245c10748..b02862bb3a 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -24,7 +24,7 @@ #include "util/u_format.h" #include "util/u_format_s3tc.h" #include "util/u_memory.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" diff --git a/src/gallium/drivers/r600/r600_gpu_load.c b/src/gallium/drivers/r600/r600_gpu_load.c index c15fb9dfa0..a2de8cc71a 100644 --- a/src/gallium/drivers/r600/r600_gpu_load.c +++ b/src/gallium/drivers/r600/r600_gpu_load.c @@ -36,7 +36,7 @@ #include "r600_pipe_common.h" #include "r600_query.h" -#include "os/os_time.h" +#include "util/os_time.h" /* For good accuracy at 1000 fps or lower. This will be inaccurate for higher * fps (there are too few samples per frame). */ diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 3648f7d14e..7604a1ec27 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -39,7 +39,7 @@ #include "vl/vl_video_buffer.h" #include "radeon_video.h" #include "radeon_uvd.h" -#include "os/os_time.h" +#include "util/os_time.h" static const struct debug_named_value r600_debug_options[] = { /* features */ diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index acad670d6f..e2d0e32bb2 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -32,7 +32,7 @@ #include "util/u_memory.h" #include "util/u_format_s3tc.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" #include "radeon_video.h" diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c index aa3e36f56f..9c17c3ba23 100644 --- a/src/gallium/drivers/r600/r600_query.c +++ b/src/gallium/drivers/r600/r600_query.c @@ -27,7 +27,7 @@ #include "r600_cs.h" #include "util/u_memory.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "tgsi/tgsi_text.h" #define R600_MAX_STREAMS 4 diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index b841114490..3515d979d9 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -32,7 +32,7 @@ #include "util/u_memory.h" #include "util/u_pack_color.h" #include "util/u_surface.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <errno.h> #include <inttypes.h> diff --git a/src/gallium/drivers/r600/sb/sb_core.cpp b/src/gallium/drivers/r600/sb/sb_core.cpp index afea8188f1..cdc2862d36 100644 --- a/src/gallium/drivers/r600/sb/sb_core.cpp +++ b/src/gallium/drivers/r600/sb/sb_core.cpp @@ -26,7 +26,7 @@ #define SB_RA_SCHED_CHECK DEBUG -#include "os/os_time.h" +#include "util/os_time.h" #include "r600_pipe.h" #include "r600_shader.h" diff --git a/src/gallium/drivers/radeon/r600_gpu_load.c b/src/gallium/drivers/radeon/r600_gpu_load.c index ccbd1c9186..411dcfe872 100644 --- a/src/gallium/drivers/radeon/r600_gpu_load.c +++ b/src/gallium/drivers/radeon/r600_gpu_load.c @@ -33,7 +33,7 @@ #include "r600_pipe_common.h" #include "r600_query.h" -#include "os/os_time.h" +#include "util/os_time.h" /* For good accuracy at 1000 fps or lower. This will be inaccurate for higher * fps (there are too few samples per frame). */ diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 2c7fce8bf2..486d635527 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -29,7 +29,7 @@ #include "util/u_memory.h" #include "util/u_format_s3tc.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" #include "radeon/radeon_video.h" diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index aedf950ff2..0a03061ab9 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -26,7 +26,7 @@ #include "r600_cs.h" #include "util/u_memory.h" #include "util/u_upload_mgr.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "tgsi/tgsi_text.h" #include "amd/common/sid.h" diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 0800c0f1d1..258690cadf 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -28,7 +28,7 @@ #include "util/u_memory.h" #include "util/u_pack_color.h" #include "util/u_surface.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <errno.h> #include <inttypes.h> #include "state_tracker/drm_driver.h" diff --git a/src/gallium/drivers/rbug/rbug_core.c b/src/gallium/drivers/rbug/rbug_core.c index 82bcef8d03..8eb39c17b1 100644 --- a/src/gallium/drivers/rbug/rbug_core.c +++ b/src/gallium/drivers/rbug/rbug_core.c @@ -33,7 +33,7 @@ #include "util/u_memory.h" #include "util/simple_list.h" #include "util/u_network.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c index 267c99977f..5c9afe6fe4 100644 --- a/src/gallium/drivers/softpipe/sp_query.c +++ b/src/gallium/drivers/softpipe/sp_query.c @@ -30,7 +30,7 @@ */ #include "draw/draw_context.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_defines.h" #include "util/u_memory.h" #include "sp_context.h" diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index c50d644b51..29e63d4963 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -31,7 +31,7 @@ #include "util/u_format_s3tc.h" #include "util/u_video.h" #include "os/os_misc.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 0d695a6492..80c59c05e8 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -31,7 +31,7 @@ #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_blitter.h" #include "util/list.h" diff --git a/src/gallium/drivers/swr/swr_fence.cpp b/src/gallium/drivers/swr/swr_fence.cpp index abf1d0c69c..3005eb9aaa 100644 --- a/src/gallium/drivers/swr/swr_fence.cpp +++ b/src/gallium/drivers/swr/swr_fence.cpp @@ -23,7 +23,7 @@ #include "pipe/p_screen.h" #include "util/u_memory.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "swr_context.h" #include "swr_screen.h" diff --git a/src/gallium/drivers/swr/swr_query.cpp b/src/gallium/drivers/swr/swr_query.cpp index e3697304e0..ea31de630b 100644 --- a/src/gallium/drivers/swr/swr_query.cpp +++ b/src/gallium/drivers/swr/swr_query.cpp @@ -23,7 +23,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "swr_context.h" #include "swr_fence.h" #include "swr_query.h" diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 2003222cc1..49349496ac 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -45,7 +45,7 @@ #include "pipe/p_compiler.h" #include "os/os_thread.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_debug.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 47e61aa81e..c315c465b5 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -24,7 +24,7 @@ #include "util/u_format.h" #include "util/u_format_s3tc.h" #include "util/u_video.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index 06b5c8da3c..7348ea3ba8 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -30,7 +30,7 @@ #include "pipe/p_screen.h" #include "util/u_memory.h" #include "hud/hud_context.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "state_tracker/st_api.h" #include "stw_icd.h" diff --git a/src/gallium/tests/unit/pipe_barrier_test.c b/src/gallium/tests/unit/pipe_barrier_test.c index 6bd46b8d96..838c9bfd96 100644 --- a/src/gallium/tests/unit/pipe_barrier_test.c +++ b/src/gallium/tests/unit/pipe_barrier_test.c @@ -36,8 +36,9 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_atomic.h" #include "util/u_thread.h" diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 27652110f0..bbe23ae88f 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -27,7 +27,7 @@ #include "amdgpu_cs.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "state_tracker/drm_driver.h" #include <amdgpu_drm.h> #include <xf86drm.h> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 0b47af9666..0450ccc359 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -27,7 +27,8 @@ */ #include "amdgpu_cs.h" -#include "os/os_time.h" +#include "util/os_time.h" +#include <inttypes.h> #include <stdio.h> #include "amd/common/sid.h" diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 15e9d38e33..b4e501c817 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -31,7 +31,7 @@ #include "util/simple_list.h" #include "os/os_thread.h" #include "os/os_mman.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "state_tracker/drm_driver.h" diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 2b1542fcf4..7220f3a024 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -56,7 +56,7 @@ #include "radeon_drm_cs.h" #include "util/u_memory.h" -#include "os/os_time.h" +#include "util/os_time.h" #include <stdio.h> #include <stdlib.h> diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index 7f542e7f1f..71e652ebf3 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -28,7 +28,7 @@ #include <sys/stat.h> #include "os/os_mman.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "util/u_memory.h" #include "util/u_format.h" #include "util/u_hash_table.h" diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c index 404ba58b08..d76be4d5d3 100644 --- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c +++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c @@ -24,7 +24,7 @@ #include "util/u_memory.h" #include "util/u_format.h" #include "util/u_inlines.h" -#include "os/os_time.h" +#include "util/os_time.h" #include "state_tracker/sw_winsys.h" #include "virgl_vtest_winsys.h" diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources index 407b282562..65de6f6df7 100644 --- a/src/util/Makefile.sources +++ b/src/util/Makefile.sources @@ -22,6 +22,8 @@ MESA_UTIL_FILES := \ macros.h \ mesa-sha1.c \ mesa-sha1.h \ + os_time.c \ + os_time.h \ sha1/sha1.c \ sha1/sha1.h \ ralloc.c \ diff --git a/src/util/meson.build b/src/util/meson.build index 0940e4d12a..bde529be56 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -46,6 +46,8 @@ files_mesa_util = files( 'macros.h', 'mesa-sha1.c', 'mesa-sha1.h', + 'os_time.c', + 'os_time.h', 'sha1/sha1.c', 'sha1/sha1.h', 'ralloc.c', diff --git a/src/gallium/auxiliary/os/os_time.c b/src/util/os_time.c index e4a1cae641..8d8291ff17 100644 --- a/src/gallium/auxiliary/os/os_time.c +++ b/src/util/os_time.c @@ -32,8 +32,11 @@ * @author Jose Fonseca <jfonseca@vmware.com> */ +#include "os_time.h" + +/* TODO: fix this dependency */ +#include "gallium/include/pipe/p_config.h" -#include "pipe/p_defines.h" #include "util/u_atomic.h" #if defined(PIPE_OS_UNIX) @@ -47,8 +50,6 @@ # error Unsupported OS #endif -#include "os_time.h" - int64_t os_time_get_nano(void) @@ -121,15 +122,15 @@ os_time_get_absolute_timeout(uint64_t timeout) int64_t time, abs_timeout; /* Also check for the type upper bound. */ - if (timeout == PIPE_TIMEOUT_INFINITE || timeout > INT64_MAX) - return PIPE_TIMEOUT_INFINITE; + if (timeout == OS_TIMEOUT_INFINITE || timeout > INT64_MAX) + return OS_TIMEOUT_INFINITE; time = os_time_get_nano(); abs_timeout = time + (int64_t)timeout; /* Check for overflow. */ if (abs_timeout < time) - return PIPE_TIMEOUT_INFINITE; + return OS_TIMEOUT_INFINITE; return abs_timeout; } @@ -144,7 +145,7 @@ os_wait_until_zero(volatile int *var, uint64_t timeout) if (!timeout) return false; - if (timeout == PIPE_TIMEOUT_INFINITE) { + if (timeout == OS_TIMEOUT_INFINITE) { while (p_atomic_read(var)) { #if defined(PIPE_OS_UNIX) sched_yield(); @@ -175,8 +176,8 @@ os_wait_until_zero_abs_timeout(volatile int *var, int64_t timeout) if (!p_atomic_read(var)) return true; - if (timeout == PIPE_TIMEOUT_INFINITE) - return os_wait_until_zero(var, PIPE_TIMEOUT_INFINITE); + if (timeout == OS_TIMEOUT_INFINITE) + return os_wait_until_zero(var, OS_TIMEOUT_INFINITE); while (p_atomic_read(var)) { if (os_time_get_nano() >= timeout) diff --git a/src/gallium/auxiliary/os/os_time.h b/src/util/os_time.h index ca0bdd5a0c..049ab118db 100644 --- a/src/gallium/auxiliary/os/os_time.h +++ b/src/util/os_time.h @@ -35,20 +35,15 @@ #ifndef _OS_TIME_H_ #define _OS_TIME_H_ - -#include "pipe/p_config.h" - -#if defined(PIPE_OS_UNIX) -# include <unistd.h> /* usleep */ -#endif - -#include "pipe/p_compiler.h" - +#include <stdbool.h> +#include <stdint.h> #ifdef __cplusplus extern "C" { #endif +/* must be equal to PIPE_TIMEOUT_INFINITE */ +#define OS_TIMEOUT_INFINITE 0xffffffffffffffffull /* * Get the current time in nanoseconds from an unknown base. @@ -79,7 +74,7 @@ os_time_sleep(int64_t usecs); * * Returns true if the current time has elapsed beyond the specified interval. */ -static inline boolean +static inline bool os_time_timeout(int64_t start, int64_t end, int64_t curr) @@ -95,8 +90,8 @@ os_time_timeout(int64_t start, * Convert a relative timeout in nanoseconds into an absolute timeout, * in other words, it returns current time + timeout. * os_time_get_nano() must be monotonic. - * PIPE_TIMEOUT_INFINITE is passed through unchanged. If the calculation - * overflows, PIPE_TIMEOUT_INFINITE is returned. + * OS_TIMEOUT_INFINITE is passed through unchanged. If the calculation + * overflows, OS_TIMEOUT_INFINITE is returned. */ int64_t os_time_get_absolute_timeout(uint64_t timeout); @@ -107,7 +102,7 @@ os_time_get_absolute_timeout(uint64_t timeout); * * \param var variable * \param timeout timeout in ns, can be anything from 0 (no wait) to - * PIPE_TIME_INFINITE (wait forever) + * OS_TIMEOUT_INFINITE (wait forever) * \return true if the variable is zero */ bool @@ -118,7 +113,7 @@ os_wait_until_zero(volatile int *var, uint64_t timeout); * Wait until the variable at the given memory location is zero. * The timeout is the absolute time when the waiting should stop. If it is * less than or equal to the current time, it only returns the status and - * doesn't wait. PIPE_TIME_INFINITE waits forever. This requires that + * doesn't wait. OS_TIMEOUT_INFINITE waits forever. This requires that * os_time_get_nano is monotonic. * * \param var variable |