aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_state.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 5a6af5df8c9..49546e5de68 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -1354,11 +1354,18 @@ nvc0_set_shader_buffers(struct pipe_context *pipe,
}
static inline void
-nvc0_set_global_handle(uint64_t *phandle, struct pipe_resource *res)
+nvc0_set_global_handle(uint32_t *phandle, struct pipe_resource *res)
{
struct nv04_resource *buf = nv04_resource(res);
if (buf) {
- *phandle = buf->address;
+ uint64_t limit = (buf->address + buf->base.width0) - 1;
+ if (limit < (1ULL << 32)) {
+ *phandle = (uint32_t)buf->address;
+ } else {
+ NOUVEAU_ERR("Cannot map into TGSI_RESOURCE_GLOBAL: "
+ "resource not contained within 32-bit address space !\n");
+ *phandle = 0;
+ }
} else {
*phandle = 0;
}
@@ -1368,7 +1375,7 @@ static void
nvc0_set_global_bindings(struct pipe_context *pipe,
unsigned start, unsigned nr,
struct pipe_resource **resources,
- uint64_t **handles)
+ uint32_t **handles)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct pipe_resource **ptr;