util: Getting u_debug.h not depends on pipe/*

Move pipe_debug_type into u_debug.h
Move pipe_debug_callback into u_debug.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
This commit is contained in:
Yonggang Luo 2022-03-30 06:10:25 +08:00 committed by Marge Bot
parent b2ece67f11
commit be1b30393b
6 changed files with 43 additions and 51 deletions

View file

@ -27,6 +27,7 @@
#include "util/list.h"
#include "util/slab.h"
#include "util/u_debug.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"

View file

@ -25,6 +25,7 @@
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/u_debug.h"
using namespace clover;

View file

@ -1000,37 +1000,6 @@ struct pipe_compute_state
unsigned req_input_mem; /**< Required size of the INPUT resource. */
};
/**
* Structure that contains a callback for debug messages from the driver back
* to the gallium frontend.
*/
struct util_debug_callback
{
/**
* When set to \c true, the callback may be called asynchronously from a
* driver-created thread.
*/
bool async;
/**
* Callback for the driver to report debug/performance/etc information back
* to the gallium frontend.
*
* \param data user-supplied data pointer
* \param id message type identifier, if pointed value is 0, then a
* new id is assigned
* \param type UTIL_DEBUG_TYPE_*
* \param format printf-style format string
* \param args args for format string
*/
void (*debug_message)(void *data,
unsigned *id,
enum util_debug_type type,
const char *fmt,
va_list args);
void *data;
};
/**
* Structure that contains a callback for device reset messages from the driver
* back to the gallium frontend.

View file

@ -425,20 +425,6 @@ u_uintN_max(unsigned bit_size)
return UINT64_MAX >> (64 - bit_size);
}
/* TODO: In future we should try to move this to u_debug.h once header
* dependencies are reorganised to allow this.
*/
enum util_debug_type
{
UTIL_DEBUG_TYPE_OUT_OF_MEMORY = 1,
UTIL_DEBUG_TYPE_ERROR,
UTIL_DEBUG_TYPE_SHADER_INFO,
UTIL_DEBUG_TYPE_PERF_INFO,
UTIL_DEBUG_TYPE_INFO,
UTIL_DEBUG_TYPE_FALLBACK,
UTIL_DEBUG_TYPE_CONFORMANCE,
};
#if !defined(alignof) && !defined(__cplusplus)
#if __STDC_VERSION__ >= 201112L
#define alignof(t) _Alignof(t)

View file

@ -27,11 +27,7 @@
**************************************************************************/
#include "pipe/p_config.h"
#include "util/u_debug.h"
#include "pipe/p_format.h"
#include "pipe/p_state.h"
#include "util/u_string.h"
#include "util/u_math.h"
#include <inttypes.h>

View file

@ -58,6 +58,47 @@
extern "C" {
#endif
enum util_debug_type
{
UTIL_DEBUG_TYPE_OUT_OF_MEMORY = 1,
UTIL_DEBUG_TYPE_ERROR,
UTIL_DEBUG_TYPE_SHADER_INFO,
UTIL_DEBUG_TYPE_PERF_INFO,
UTIL_DEBUG_TYPE_INFO,
UTIL_DEBUG_TYPE_FALLBACK,
UTIL_DEBUG_TYPE_CONFORMANCE,
};
/**
* Structure that contains a callback for debug messages from the driver back
* to the gallium frontend.
*/
struct util_debug_callback
{
/**
* When set to \c true, the callback may be called asynchronously from a
* driver-created thread.
*/
bool async;
/**
* Callback for the driver to report debug/performance/etc information back
* to the gallium frontend.
*
* \param data user-supplied data pointer
* \param id message type identifier, if pointed value is 0, then a
* new id is assigned
* \param type UTIL_DEBUG_TYPE_*
* \param format printf-style format string
* \param args args for format string
*/
void (*debug_message)(void *data,
unsigned *id,
enum util_debug_type type,
const char *fmt,
va_list args);
void *data;
};
#define _util_printf_format(fmt, list) PRINTFLIKE(fmt, list)
@ -275,8 +316,6 @@ void _debug_assert_fail(const char *expr,
} \
} while (0)
struct util_debug_callback;
void
_util_debug_message(
struct util_debug_callback *cb,