mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
pb_buffer: switch pb_buffer::size to 64 bits
being able to allocate more than 4 GB may be useful Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
e241a63512
commit
7e78b5ed38
8 changed files with 21 additions and 16 deletions
|
|
@ -87,9 +87,9 @@ struct pb_desc
|
|||
|
||||
|
||||
/**
|
||||
* Size. Regular (32bit) unsigned for now.
|
||||
* 64-bit type for GPU buffer sizes and offsets.
|
||||
*/
|
||||
typedef unsigned pb_size;
|
||||
typedef uint64_t pb_size;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -98,8 +98,8 @@ typedef unsigned pb_size;
|
|||
struct pb_buffer
|
||||
{
|
||||
struct pipe_reference reference;
|
||||
unsigned size;
|
||||
unsigned alignment;
|
||||
pb_size size;
|
||||
unsigned usage;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#endif
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_defines.h"
|
||||
|
|
@ -208,7 +209,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
|
|||
while (curr != &fenced_mgr->unfenced) {
|
||||
fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
|
||||
assert(!fenced_buf->fence);
|
||||
debug_printf("%10p %7u %8u %7s\n",
|
||||
debug_printf("%10p %"PRIu64" %8u %7s\n",
|
||||
(void *) fenced_buf,
|
||||
fenced_buf->base.size,
|
||||
p_atomic_read(&fenced_buf->base.reference.count),
|
||||
|
|
@ -224,7 +225,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
|
|||
fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
|
||||
assert(fenced_buf->buffer);
|
||||
signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
|
||||
debug_printf("%10p %7u %8u %7s %10p %s\n",
|
||||
debug_printf("%10p %"PRIu64" %8u %7s %10p %s\n",
|
||||
(void *) fenced_buf,
|
||||
fenced_buf->base.size,
|
||||
p_atomic_read(&fenced_buf->base.reference.count),
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "util/list.h"
|
||||
#include "util/u_time.h"
|
||||
#include "util/u_debug_stack.h"
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "pb_buffer.h"
|
||||
#include "pb_bufmgr.h"
|
||||
|
|
@ -190,7 +191,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
|
|||
underflow = !check_random_pattern(map, buf->underflow_size,
|
||||
&min_ofs, &max_ofs);
|
||||
if(underflow) {
|
||||
debug_printf("buffer underflow (offset -%u%s to -%u bytes) detected\n",
|
||||
debug_printf("buffer underflow (offset -%"PRIu64"%s to -%"PRIu64" bytes) detected\n",
|
||||
buf->underflow_size - min_ofs,
|
||||
min_ofs == 0 ? "+" : "",
|
||||
buf->underflow_size - max_ofs);
|
||||
|
|
@ -200,7 +201,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
|
|||
buf->overflow_size,
|
||||
&min_ofs, &max_ofs);
|
||||
if(overflow) {
|
||||
debug_printf("buffer overflow (size %u plus offset %u to %u%s bytes) detected\n",
|
||||
debug_printf("buffer overflow (size %"PRIu64" plus offset %"PRIu64" to %"PRIu64"%s bytes) detected\n",
|
||||
buf->base.size,
|
||||
min_ofs,
|
||||
max_ofs,
|
||||
|
|
@ -349,7 +350,7 @@ pb_debug_manager_dump_locked(struct pb_debug_manager *mgr)
|
|||
buf = LIST_ENTRY(struct pb_debug_buffer, curr, head);
|
||||
|
||||
debug_printf("buffer = %p\n", (void *) buf);
|
||||
debug_printf(" .size = 0x%x\n", buf->base.size);
|
||||
debug_printf(" .size = 0x%"PRIx64"\n", buf->base.size);
|
||||
debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE);
|
||||
|
||||
curr = next;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "r300_context.h"
|
||||
|
||||
#include "util/u_format.h"
|
||||
#include <inttypes.h>
|
||||
|
||||
/* Returns the number of pixels that the texture should be aligned to
|
||||
* in the given dimension. */
|
||||
|
|
@ -614,7 +615,7 @@ void r300_texture_desc_init(struct r300_screen *rscreen,
|
|||
"r300: I got a pre-allocated buffer to use it as a texture "
|
||||
"storage, but the buffer is too small. I'll use the buffer "
|
||||
"anyway, because I can't crash here, but it's dangerous. "
|
||||
"This can be a DDX bug. Got: %iB, Need: %iB, Info:\n",
|
||||
"This can be a DDX bug. Got: %"PRIu64"B, Need: %uB, Info:\n",
|
||||
tex->buf->size, tex->tex.size_in_bytes);
|
||||
r300_tex_print_info(tex, "texture_desc_init");
|
||||
/* Ooops, what now. Apps will break if we fail this,
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
|
|||
res->TC_L2_dirty = false;
|
||||
|
||||
if (rscreen->debug_flags & DBG_VM && res->b.b.target == PIPE_BUFFER) {
|
||||
fprintf(stderr, "VM start=0x%"PRIX64" end=0x%"PRIX64" | Buffer %u bytes\n",
|
||||
fprintf(stderr, "VM start=0x%"PRIX64" end=0x%"PRIX64" | Buffer %"PRIu64" bytes\n",
|
||||
res->gpu_address, res->gpu_address + res->buf->size,
|
||||
res->buf->size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
static inline struct radeon_bo *radeon_bo(struct pb_buffer *bo)
|
||||
{
|
||||
|
|
@ -297,8 +298,8 @@ void radeon_bo_destroy(struct pb_buffer *_buf)
|
|||
sizeof(va)) != 0 &&
|
||||
va.operation == RADEON_VA_RESULT_ERROR) {
|
||||
fprintf(stderr, "radeon: Failed to deallocate virtual address for buffer:\n");
|
||||
fprintf(stderr, "radeon: size : %d bytes\n", bo->base.size);
|
||||
fprintf(stderr, "radeon: va : 0x%016llx\n", (unsigned long long)bo->va);
|
||||
fprintf(stderr, "radeon: size : %"PRIu64" bytes\n", bo->base.size);
|
||||
fprintf(stderr, "radeon: va : 0x%"PRIx64"\n", bo->va);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#endif
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_defines.h"
|
||||
|
|
@ -172,7 +173,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
|
|||
while(curr != &fenced_mgr->unfenced) {
|
||||
fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
|
||||
assert(!fenced_buf->fence);
|
||||
debug_printf("%10p %7u %8u %7s\n",
|
||||
debug_printf("%10p %"PRIu64" %8u %7s\n",
|
||||
(void *) fenced_buf,
|
||||
fenced_buf->base.size,
|
||||
p_atomic_read(&fenced_buf->base.reference.count),
|
||||
|
|
@ -188,7 +189,7 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
|
|||
fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
|
||||
assert(fenced_buf->buffer);
|
||||
signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
|
||||
debug_printf("%10p %7u %8u %7s %10p %s\n",
|
||||
debug_printf("%10p %"PRIu64" %8u %7s %10p %s\n",
|
||||
(void *) fenced_buf,
|
||||
fenced_buf->base.size,
|
||||
p_atomic_read(&fenced_buf->base.reference.count),
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ vmw_gmr_buffer_unmap(struct pb_buffer *_buf)
|
|||
static void
|
||||
vmw_gmr_buffer_get_base_buffer(struct pb_buffer *buf,
|
||||
struct pb_buffer **base_buf,
|
||||
unsigned *offset)
|
||||
pb_size *offset)
|
||||
{
|
||||
*base_buf = buf;
|
||||
*offset = 0;
|
||||
|
|
@ -266,7 +266,7 @@ vmw_gmr_bufmgr_region_ptr(struct pb_buffer *buf,
|
|||
struct SVGAGuestPtr *ptr)
|
||||
{
|
||||
struct pb_buffer *base_buf;
|
||||
unsigned offset = 0;
|
||||
pb_size offset = 0;
|
||||
struct vmw_gmr_buffer *gmr_buf;
|
||||
|
||||
pb_get_base_buffer( buf, &base_buf, &offset );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue