util: stop including files from mesa/main

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 21:26:24 -04:00 committed by Marge Bot
parent c42fa40a51
commit 76f79db3f5
5 changed files with 27 additions and 9 deletions

View file

@ -23,8 +23,8 @@
#include <string.h>
#include "main/macros.h"
#include "blob.h"
#include "u_math.h"
#ifdef HAVE_VALGRIND
#include <valgrind.h>
@ -85,7 +85,7 @@ grow_to_fit(struct blob *blob, size_t additional)
static bool
align_blob(struct blob *blob, size_t alignment)
{
const size_t new_size = ALIGN(blob->size, alignment);
const size_t new_size = align64(blob->size, alignment);
if (blob->size < new_size) {
if (!grow_to_fit(blob, new_size - blob->size))
@ -102,7 +102,7 @@ align_blob(struct blob *blob, size_t alignment)
static void
align_blob_reader(struct blob_reader *blob, size_t alignment)
{
blob->current = blob->data + ALIGN(blob->current - blob->data, alignment);
blob->current = blob->data + align64(blob->current - blob->data, alignment);
}
void
@ -212,7 +212,7 @@ BLOB_WRITE_TYPE(blob_write_uint64, uint64_t)
BLOB_WRITE_TYPE(blob_write_intptr, intptr_t)
#define ASSERT_ALIGNED(_offset, _align) \
assert(ALIGN((_offset), (_align)) == (_offset))
assert(align64((_offset), (_align)) == (_offset))
bool
blob_overwrite_uint8 (struct blob *blob,

View file

@ -23,7 +23,6 @@
#include <errno.h>
#include <string.h>
#include "main/macros.h"
#include "debug.h"
#include "u_string.h"

View file

@ -52,7 +52,6 @@
#include "util/mesa-sha1.h"
#include "util/ralloc.h"
#include "util/compiler.h"
#include "main/errors.h"
#include "disk_cache.h"

View file

@ -47,12 +47,31 @@
#include "hash_table.h"
#include "ralloc.h"
#include "macros.h"
#include "main/hash.h"
#include "u_memory.h"
#include "fast_urem_by_const.h"
#define XXH_INLINE_ALL
#include "xxhash.h"
/**
* Magic number that gets stored outside of the struct hash_table.
*
* The hash table needs a particular pointer to be the marker for a key that
* was deleted from the table, along with NULL for the "never allocated in the
* table" marker. Legacy GL allows any GLuint to be used as a GL object name,
* and we use a 1:1 mapping from GLuints to key pointers, so we need to be
* able to track a GLuint that happens to match the deleted key outside of
* struct hash_table. We tell the hash table to use "1" as the deleted key
* value, so that we test the deleted-key-in-the-table path as best we can.
*/
#define DELETED_KEY_VALUE 1
static inline void *
uint_key(unsigned id)
{
return (void *)(uintptr_t) id;
}
static const uint32_t deleted_key_value;
/**

View file

@ -71,11 +71,12 @@
*/
#include <stdbool.h>
#include <limits.h>
#include "ralloc.h"
#include "util/imports.h"
#include "main/macros.h"
#include "util/bitset.h"
#include "u_math.h"
#include "register_allocate.h"
struct ra_reg {
@ -496,7 +497,7 @@ ra_realloc_interference_graph(struct ra_graph *g, unsigned int alloc)
* easier to memset the top of the growing bitsets.
*/
assert(g->alloc % BITSET_WORDBITS == 0);
alloc = ALIGN(alloc, BITSET_WORDBITS);
alloc = align64(alloc, BITSET_WORDBITS);
g->nodes = reralloc(g, g->nodes, struct ra_node, alloc);