util: don't include p_defines.h and u_pointer.h from gallium

It's a mess, but this is what I arrived at.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
This commit is contained in:
Marek Olšák 2020-03-25 23:44:59 -04:00 committed by Marge Bot
parent 013b65635f
commit 7164674500
21 changed files with 38 additions and 26 deletions

View file

@ -25,6 +25,7 @@
#include <inttypes.h>
#include <locale.h>
#include <xf86drm.h>
#include <stdlib.h>
#include "util/u_math.h"

View file

@ -172,7 +172,7 @@ retry:
bo = find_in_bucket(bucket, flags);
if (bo) {
VG_BO_OBTAIN(bo);
if (bo->funcs->madvise(bo, TRUE) <= 0) {
if (bo->funcs->madvise(bo, true) <= 0) {
/* we've lost the backing pages, delete and try again: */
pthread_mutex_lock(&table_lock);
bo_del(bo);
@ -197,7 +197,7 @@ fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo)
if (bucket) {
struct timespec time;
bo->funcs->madvise(bo, FALSE);
bo->funcs->madvise(bo, false);
clock_gettime(CLOCK_MONOTONIC, &time);

View file

@ -79,8 +79,8 @@ out:
dev->fd = fd;
dev->handle_table = _mesa_hash_table_create(NULL, _mesa_hash_u32, _mesa_key_u32_equal);
dev->name_table = _mesa_hash_table_create(NULL, _mesa_hash_u32, _mesa_key_u32_equal);
fd_bo_cache_init(&dev->bo_cache, FALSE);
fd_bo_cache_init(&dev->ring_cache, TRUE);
fd_bo_cache_init(&dev->bo_cache, false);
fd_bo_cache_init(&dev->ring_cache, true);
return dev;
}

View file

@ -38,6 +38,7 @@
#include "gallivm/lp_bld.h"
#include "pipe/p_compiler.h"
struct lp_type;

View file

@ -33,7 +33,7 @@
#include "util/u_debug.h"
#include "util/u_cpu_detect.h"
DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", FALSE);
DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", false);
static struct util_cpu_caps *get_cpu_caps(void)
{

View file

@ -28,6 +28,7 @@
#ifndef TGSI_UREG_H
#define TGSI_UREG_H
#include "pipe/p_defines.h"
#include "pipe/p_format.h"
#include "pipe/p_compiler.h"
#include "pipe/p_shader_tokens.h"

View file

@ -34,7 +34,7 @@
#define UTIL_ASYNC_DEBUG_H
#include "pipe/p_state.h"
#include "util/u_debug.h"
#include "util/simple_mtx.h"
struct util_debug_message {

View file

@ -34,7 +34,7 @@
#include "util/u_idalloc.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include <stdlib.h>
void
util_idalloc_init(struct util_idalloc *buf)

View file

@ -48,7 +48,7 @@ struct i915_winsys_batchbuffer;
extern unsigned i915_debug;
#ifdef DEBUG
static inline boolean
static inline bool
I915_DBG_ON(unsigned flags)
{
return i915_debug & flags;

View file

@ -1246,17 +1246,6 @@ enum pipe_fd_type
PIPE_FD_TYPE_SYNCOBJ,
};
enum pipe_debug_type
{
PIPE_DEBUG_TYPE_OUT_OF_MEMORY = 1,
PIPE_DEBUG_TYPE_ERROR,
PIPE_DEBUG_TYPE_SHADER_INFO,
PIPE_DEBUG_TYPE_PERF_INFO,
PIPE_DEBUG_TYPE_INFO,
PIPE_DEBUG_TYPE_FALLBACK,
PIPE_DEBUG_TYPE_CONFORMANCE,
};
/**
* counter type and counter data type enums used by INTEL_performance_query
* APIs in gallium drivers.

View file

@ -24,6 +24,7 @@
#define _NINE_DEBUG_H_
#include "util/u_debug.h"
#include "pipe/p_compiler.h"
void
_nine_debug_printf( unsigned long flag,

View file

@ -28,6 +28,7 @@
#include "util/u_hash_table.h"
#include "util/u_memory.h"
#include "util/u_pointer.h"
#include "etnaviv/etnaviv_screen.h"
#include "etnaviv/hw/common.xml.h"

View file

@ -32,6 +32,7 @@
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
#include "os/os_thread.h"
#include "freedreno_drm_public.h"

View file

@ -7,6 +7,7 @@
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
#include "os/os_thread.h"
#include "nouveau_drm_public.h"

View file

@ -32,6 +32,7 @@
#include "util/u_cpu_detect.h"
#include "util/u_memory.h"
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
#include <xf86drm.h>
#include <stdio.h>

View file

@ -34,6 +34,7 @@
#include "util/format/u_format.h"
#include "util/u_hash_table.h"
#include "util/u_inlines.h"
#include "util/u_pointer.h"
#include "state_tracker/drm_driver.h"
#include "virgl/virgl_screen.h"
#include "virgl/virgl_public.h"

View file

@ -332,4 +332,18 @@ do { \
#define BITFIELD64_RANGE(b, count) \
(BITFIELD64_MASK((b) + (count)) & ~BITFIELD64_MASK(b))
/* TODO: In future we should try to move this to u_debug.h once header
* dependencies are reorganised to allow this.
*/
enum pipe_debug_type
{
PIPE_DEBUG_TYPE_OUT_OF_MEMORY = 1,
PIPE_DEBUG_TYPE_ERROR,
PIPE_DEBUG_TYPE_SHADER_INFO,
PIPE_DEBUG_TYPE_PERF_INFO,
PIPE_DEBUG_TYPE_INFO,
PIPE_DEBUG_TYPE_FALLBACK,
PIPE_DEBUG_TYPE_CONFORMANCE,
};
#endif /* UTIL_MACROS_H */

View file

@ -33,6 +33,7 @@
*/
#include "pipe/p_config.h"
#include "pipe/p_compiler.h"
#include "util/u_debug.h"
#include "u_cpu_detect.h"
@ -83,7 +84,7 @@
#ifdef DEBUG
DEBUG_GET_ONCE_BOOL_OPTION(dump_cpu, "GALLIUM_DUMP_CPU", FALSE)
DEBUG_GET_ONCE_BOOL_OPTION(dump_cpu, "GALLIUM_DUMP_CPU", false)
#endif

View file

@ -38,18 +38,17 @@
#ifndef U_DEBUG_H_
#define U_DEBUG_H_
#include <stdarg.h>
#include <string.h>
#include "util/os_misc.h"
#include "util/detect_os.h"
#include "util/macros.h"
#if DETECT_OS_HAIKU
/* Haiku provides debug_printf in libroot with OS.h */
#include <OS.h>
#endif
#include "pipe/p_defines.h"
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -34,7 +34,6 @@
#ifndef U_MEMORY_H
#define U_MEMORY_H
#include "util/u_pointer.h"
#include "util/u_debug.h"
#include "util/os_memory.h"
@ -75,7 +74,7 @@ align_calloc(size_t size, unsigned long alignment)
* Duplicate a block of memory.
*/
static inline void *
mem_dup(const void *src, uint size)
mem_dup(const void *src, size_t size)
{
void *dup = MALLOC(size);
if (dup)

View file

@ -27,6 +27,7 @@
#include "util/u_memory.h"
#include "util/u_mm.h"
#include "util/macros.h"
void